Fixed all warnings while building on Linux, except for the ones on MatroskaParser.c and the ones about image conversion. Poke equinox for the later.

Originally committed to SVN as r1008.
This commit is contained in:
Rodrigo Braz Monteiro 2007-04-04 20:42:44 +00:00
parent 06d5929bea
commit 97d996f995
31 changed files with 84 additions and 55 deletions

View file

@ -1,10 +1,10 @@
// This file is part of FexGenericFilter and (C) 2006 by Hajo Krabbenhöft (tentacle)
// This file is part of FexGenericFilter and (C) 2006 by Hajo Krabbenh<EFBFBD>t (tentacle)
// All rights reserved but the aegisub project is allowed to use it.
class FexFilter {
public:
FexFilter();
~FexFilter();
virtual ~FexFilter();
virtual double Filter( double t );
@ -14,7 +14,7 @@ public:
class FexFilter_Gauss : public FexFilter {
public:
FexFilter_Gauss( double sigma );
~FexFilter_Gauss();
virtual ~FexFilter_Gauss();
double Filter( double t );
@ -26,7 +26,7 @@ public:
class FexFilter_GaussDerivation : public FexFilter {
public:
FexFilter_GaussDerivation( double sigma );
~FexFilter_GaussDerivation();
virtual ~FexFilter_GaussDerivation();
double Filter( double t );

View file

@ -1,4 +1,4 @@
// This file is part of FexTracker and (C) 2006 by Hajo Krabbenhöft (tentacle)
// This file is part of FexTracker and (C) 2006 by Hajo Krabbenh<EFBFBD>t (tentacle)
// All rights reserved but the aegisub project is allowed to use it.
@ -25,15 +25,15 @@ class FEXTRACKER_API FexTrackerConfig
public:
inline FexTrackerConfig() :
FeatureNumber(0),
EdgeDetectSigma(1.f),
WindowX(3), WindowY(3),
SearchRange(15),
DetectSmoothSigma(0.9f),
EdgeDetectSigma(1.f),
MaxIterations(10),
MinDeterminant(0.01f),
MinDisplacement(0.1f),
MaxResidue(10.f),
IgnoreLightning(0),
DetectSmoothSigma(0.9f),
MinDistanceSquare(100.f)
{};

View file

@ -1,4 +1,4 @@
// This file is part of FexTracker and (C) 2006 by Hajo Krabbenhöft (tentacle)
// This file is part of FexTracker and (C) 2006 by Hajo Krabbenh<EFBFBD>t (tentacle)
// All rights reserved but the aegisub project is allowed to use it.
// FexTrackingFeature.cpp: implementation of the FexTrackingFeature class.
@ -20,3 +20,4 @@ FexTrackingFeature::~FexTrackingFeature()
}

View file

@ -74,7 +74,11 @@ void AssColor::Parse(const wxString value) {
}
outval=strtoul(ostr+oindex,0,ishex?16:10);
if (isneg) outval+=2147483648; //2^31 (MSB)
if (isneg) {
// Two lines to stop g++ from bitching
outval+=2147483647; //2^31 (MSB)
outval++;
}
r = outval & 0xFF;
g = (outval>>8) & 0xFF;

View file

@ -691,7 +691,7 @@ void AudioDisplay::SetSamplesPercent(int percent,bool update,float pivot) {
// Center scroll
int oldSamples = samples;
UpdateSamples();
PositionSample += (oldSamples-samples)*w*pivot;
PositionSample += __int64((oldSamples-samples)*w*pivot);
if (PositionSample < 0) PositionSample = 0;
// Update
@ -715,7 +715,7 @@ void AudioDisplay::UpdateSamples() {
int min = 8;
if (total < min) total = min;
int range = total-min;
samples = range*pow(samplesPercent/100.0,3)+min;
samples = int(range*pow(samplesPercent/100.0,3)+min);
// Set position
int length = w * samples;
@ -806,7 +806,7 @@ void AudioDisplay::UpdateScrollbar() {
int page = w/12;
int len = provider->GetNumSamples() / samples / 12;
Position = PositionSample / samples;
ScrollBar->SetScrollbar(Position/12,page,len,page*0.7,true);
ScrollBar->SetScrollbar(Position/12,page,len,int(page*0.7),true);
}

View file

@ -54,7 +54,7 @@ AudioProvider::AudioProvider() {
// Destructor
AudioProvider::~AudioProvider() {
// Clear buffers
delete raw;
delete[] raw;
}
@ -112,7 +112,7 @@ void AudioProvider::GetWaveForm(int *min,int *peak,__int64 start,int w,int h,int
int needLen = n*channels*bytes_per_sample;
if (raw) {
if (raw_len < needLen) {
delete raw;
delete[] raw;
raw = NULL;
}
}
@ -125,7 +125,7 @@ void AudioProvider::GetWaveForm(int *min,int *peak,__int64 start,int w,int h,int
// Read raw samples
unsigned char *raw_char = (unsigned char*) raw;
GetAudio(raw,start,n);
int amplitude = h*scale;
int amplitude = int(h*scale);
// Calculate waveform
for (int i=0;i<n;i++) {
@ -143,7 +143,7 @@ void AudioProvider::GetWaveForm(int *min,int *peak,__int64 start,int w,int h,int
short *raw_short = (short*) raw;
GetAudio(raw,start,n);
int half_h = h/2;
int half_amplitude = half_h * scale;
int half_amplitude = int(half_h * scale);
// Calculate waveform
for (int i=0;i<n;i++) {

View file

@ -111,7 +111,7 @@ LAVCAudioProvider::LAVCAudioProvider(wxString _filename)
}
#endif
audStream = -1;
for (unsigned int i = 0; i < lavcfile->fctx->nb_streams; i++) {
for (int i = 0; i < lavcfile->fctx->nb_streams; i++) {
codecContext = lavcfile->fctx->streams[i]->codec;
if (codecContext->codec_type == CODEC_TYPE_AUDIO) {
stream = lavcfile->fctx->streams[i];

View file

@ -142,7 +142,7 @@ public:
if (i >= start && i-start <= length) {
// Determine which sub-cache this line resides in
size_t subcache = (i-start) / subcache_length;
assert(subcache >= 0 && subcache < sub_caches.size());
assert(subcache < sub_caches.size());
if (!sub_caches[subcache]) {
if (subcaches_are_final) {

View file

@ -278,6 +278,8 @@ namespace Automation4 {
((wxChoice*)control.control)->Insert(_T(""), 0);
break;
case COK_INVALID:
break;
}
if (opt->kind != COK_LABEL && opt->kind != COK_BOOL) {
@ -462,6 +464,8 @@ namespace Automation4 {
opt.kind = COK_INVALID;
}
break;
case COK_INVALID:
break;
}
opt.value = opt.default_val;
lua_pop(L, 1);
@ -555,6 +559,10 @@ continue_invalid_option:
case COK_STYLE:
ctl->option->value.stringval = ((wxChoice*)ctl->control)->GetStringSelection();
break;
case COK_LABEL:
case COK_INVALID:
break;
}
}
}
@ -635,6 +643,10 @@ continue_invalid_option:
case COK_COLOUR:
opt->value.colourval.Parse(optval);
break;
case COK_LABEL:
case COK_INVALID:
break;
}
}
}
@ -1162,8 +1174,8 @@ continue_invalid_option:
Auto3Script::Auto3Script(const wxString &filename)
: Script(filename)
, L(0)
, filter(0)
, L(0)
{
try {
Create();

View file

@ -332,11 +332,11 @@ namespace Automation4 {
ProgressSink::ProgressSink(wxWindow *parent)
: wxDialog(parent, -1, _T("Automation"), wxDefaultPosition, wxDefaultSize, wxDOUBLE_BORDER)
, debug_visible(false)
, data_updated(false)
, cancelled(false)
, has_inited(false)
, script_finished(false)
, debug_visible(false)
, data_updated(false)
{
// make the controls
progress_display = new wxGauge(this, -1, 1000, wxDefaultPosition, wxSize(300, 20));

View file

@ -252,8 +252,8 @@ namespace Automation4 {
void SetTitle(const wxString &_title);
void AddDebugOutput(const wxString &msg);
volatile bool script_finished;
volatile bool has_inited;
volatile bool script_finished;
DECLARE_EVENT_TABLE()
};

View file

@ -638,6 +638,7 @@ namespace Automation4 {
ps->ShowModal();
wxThread::ExitCode code = call.Wait();
(void) code;
//if (code) ThrowError();
delete ps;
@ -709,6 +710,7 @@ namespace Automation4 {
ps->ShowModal();
wxThread::ExitCode code = call.Wait();
(void) code;
//if (code) ThrowError();
delete ps;

View file

@ -710,7 +710,7 @@ namespace Automation4 {
int n = lua_gettop(L);
laf->GetAssEntry(lua_tonumber(L, 1)-1);
laf->GetAssEntry(int(lua_tonumber(L, 1)-1));
for (int i = 2; i <= n; i++) {
lua_pushvalue(L, i);

View file

@ -229,7 +229,7 @@ void DialogDummyVideo::UpdateLengthDisplay()
int lengthval;
if (!length_display) return;
if ((fps->GetValue().ToDouble(&fpsval)) && (lengthval = length->GetValue()) && fpsval > 0 && lengthval > 0) {
int tt = lengthval / fpsval * 1000; // frames / (frames/seconds) * 1000 = milliseconds
int tt = int(lengthval / fpsval * 1000); // frames / (frames/seconds) * 1000 = milliseconds
// 32 bit signed int can hold almost 600 positive hours when counting milliseconds, ASS allows at most just below 10 hours, so we're safe
int ms, s, m, h;
ms = tt % 1000; tt /= 1000;

View file

@ -375,7 +375,8 @@ wxThread::ExitCode FontsCollectorThread::Entry() {
// Collect
void FontsCollectorThread::Collect() {
// Prepare
bool attaching = collector->AttachmentCheck->IsChecked();
bool attaching;
attaching = collector->AttachmentCheck->IsChecked();
bool zipOut = collector->ArchiveCheck->IsChecked();
// Make sure there is a separator at the end

View file

@ -142,7 +142,7 @@ void DialogResample::ResampleTags (wxString name,int n,AssOverrideParameter *cur
curParam->SetFloat(curParam->AsFloat() * resizer);
}
if (curType == VARDATA_INT) {
curParam->SetInt(double(curParam->AsInt()) * resizer + 0.5);
curParam->SetInt(int(double(curParam->AsInt()) * resizer + 0.5));
}
}

View file

@ -356,8 +356,9 @@ void SearchReplaceEngine::ReplaceNext(bool DoReplace) {
else {
wxString src = Text->Mid(tempPos);
if (!matchCase) src.MakeLower();
pos = src.Find(LookFor);
if (pos != -1) {
int tempPos = src.Find(LookFor);
if (tempPos != -1) {
pos = tempPos;
pos += tempPos;
found = true;
matchLen = LookFor.Length();

View file

@ -469,7 +469,7 @@ void DialogStyleEditor::Apply (bool apply,bool close) {
///////////////////
// Choose font box
void DialogStyleEditor::OnChooseFont (wxCommandEvent &event) {
wxFont oldfont (work->fontsize, wxFONTFAMILY_DEFAULT, (work->italic?wxFONTSTYLE_ITALIC:wxFONTSTYLE_NORMAL), (work->bold?wxFONTWEIGHT_BOLD:wxFONTWEIGHT_NORMAL), work->underline, work->font, wxFONTENCODING_DEFAULT);
wxFont oldfont (int(work->fontsize), wxFONTFAMILY_DEFAULT, (work->italic?wxFONTSTYLE_ITALIC:wxFONTSTYLE_NORMAL), (work->bold?wxFONTWEIGHT_BOLD:wxFONTWEIGHT_NORMAL), work->underline, work->font, wxFONTENCODING_DEFAULT);
wxFont newfont = wxGetFontFromUser(this,oldfont);
if (newfont.Ok()) {
FontName->SetValue(newfont.GetFaceName());

View file

@ -51,7 +51,8 @@ void* glGetProc(const char *str) { return wglGetProcAddress(str); }
#ifdef __WXMAC_OSX__
void* glGetProc(const char *str) { return aglGetProcAddress(str); }
#else
void* glGetProc(const char *str) { return glXGetProcAddress((const GLubyte *)str); }
//void* glGetProc(const char *str) { return glXGetProcAddress((const GLubyte *)str); }
#define glGetProc(a) glXGetProcAddress((const GLubyte *)(a))
#endif
#endif

View file

@ -163,7 +163,7 @@ void MatroskaWrapper::Parse() {
mkv_SetTrackMask(file, ~(1 << track));
// Progress bar
int totalTime = double(segInfo->Duration) / timecodeScale;
int totalTime = int(double(segInfo->Duration) / timecodeScale);
volatile bool canceled = false;
DialogProgress *progress = new DialogProgress(NULL,_("Parsing Matroska"),&canceled,_("Reading keyframe and timecode data from Matroska file."),0,totalTime);
progress->Show();
@ -184,7 +184,7 @@ void MatroskaWrapper::Parse() {
}
// Update progress
progress->SetProgress(curTime,totalTime);
progress->SetProgress(int(curTime),totalTime);
}
// Clean up progress
@ -261,8 +261,8 @@ void MatroskaWrapper::SetToTimecodes(FrameRate &target) {
// Constant framerate
if (isCFR) {
if (abs(estimateCFR - 23.976) < 0.01) estimateCFR = 24000.0 / 1001.0;
if (abs(estimateCFR - 29.97) < 0.01) estimateCFR = 30000.0 / 1001.0;
if (fabs(estimateCFR - 23.976) < 0.01) estimateCFR = 24000.0 / 1001.0;
if (fabs(estimateCFR - 29.97) < 0.01) estimateCFR = 30000.0 / 1001.0;
target.SetCFR(estimateCFR);
}
@ -382,7 +382,7 @@ void MatroskaWrapper::GetSubtitles(AssFile *target) {
long int order = -1;
// Progress bar
int totalTime = double(segInfo->Duration) / timecodeScale;
int totalTime = int(double(segInfo->Duration) / timecodeScale);
volatile bool canceled = false;
DialogProgress *progress = new DialogProgress(NULL,_("Parsing Matroska"),&canceled,_("Reading subtitles from Matroska file."),0,totalTime);
progress->Show();
@ -451,7 +451,7 @@ void MatroskaWrapper::GetSubtitles(AssFile *target) {
}
// Update progress bar
progress->SetProgress(double(startTime) / 1000000.0,totalTime);
progress->SetProgress(int(double(startTime) / 1000000.0),totalTime);
}
// Insert into file

View file

@ -37,14 +37,14 @@ typedef uint64_t __uint64;
#error no audio system available
#endif
#define USE_DIRECTSHOW 0
#define USE_DIRECTSOUND 0
#define USE_HUNSPELL 0
//#define USE_HUNSPELL 0
#ifndef USE_LAVC
#define USE_LAVC 0
#endif
#define USE_PRS 0
#ifndef USE_FEXTRACKER
#define USE_FEXTRACKER 1
#endif
#ifndef USE_LIBSSA
#define USE_LIBSSA 0
#endif

View file

@ -196,7 +196,7 @@ wxArrayString HunspellSpellChecker::GetLanguageList() {
// For each dictionary match, see if it can find the corresponding .aff
for (unsigned int i=0;i<dic.Count();i++) {
wxString curAff = dic[i].Left(MAX(0,dic[i].Length()-4)) + _T(".aff");
wxString curAff = dic[i].Left(dic[i].Length()-4) + _T(".aff");
for (unsigned int j=0;j<aff.Count();j++) {
// Found match
if (curAff == aff[j]) {

View file

@ -959,7 +959,7 @@ void SubsEditBox::SetOverride (wxString tagname,wxString preValue,int forcePos,b
}
else if (tagname == _T("\\fn")) {
startfont.SetFaceName(style->font);
startfont.SetPointSize(style->fontsize);
startfont.SetPointSize(int(style->fontsize));
startfont.SetWeight(style->bold ? wxFONTWEIGHT_BOLD : wxFONTWEIGHT_NORMAL);
startfont.SetStyle(style->italic ? wxFONTSTYLE_ITALIC : wxFONTSTYLE_NORMAL);
startfont.SetUnderlined(style->underline);

View file

@ -472,7 +472,7 @@ void SubsTextEditCtrl::UpdateCallTip() {
// No tag available
int textLen = text.Length();
unsigned int posInTag = pos - tagStart;
if (tagStart+len > textLen || len <= 0 || tagStart < 0 || posInTag < 0) {
if (tagStart+len > textLen || len <= 0 || tagStart < 0) {
CallTipCancel();
return;
}
@ -828,7 +828,8 @@ void SubsTextEditCtrl::ShowPopupMenu(int activePos) {
// Build menu
for (int i=0;i<nSugs;i++) {
wxMenuItem *itm = menu.Append(EDIT_MENU_SUGGESTIONS+i,sugs[i]);
wxMenuItem *itm;
itm = menu.Append(EDIT_MENU_SUGGESTIONS+i,sugs[i]);
#if wxCHECK_VERSION(2, 8, 0) && defined(__WINDOWS__)
itm->SetFont(font);
#endif

View file

@ -659,7 +659,7 @@ void SubtitlesGrid::OnAudioClip(wxCommandEvent &event) {
num_samples = provider->GetNumSamples();
for(int i=0;i!=sel.GetCount();i++) {
for(unsigned int i=0;i!=sel.GetCount();i++) {
cur = GetDialogue(sel[i]);
temp = audioDisplay->GetSampleAtMS(cur->Start.GetMS());

View file

@ -173,14 +173,14 @@ void VideoDisplay::Render() {
// Window is wider than video, blackbox left/right
if (thisAr - vidAr > 0.01f) {
int delta = (w-vidAr*h);
int delta = int(w-vidAr*h);
dx1 += delta/2;
dx2 -= delta;
}
// Video is wider than window, blackbox top/bottom
else if (vidAr - thisAr > 0.01f) {
int delta = (h-w/vidAr);
int delta = int(h-w/vidAr);
dy1 += delta/2;
dy2 -= delta;
}
@ -271,9 +271,9 @@ void VideoDisplay::UpdateSize() {
if (!IsShownOnScreen()) return;
// Get size
if (con->GetAspectRatioType() == 0) w = con->GetWidth() * zoomValue;
else w = con->GetHeight() * zoomValue * con->GetAspectRatioValue();
h = con->GetHeight() * zoomValue;
if (con->GetAspectRatioType() == 0) w = int(con->GetWidth() * zoomValue);
else w = int(con->GetHeight() * zoomValue * con->GetAspectRatioValue());
h = int(con->GetHeight() * zoomValue);
int _w,_h;
if (w <= 1 || h <= 1) return;
locked = true;

View file

@ -284,8 +284,8 @@ void VideoDisplayVisual::DrawOverlay() {
int fx = int(cos(angle)*oRadius);
int fy = -int(sin(angle)*oRadius);
DrawLine(0,0,fx,fy);
int mdx = cos(rz*3.1415926536/180.0)*20;
int mdy = -sin(rz*3.1415926536/180.0)*20;
int mdx = int(cos(rz*3.1415926536/180.0)*20);
int mdy = int(-sin(rz*3.1415926536/180.0)*20);
DrawLine(-mdx,-mdy,mdx,mdy);
}

View file

@ -241,7 +241,13 @@ void AegiVideoFrame::GetFloat(float *buffer) const {
if (flipped) src = data[0] + (h-y-1)*pitch[0]; // I think that it requires flipped data - amz
else src = data[0] + y*pitch[0];
for (unsigned int x=0;x<w;x++) {
temp = (*src++)*0.3 + (*src++)*0.4 + (*src++)*0.3;
//temp = (*src++)*0.3 + (*src++)*0.4 + (*src++)*0.3;
temp += (*src)*0.3;
src++;
temp += (*src)*0.4;
src++;
temp += (*src)*0.3;
src++;
src += delta;
*dst++ = temp;
}

View file

@ -71,7 +71,7 @@ void DummyVideoProvider::Create(double _fps, int frames, int _width, int _height
if (pattern) {
int ppitch = frame.pitch[0] / frame.GetBpp();
for (int y = 0; y < frame.h; ++y) {
for (unsigned int y = 0; y < frame.h; ++y) {
if ((y / 8) & 1) {
for (int x = 0; x < ppitch; ++x) {
if ((x / 8) & 1) {

View file

@ -165,7 +165,7 @@ void LAVCVideoProvider::LoadVideo(wxString filename, double fps) {
// Find video stream
vidStream = -1;
codecContext = NULL;
for (unsigned int i=0;i<lavcfile->fctx->nb_streams;i++) {
for (int i=0;i<lavcfile->fctx->nb_streams;i++) {
codecContext = lavcfile->fctx->streams[i]->codec;
if (codecContext->codec_type == CODEC_TYPE_VIDEO) {
stream = lavcfile->fctx->streams[i];