fixed some warnings

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@5059 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2007-04-11 21:42:46 +00:00
parent 4cf73d2316
commit a96f348c0a
3 changed files with 14 additions and 15 deletions

View file

@ -307,11 +307,11 @@ BOOL CALLBACK DialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) {
return TRUE; return TRUE;
} }
else { else {
int this_compressor; int this_compressor=0;
int last_compressor; int last_compressor;
int i; int i;
HANDLE hPrev, hThis; HANDLE hPrev, hThis;
DWORD prevSize, thisSize; DWORD prevSize=0, thisSize=0;
for(i=(int)COMPRESSOR_SCRIPT+2; i<(int)COMPRESSOR_BEST; i++) { for(i=(int)COMPRESSOR_SCRIPT+2; i<(int)COMPRESSOR_BEST; i++) {
@ -1057,7 +1057,7 @@ BOOL CALLBACK SettingsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{ {
int n = SendDlgItemMessage(hwndDlg, IDC_SYMBOLS, LB_GETSELCOUNT, 0, 0); int n = SendDlgItemMessage(hwndDlg, IDC_SYMBOLS, LB_GETSELCOUNT, 0, 0);
int *items = (int *)GlobalAlloc(GPTR, n*sizeof(int)); int *items = (int *)GlobalAlloc(GPTR, n*sizeof(int));
int rv = SendDlgItemMessage(hwndDlg, IDC_SYMBOLS, LB_GETSELITEMS, (WPARAM)n, (LPARAM)items); SendDlgItemMessage(hwndDlg, IDC_SYMBOLS, LB_GETSELITEMS, (WPARAM)n, (LPARAM)items);
int i; int i;
for(i=n-1;i>=0;i--) { for(i=n-1;i>=0;i--) {
SendDlgItemMessage(hwndDlg, IDC_SYMBOLS, LB_DELETESTRING, (WPARAM)items[i], 0); SendDlgItemMessage(hwndDlg, IDC_SYMBOLS, LB_DELETESTRING, (WPARAM)items[i], 0);

View file

@ -435,7 +435,7 @@ char** LoadSymbolSet(char *name)
DWORD t; DWORD t;
DWORD bufSize; DWORD bufSize;
DWORD i = 0; DWORD i = 0;
HGLOBAL hMem; HGLOBAL hMem = NULL;
while(TRUE) { while(TRUE) {
l = 0; l = 0;
@ -582,7 +582,6 @@ int InitBranding() {
} }
char szBuf[1024]; char szBuf[1024];
DWORD dwRead = 1; DWORD dwRead = 1;
DWORD dwExit = !STILL_ACTIVE;
if (WaitForSingleObject(pi.hProcess,10000)!=WAIT_OBJECT_0) { if (WaitForSingleObject(pi.hProcess,10000)!=WAIT_OBJECT_0) {
return 0; return 0;
} }

View file

@ -168,7 +168,7 @@ void SaveVersionHeader (GrowBuf &strm, WORD wLength, WORD wValueLength, WORD wTy
strm.add (&wValueLength, sizeof (wValueLength)); strm.add (&wValueLength, sizeof (wValueLength));
strm.add (&wType, sizeof (wType)); strm.add (&wType, sizeof (wType));
keyLen = (winchar_strlen(key) + 1) * sizeof (WCHAR); keyLen = WORD((winchar_strlen(key) + 1) * sizeof (WCHAR));
strm.add ((void*)key, keyLen); strm.add ((void*)key, keyLen);
PadStream(strm); PadStream(strm);
@ -177,7 +177,7 @@ void SaveVersionHeader (GrowBuf &strm, WORD wLength, WORD wValueLength, WORD wTy
{ {
valueLen = wValueLength; valueLen = wValueLength;
if ( wType == 1 ) if ( wType == 1 )
valueLen = valueLen * sizeof (WCHAR); valueLen = valueLen * WORD(sizeof (WCHAR));
strm.add (value, valueLen); strm.add (value, valueLen);
} }
} }
@ -213,15 +213,15 @@ void CResourceVersionInfo::ExportToStream(GrowBuf &strm, int Index)
p = stringInfoStream.getlen(); p = stringInfoStream.getlen();
KeyName = winchar_fromansi(pChildStrings->getname(i), codepage); KeyName = winchar_fromansi(pChildStrings->getname(i), codepage);
KeyValue = winchar_fromansi(pChildStrings->getvalue(i), codepage); KeyValue = winchar_fromansi(pChildStrings->getvalue(i), codepage);
SaveVersionHeader (stringInfoStream, 0, winchar_strlen(KeyValue) + 1, 1, KeyName, (void*)KeyValue); SaveVersionHeader (stringInfoStream, 0, WORD(winchar_strlen(KeyValue) + 1), 1, KeyName, (void*)KeyValue);
delete [] KeyName; delete [] KeyName;
delete [] KeyValue; delete [] KeyValue;
wSize = stringInfoStream.getlen() - p; wSize = WORD(stringInfoStream.getlen() - p);
*(WORD*)((PBYTE)stringInfoStream.get()+p)=wSize; *(WORD*)((PBYTE)stringInfoStream.get()+p)=wSize;
} }
wSize = stringInfoStream.getlen(); wSize = WORD(stringInfoStream.getlen());
*(WORD*)((PBYTE)stringInfoStream.get())=wSize; *(WORD*)((PBYTE)stringInfoStream.get())=wSize;
PadStream (strm); PadStream (strm);
@ -230,7 +230,7 @@ void CResourceVersionInfo::ExportToStream(GrowBuf &strm, int Index)
SaveVersionHeader (strm, 0, 0, 0, KeyName, &ZEROS); SaveVersionHeader (strm, 0, 0, 0, KeyName, &ZEROS);
delete [] KeyName; delete [] KeyName;
strm.add (stringInfoStream.get(), stringInfoStream.getlen()); strm.add (stringInfoStream.get(), stringInfoStream.getlen());
wSize = strm.getlen() - p; wSize = WORD(strm.getlen() - p);
*(WORD*)((PBYTE)strm.get()+p)=wSize; *(WORD*)((PBYTE)strm.get()+p)=wSize;
} }
@ -263,17 +263,17 @@ void CResourceVersionInfo::ExportToStream(GrowBuf &strm, int Index)
} }
} }
wSize = strm.getlen() - p1; wSize = WORD(strm.getlen() - p1);
*(WORD*)((PBYTE)strm.get()+p1)=wSize; *(WORD*)((PBYTE)strm.get()+p1)=wSize;
wSize = sizeof (int) * m_ChildStringLists.getnum(); wSize = WORD(sizeof (int) * m_ChildStringLists.getnum());
p1+=sizeof(WORD); p1+=sizeof(WORD);
*(WORD*)((PBYTE)strm.get()+p1)=wSize; *(WORD*)((PBYTE)strm.get()+p1)=wSize;
wSize = strm.getlen() - p; wSize = WORD(strm.getlen() - p);
*(WORD*)((PBYTE)strm.get()+p)=wSize; *(WORD*)((PBYTE)strm.get()+p)=wSize;
} }
wSize = strm.getlen(); wSize = WORD(strm.getlen());
*(WORD*)((PBYTE)strm.get())=wSize; *(WORD*)((PBYTE)strm.get())=wSize;
} }