From 297dbd74b8be4ed8b20824a43989b117a97cf44b Mon Sep 17 00:00:00 2001 From: Rodrigo Braz Monteiro Date: Wed, 24 Jan 2007 03:54:32 +0000 Subject: [PATCH] Fixed almost a hundred warning messages issued with /W4 in VC++ (with warning 4100 disabled) Originally committed to SVN as r891. --- FexTrackerSource/FexMovement.cpp | 2 +- aegisub/MatroskaParser.c | 38 ++++++++++++++++------------- aegisub/audio_display.cpp | 1 - aegisub/audio_karaoke.cpp | 6 ++--- aegisub/audio_player_dsound.cpp | 2 +- aegisub/auto4_base.cpp | 2 +- aegisub/auto4_lua.cpp | 9 ++++++- aegisub/dialog_kanji_timer.cpp | 35 ++++++++++++++------------ aegisub/dialog_progress.cpp | 2 +- aegisub/dialog_search_replace.cpp | 2 +- aegisub/dialog_style_manager.cpp | 2 -- aegisub/dialog_translation.cpp | 4 +-- aegisub/frame_main.cpp | 5 +++- aegisub/frame_main_events.cpp | 2 +- aegisub/gl_wrap.cpp | 2 +- aegisub/kana_table.h | 1 + aegisub/mkv_wrap.cpp | 8 +++--- aegisub/mkv_wrap.h | 5 ++++ aegisub/options.cpp | 3 --- aegisub/subs_edit_box.cpp | 10 ++++---- aegisub/subs_edit_ctrl.cpp | 6 ++--- aegisub/subtitle_format_prs.cpp | 2 +- aegisub/subtitles_provider_csri.cpp | 1 + aegisub/utils.cpp | 2 +- aegisub/video_context.cpp | 2 +- aegisub/video_display_visual.cpp | 6 ++--- aegisub/video_frame.cpp | 2 +- aegisub/video_provider_dshow.cpp | 4 +-- aegisub/video_slider.cpp | 2 +- 29 files changed, 93 insertions(+), 75 deletions(-) diff --git a/FexTrackerSource/FexMovement.cpp b/FexTrackerSource/FexMovement.cpp index ec8f4a983..258f04e17 100644 --- a/FexTrackerSource/FexMovement.cpp +++ b/FexTrackerSource/FexMovement.cpp @@ -41,7 +41,7 @@ FEXTRACKER_API void LoadMovement( FexMovement* me, const wchar_t* Filename ) FILE *fi = _wfopen( Filename, L"rt" ); if( !fi ) return; - int CurFeat = -1; + //int CurFeat = -1; char Line[512]; while( !feof(fi) ) { diff --git a/aegisub/MatroskaParser.c b/aegisub/MatroskaParser.c index 03f91547b..bf15929f7 100644 --- a/aegisub/MatroskaParser.c +++ b/aegisub/MatroskaParser.c @@ -240,7 +240,7 @@ static void myvsnprintf_uint_impl(char **pdest,char *de,int width,int zero, int rem = (int)(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); @@ -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) { // s,d,x,u,ll 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 > 0) @@ -687,7 +687,7 @@ static ulonglong readVLUIntImp(MatroskaFile *mf,int *mask) { c = readch(mf); if (c == EOF) - return EOF; + return (ulonglong)EOF; if (c == 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 MKFLOAT f; int shift; + f.v = 0; #else union { unsigned int ui; @@ -769,6 +770,9 @@ static MKFLOAT readFloat(MatroskaFile *mf,unsigned int len) { float f; double d; } u; + ui = 0; + d = 0; + ull = 0; #endif if (len!=4 && len!=8) @@ -1246,7 +1250,7 @@ static void parseTrackEntry(MatroskaFile *mf,ulonglong toplen) { ulonglong v; char *cp = NULL, *cs = NULL; size_t cplen = 0, cslen = 0, cpadd = 0; - unsigned CompScope, num_comp = 0; + unsigned CompScope=0, num_comp = 0; if (mf->nTracks >= MAX_TRACKS) errorjmp(mf,"Too many tracks."); @@ -1431,11 +1435,11 @@ static void parseTrackEntry(MatroskaFile *mf,ulonglong toplen) { if (inflateInit(&zs) != Z_OK) errorjmp(mf, "inflateInit failed"); - zs.next_in = cp; + zs.next_in = (Bytef*) cp; zs.avail_in = cplen; do { - zs.next_out = tmp; + zs.next_out = (Bytef*) tmp; zs.avail_out = sizeof(tmp); code = inflate(&zs, Z_NO_FLUSH); @@ -1449,9 +1453,9 @@ static void parseTrackEntry(MatroskaFile *mf,ulonglong toplen) { inflateReset(&zs); - zs.next_in = cp; + zs.next_in = (Bytef*) cp; zs.avail_in = cplen; - zs.next_out = ncp; + zs.next_out = (Bytef*) ncp; zs.avail_out = ncplen; 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) { - ulonglong add_id = 1, add_pos, add_len; + ulonglong add_id = 1, add_pos=0, add_len=0; unsigned char have_add; 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) { - ulonglong v; + ulonglong v=0; ulonglong duration = 0; - ulonglong dpos; - unsigned add_id = 0; + ulonglong dpos=0; + //unsigned add_id = 0; struct QueueEntry *qe,*qf = NULL; unsigned char have_duration = 0, have_block = 0; unsigned char gap = 0; @@ -2151,10 +2155,10 @@ found: errorjmp(mf,"Unexpected EOF while reading Block flags"); if (blockex) - ref = !(c & 0x80); + ref = (unsigned char)(!(c & 0x80)); - gap = c & 0x1; - lacing = (c >> 1) & 3; + gap = (unsigned char)(c & 0x1); + lacing = (unsigned char)((c >> 1) & 3); if (lacing) { c = readch(mf); @@ -3259,7 +3263,7 @@ int cs_ReadData(CompressedStream *cs,char *buffer,unsigned bufsize) cs->decoded_ptr += todo; } else { /* 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); /* try to read more data */ @@ -3273,7 +3277,7 @@ int cs_ReadData(CompressedStream *cs,char *buffer,unsigned bufsize) return -1; } - cs->zs.next_in = cs->frame_buffer; + cs->zs.next_in = (Bytef*) cs->frame_buffer; cs->zs.avail_in = todo; cs->frame_pos += todo; diff --git a/aegisub/audio_display.cpp b/aegisub/audio_display.cpp index fb3b2c685..94ae35fc3 100644 --- a/aegisub/audio_display.cpp +++ b/aegisub/audio_display.cpp @@ -1124,7 +1124,6 @@ void AudioDisplay::OnMouseEvent(wxMouseEvent& event) { __int64 y = event.GetY(); bool karMode = karaoke->enabled; bool shiftDown = event.m_shiftDown; - bool ctrlDown = event.m_controlDown; int timelineHeight = Options.AsBool(_T("Audio Draw Timeline")) ? 20 : 0; // Leaving event diff --git a/aegisub/audio_karaoke.cpp b/aegisub/audio_karaoke.cpp index bf1a18ae7..8d526d505 100644 --- a/aegisub/audio_karaoke.cpp +++ b/aegisub/audio_karaoke.cpp @@ -264,7 +264,7 @@ bool AudioKaraoke::ParseDialogue(AssDialogue *curDiag) { // Last syllable if (foundBlock) syllables.push_back(temp); 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.DrawLine(dx+4+split_cursor_x, 0, dx+4+split_cursor_x, h); dc.SetPen(wxPen(wxColour(0,0,0))); @@ -411,7 +411,7 @@ void AudioKaraoke::OnSize(wxSizeEvent &event) { void AudioKaraoke::OnMouse(wxMouseEvent &event) { // Get coordinates int x = event.GetX(); - int y = event.GetY(); + //int y = event.GetY(); bool shift = event.m_shiftDown; // Syllable selection mode diff --git a/aegisub/audio_player_dsound.cpp b/aegisub/audio_player_dsound.cpp index 8ce57374a..c451b23d8 100644 --- a/aegisub/audio_player_dsound.cpp +++ b/aegisub/audio_player_dsound.cpp @@ -361,7 +361,7 @@ DirectSoundPlayerThread::~DirectSoundPlayerThread() { // Thread entry point wxThread::ExitCode DirectSoundPlayerThread::Entry() { // Variables - unsigned long int playPos,endPos,bufSize; + unsigned long int playPos=0,endPos=0,bufSize=0; bool playing; // Wait for notification diff --git a/aegisub/auto4_base.cpp b/aegisub/auto4_base.cpp index b5b4ad26e..f802edc41 100644 --- a/aegisub/auto4_base.cpp +++ b/aegisub/auto4_base.cpp @@ -248,7 +248,7 @@ namespace Automation4 { delete config_dialog; config_dialog = 0; } - if (config_dialog = GenerateConfigDialog(parent)) { + if ((config_dialog = GenerateConfigDialog(parent)) != NULL) { return config_dialog->GetWindow(parent); } else { return 0; diff --git a/aegisub/auto4_lua.cpp b/aegisub/auto4_lua.cpp index fe9b803ce..5aeda3dd5 100644 --- a/aegisub/auto4_lua.cpp +++ b/aegisub/auto4_lua.cpp @@ -494,7 +494,7 @@ namespace Automation4 { // create an array-style table with an integer vector in it // leave the new table on top of the stack 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_rawseti(L, -2, i+1); } @@ -516,6 +516,7 @@ namespace Automation4 { wxString _description(lua_tostring(L, 2), wxConvUTF8); LuaFeatureMacro *macro = new LuaFeatureMacro(_name, _description, L); + (void)macro; return 0; } @@ -553,12 +554,14 @@ namespace Automation4 { // prepare function call LuaAssFile *subsobj = new LuaAssFile(L, subs, false, false); + (void) subsobj; CreateIntegerArray(selected); // selected items lua_pushinteger(L, -1); // active line // do call LuaThreadedCall call(L, 3, 1); wxThread::ExitCode code = call.Wait(); + (void) code; // get result bool result = !!lua_toboolean(L, -1); @@ -574,6 +577,7 @@ namespace Automation4 { // prepare function call LuaAssFile *subsobj = new LuaAssFile(L, subs, true, true); + (void) subsobj; CreateIntegerArray(selected); // selected items lua_pushinteger(L, -1); // active line @@ -625,6 +629,7 @@ namespace Automation4 { int _merit = lua_tointeger(L, 3); LuaFeatureFilter *filter = new LuaFeatureFilter(_name, _description, _merit, L); + (void) filter; return 0; } @@ -636,6 +641,7 @@ namespace Automation4 { // prepare function call // 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*/); + (void) subsobj; // config if (has_config && config_dialog) { assert(config_dialog->LuaReadBack(L) == 1); @@ -665,6 +671,7 @@ namespace Automation4 { // prepare function call // 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*/); + (void) subsobj; // stored options lua_newtable(L); // TODO, nothing for now diff --git a/aegisub/dialog_kanji_timer.cpp b/aegisub/dialog_kanji_timer.cpp index 73abb7439..dab620d8e 100644 --- a/aegisub/dialog_kanji_timer.cpp +++ b/aegisub/dialog_kanji_timer.cpp @@ -180,8 +180,9 @@ void DialogKanjiTimer::OnStart(wxCommandEvent &event) { else if (SourceStyle->GetValue() == DestStyle->GetValue()) wxMessageBox(_("The source and destination styles must be different."),_("Error"),wxICON_EXCLAMATION | wxOK); else { - OnSkipDest((wxCommandEvent)NULL); - OnSkipSource((wxCommandEvent)NULL); + wxCommandEvent blank; + OnSkipDest(blank); + OnSkipSource(blank); DestText->SetFocus(); } } @@ -306,11 +307,10 @@ void DialogKanjiTimer::OnSkipDest(wxCommandEvent &event) { GroupsList->DeleteAllItems(); int index = ListIndexFromStyleandIndex(DestStyle->GetValue(), DestIndex); if (index != -1) { - AssDialogue *line = grid->GetDialogue(index); DestText->ChangeValue(grid->GetDialogue(index)->GetStrippedText()); - + SetSelected(); - + DestText->SetFocus(); DestIndex++; } @@ -318,8 +318,9 @@ void DialogKanjiTimer::OnSkipDest(wxCommandEvent &event) { void DialogKanjiTimer::OnGoBack(wxCommandEvent &event) { DestIndex-=2; SourceIndex-=2; - OnSkipDest((wxCommandEvent)NULL); - OnSkipSource((wxCommandEvent)NULL); + wxCommandEvent tmpEvent; + OnSkipDest(tmpEvent); + OnSkipSource(tmpEvent); } void DialogKanjiTimer::OnAccept(wxCommandEvent &event) { if (RegroupTotalLen==0) @@ -358,18 +359,20 @@ void DialogKanjiTimer::OnAccept(wxCommandEvent &event) { grid->ass->FlagAsModified(); grid->CommitChanges(); - OnSkipDest((wxCommandEvent)NULL); - OnSkipSource((wxCommandEvent)NULL); + wxCommandEvent evt; + OnSkipDest(evt); + OnSkipSource(evt); } } void DialogKanjiTimer::OnKeyDown(wxKeyEvent &event) { + wxCommandEvent evt; switch(event.GetKeyCode()) { case WXK_ESCAPE : //this->EndModal(0); - OnClose((wxCommandEvent)NULL); + OnClose(evt); break; case WXK_BACK : - OnUnlink((wxCommandEvent)NULL); + OnUnlink(evt); break; case WXK_RIGHT : //inc dest selection len if (DestText->GetStringSelection().Len()!=DestText->GetValue().Len()) @@ -390,17 +393,18 @@ void DialogKanjiTimer::OnKeyDown(wxKeyEvent &event) { } break; case WXK_RETURN : - OnKeyEnter((wxCommandEvent)NULL); + OnKeyEnter(evt); break; default : event.Skip(); } } void DialogKanjiTimer::OnKeyEnter(wxCommandEvent &event) { + wxCommandEvent evt; if (SourceText->GetValue().Len()==0&&RegroupTotalLen!=0) - this->OnAccept((wxCommandEvent)NULL); + this->OnAccept(evt); else if (SourceText->GetStringSelection().Len()!=0) - this->OnLink((wxCommandEvent)NULL); + this->OnLink(evt); } void DialogKanjiTimer::OnMouseEvent(wxMouseEvent &event) { 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, // then we may be able to figure this one out. wxString NextSGroup = RegroupSourceText[GetSourceArrayPos(false)]; - int highlight=0; for(std::list::iterator iter = kt->entries.begin(); iter != kt->entries.end(); iter++) { KanaEntry ke = *iter; @@ -558,7 +561,7 @@ int DialogKanjiTimer::ListIndexFromStyleandIndex(wxString StyleName, int Occuran AssDialogue *line; int index = 0; int occindex = 0; - while(line=grid->GetDialogue(index)) { + while((line=grid->GetDialogue(index)) != NULL) { if (line->Style == StyleName) { if (occindex == Occurance) return index; diff --git a/aegisub/dialog_progress.cpp b/aegisub/dialog_progress.cpp index a0e7d4925..f14db601a 100644 --- a/aegisub/dialog_progress.cpp +++ b/aegisub/dialog_progress.cpp @@ -50,7 +50,7 @@ DialogProgress::DialogProgress(wxWindow *parent,wxString title,volatile bool *ca // Gauge 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); text = new wxStaticText(this, -1, message, wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE | wxST_NO_AUTORESIZE); diff --git a/aegisub/dialog_search_replace.cpp b/aegisub/dialog_search_replace.cpp index 85364de42..36f913392 100644 --- a/aegisub/dialog_search_replace.cpp +++ b/aegisub/dialog_search_replace.cpp @@ -338,7 +338,7 @@ void SearchReplaceEngine::ReplaceNext(bool DoReplace) { int start = curLine; int nrows = grid->GetRows(); bool found = false; - wxString *Text; + wxString *Text = NULL; size_t tempPos; int regFlags = wxRE_ADVANCED; if (!matchCase) { diff --git a/aegisub/dialog_style_manager.cpp b/aegisub/dialog_style_manager.cpp index 865bbd100..f534bc45f 100644 --- a/aegisub/dialog_style_manager.cpp +++ b/aegisub/dialog_style_manager.cpp @@ -570,7 +570,6 @@ void DialogStyleManager::OnStorageCopy (wxCommandEvent &event) { wxArrayInt selections; AssStyle *temp = new AssStyle; - int n = StorageList->GetSelections(selections); *temp = *(styleStorageMap.at(selections[0])); wxString newName = _("Copy of "); newName += temp->name; @@ -594,7 +593,6 @@ void DialogStyleManager::OnStorageCopy (wxCommandEvent &event) { void DialogStyleManager::OnCurrentCopy (wxCommandEvent &event) { wxArrayInt selections; - int n = CurrentList->GetSelections(selections); AssStyle *temp = new AssStyle(styleMap.at(selections[0])->GetEntryData()); wxString newName = _("Copy of "); newName += temp->name; diff --git a/aegisub/dialog_translation.cpp b/aegisub/dialog_translation.cpp index 8838f6a20..599f4848e 100644 --- a/aegisub/dialog_translation.cpp +++ b/aegisub/dialog_translation.cpp @@ -321,11 +321,11 @@ void DialogTranslation::OnTransBoxKey(wxKeyEvent &event) { // Next if (Hotkeys.IsPressed(_T("Translation Assistant Accept"))) { - bool ok = JumpToLine(curline,curblock+1); + JumpToLine(curline,curblock+1); TransText->Clear(); TransText->SetFocus(); } - else bool ok = JumpToLine(curline,curblock); + else JumpToLine(curline,curblock); return; } diff --git a/aegisub/frame_main.cpp b/aegisub/frame_main.cpp index f148736d6..67312ab63 100644 --- a/aegisub/frame_main.cpp +++ b/aegisub/frame_main.cpp @@ -152,7 +152,10 @@ FrameMain::FrameMain (wxArrayString args) Options.SetInt(_T("Auto check for updates"),option); Options.Save(); } - if (option == 1) DialogVersionCheck *checker = new DialogVersionCheck (this,true); + if (option == 1) { + DialogVersionCheck *checker = new DialogVersionCheck (this,true); + (void)checker; + } } diff --git a/aegisub/frame_main_events.cpp b/aegisub/frame_main_events.cpp index 5bc31d8ef..82ce7203f 100644 --- a/aegisub/frame_main_events.cpp +++ b/aegisub/frame_main_events.cpp @@ -575,6 +575,7 @@ void FrameMain::OnAbout(wxCommandEvent &event) { // Open check updates void FrameMain::OnCheckUpdates(wxCommandEvent &event) { 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 void FrameMain::OnAutomationMacro (wxCommandEvent &event) { - AssFile *oldtop = AssFile::top; activeMacroItems[event.GetId()-Menu_Automation_Macro]->Process(SubsBox->ass, SubsBox->GetAbsoluteSelection(), SubsBox->GetFirstSelRow(), this); // check if modifications were made and put on undo stack AssFile::Popping = true; // HACK to avoid getting an additional undo point on stack diff --git a/aegisub/gl_wrap.cpp b/aegisub/gl_wrap.cpp index 8eaed4036..c03f69f5a 100644 --- a/aegisub/gl_wrap.cpp +++ b/aegisub/gl_wrap.cpp @@ -106,7 +106,7 @@ void OpenGLWrapper::DrawRing(float x,float y,float r1,float r2,float ar,float ar // Math int steps = int((r1 + r1*ar) * range / (2.0f*pi))*4; if (steps < 12) steps = 12; - float end = arcEnd; + //float end = arcEnd; float step = range/steps; float curAngle = arcStart; diff --git a/aegisub/kana_table.h b/aegisub/kana_table.h index ec14487e4..eb0c44abf 100644 --- a/aegisub/kana_table.h +++ b/aegisub/kana_table.h @@ -48,6 +48,7 @@ public: wxString katakana; wxString hepburn; + KanaEntry() {} KanaEntry(wxString hira,wxString kata,wxString hep) { hiragana = hira; katakana = kata; diff --git a/aegisub/mkv_wrap.cpp b/aegisub/mkv_wrap.cpp index 87d3986fb..327ff75a1 100644 --- a/aegisub/mkv_wrap.cpp +++ b/aegisub/mkv_wrap.cpp @@ -154,7 +154,7 @@ void MatroskaWrapper::Parse() { // Variables ulonglong startTime, endTime, filePos; unsigned int rt, frameSize, frameFlags; - CompressedStream *cs = NULL; + //CompressedStream *cs = NULL; // Timecode scale __int64 timecodeScale = mkv_TruncFloat(trackInfo->TimecodeScale) * segInfo->TimecodeScale; @@ -281,7 +281,7 @@ void MatroskaWrapper::GetSubtitles(AssFile *target) { // Get info int tracks = mkv_GetNumTracks(file); TrackInfo *trackInfo; - SegmentInfo *segInfo = mkv_GetFileInfo(file); + //SegmentInfo *segInfo = mkv_GetFileInfo(file); wxArrayInt tracksFound; wxArrayString tracksNames; int trackToRead = -1; @@ -289,7 +289,7 @@ void MatroskaWrapper::GetSubtitles(AssFile *target) { // Haali's library variables ulonglong startTime, endTime, filePos; unsigned int rt, frameSize, frameFlags; - CompressedStream *cs = NULL; + //CompressedStream *cs = NULL; // Find tracks for (int track=0;trackBeginBatch(); wxArrayInt sel = grid->GetSelection(); int n = sel.Count(); - AssDialogue *cur; + AssDialogue *cur = NULL; for (int i=0;iGetDialogue(sel[i]); if (cur) { @@ -721,7 +721,7 @@ void SubsEditBox::OnMarginRChange(wxCommandEvent &event) { grid->BeginBatch(); wxArrayInt sel = grid->GetSelection(); int n = sel.Count(); - AssDialogue *cur; + AssDialogue *cur = NULL; for (int i=0;iGetDialogue(sel[i]); if (cur) { @@ -743,7 +743,7 @@ void SubsEditBox::OnMarginVChange(wxCommandEvent &event) { grid->BeginBatch(); wxArrayInt sel = grid->GetSelection(); int n = sel.Count(); - AssDialogue *cur; + AssDialogue *cur = NULL; for (int i=0;iGetDialogue(sel[i]); if (cur) { @@ -922,7 +922,7 @@ void SubsEditBox::SetOverride (wxString tagname,wxString preValue,int forcePos,b // Insert variables wxString insert; wxString insert2; - int shift; + int shift = 0; int nInserted = 1; // Default value diff --git a/aegisub/subs_edit_ctrl.cpp b/aegisub/subs_edit_ctrl.cpp index 001b08df0..09b1ad46b 100644 --- a/aegisub/subs_edit_ctrl.cpp +++ b/aegisub/subs_edit_ctrl.cpp @@ -538,7 +538,7 @@ void SubsTextEditCtrl::UpdateCallTip() { wxString useProto; wxString cleanProto; wxString protoName; - int protoN; + int protoN = 0; bool semiProto = false; for (unsigned int i=0;iCheckWord(currentWord); diff --git a/aegisub/subtitle_format_prs.cpp b/aegisub/subtitle_format_prs.cpp index a2b00d150..eb914bf72 100644 --- a/aegisub/subtitle_format_prs.cpp +++ b/aegisub/subtitle_format_prs.cpp @@ -315,7 +315,7 @@ void PRSSubtitleFormat::InsertFrame(PRSFile &file,int &framen,std::vector & unsigned char blend = 0; // 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->end = start; diff --git a/aegisub/subtitles_provider_csri.cpp b/aegisub/subtitles_provider_csri.cpp index 7f8623f68..2733ced32 100644 --- a/aegisub/subtitles_provider_csri.cpp +++ b/aegisub/subtitles_provider_csri.cpp @@ -133,6 +133,7 @@ void CSRISubtitlesProvider::DrawSubtitles(AegiVideoFrame &dst,double time) { switch (dst.format) { case FORMAT_RGB32: frame.pixfmt = CSRI_F_BGR_; break; case FORMAT_RGB24: frame.pixfmt = CSRI_F_BGR; break; + default: frame.pixfmt = CSRI_F_BGR_; } // Set format diff --git a/aegisub/utils.cpp b/aegisub/utils.cpp index c6725a408..a6786e83b 100644 --- a/aegisub/utils.cpp +++ b/aegisub/utils.cpp @@ -57,7 +57,7 @@ __int64 abs64(__int64 input) { /////////////////////////////////////// // Count number of matches of a substr int CountMatches(wxString parent,wxString child) { - size_t pos = -1; + size_t pos = wxString::npos; int n = 0; while ((pos = parent.find(child,pos+1)) != wxString::npos) n++; return n; diff --git a/aegisub/video_context.cpp b/aegisub/video_context.cpp index 32f1ae36e..163773f2c 100644 --- a/aegisub/video_context.cpp +++ b/aegisub/video_context.cpp @@ -402,7 +402,7 @@ GLuint VideoContext::GetFrameAsTexture(int n) { lastFrame = n; // Image type - GLenum format; + GLenum format = GL_LUMINANCE; if (frame.format == FORMAT_RGB32) { if (frame.invertChannels) format = GL_BGRA_EXT; else format = GL_RGBA; diff --git a/aegisub/video_display_visual.cpp b/aegisub/video_display_visual.cpp index 0a2abe804..8f053ec8b 100644 --- a/aegisub/video_display_visual.cpp +++ b/aegisub/video_display_visual.cpp @@ -149,7 +149,7 @@ void VideoDisplayVisual::DrawOverlay() { diag = VideoContext::Get()->grid->GetDialogue(i); if (diag) { // Draw? - bool draw = false; + //bool draw = false; bool high = false; bool isCur = diag == curSelection; 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) { // For each line int numRows = VideoContext::Get()->grid->GetRows(); - int startMs = VFR_Output.GetTimeAtFrame(frame_n,true); - int endMs = VFR_Output.GetTimeAtFrame(frame_n,false); + //int startMs = VFR_Output.GetTimeAtFrame(frame_n,true); + //int endMs = VFR_Output.GetTimeAtFrame(frame_n,false); AssDialogue *diag; // Don't uninvert this loop or selection will break diff --git a/aegisub/video_frame.cpp b/aegisub/video_frame.cpp index 0d88da591..e5c4ed84f 100644 --- a/aegisub/video_frame.cpp +++ b/aegisub/video_frame.cpp @@ -82,7 +82,7 @@ void AegiVideoFrame::Allocate() { // Get size int height = h; if (format == FORMAT_YV12 && i > 0) height/=2; - int size = pitch[i]*height; + unsigned int size = pitch[i]*height; // Reallocate, if necessary if (memSize[i] != size) { diff --git a/aegisub/video_provider_dshow.cpp b/aegisub/video_provider_dshow.cpp index 87657ca7a..1ddf3d582 100644 --- a/aegisub/video_provider_dshow.cpp +++ b/aegisub/video_provider_dshow.cpp @@ -359,7 +359,7 @@ HRESULT DirectShowVideoProvider::OpenVideo(wxString _filename) { else fps = 10000000.0 / double(defd); // Set number of frames - last_fnum = -1; + last_fnum = 0; num_frames = duration / defd; // Store filters @@ -507,7 +507,7 @@ const AegiVideoFrame DirectShowVideoProvider::DoGetFrame(int n) { if (cur < 0) cur = 0; // Is next - if (n == last_fnum + 1) { + if (n == (signed)last_fnum + 1) { //rdf.frame.Clear(); NextFrame(rdf,fn); last_fnum = n; diff --git a/aegisub/video_slider.cpp b/aegisub/video_slider.cpp index eb5ba017f..8bc8387cb 100644 --- a/aegisub/video_slider.cpp +++ b/aegisub/video_slider.cpp @@ -173,7 +173,7 @@ void VideoSlider::UpdateVideo() { void VideoSlider::OnMouse(wxMouseEvent &event) { // Coordinates int x = event.GetX(); - int y = event.GetY(); + //int y = event.GetY(); bool shift = event.m_shiftDown; // Left click