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:
Rodrigo Braz Monteiro 2008-01-20 22:38:07 +00:00
parent da09a52b59
commit 5cafaeb976
10 changed files with 32 additions and 15 deletions

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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<AssEntry*>::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));

View file

@ -41,6 +41,11 @@
#include "ass_file.h"
#ifdef __VISUALC__
#pragma warning(disable: 4800)
#endif
namespace Automation4 {

View file

@ -44,6 +44,9 @@
#include <wx/filename.h>
#include <wx/utils.h>
#ifdef __VISUALC__
#pragma warning(disable: 4800)
#endif
namespace Automation4 {

View file

@ -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<v_t> and AVs

View file

@ -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);
}

View file

@ -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());
}

View file

@ -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"

View file

@ -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;
}