mirror of https://github.com/odrling/Aegisub
Fixed all (?) warnings on MSVC++ and made the default project treat warnings as errors. This fixed several 64-compatibility warnings, as well.
Originally committed to SVN as r1797.
This commit is contained in:
parent
da09a52b59
commit
5cafaeb976
|
@ -393,7 +393,8 @@ namespace Automation4 {
|
||||||
sink->script_finished = true;
|
sink->script_finished = true;
|
||||||
wxWakeUpIdle();
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -429,7 +429,8 @@ namespace Automation4 {
|
||||||
lua_pop(L, 1);
|
lua_pop(L, 1);
|
||||||
|
|
||||||
lua_gc(L, LUA_GCCOLLECT, 0);
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -45,6 +45,11 @@
|
||||||
#include "ass_attachment.h"
|
#include "ass_attachment.h"
|
||||||
|
|
||||||
|
|
||||||
|
// Disable warning
|
||||||
|
#ifdef __VISUALC__
|
||||||
|
#pragma warning(disable: 4800)
|
||||||
|
#endif
|
||||||
|
|
||||||
// For wxString::Trim
|
// For wxString::Trim
|
||||||
#define right true
|
#define right true
|
||||||
#define left false
|
#define left false
|
||||||
|
@ -438,7 +443,7 @@ namespace Automation4 {
|
||||||
std::list<AssEntry*>::iterator it = ass->Line.begin();
|
std::list<AssEntry*>::iterator it = ass->Line.begin();
|
||||||
for(I32 i = 0; i <= av_len(lines); i++) {
|
for(I32 i = 0; i <= av_len(lines); i++) {
|
||||||
if(!av_exists(lines, i)) continue;
|
if(!av_exists(lines, i)) continue;
|
||||||
if(i < ass->Line.size()) {
|
if(i < (I32)ass->Line.size()) {
|
||||||
if(*it) delete *it;
|
if(*it) delete *it;
|
||||||
AV_FETCH(lines, i)
|
AV_FETCH(lines, i)
|
||||||
*it++ = MakeAssEntry((HV*)SvRV(AV_VAL));
|
*it++ = MakeAssEntry((HV*)SvRV(AV_VAL));
|
||||||
|
|
|
@ -41,6 +41,11 @@
|
||||||
#include "ass_file.h"
|
#include "ass_file.h"
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __VISUALC__
|
||||||
|
#pragma warning(disable: 4800)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
namespace Automation4 {
|
namespace Automation4 {
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -44,6 +44,9 @@
|
||||||
#include <wx/filename.h>
|
#include <wx/filename.h>
|
||||||
#include <wx/utils.h>
|
#include <wx/utils.h>
|
||||||
|
|
||||||
|
#ifdef __VISUALC__
|
||||||
|
#pragma warning(disable: 4800)
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace Automation4 {
|
namespace Automation4 {
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
|
|
||||||
// Discards values of selected that are past the end of AssFile::Line
|
// Discards values of selected that are past the end of AssFile::Line
|
||||||
#define CHOP_SELECTED(ass, sel) \
|
#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<v_t> and AVs
|
// Conversions between std::vector<v_t> and AVs
|
||||||
|
|
|
@ -108,7 +108,7 @@ void DialogAttachments::UpdateList() {
|
||||||
listView->InsertItem(row,attach->GetFileName(true));
|
listView->InsertItem(row,attach->GetFileName(true));
|
||||||
listView->SetItem(row,1,PrettySize(attach->GetData().size()));
|
listView->SetItem(row,1,PrettySize(attach->GetData().size()));
|
||||||
listView->SetItem(row,2,attach->group);
|
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("/");
|
if (listView->GetNextSelected(i) != -1) path = wxDirSelector(_("Select the path to save the files to:"),Options.AsText(_T("Fonts Collector Destination"))) + _T("/");
|
||||||
else {
|
else {
|
||||||
// Default path
|
// 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);
|
path = wxFileSelector(_("Select the path to save the file to:"),Options.AsText(_T("Fonts Collector Destination")),defPath);
|
||||||
fullPath = true;
|
fullPath = true;
|
||||||
}
|
}
|
||||||
|
@ -222,7 +222,7 @@ void DialogAttachments::OnExtract(wxCommandEvent &event) {
|
||||||
|
|
||||||
// Loop through items in list
|
// Loop through items in list
|
||||||
while (i != -1) {
|
while (i != -1) {
|
||||||
AssAttachment *attach = (AssAttachment*) listView->GetItemData(i);
|
AssAttachment *attach = (AssAttachment*) wxUIntToPtr(listView->GetItemData(i));
|
||||||
wxString filename = path;
|
wxString filename = path;
|
||||||
if (!fullPath) filename += attach->GetFileName();
|
if (!fullPath) filename += attach->GetFileName();
|
||||||
attach->Extract(filename);
|
attach->Extract(filename);
|
||||||
|
@ -238,7 +238,7 @@ void DialogAttachments::OnDelete(wxCommandEvent &event) {
|
||||||
// Loop through items in list
|
// Loop through items in list
|
||||||
int i = listView->GetFirstSelected();
|
int i = listView->GetFirstSelected();
|
||||||
while (i != -1) {
|
while (i != -1) {
|
||||||
AssFile::top->Line.remove((AssEntry*)listView->GetItemData(i));
|
AssFile::top->Line.remove((AssEntry*)wxUIntToPtr(listView->GetItemData(i)));
|
||||||
i = listView->GetNextSelected(i);
|
i = listView->GetNextSelected(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1011,7 +1011,7 @@ void DialogOptions::OnEditHotkey(wxCommandEvent &event) {
|
||||||
if (sel == wxNOT_FOUND) return;
|
if (sel == wxNOT_FOUND) return;
|
||||||
|
|
||||||
// Get key and store old
|
// Get key and store old
|
||||||
HotkeyType *curKey = (HotkeyType *) Shortcuts->GetItemData(sel);
|
HotkeyType *curKey = (HotkeyType *) wxUIntToPtr(Shortcuts->GetItemData(sel));
|
||||||
int oldKeycode = curKey->keycode;
|
int oldKeycode = curKey->keycode;
|
||||||
int oldFlags = curKey->flags;
|
int oldFlags = curKey->flags;
|
||||||
|
|
||||||
|
@ -1034,7 +1034,7 @@ void DialogOptions::OnClearHotkey(wxCommandEvent &event) {
|
||||||
item = Shortcuts->GetNextItem(item,wxLIST_NEXT_ALL,wxLIST_STATE_SELECTED);
|
item = Shortcuts->GetNextItem(item,wxLIST_NEXT_ALL,wxLIST_STATE_SELECTED);
|
||||||
if (item == -1) break;
|
if (item == -1) break;
|
||||||
|
|
||||||
HotkeyType *curKey = (HotkeyType *) Shortcuts->GetItemData(item);
|
HotkeyType *curKey = (HotkeyType *) wxUIntToPtr(Shortcuts->GetItemData(item));
|
||||||
if (curKey->keycode != 0 || curKey->flags != 0) {
|
if (curKey->keycode != 0 || curKey->flags != 0) {
|
||||||
hotkeysModified = true;
|
hotkeysModified = true;
|
||||||
curKey->keycode = 0;
|
curKey->keycode = 0;
|
||||||
|
@ -1057,7 +1057,7 @@ void DialogOptions::OnDefaultHotkey(wxCommandEvent &event) {
|
||||||
item = Shortcuts->GetNextItem(item,wxLIST_NEXT_ALL,wxLIST_STATE_SELECTED);
|
item = Shortcuts->GetNextItem(item,wxLIST_NEXT_ALL,wxLIST_STATE_SELECTED);
|
||||||
if (item == -1) break;
|
if (item == -1) break;
|
||||||
|
|
||||||
HotkeyType *curKey = (HotkeyType *) Shortcuts->GetItemData(item);
|
HotkeyType *curKey = (HotkeyType *) wxUIntToPtr(Shortcuts->GetItemData(item));
|
||||||
HotkeyType *origKey = &defs.key[curKey->origName.Lower()];
|
HotkeyType *origKey = &defs.key[curKey->origName.Lower()];
|
||||||
if (origKey->keycode != curKey->keycode || origKey->flags != curKey->flags) {
|
if (origKey->keycode != curKey->keycode || origKey->flags != curKey->flags) {
|
||||||
hotkeysModified = true;
|
hotkeysModified = true;
|
||||||
|
@ -1070,7 +1070,7 @@ void DialogOptions::OnDefaultHotkey(wxCommandEvent &event) {
|
||||||
if (dup) {
|
if (dup) {
|
||||||
dup->keycode = 0;
|
dup->keycode = 0;
|
||||||
dup->flags = 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());
|
if (item != -1) Shortcuts->SetItem(item,1,dup->GetText());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1169,7 +1169,7 @@ void CaptureKey::OnKeyDown(wxKeyEvent &event) {
|
||||||
}
|
}
|
||||||
dup->keycode = 0;
|
dup->keycode = 0;
|
||||||
dup->flags = 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());
|
if (item != -1) parent->shortcuts->SetItem(item,1,dup->GetText());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -50,6 +50,7 @@
|
||||||
UsePrecompiledHeader="2"
|
UsePrecompiledHeader="2"
|
||||||
PrecompiledHeaderThrough="stdwx.h"
|
PrecompiledHeaderThrough="stdwx.h"
|
||||||
WarningLevel="3"
|
WarningLevel="3"
|
||||||
|
WarnAsError="true"
|
||||||
Detect64BitPortabilityProblems="true"
|
Detect64BitPortabilityProblems="true"
|
||||||
DebugInformationFormat="4"
|
DebugInformationFormat="4"
|
||||||
DisableSpecificWarnings="4267"
|
DisableSpecificWarnings="4267"
|
||||||
|
@ -133,6 +134,7 @@
|
||||||
UsePrecompiledHeader="2"
|
UsePrecompiledHeader="2"
|
||||||
PrecompiledHeaderThrough="stdwx.h"
|
PrecompiledHeaderThrough="stdwx.h"
|
||||||
WarningLevel="3"
|
WarningLevel="3"
|
||||||
|
WarnAsError="true"
|
||||||
Detect64BitPortabilityProblems="true"
|
Detect64BitPortabilityProblems="true"
|
||||||
DebugInformationFormat="3"
|
DebugInformationFormat="3"
|
||||||
DisableSpecificWarnings="4267"
|
DisableSpecificWarnings="4267"
|
||||||
|
|
|
@ -74,7 +74,7 @@ PRBool nsCharSetProber::FilterWithoutEnglishLetters(const char* aBuf, PRUint32 a
|
||||||
if (meetMSB && curPtr > prevPtr)
|
if (meetMSB && curPtr > prevPtr)
|
||||||
while (prevPtr < curPtr) *newptr++ = *prevPtr++;
|
while (prevPtr < curPtr) *newptr++ = *prevPtr++;
|
||||||
|
|
||||||
newLen = newptr - *newBuf;
|
newLen = PRUint32(newptr - *newBuf);
|
||||||
|
|
||||||
return PR_TRUE;
|
return PR_TRUE;
|
||||||
}
|
}
|
||||||
|
@ -119,7 +119,7 @@ PRBool nsCharSetProber::FilterWithEnglishLetters(const char* aBuf, PRUint32 aLen
|
||||||
while (prevPtr < curPtr)
|
while (prevPtr < curPtr)
|
||||||
*newptr++ = *prevPtr++;
|
*newptr++ = *prevPtr++;
|
||||||
|
|
||||||
newLen = newptr - *newBuf;
|
newLen = PRUint32(newptr - *newBuf);
|
||||||
|
|
||||||
return PR_TRUE;
|
return PR_TRUE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue