diff --git a/aegisub/auto4_auto3.cpp b/aegisub/auto4_auto3.cpp index b3f4b4423..55c1d2121 100644 --- a/aegisub/auto4_auto3.cpp +++ b/aegisub/auto4_auto3.cpp @@ -393,7 +393,8 @@ namespace Automation4 { sink->script_finished = true; wxWakeUpIdle(); - return (wxThread::ExitCode)res; // no matter what MSVC says, this works (zero/non-zero is all that matters here anyway) + if (res) return (wxThread::ExitCode) 1; + else return 0; } diff --git a/aegisub/auto4_lua.cpp b/aegisub/auto4_lua.cpp index 836bcc9ea..78cd5fc0f 100644 --- a/aegisub/auto4_lua.cpp +++ b/aegisub/auto4_lua.cpp @@ -429,7 +429,8 @@ namespace Automation4 { lua_pop(L, 1); lua_gc(L, LUA_GCCOLLECT, 0); - return (wxThread::ExitCode)result; // works no matter what MSVC says + if (result) return (wxThread::ExitCode) 1; + else return 0; } diff --git a/aegisub/auto4_perl_ass.cpp b/aegisub/auto4_perl_ass.cpp index 78fa35e3a..6c0be586c 100644 --- a/aegisub/auto4_perl_ass.cpp +++ b/aegisub/auto4_perl_ass.cpp @@ -45,6 +45,11 @@ #include "ass_attachment.h" +// Disable warning +#ifdef __VISUALC__ +#pragma warning(disable: 4800) +#endif + // For wxString::Trim #define right true #define left false @@ -438,7 +443,7 @@ namespace Automation4 { std::list::iterator it = ass->Line.begin(); for(I32 i = 0; i <= av_len(lines); i++) { if(!av_exists(lines, i)) continue; - if(i < ass->Line.size()) { + if(i < (I32)ass->Line.size()) { if(*it) delete *it; AV_FETCH(lines, i) *it++ = MakeAssEntry((HV*)SvRV(AV_VAL)); diff --git a/aegisub/auto4_perl_macro.cpp b/aegisub/auto4_perl_macro.cpp index 594af8385..fac42aa82 100644 --- a/aegisub/auto4_perl_macro.cpp +++ b/aegisub/auto4_perl_macro.cpp @@ -41,6 +41,11 @@ #include "ass_file.h" +#ifdef __VISUALC__ +#pragma warning(disable: 4800) +#endif + + namespace Automation4 { diff --git a/aegisub/auto4_perl_script.cpp b/aegisub/auto4_perl_script.cpp index d68c74495..c6d436065 100644 --- a/aegisub/auto4_perl_script.cpp +++ b/aegisub/auto4_perl_script.cpp @@ -44,6 +44,9 @@ #include #include +#ifdef __VISUALC__ +#pragma warning(disable: 4800) +#endif namespace Automation4 { diff --git a/aegisub/auto4_perldata.inc b/aegisub/auto4_perldata.inc index ce463cc9f..e777d4843 100644 --- a/aegisub/auto4_perldata.inc +++ b/aegisub/auto4_perldata.inc @@ -39,7 +39,7 @@ // Discards values of selected that are past the end of AssFile::Line #define CHOP_SELECTED(ass, sel) \ - for(; sel.back() >= ass->Line.size(); sel.pop_back()) + for(; sel.back() >= (int)ass->Line.size(); sel.pop_back()) // Conversions between std::vector and AVs diff --git a/aegisub/dialog_attachments.cpp b/aegisub/dialog_attachments.cpp index 19043bad8..2ddef5021 100644 --- a/aegisub/dialog_attachments.cpp +++ b/aegisub/dialog_attachments.cpp @@ -108,7 +108,7 @@ void DialogAttachments::UpdateList() { listView->InsertItem(row,attach->GetFileName(true)); listView->SetItem(row,1,PrettySize(attach->GetData().size())); listView->SetItem(row,2,attach->group); - listView->SetItemData(row,(long)attach); + listView->SetItemPtrData(row,wxPtrToUInt(attach)); } } } @@ -214,7 +214,7 @@ void DialogAttachments::OnExtract(wxCommandEvent &event) { if (listView->GetNextSelected(i) != -1) path = wxDirSelector(_("Select the path to save the files to:"),Options.AsText(_T("Fonts Collector Destination"))) + _T("/"); else { // Default path - wxString defPath = ((AssAttachment*) listView->GetItemData(i))->GetFileName(); + wxString defPath = ((AssAttachment*) wxUIntToPtr(listView->GetItemData(i)))->GetFileName(); path = wxFileSelector(_("Select the path to save the file to:"),Options.AsText(_T("Fonts Collector Destination")),defPath); fullPath = true; } @@ -222,7 +222,7 @@ void DialogAttachments::OnExtract(wxCommandEvent &event) { // Loop through items in list while (i != -1) { - AssAttachment *attach = (AssAttachment*) listView->GetItemData(i); + AssAttachment *attach = (AssAttachment*) wxUIntToPtr(listView->GetItemData(i)); wxString filename = path; if (!fullPath) filename += attach->GetFileName(); attach->Extract(filename); @@ -238,7 +238,7 @@ void DialogAttachments::OnDelete(wxCommandEvent &event) { // Loop through items in list int i = listView->GetFirstSelected(); while (i != -1) { - AssFile::top->Line.remove((AssEntry*)listView->GetItemData(i)); + AssFile::top->Line.remove((AssEntry*)wxUIntToPtr(listView->GetItemData(i))); i = listView->GetNextSelected(i); } diff --git a/aegisub/dialog_options.cpp b/aegisub/dialog_options.cpp index cd24fe4b0..d2fa1a00c 100644 --- a/aegisub/dialog_options.cpp +++ b/aegisub/dialog_options.cpp @@ -1011,7 +1011,7 @@ void DialogOptions::OnEditHotkey(wxCommandEvent &event) { if (sel == wxNOT_FOUND) return; // Get key and store old - HotkeyType *curKey = (HotkeyType *) Shortcuts->GetItemData(sel); + HotkeyType *curKey = (HotkeyType *) wxUIntToPtr(Shortcuts->GetItemData(sel)); int oldKeycode = curKey->keycode; int oldFlags = curKey->flags; @@ -1034,7 +1034,7 @@ void DialogOptions::OnClearHotkey(wxCommandEvent &event) { item = Shortcuts->GetNextItem(item,wxLIST_NEXT_ALL,wxLIST_STATE_SELECTED); if (item == -1) break; - HotkeyType *curKey = (HotkeyType *) Shortcuts->GetItemData(item); + HotkeyType *curKey = (HotkeyType *) wxUIntToPtr(Shortcuts->GetItemData(item)); if (curKey->keycode != 0 || curKey->flags != 0) { hotkeysModified = true; curKey->keycode = 0; @@ -1057,7 +1057,7 @@ void DialogOptions::OnDefaultHotkey(wxCommandEvent &event) { item = Shortcuts->GetNextItem(item,wxLIST_NEXT_ALL,wxLIST_STATE_SELECTED); if (item == -1) break; - HotkeyType *curKey = (HotkeyType *) Shortcuts->GetItemData(item); + HotkeyType *curKey = (HotkeyType *) wxUIntToPtr(Shortcuts->GetItemData(item)); HotkeyType *origKey = &defs.key[curKey->origName.Lower()]; if (origKey->keycode != curKey->keycode || origKey->flags != curKey->flags) { hotkeysModified = true; @@ -1070,7 +1070,7 @@ void DialogOptions::OnDefaultHotkey(wxCommandEvent &event) { if (dup) { dup->keycode = 0; dup->flags = 0; - int item = Shortcuts->FindItem(-1,(wxUIntPtr)dup); + int item = Shortcuts->FindItem(-1,wxPtrToUInt(dup)); if (item != -1) Shortcuts->SetItem(item,1,dup->GetText()); } } @@ -1169,7 +1169,7 @@ void CaptureKey::OnKeyDown(wxKeyEvent &event) { } dup->keycode = 0; dup->flags = 0; - int item = parent->shortcuts->FindItem(-1,(wxUIntPtr)dup); + int item = parent->shortcuts->FindItem(-1,wxPtrToUInt(dup)); if (item != -1) parent->shortcuts->SetItem(item,1,dup->GetText()); } diff --git a/build/aegisub_vs2005/aegisub_vs2005.vcproj b/build/aegisub_vs2005/aegisub_vs2005.vcproj index 3de9972a9..fc107d487 100644 --- a/build/aegisub_vs2005/aegisub_vs2005.vcproj +++ b/build/aegisub_vs2005/aegisub_vs2005.vcproj @@ -50,6 +50,7 @@ UsePrecompiledHeader="2" PrecompiledHeaderThrough="stdwx.h" WarningLevel="3" + WarnAsError="true" Detect64BitPortabilityProblems="true" DebugInformationFormat="4" DisableSpecificWarnings="4267" @@ -133,6 +134,7 @@ UsePrecompiledHeader="2" PrecompiledHeaderThrough="stdwx.h" WarningLevel="3" + WarnAsError="true" Detect64BitPortabilityProblems="true" DebugInformationFormat="3" DisableSpecificWarnings="4267" diff --git a/universalchardet/nsCharSetProber.cpp b/universalchardet/nsCharSetProber.cpp index 0429dd1a0..d19a2417d 100644 --- a/universalchardet/nsCharSetProber.cpp +++ b/universalchardet/nsCharSetProber.cpp @@ -74,7 +74,7 @@ PRBool nsCharSetProber::FilterWithoutEnglishLetters(const char* aBuf, PRUint32 a if (meetMSB && curPtr > prevPtr) while (prevPtr < curPtr) *newptr++ = *prevPtr++; - newLen = newptr - *newBuf; + newLen = PRUint32(newptr - *newBuf); return PR_TRUE; } @@ -119,7 +119,7 @@ PRBool nsCharSetProber::FilterWithEnglishLetters(const char* aBuf, PRUint32 aLen while (prevPtr < curPtr) *newptr++ = *prevPtr++; - newLen = newptr - *newBuf; + newLen = PRUint32(newptr - *newBuf); return PR_TRUE; }