Fixed almost a hundred warning messages issued with /W4 in VC++ (with warning 4100 disabled)

Originally committed to SVN as r891.
This commit is contained in:
Rodrigo Braz Monteiro 2007-01-24 03:54:32 +00:00
parent 3ab9822ed3
commit 297dbd74b8
29 changed files with 93 additions and 75 deletions

View file

@ -41,7 +41,7 @@ FEXTRACKER_API void LoadMovement( FexMovement* me, const wchar_t* Filename )
FILE *fi = _wfopen( Filename, L"rt" ); FILE *fi = _wfopen( Filename, L"rt" );
if( !fi ) return; if( !fi ) return;
int CurFeat = -1; //int CurFeat = -1;
char Line[512]; char Line[512];
while( !feof(fi) ) while( !feof(fi) )
{ {

View file

@ -240,7 +240,7 @@ static void myvsnprintf_uint_impl(char **pdest,char *de,int width,int zero,
int rem = (int)(val % base); int rem = (int)(val % base);
val = val / base; val = val / base;
*--np = rem < 10 ? rem + '0' : rem - 10 + letter; *--np = (char) (rem < 10 ? rem + '0' : rem - 10 + letter);
} }
rw = (int)(tmp - np + sizeof(tmp) - 1); rw = (int)(tmp - np + sizeof(tmp) - 1);
@ -290,7 +290,7 @@ static void myvsnprintf_int(char **pdest,char *de,int width,int zero,
static void myvsnprintf(char *dest,unsigned dsize,const char *fmt,va_list ap) { static void myvsnprintf(char *dest,unsigned dsize,const char *fmt,va_list ap) {
// s,d,x,u,ll // s,d,x,u,ll
char *de = dest + dsize - 1; char *de = dest + dsize - 1;
int state = 0, width, zero, neg, ll; int state = 0, width=0, zero=0, neg=0, ll=0;
if (dsize <= 1) { if (dsize <= 1) {
if (dsize > 0) if (dsize > 0)
@ -687,7 +687,7 @@ static ulonglong readVLUIntImp(MatroskaFile *mf,int *mask) {
c = readch(mf); c = readch(mf);
if (c == EOF) if (c == EOF)
return EOF; return (ulonglong)EOF;
if (c == 0) if (c == 0)
errorjmp(mf,"Invalid first byte of EBML integer: 0"); errorjmp(mf,"Invalid first byte of EBML integer: 0");
@ -762,6 +762,7 @@ static MKFLOAT readFloat(MatroskaFile *mf,unsigned int len) {
#ifdef MATROSKA_INTEGER_ONLY #ifdef MATROSKA_INTEGER_ONLY
MKFLOAT f; MKFLOAT f;
int shift; int shift;
f.v = 0;
#else #else
union { union {
unsigned int ui; unsigned int ui;
@ -769,6 +770,9 @@ static MKFLOAT readFloat(MatroskaFile *mf,unsigned int len) {
float f; float f;
double d; double d;
} u; } u;
ui = 0;
d = 0;
ull = 0;
#endif #endif
if (len!=4 && len!=8) if (len!=4 && len!=8)
@ -1246,7 +1250,7 @@ static void parseTrackEntry(MatroskaFile *mf,ulonglong toplen) {
ulonglong v; ulonglong v;
char *cp = NULL, *cs = NULL; char *cp = NULL, *cs = NULL;
size_t cplen = 0, cslen = 0, cpadd = 0; size_t cplen = 0, cslen = 0, cpadd = 0;
unsigned CompScope, num_comp = 0; unsigned CompScope=0, num_comp = 0;
if (mf->nTracks >= MAX_TRACKS) if (mf->nTracks >= MAX_TRACKS)
errorjmp(mf,"Too many tracks."); errorjmp(mf,"Too many tracks.");
@ -1431,11 +1435,11 @@ static void parseTrackEntry(MatroskaFile *mf,ulonglong toplen) {
if (inflateInit(&zs) != Z_OK) if (inflateInit(&zs) != Z_OK)
errorjmp(mf, "inflateInit failed"); errorjmp(mf, "inflateInit failed");
zs.next_in = cp; zs.next_in = (Bytef*) cp;
zs.avail_in = cplen; zs.avail_in = cplen;
do { do {
zs.next_out = tmp; zs.next_out = (Bytef*) tmp;
zs.avail_out = sizeof(tmp); zs.avail_out = sizeof(tmp);
code = inflate(&zs, Z_NO_FLUSH); code = inflate(&zs, Z_NO_FLUSH);
@ -1449,9 +1453,9 @@ static void parseTrackEntry(MatroskaFile *mf,ulonglong toplen) {
inflateReset(&zs); inflateReset(&zs);
zs.next_in = cp; zs.next_in = (Bytef*) cp;
zs.avail_in = cplen; zs.avail_in = cplen;
zs.next_out = ncp; zs.next_out = (Bytef*) ncp;
zs.avail_out = ncplen; zs.avail_out = ncplen;
if (inflate(&zs, Z_FINISH) != Z_STREAM_END) if (inflate(&zs, Z_FINISH) != Z_STREAM_END)
@ -2059,7 +2063,7 @@ static void parseSegment(MatroskaFile *mf,ulonglong toplen) {
} }
static void parseBlockAdditions(MatroskaFile *mf, ulonglong toplen, ulonglong timecode, unsigned track) { static void parseBlockAdditions(MatroskaFile *mf, ulonglong toplen, ulonglong timecode, unsigned track) {
ulonglong add_id = 1, add_pos, add_len; ulonglong add_id = 1, add_pos=0, add_len=0;
unsigned char have_add; unsigned char have_add;
FOREACH(mf, toplen) FOREACH(mf, toplen)
@ -2091,10 +2095,10 @@ static void parseBlockAdditions(MatroskaFile *mf, ulonglong toplen, ulonglong ti
} }
static void parseBlockGroup(MatroskaFile *mf,ulonglong toplen,ulonglong timecode, int blockex) { static void parseBlockGroup(MatroskaFile *mf,ulonglong toplen,ulonglong timecode, int blockex) {
ulonglong v; ulonglong v=0;
ulonglong duration = 0; ulonglong duration = 0;
ulonglong dpos; ulonglong dpos=0;
unsigned add_id = 0; //unsigned add_id = 0;
struct QueueEntry *qe,*qf = NULL; struct QueueEntry *qe,*qf = NULL;
unsigned char have_duration = 0, have_block = 0; unsigned char have_duration = 0, have_block = 0;
unsigned char gap = 0; unsigned char gap = 0;
@ -2151,10 +2155,10 @@ found:
errorjmp(mf,"Unexpected EOF while reading Block flags"); errorjmp(mf,"Unexpected EOF while reading Block flags");
if (blockex) if (blockex)
ref = !(c & 0x80); ref = (unsigned char)(!(c & 0x80));
gap = c & 0x1; gap = (unsigned char)(c & 0x1);
lacing = (c >> 1) & 3; lacing = (unsigned char)((c >> 1) & 3);
if (lacing) { if (lacing) {
c = readch(mf); c = readch(mf);
@ -3259,7 +3263,7 @@ int cs_ReadData(CompressedStream *cs,char *buffer,unsigned bufsize)
cs->decoded_ptr += todo; cs->decoded_ptr += todo;
} else { } else {
/* setup output buffer */ /* setup output buffer */
cs->zs.next_out = cs->decoded_buffer; cs->zs.next_out = (Bytef*) cs->decoded_buffer;
cs->zs.avail_out = sizeof(cs->decoded_buffer); cs->zs.avail_out = sizeof(cs->decoded_buffer);
/* try to read more data */ /* try to read more data */
@ -3273,7 +3277,7 @@ int cs_ReadData(CompressedStream *cs,char *buffer,unsigned bufsize)
return -1; return -1;
} }
cs->zs.next_in = cs->frame_buffer; cs->zs.next_in = (Bytef*) cs->frame_buffer;
cs->zs.avail_in = todo; cs->zs.avail_in = todo;
cs->frame_pos += todo; cs->frame_pos += todo;

View file

@ -1124,7 +1124,6 @@ void AudioDisplay::OnMouseEvent(wxMouseEvent& event) {
__int64 y = event.GetY(); __int64 y = event.GetY();
bool karMode = karaoke->enabled; bool karMode = karaoke->enabled;
bool shiftDown = event.m_shiftDown; bool shiftDown = event.m_shiftDown;
bool ctrlDown = event.m_controlDown;
int timelineHeight = Options.AsBool(_T("Audio Draw Timeline")) ? 20 : 0; int timelineHeight = Options.AsBool(_T("Audio Draw Timeline")) ? 20 : 0;
// Leaving event // Leaving event

View file

@ -264,7 +264,7 @@ bool AudioKaraoke::ParseDialogue(AssDialogue *curDiag) {
// Last syllable // Last syllable
if (foundBlock) syllables.push_back(temp); if (foundBlock) syllables.push_back(temp);
return foundBlock; return foundBlock;
curDiag->ClearBlocks(); //curDiag->ClearBlocks();
} }
@ -380,7 +380,7 @@ void AudioKaraoke::OnPaint(wxPaintEvent &event) {
} }
} }
if (splitting && split_cursor_syl == i /*&& split_cursor_x > 0*/) { if (splitting && split_cursor_syl == (signed)i /*&& split_cursor_x > 0*/) {
dc.SetPen(*wxRED); dc.SetPen(*wxRED);
dc.DrawLine(dx+4+split_cursor_x, 0, dx+4+split_cursor_x, h); dc.DrawLine(dx+4+split_cursor_x, 0, dx+4+split_cursor_x, h);
dc.SetPen(wxPen(wxColour(0,0,0))); dc.SetPen(wxPen(wxColour(0,0,0)));
@ -411,7 +411,7 @@ void AudioKaraoke::OnSize(wxSizeEvent &event) {
void AudioKaraoke::OnMouse(wxMouseEvent &event) { void AudioKaraoke::OnMouse(wxMouseEvent &event) {
// Get coordinates // Get coordinates
int x = event.GetX(); int x = event.GetX();
int y = event.GetY(); //int y = event.GetY();
bool shift = event.m_shiftDown; bool shift = event.m_shiftDown;
// Syllable selection mode // Syllable selection mode

View file

@ -361,7 +361,7 @@ DirectSoundPlayerThread::~DirectSoundPlayerThread() {
// Thread entry point // Thread entry point
wxThread::ExitCode DirectSoundPlayerThread::Entry() { wxThread::ExitCode DirectSoundPlayerThread::Entry() {
// Variables // Variables
unsigned long int playPos,endPos,bufSize; unsigned long int playPos=0,endPos=0,bufSize=0;
bool playing; bool playing;
// Wait for notification // Wait for notification

View file

@ -248,7 +248,7 @@ namespace Automation4 {
delete config_dialog; delete config_dialog;
config_dialog = 0; config_dialog = 0;
} }
if (config_dialog = GenerateConfigDialog(parent)) { if ((config_dialog = GenerateConfigDialog(parent)) != NULL) {
return config_dialog->GetWindow(parent); return config_dialog->GetWindow(parent);
} else { } else {
return 0; return 0;

View file

@ -494,7 +494,7 @@ namespace Automation4 {
// create an array-style table with an integer vector in it // create an array-style table with an integer vector in it
// leave the new table on top of the stack // leave the new table on top of the stack
lua_newtable(L); lua_newtable(L);
for (int i = 0; i != ints.size(); ++i) { for (size_t i = 0; i != ints.size(); ++i) {
lua_pushinteger(L, ints[i]+1); lua_pushinteger(L, ints[i]+1);
lua_rawseti(L, -2, i+1); lua_rawseti(L, -2, i+1);
} }
@ -516,6 +516,7 @@ namespace Automation4 {
wxString _description(lua_tostring(L, 2), wxConvUTF8); wxString _description(lua_tostring(L, 2), wxConvUTF8);
LuaFeatureMacro *macro = new LuaFeatureMacro(_name, _description, L); LuaFeatureMacro *macro = new LuaFeatureMacro(_name, _description, L);
(void)macro;
return 0; return 0;
} }
@ -553,12 +554,14 @@ namespace Automation4 {
// prepare function call // prepare function call
LuaAssFile *subsobj = new LuaAssFile(L, subs, false, false); LuaAssFile *subsobj = new LuaAssFile(L, subs, false, false);
(void) subsobj;
CreateIntegerArray(selected); // selected items CreateIntegerArray(selected); // selected items
lua_pushinteger(L, -1); // active line lua_pushinteger(L, -1); // active line
// do call // do call
LuaThreadedCall call(L, 3, 1); LuaThreadedCall call(L, 3, 1);
wxThread::ExitCode code = call.Wait(); wxThread::ExitCode code = call.Wait();
(void) code;
// get result // get result
bool result = !!lua_toboolean(L, -1); bool result = !!lua_toboolean(L, -1);
@ -574,6 +577,7 @@ namespace Automation4 {
// prepare function call // prepare function call
LuaAssFile *subsobj = new LuaAssFile(L, subs, true, true); LuaAssFile *subsobj = new LuaAssFile(L, subs, true, true);
(void) subsobj;
CreateIntegerArray(selected); // selected items CreateIntegerArray(selected); // selected items
lua_pushinteger(L, -1); // active line lua_pushinteger(L, -1); // active line
@ -625,6 +629,7 @@ namespace Automation4 {
int _merit = lua_tointeger(L, 3); int _merit = lua_tointeger(L, 3);
LuaFeatureFilter *filter = new LuaFeatureFilter(_name, _description, _merit, L); LuaFeatureFilter *filter = new LuaFeatureFilter(_name, _description, _merit, L);
(void) filter;
return 0; return 0;
} }
@ -636,6 +641,7 @@ namespace Automation4 {
// prepare function call // prepare function call
// subtitles (undo doesn't make sense in exported subs, in fact it'll totally break the undo system) // subtitles (undo doesn't make sense in exported subs, in fact it'll totally break the undo system)
LuaAssFile *subsobj = new LuaAssFile(L, subs, true/*allow modifications*/, false/*disallow undo*/); LuaAssFile *subsobj = new LuaAssFile(L, subs, true/*allow modifications*/, false/*disallow undo*/);
(void) subsobj;
// config // config
if (has_config && config_dialog) { if (has_config && config_dialog) {
assert(config_dialog->LuaReadBack(L) == 1); assert(config_dialog->LuaReadBack(L) == 1);
@ -665,6 +671,7 @@ namespace Automation4 {
// prepare function call // prepare function call
// subtitles (don't allow any modifications during dialog creation, ideally the subs aren't even accessed) // subtitles (don't allow any modifications during dialog creation, ideally the subs aren't even accessed)
LuaAssFile *subsobj = new LuaAssFile(L, AssFile::top, false/*allow modifications*/, false/*disallow undo*/); LuaAssFile *subsobj = new LuaAssFile(L, AssFile::top, false/*allow modifications*/, false/*disallow undo*/);
(void) subsobj;
// stored options // stored options
lua_newtable(L); // TODO, nothing for now lua_newtable(L); // TODO, nothing for now

View file

@ -180,8 +180,9 @@ void DialogKanjiTimer::OnStart(wxCommandEvent &event) {
else if (SourceStyle->GetValue() == DestStyle->GetValue()) else if (SourceStyle->GetValue() == DestStyle->GetValue())
wxMessageBox(_("The source and destination styles must be different."),_("Error"),wxICON_EXCLAMATION | wxOK); wxMessageBox(_("The source and destination styles must be different."),_("Error"),wxICON_EXCLAMATION | wxOK);
else { else {
OnSkipDest((wxCommandEvent)NULL); wxCommandEvent blank;
OnSkipSource((wxCommandEvent)NULL); OnSkipDest(blank);
OnSkipSource(blank);
DestText->SetFocus(); DestText->SetFocus();
} }
} }
@ -306,11 +307,10 @@ void DialogKanjiTimer::OnSkipDest(wxCommandEvent &event) {
GroupsList->DeleteAllItems(); GroupsList->DeleteAllItems();
int index = ListIndexFromStyleandIndex(DestStyle->GetValue(), DestIndex); int index = ListIndexFromStyleandIndex(DestStyle->GetValue(), DestIndex);
if (index != -1) { if (index != -1) {
AssDialogue *line = grid->GetDialogue(index);
DestText->ChangeValue(grid->GetDialogue(index)->GetStrippedText()); DestText->ChangeValue(grid->GetDialogue(index)->GetStrippedText());
SetSelected(); SetSelected();
DestText->SetFocus(); DestText->SetFocus();
DestIndex++; DestIndex++;
} }
@ -318,8 +318,9 @@ void DialogKanjiTimer::OnSkipDest(wxCommandEvent &event) {
void DialogKanjiTimer::OnGoBack(wxCommandEvent &event) { void DialogKanjiTimer::OnGoBack(wxCommandEvent &event) {
DestIndex-=2; DestIndex-=2;
SourceIndex-=2; SourceIndex-=2;
OnSkipDest((wxCommandEvent)NULL); wxCommandEvent tmpEvent;
OnSkipSource((wxCommandEvent)NULL); OnSkipDest(tmpEvent);
OnSkipSource(tmpEvent);
} }
void DialogKanjiTimer::OnAccept(wxCommandEvent &event) { void DialogKanjiTimer::OnAccept(wxCommandEvent &event) {
if (RegroupTotalLen==0) if (RegroupTotalLen==0)
@ -358,18 +359,20 @@ void DialogKanjiTimer::OnAccept(wxCommandEvent &event) {
grid->ass->FlagAsModified(); grid->ass->FlagAsModified();
grid->CommitChanges(); grid->CommitChanges();
OnSkipDest((wxCommandEvent)NULL); wxCommandEvent evt;
OnSkipSource((wxCommandEvent)NULL); OnSkipDest(evt);
OnSkipSource(evt);
} }
} }
void DialogKanjiTimer::OnKeyDown(wxKeyEvent &event) { void DialogKanjiTimer::OnKeyDown(wxKeyEvent &event) {
wxCommandEvent evt;
switch(event.GetKeyCode()) { switch(event.GetKeyCode()) {
case WXK_ESCAPE : case WXK_ESCAPE :
//this->EndModal(0); //this->EndModal(0);
OnClose((wxCommandEvent)NULL); OnClose(evt);
break; break;
case WXK_BACK : case WXK_BACK :
OnUnlink((wxCommandEvent)NULL); OnUnlink(evt);
break; break;
case WXK_RIGHT : //inc dest selection len case WXK_RIGHT : //inc dest selection len
if (DestText->GetStringSelection().Len()!=DestText->GetValue().Len()) if (DestText->GetStringSelection().Len()!=DestText->GetValue().Len())
@ -390,17 +393,18 @@ void DialogKanjiTimer::OnKeyDown(wxKeyEvent &event) {
} }
break; break;
case WXK_RETURN : case WXK_RETURN :
OnKeyEnter((wxCommandEvent)NULL); OnKeyEnter(evt);
break; break;
default : default :
event.Skip(); event.Skip();
} }
} }
void DialogKanjiTimer::OnKeyEnter(wxCommandEvent &event) { void DialogKanjiTimer::OnKeyEnter(wxCommandEvent &event) {
wxCommandEvent evt;
if (SourceText->GetValue().Len()==0&&RegroupTotalLen!=0) if (SourceText->GetValue().Len()==0&&RegroupTotalLen!=0)
this->OnAccept((wxCommandEvent)NULL); this->OnAccept(evt);
else if (SourceText->GetStringSelection().Len()!=0) else if (SourceText->GetStringSelection().Len()!=0)
this->OnLink((wxCommandEvent)NULL); this->OnLink(evt);
} }
void DialogKanjiTimer::OnMouseEvent(wxMouseEvent &event) { void DialogKanjiTimer::OnMouseEvent(wxMouseEvent &event) {
if (event.LeftDown()) DestText->SetFocus(); if (event.LeftDown()) DestText->SetFocus();
@ -457,7 +461,6 @@ void DialogKanjiTimer::SetSelected() {
//Try some interpolation for kanji. If we find a hiragana we know after this, //Try some interpolation for kanji. If we find a hiragana we know after this,
// then we may be able to figure this one out. // then we may be able to figure this one out.
wxString NextSGroup = RegroupSourceText[GetSourceArrayPos(false)]; wxString NextSGroup = RegroupSourceText[GetSourceArrayPos(false)];
int highlight=0;
for(std::list<KanaEntry>::iterator iter = kt->entries.begin(); iter != kt->entries.end(); iter++) { for(std::list<KanaEntry>::iterator iter = kt->entries.begin(); iter != kt->entries.end(); iter++) {
KanaEntry ke = *iter; KanaEntry ke = *iter;
@ -558,7 +561,7 @@ int DialogKanjiTimer::ListIndexFromStyleandIndex(wxString StyleName, int Occuran
AssDialogue *line; AssDialogue *line;
int index = 0; int index = 0;
int occindex = 0; int occindex = 0;
while(line=grid->GetDialogue(index)) { while((line=grid->GetDialogue(index)) != NULL) {
if (line->Style == StyleName) { if (line->Style == StyleName) {
if (occindex == Occurance) if (occindex == Occurance)
return index; return index;

View file

@ -50,7 +50,7 @@ DialogProgress::DialogProgress(wxWindow *parent,wxString title,volatile bool *ca
// Gauge // Gauge
gauge = new wxGauge(this, -1, max, wxDefaultPosition, wxSize(300,20), wxGA_HORIZONTAL); gauge = new wxGauge(this, -1, max, wxDefaultPosition, wxSize(300,20), wxGA_HORIZONTAL);
wxButton *cancelButton; wxButton *cancelButton = NULL;
if (cancel) cancelButton = new wxButton(this,wxID_CANCEL); if (cancel) cancelButton = new wxButton(this,wxID_CANCEL);
text = new wxStaticText(this, -1, message, wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE | wxST_NO_AUTORESIZE); text = new wxStaticText(this, -1, message, wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE | wxST_NO_AUTORESIZE);

View file

@ -338,7 +338,7 @@ void SearchReplaceEngine::ReplaceNext(bool DoReplace) {
int start = curLine; int start = curLine;
int nrows = grid->GetRows(); int nrows = grid->GetRows();
bool found = false; bool found = false;
wxString *Text; wxString *Text = NULL;
size_t tempPos; size_t tempPos;
int regFlags = wxRE_ADVANCED; int regFlags = wxRE_ADVANCED;
if (!matchCase) { if (!matchCase) {

View file

@ -570,7 +570,6 @@ void DialogStyleManager::OnStorageCopy (wxCommandEvent &event) {
wxArrayInt selections; wxArrayInt selections;
AssStyle *temp = new AssStyle; AssStyle *temp = new AssStyle;
int n = StorageList->GetSelections(selections);
*temp = *(styleStorageMap.at(selections[0])); *temp = *(styleStorageMap.at(selections[0]));
wxString newName = _("Copy of "); wxString newName = _("Copy of ");
newName += temp->name; newName += temp->name;
@ -594,7 +593,6 @@ void DialogStyleManager::OnStorageCopy (wxCommandEvent &event) {
void DialogStyleManager::OnCurrentCopy (wxCommandEvent &event) { void DialogStyleManager::OnCurrentCopy (wxCommandEvent &event) {
wxArrayInt selections; wxArrayInt selections;
int n = CurrentList->GetSelections(selections);
AssStyle *temp = new AssStyle(styleMap.at(selections[0])->GetEntryData()); AssStyle *temp = new AssStyle(styleMap.at(selections[0])->GetEntryData());
wxString newName = _("Copy of "); wxString newName = _("Copy of ");
newName += temp->name; newName += temp->name;

View file

@ -321,11 +321,11 @@ void DialogTranslation::OnTransBoxKey(wxKeyEvent &event) {
// Next // Next
if (Hotkeys.IsPressed(_T("Translation Assistant Accept"))) { if (Hotkeys.IsPressed(_T("Translation Assistant Accept"))) {
bool ok = JumpToLine(curline,curblock+1); JumpToLine(curline,curblock+1);
TransText->Clear(); TransText->Clear();
TransText->SetFocus(); TransText->SetFocus();
} }
else bool ok = JumpToLine(curline,curblock); else JumpToLine(curline,curblock);
return; return;
} }

View file

@ -152,7 +152,10 @@ FrameMain::FrameMain (wxArrayString args)
Options.SetInt(_T("Auto check for updates"),option); Options.SetInt(_T("Auto check for updates"),option);
Options.Save(); Options.Save();
} }
if (option == 1) DialogVersionCheck *checker = new DialogVersionCheck (this,true); if (option == 1) {
DialogVersionCheck *checker = new DialogVersionCheck (this,true);
(void)checker;
}
} }

View file

@ -575,6 +575,7 @@ void FrameMain::OnAbout(wxCommandEvent &event) {
// Open check updates // Open check updates
void FrameMain::OnCheckUpdates(wxCommandEvent &event) { void FrameMain::OnCheckUpdates(wxCommandEvent &event) {
DialogVersionCheck *check = new DialogVersionCheck(this,false); DialogVersionCheck *check = new DialogVersionCheck(this,false);
(void)check;
} }
@ -994,7 +995,6 @@ void FrameMain::OnOpenAutomation (wxCommandEvent &event) {
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
// General handler for all Automation-generated menu items // General handler for all Automation-generated menu items
void FrameMain::OnAutomationMacro (wxCommandEvent &event) { void FrameMain::OnAutomationMacro (wxCommandEvent &event) {
AssFile *oldtop = AssFile::top;
activeMacroItems[event.GetId()-Menu_Automation_Macro]->Process(SubsBox->ass, SubsBox->GetAbsoluteSelection(), SubsBox->GetFirstSelRow(), this); activeMacroItems[event.GetId()-Menu_Automation_Macro]->Process(SubsBox->ass, SubsBox->GetAbsoluteSelection(), SubsBox->GetFirstSelRow(), this);
// check if modifications were made and put on undo stack // check if modifications were made and put on undo stack
AssFile::Popping = true; // HACK to avoid getting an additional undo point on stack AssFile::Popping = true; // HACK to avoid getting an additional undo point on stack

View file

@ -106,7 +106,7 @@ void OpenGLWrapper::DrawRing(float x,float y,float r1,float r2,float ar,float ar
// Math // Math
int steps = int((r1 + r1*ar) * range / (2.0f*pi))*4; int steps = int((r1 + r1*ar) * range / (2.0f*pi))*4;
if (steps < 12) steps = 12; if (steps < 12) steps = 12;
float end = arcEnd; //float end = arcEnd;
float step = range/steps; float step = range/steps;
float curAngle = arcStart; float curAngle = arcStart;

View file

@ -48,6 +48,7 @@ public:
wxString katakana; wxString katakana;
wxString hepburn; wxString hepburn;
KanaEntry() {}
KanaEntry(wxString hira,wxString kata,wxString hep) { KanaEntry(wxString hira,wxString kata,wxString hep) {
hiragana = hira; hiragana = hira;
katakana = kata; katakana = kata;

View file

@ -154,7 +154,7 @@ void MatroskaWrapper::Parse() {
// Variables // Variables
ulonglong startTime, endTime, filePos; ulonglong startTime, endTime, filePos;
unsigned int rt, frameSize, frameFlags; unsigned int rt, frameSize, frameFlags;
CompressedStream *cs = NULL; //CompressedStream *cs = NULL;
// Timecode scale // Timecode scale
__int64 timecodeScale = mkv_TruncFloat(trackInfo->TimecodeScale) * segInfo->TimecodeScale; __int64 timecodeScale = mkv_TruncFloat(trackInfo->TimecodeScale) * segInfo->TimecodeScale;
@ -281,7 +281,7 @@ void MatroskaWrapper::GetSubtitles(AssFile *target) {
// Get info // Get info
int tracks = mkv_GetNumTracks(file); int tracks = mkv_GetNumTracks(file);
TrackInfo *trackInfo; TrackInfo *trackInfo;
SegmentInfo *segInfo = mkv_GetFileInfo(file); //SegmentInfo *segInfo = mkv_GetFileInfo(file);
wxArrayInt tracksFound; wxArrayInt tracksFound;
wxArrayString tracksNames; wxArrayString tracksNames;
int trackToRead = -1; int trackToRead = -1;
@ -289,7 +289,7 @@ void MatroskaWrapper::GetSubtitles(AssFile *target) {
// Haali's library variables // Haali's library variables
ulonglong startTime, endTime, filePos; ulonglong startTime, endTime, filePos;
unsigned int rt, frameSize, frameFlags; unsigned int rt, frameSize, frameFlags;
CompressedStream *cs = NULL; //CompressedStream *cs = NULL;
// Find tracks // Find tracks
for (int track=0;track<tracks;track++) { for (int track=0;track<tracks;track++) {
@ -444,7 +444,7 @@ void MatroskaWrapper::GetSubtitles(AssFile *target) {
} }
// Insert into vector // Insert into vector
if (subList.size() == order) subList.push_back(blockString); if (subList.size() == (unsigned int)order) subList.push_back(blockString);
else { else {
if ((signed)(subList.size()) < order+1) subList.resize(order+1); if ((signed)(subList.size()) < order+1) subList.resize(order+1);
subList[order] = blockString; subList[order] = blockString;

View file

@ -70,6 +70,11 @@ public:
bool isKey; bool isKey;
__int64 filePos; __int64 filePos;
MkvFrame() {
time = 0;
isKey = false;
filePos = -1;
}
MkvFrame(bool keyframe,double timecode,__int64 _filePos) { MkvFrame(bool keyframe,double timecode,__int64 _filePos) {
isKey = keyframe; isKey = keyframe;
time = timecode; time = timecode;

View file

@ -181,9 +181,6 @@ void OptionsManager::LoadDefaults() {
// Generate colors // Generate colors
wxColour tempCol = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW); wxColour tempCol = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW);
float r = tempCol.Red() / 255.0;
float g = tempCol.Green() / 255.0;
float b = tempCol.Blue() / 255.0;
wxColour textCol = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT); wxColour textCol = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT);
wxColour background = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW); wxColour background = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW);
wxColour comment = wxColour(216,222,245); wxColour comment = wxColour(216,222,245);

View file

@ -424,7 +424,7 @@ void SubsEditBox::OnNeedStyle(wxScintillaEvent &event) {
/////////////////// ///////////////////
// Character added // Character added
void SubsEditBox::OnCharAdded(wxScintillaEvent &event) { void SubsEditBox::OnCharAdded(wxScintillaEvent &event) {
int character = event.GetKey(); //int character = event.GetKey();
} }
@ -699,7 +699,7 @@ void SubsEditBox::OnMarginLChange(wxCommandEvent &event) {
grid->BeginBatch(); grid->BeginBatch();
wxArrayInt sel = grid->GetSelection(); wxArrayInt sel = grid->GetSelection();
int n = sel.Count(); int n = sel.Count();
AssDialogue *cur; AssDialogue *cur = NULL;
for (int i=0;i<n;i++) { for (int i=0;i<n;i++) {
cur = grid->GetDialogue(sel[i]); cur = grid->GetDialogue(sel[i]);
if (cur) { if (cur) {
@ -721,7 +721,7 @@ void SubsEditBox::OnMarginRChange(wxCommandEvent &event) {
grid->BeginBatch(); grid->BeginBatch();
wxArrayInt sel = grid->GetSelection(); wxArrayInt sel = grid->GetSelection();
int n = sel.Count(); int n = sel.Count();
AssDialogue *cur; AssDialogue *cur = NULL;
for (int i=0;i<n;i++) { for (int i=0;i<n;i++) {
cur = grid->GetDialogue(sel[i]); cur = grid->GetDialogue(sel[i]);
if (cur) { if (cur) {
@ -743,7 +743,7 @@ void SubsEditBox::OnMarginVChange(wxCommandEvent &event) {
grid->BeginBatch(); grid->BeginBatch();
wxArrayInt sel = grid->GetSelection(); wxArrayInt sel = grid->GetSelection();
int n = sel.Count(); int n = sel.Count();
AssDialogue *cur; AssDialogue *cur = NULL;
for (int i=0;i<n;i++) { for (int i=0;i<n;i++) {
cur = grid->GetDialogue(sel[i]); cur = grid->GetDialogue(sel[i]);
if (cur) { if (cur) {
@ -922,7 +922,7 @@ void SubsEditBox::SetOverride (wxString tagname,wxString preValue,int forcePos,b
// Insert variables // Insert variables
wxString insert; wxString insert;
wxString insert2; wxString insert2;
int shift; int shift = 0;
int nInserted = 1; int nInserted = 1;
// Default value // Default value

View file

@ -538,7 +538,7 @@ void SubsTextEditCtrl::UpdateCallTip() {
wxString useProto; wxString useProto;
wxString cleanProto; wxString cleanProto;
wxString protoName; wxString protoName;
int protoN; int protoN = 0;
bool semiProto = false; bool semiProto = false;
for (unsigned int i=0;i<proto.Count();i++) { for (unsigned int i=0;i<proto.Count();i++) {
// Get prototype name // Get prototype name
@ -599,7 +599,7 @@ void SubsTextEditCtrl::UpdateCallTip() {
if (highEnd == -1) highEnd = useProto.Length(); if (highEnd == -1) highEnd = useProto.Length();
// Calltip is over // Calltip is over
if (highStart == useProto.Length()) { if (highStart == (signed) useProto.Length()) {
CallTipCancel(); CallTipCancel();
return; return;
} }
@ -807,7 +807,7 @@ void SubsTextEditCtrl::ShowPopupMenu(int activePos) {
currentWordPos = activePos; currentWordPos = activePos;
// Spell check // Spell check
int style = GetStyleAt(activePos); //int style = GetStyleAt(activePos);
if (spellchecker && currentWord.Length()) { if (spellchecker && currentWord.Length()) {
// Spelled right? // Spelled right?
bool rightSpelling = spellchecker->CheckWord(currentWord); bool rightSpelling = spellchecker->CheckWord(currentWord);

View file

@ -315,7 +315,7 @@ void PRSSubtitleFormat::InsertFrame(PRSFile &file,int &framen,std::vector<int> &
unsigned char blend = 0; unsigned char blend = 0;
// Check if it's just an extension of last display // Check if it's just an extension of last display
if (lastDisplay && lastDisplay->id == useID && lastDisplay->endFrame == startf-1 && if (lastDisplay && lastDisplay->id == (unsigned)useID && (signed)lastDisplay->endFrame == startf-1 &&
lastDisplay->x == x && lastDisplay->y == y && lastDisplay->alpha == alpha && lastDisplay->blend == blend) lastDisplay->x == x && lastDisplay->y == y && lastDisplay->alpha == alpha && lastDisplay->blend == blend)
{ {
lastDisplay->end = start; lastDisplay->end = start;

View file

@ -133,6 +133,7 @@ void CSRISubtitlesProvider::DrawSubtitles(AegiVideoFrame &dst,double time) {
switch (dst.format) { switch (dst.format) {
case FORMAT_RGB32: frame.pixfmt = CSRI_F_BGR_; break; case FORMAT_RGB32: frame.pixfmt = CSRI_F_BGR_; break;
case FORMAT_RGB24: frame.pixfmt = CSRI_F_BGR; break; case FORMAT_RGB24: frame.pixfmt = CSRI_F_BGR; break;
default: frame.pixfmt = CSRI_F_BGR_;
} }
// Set format // Set format

View file

@ -57,7 +57,7 @@ __int64 abs64(__int64 input) {
/////////////////////////////////////// ///////////////////////////////////////
// Count number of matches of a substr // Count number of matches of a substr
int CountMatches(wxString parent,wxString child) { int CountMatches(wxString parent,wxString child) {
size_t pos = -1; size_t pos = wxString::npos;
int n = 0; int n = 0;
while ((pos = parent.find(child,pos+1)) != wxString::npos) n++; while ((pos = parent.find(child,pos+1)) != wxString::npos) n++;
return n; return n;

View file

@ -402,7 +402,7 @@ GLuint VideoContext::GetFrameAsTexture(int n) {
lastFrame = n; lastFrame = n;
// Image type // Image type
GLenum format; GLenum format = GL_LUMINANCE;
if (frame.format == FORMAT_RGB32) { if (frame.format == FORMAT_RGB32) {
if (frame.invertChannels) format = GL_BGRA_EXT; if (frame.invertChannels) format = GL_BGRA_EXT;
else format = GL_RGBA; else format = GL_RGBA;

View file

@ -149,7 +149,7 @@ void VideoDisplayVisual::DrawOverlay() {
diag = VideoContext::Get()->grid->GetDialogue(i); diag = VideoContext::Get()->grid->GetDialogue(i);
if (diag) { if (diag) {
// Draw? // Draw?
bool draw = false; //bool draw = false;
bool high = false; bool high = false;
bool isCur = diag == curSelection; bool isCur = diag == curSelection;
bool timeVisible = VFR_Output.GetFrameAtTime(diag->Start.GetMS(),true) <= frame_n && VFR_Output.GetFrameAtTime(diag->End.GetMS(),false) >= frame_n; bool timeVisible = VFR_Output.GetFrameAtTime(diag->Start.GetMS(),true) <= frame_n && VFR_Output.GetFrameAtTime(diag->End.GetMS(),false) >= frame_n;
@ -773,8 +773,8 @@ void VideoDisplayVisual::OnMouseEvent (wxMouseEvent &event) {
if (mode == 1) { if (mode == 1) {
// For each line // For each line
int numRows = VideoContext::Get()->grid->GetRows(); int numRows = VideoContext::Get()->grid->GetRows();
int startMs = VFR_Output.GetTimeAtFrame(frame_n,true); //int startMs = VFR_Output.GetTimeAtFrame(frame_n,true);
int endMs = VFR_Output.GetTimeAtFrame(frame_n,false); //int endMs = VFR_Output.GetTimeAtFrame(frame_n,false);
AssDialogue *diag; AssDialogue *diag;
// Don't uninvert this loop or selection will break // Don't uninvert this loop or selection will break

View file

@ -82,7 +82,7 @@ void AegiVideoFrame::Allocate() {
// Get size // Get size
int height = h; int height = h;
if (format == FORMAT_YV12 && i > 0) height/=2; if (format == FORMAT_YV12 && i > 0) height/=2;
int size = pitch[i]*height; unsigned int size = pitch[i]*height;
// Reallocate, if necessary // Reallocate, if necessary
if (memSize[i] != size) { if (memSize[i] != size) {

View file

@ -359,7 +359,7 @@ HRESULT DirectShowVideoProvider::OpenVideo(wxString _filename) {
else fps = 10000000.0 / double(defd); else fps = 10000000.0 / double(defd);
// Set number of frames // Set number of frames
last_fnum = -1; last_fnum = 0;
num_frames = duration / defd; num_frames = duration / defd;
// Store filters // Store filters
@ -507,7 +507,7 @@ const AegiVideoFrame DirectShowVideoProvider::DoGetFrame(int n) {
if (cur < 0) cur = 0; if (cur < 0) cur = 0;
// Is next // Is next
if (n == last_fnum + 1) { if (n == (signed)last_fnum + 1) {
//rdf.frame.Clear(); //rdf.frame.Clear();
NextFrame(rdf,fn); NextFrame(rdf,fn);
last_fnum = n; last_fnum = n;

View file

@ -173,7 +173,7 @@ void VideoSlider::UpdateVideo() {
void VideoSlider::OnMouse(wxMouseEvent &event) { void VideoSlider::OnMouse(wxMouseEvent &event) {
// Coordinates // Coordinates
int x = event.GetX(); int x = event.GetX();
int y = event.GetY(); //int y = event.GetY();
bool shift = event.m_shiftDown; bool shift = event.m_shiftDown;
// Left click // Left click