DXGL r944 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r943‎ | r944 | r945 >
Date:14:44, 28 August 2019
Author:admin
Status:new
Tags:
Comment:
Fix several compilation warnings.
Modified paths:
  • /buildtool/buildtool.c (modified) (history)
  • /cfgmgr/cfgmgr.c (modified) (history)
  • /dxglcfg/dxglcfg.cpp (modified) (history)

Diff [purge]

Index: buildtool/buildtool.c
@@ -481,13 +481,13 @@
482482 puts("Skipping file signature.");
483483 return 0;
484484 }
485 - strcpy(&signpath, &signtoolsha1path);
486 - strcat(&signpath, "\"");
487 - strncat(&signpath, exefile, MAX_PATH);
488 - strcat(&signpath, "\"");
 485+ strcpy(signpath, signtoolsha1path);
 486+ strcat(signpath, "\"");
 487+ strncat(signpath, exefile, MAX_PATH);
 488+ strcat(signpath, "\"");
489489 ZeroMemory(&startinfo, sizeof(STARTUPINFOA));
490490 startinfo.cb = sizeof(STARTUPINFOA);
491 - if (CreateProcessA(NULL, &signpath, NULL, NULL, FALSE, 0, NULL, NULL, &startinfo, &process))
 491+ if (CreateProcessA(NULL, signpath, NULL, NULL, FALSE, 0, NULL, NULL, &startinfo, &process))
492492 {
493493 WaitForSingleObject(process.hProcess, INFINITE);
494494 CloseHandle(process.hProcess);
Index: cfgmgr/cfgmgr.c
@@ -160,7 +160,7 @@
161161 {
162162 _tcscat(buffer, _T(" "));
163163 _tcscat(buffer, flag);
164 - error2 = RegSetValueEx(hKey, filename, 0, REG_SZ, (BYTE*)buffer, (_tcslen(buffer) + 1)*sizeof(TCHAR));
 164+ error2 = RegSetValueEx(hKey, filename, 0, REG_SZ, (BYTE*)buffer, (DWORD)(_tcslen(buffer) + 1)*sizeof(TCHAR));
165165 if (error2 == ERROR_SUCCESS) ShowRestartDialog();
166166 else
167167 {
@@ -171,7 +171,7 @@
172172 }
173173 else if (error2 == ERROR_FILE_NOT_FOUND)
174174 {
175 - error2 = RegSetValueEx(hKey, filename, 0, REG_SZ, (BYTE*)flag, (_tcslen(flag) + 1)*sizeof(TCHAR));
 175+ error2 = RegSetValueEx(hKey, filename, 0, REG_SZ, (BYTE*)flag, (DWORD)(_tcslen(flag) + 1)*sizeof(TCHAR));
176176 if (error2 == ERROR_SUCCESS) ShowRestartDialog();
177177 else
178178 {
@@ -225,7 +225,7 @@
226226 else error = RegOpenKeyEx(HKEY_LOCAL_MACHINE, writekey, 0, KEY_WRITE, &hKeyWrite);
227227 if (error == ERROR_SUCCESS)
228228 {
229 - error = RegSetValueEx(hKeyWrite, filename, 0, REG_SZ, (BYTE*)buffer, (_tcslen(bufferpos + _tcslen(flag)))*sizeof(TCHAR)+sizeof(TCHAR));
 229+ error = RegSetValueEx(hKeyWrite, filename, 0, REG_SZ, (BYTE*)buffer, (DWORD)(_tcslen(bufferpos + _tcslen(flag)))*sizeof(TCHAR)+sizeof(TCHAR));
230230 RegCloseKey(hKeyWrite);
231231 hKeyWrite = NULL;
232232 }
@@ -292,7 +292,7 @@
293293 error = RegOpenKeyEx(HKEY_CURRENT_USER, writekey, 0, KEY_WRITE, &hKeyWrite);
294294 if (error == ERROR_SUCCESS)
295295 {
296 - error = RegSetValueEx(hKeyWrite, filename, 0, REG_SZ, (BYTE*)buffer, (_tcslen(bufferpos + _tcslen(flag)))*sizeof(TCHAR)+sizeof(TCHAR));
 296+ error = RegSetValueEx(hKeyWrite, filename, 0, REG_SZ, (BYTE*)buffer, (DWORD)(_tcslen(bufferpos + _tcslen(flag)))*sizeof(TCHAR)+sizeof(TCHAR));
297297 RegCloseKey(hKeyWrite);
298298 hKeyWrite = NULL;
299299 }
@@ -352,8 +352,8 @@
353353
354354 void GetDirFromPath(LPTSTR path)
355355 {
356 - int i;
357 - int len = _tcslen(path);
 356+ size_t i;
 357+ size_t len = _tcslen(path);
358358 for(i = len; i > 0; i--)
359359 {
360360 if((path[i] == '\\') || (path[i] == '/'))
@@ -710,7 +710,7 @@
711711 error = RegQueryValueEx(hKey,_T("InstallPath"),NULL,&regsz,NULL,&sizeout);
712712 if(error == ERROR_FILE_NOT_FOUND)
713713 RegSetValueEx(hKey, _T("InstallPath"), 0, REG_SZ,
714 - (LPBYTE)path, _tcslen(path) * sizeof(TCHAR));
 714+ (LPBYTE)path, (DWORD)(_tcslen(path) * sizeof(TCHAR)));
715715 }
716716 if (global && !cfg->Windows8Detected)
717717 {
@@ -759,7 +759,7 @@
760760 }
761761 void WritePath(HKEY hKey, const TCHAR *path, const TCHAR *mask, LPCTSTR name)
762762 {
763 - if(mask[0]) RegSetValueEx(hKey,name,0,REG_SZ,(BYTE*)path,(_tcslen(path)+1)*sizeof(TCHAR));
 763+ if(mask[0]) RegSetValueEx(hKey,name,0,REG_SZ,(BYTE*)path,(DWORD)(_tcslen(path)+1)*sizeof(TCHAR));
764764 else RegDeleteValue(hKey,name);
765765 }
766766
@@ -889,7 +889,7 @@
890890 _tcscpy(regkey, regkeybase);
891891 _tcscat(regkey, _T("Profiles\\"));
892892 _tcscpy(filename, path);
893 - for (i = _tcslen(filename); (i > 0) && (filename[i] != 92) && (filename[i] != 47); i--);
 893+ for (i = (int)_tcslen(filename); (i > 0) && (filename[i] != 92) && (filename[i] != 47); i--);
894894 i++;
895895 _tcscat(regkey, &filename[i]);
896896 _tcscat(regkey, _T("-"));
@@ -897,7 +897,7 @@
898898 filename[i] = 0;
899899 _tcslwr(filename);
900900 Sha256Initialise(&sha_context);
901 - Sha256Update(&sha_context, filename, _tcslen(filename));
 901+ Sha256Update(&sha_context, filename, (uint32_t)_tcslen(filename));
902902 Sha256Finalise(&sha_context, &sha256);
903903 for (i = 0; i < (256 / 8); i++)
904904 {
@@ -928,11 +928,11 @@
929929 TCHAR filename[MAX_PATH + 1];
930930 _tcsncpy(pathlwr, path, MAX_PATH);
931931 pathlwr[MAX_PATH] = 0;
932 - for (i = _tcslen(pathlwr); (i > 0) && (pathlwr[i] != 92) && (pathlwr[i] != 47); i--);
 932+ for (i = (int)_tcslen(pathlwr); (i > 0) && (pathlwr[i] != 92) && (pathlwr[i] != 47); i--);
933933 pathlwr[i] = 0;
934934 _tcslwr(pathlwr);
935935 Sha256Initialise(&sha_context);
936 - Sha256Update(&sha_context, pathlwr, _tcslen(pathlwr));
 936+ Sha256Update(&sha_context, pathlwr, (uint32_t)_tcslen(pathlwr));
937937 Sha256Finalise(&sha_context, &sha256);
938938 for (i = 0; i < (256 / 8); i++)
939939 {
@@ -943,7 +943,7 @@
944944 _tcscpy(regkey,regkeybase);
945945 _tcsncpy(filename,path,MAX_PATH);
946946 filename[MAX_PATH] = 0;
947 - for(i = _tcslen(filename); (i > 0) && (filename[i] != 92) && (filename[i] != 47); i--);
 947+ for(i = (int)_tcslen(filename); (i > 0) && (filename[i] != 92) && (filename[i] != 47); i--);
948948 i++;
949949 _tcscat(regkey, _T("Profiles\\"));
950950 _tcscat(regkey,&filename[i]);
@@ -1200,8 +1200,8 @@
12011201 void SetINISection(HANDLE file, int section)
12021202 {
12031203 char buffer[32];
1204 - int buffersize;
1205 - int outsize;
 1204+ DWORD buffersize;
 1205+ DWORD outsize;
12061206 if (section != ini_currentsection)
12071207 {
12081208 ini_currentsection = section;
@@ -1234,7 +1234,7 @@
12351235 default:
12361236 return;
12371237 }
1238 - buffersize = strlen(buffer);
 1238+ buffersize = (DWORD)strlen(buffer);
12391239 WriteFile(file, buffer, buffersize, &outsize, NULL);
12401240 }
12411241 }
@@ -1242,8 +1242,8 @@
12431243 void INIWriteBool(HANDLE file, const char *name, BOOL value, BOOL mask, int section)
12441244 {
12451245 char buffer[256];
1246 - int buffersize;
1247 - int outsize;
 1246+ DWORD buffersize;
 1247+ DWORD outsize;
12481248 if (mask)
12491249 {
12501250 SetINISection(file, section);
@@ -1252,7 +1252,7 @@
12531253 if (value) strcat(buffer, "true");
12541254 else strcat(buffer, "false");
12551255 strcat(buffer, "\r\n");
1256 - buffersize = strlen(buffer);
 1256+ buffersize = (DWORD)strlen(buffer);
12571257 WriteFile(file, buffer, buffersize, &outsize, NULL);
12581258 }
12591259 }
@@ -1261,8 +1261,8 @@
12621262 {
12631263 char buffer[256];
12641264 char number[32];
1265 - int buffersize;
1266 - int outsize;
 1265+ DWORD buffersize;
 1266+ DWORD outsize;
12671267 if (mask)
12681268 {
12691269 SetINISection(file, section);
@@ -1271,7 +1271,7 @@
12721272 _itoa(value, number, 10);
12731273 strcat(buffer, number);
12741274 strcat(buffer, "\r\n");
1275 - buffersize = strlen(buffer);
 1275+ buffersize = (DWORD)strlen(buffer);
12761276 WriteFile(file, buffer, buffersize, &outsize, NULL);
12771277 }
12781278 }
@@ -1280,8 +1280,8 @@
12811281 {
12821282 char buffer[256];
12831283 char number[32];
1284 - int buffersize;
1285 - int outsize;
 1284+ DWORD buffersize;
 1285+ DWORD outsize;
12861286 if (mask)
12871287 {
12881288 SetINISection(file, section);
@@ -1290,7 +1290,7 @@
12911291 _itoa(value, number, 16);
12921292 strcat(buffer, number);
12931293 strcat(buffer, "\r\n");
1294 - buffersize = strlen(buffer);
 1294+ buffersize = (DWORD)strlen(buffer);
12951295 WriteFile(file, buffer, buffersize, &outsize, NULL);
12961296 }
12971297 }
@@ -1300,8 +1300,8 @@
13011301 char buffer[256];
13021302 char number[32];
13031303 char floatformat[16];
1304 - int buffersize;
1305 - int outsize;
 1304+ DWORD buffersize;
 1305+ DWORD outsize;
13061306 if (mask)
13071307 {
13081308 SetINISection(file, section);
@@ -1315,7 +1315,7 @@
13161316 number[31] = 0;
13171317 strcat(buffer, number);
13181318 strcat(buffer, "\r\n");
1319 - buffersize = strlen(buffer);
 1319+ buffersize = (DWORD)strlen(buffer);
13201320 WriteFile(file, buffer, buffersize, &outsize, NULL);
13211321 }
13221322 }
@@ -1391,8 +1391,8 @@
13921392 {
13931393 char buffer[256];
13941394 char number[32];
1395 - int buffersize;
1396 - int outsize;
 1395+ DWORD buffersize;
 1396+ DWORD outsize;
13971397 if (mask)
13981398 {
13991399 SetINISection(file, section);
@@ -1401,7 +1401,7 @@
14021402 FloatToAspectString(value,number);
14031403 strcat(buffer, number);
14041404 strcat(buffer, "\r\n");
1405 - buffersize = strlen(buffer);
 1405+ buffersize = (DWORD)strlen(buffer);
14061406 WriteFile(file, buffer, buffersize, &outsize, NULL);
14071407 }
14081408 }
@@ -1409,8 +1409,8 @@
14101410 void INIWriteString(HANDLE file, const char *name, const char *value, DWORD mask, int section)
14111411 {
14121412 char buffer[512];
1413 - int buffersize;
1414 - int outsize;
 1413+ DWORD buffersize;
 1414+ DWORD outsize;
14151415 if (mask)
14161416 {
14171417 SetINISection(file, section);
@@ -1418,7 +1418,7 @@
14191419 strcat(buffer, "=");
14201420 strcat(buffer, value);
14211421 strcat(buffer, "\r\n");
1422 - buffersize = strlen(buffer);
 1422+ buffersize = (DWORD)strlen(buffer);
14231423 WriteFile(file, buffer, buffersize, &outsize, NULL);
14241424 }
14251425 }
@@ -1429,8 +1429,8 @@
14301430 #ifdef _UNICODE
14311431 char unicodebuffer[MAX_PATH + 1];
14321432 #endif
1433 - int buffersize;
1434 - int outsize;
 1433+ DWORD buffersize;
 1434+ DWORD outsize;
14351435 if (mask)
14361436 {
14371437 SetINISection(file, section);
@@ -1443,7 +1443,7 @@
14441444 strcat(buffer, value);
14451445 #endif
14461446 strcat(buffer, "\r\n");
1447 - buffersize = strlen(buffer);
 1447+ buffersize = (DWORD)strlen(buffer);
14481448 WriteFile(file, buffer, buffersize, &outsize, NULL);
14491449 }
14501450 }
@@ -1478,7 +1478,7 @@
14791479 }
14801480 ini_currentsection = INISECTION_NULL;
14811481 strcpy(buffer, "; DXGL Configuration file\r\n; This file was generated by DXGL Config.\r\n");
1482 - WriteFile(file, buffer, strlen(buffer), &bytesread, NULL);
 1482+ WriteFile(file, buffer, (DWORD)strlen(buffer), &bytesread, NULL);
14831483 // [system]
14841484 if (cfg->NoWriteRegistry) INIWriteBool(file, "NoWriteRegistry", TRUE, TRUE, INISECTION_SYSTEM);
14851485 if (cfg->OverrideDefaults) INIWriteBool(file, "OverrideDefaults", TRUE, TRUE, INISECTION_SYSTEM);
@@ -1508,7 +1508,7 @@
15091509 sha256string[(i * 2) + 1] = hexdigit(sha256.bytes[i] & 0xF);
15101510 }
15111511 strcpy(buffer, "; Do not change the following value!\r\n");
1512 - WriteFile(file, buffer, strlen(buffer), &bytesread, NULL);
 1512+ WriteFile(file, buffer, (DWORD)strlen(buffer), &bytesread, NULL);
15131513 INIWriteString(file, "BundledDDrawSHA256", sha256string, 1, INISECTION_SYSTEM);
15141514 }
15151515 else MessageBox(hWnd, _T("Cannot read ddraw.dll, skipping SHA-256 checksum"),
@@ -1603,7 +1603,7 @@
16041604 TCHAR sha256string[65];
16051605 TCHAR filename[MAX_PATH+1];
16061606 TCHAR regkey[MAX_PATH + 80];
1607 - int i;
 1607+ size_t i;
16081608 BOOL DPIAwarePM = FALSE;
16091609 HMODULE hSHCore = NULL;
16101610 HMODULE hUser32 = NULL;
@@ -1621,7 +1621,7 @@
16221622 filename[i] = 0;
16231623 _tcslwr(filename);
16241624 Sha256Initialise(&sha_context);
1625 - Sha256Update(&sha_context, filename, _tcslen(filename));
 1625+ Sha256Update(&sha_context, filename, (uint32_t)_tcslen(filename));
16261626 Sha256Finalise(&sha_context, &sha256);
16271627 for (i = 0; i < (256 / 8); i++)
16281628 {
@@ -1873,7 +1873,7 @@
18741874 {
18751875 _tcslwr(installpath);
18761876 Sha256Initialise(&sha_context);
1877 - Sha256Update(&sha_context, installpath, _tcslen(installpath));
 1877+ Sha256Update(&sha_context, installpath, (uint32_t)_tcslen(installpath));
18781878 Sha256Finalise(&sha_context, &sha256);
18791879 for (i = 0; i < (256 / 8); i++)
18801880 {
@@ -2150,7 +2150,7 @@
21512151 }
21522152 else oldkeys[oldconfigcount].exe_found = TRUE;
21532153 Sha256Initialise(&sha_context);
2154 - Sha256Update(&sha_context, oldkeys[oldconfigcount].InstallPathLowercase, length);
 2154+ Sha256Update(&sha_context, oldkeys[oldconfigcount].InstallPathLowercase, (uint32_t)length);
21552155 Sha256Finalise(&sha_context, &oldkeys[oldconfigcount].PathHash);
21562156 for (i = 0; i < (256 / 8); i++)
21572157 {
@@ -2229,7 +2229,7 @@
22302230 numvalue++;
22312231 } while (error == ERROR_SUCCESS);
22322232 RegSetValueEx(hKeyDest, _T("InstallPath"), 0, REG_SZ, (BYTE*)oldkeys[i].InstallPath,
2233 - ((_tcslen(oldkeys[i].InstallPath) + 1) * sizeof(TCHAR)));
 2233+ (DWORD)((_tcslen(oldkeys[i].InstallPath) + 1) * sizeof(TCHAR)));
22342234 RegCloseKey(hKeyDest);
22352235 }
22362236 RegCloseKey(hKeyProfile);
Index: dxglcfg/dxglcfg.cpp
@@ -632,7 +632,7 @@
633633 *minor = 0;
634634 if (tristate)
635635 {
636 - position = SendDlgItemMessage(hWnd, DlgItem, CB_FINDSTRING, -1, (LPARAM)strdefault);
 636+ position = (int)SendDlgItemMessage(hWnd, DlgItem, CB_FINDSTRING, -1, (LPARAM)strdefault);
637637 *majormask = 0;
638638 *minormask = 0;
639639 }
@@ -762,7 +762,7 @@
763763
764764 BOOL GetCheck(HWND hWnd, int DlgItem, BOOL *mask)
765765 {
766 - int check = SendDlgItemMessage(hWnd,DlgItem,BM_GETCHECK,0,0);
 766+ int check = (int)SendDlgItemMessage(hWnd,DlgItem,BM_GETCHECK,0,0);
767767 switch(check)
768768 {
769769 case BST_CHECKED:
@@ -780,7 +780,7 @@
781781
782782 DWORD GetCombo(HWND hWnd, int DlgItem, DWORD *mask)
783783 {
784 - int value = SendDlgItemMessage(hWnd,DlgItem,CB_GETCURSEL,0,0);
 784+ int value = (int)SendDlgItemMessage(hWnd,DlgItem,CB_GETCURSEL,0,0);
785785 if(value == SendDlgItemMessage(hWnd,DlgItem,CB_FINDSTRING,-1,(LPARAM)strdefault))
786786 {
787787 *mask = 0;
@@ -795,7 +795,7 @@
796796
797797 void GetGLCombo(HWND hWnd, int DlgItem, DWORD *major, DWORD *minor, DWORD *majormask, DWORD *minormask)
798798 {
799 - int value = SendDlgItemMessage(hWnd, DlgItem, CB_GETCURSEL, 0, 0);
 799+ int value = (int)SendDlgItemMessage(hWnd, DlgItem, CB_GETCURSEL, 0, 0);
800800 if (value == SendDlgItemMessage(hWnd, DlgItem, CB_FINDSTRING, -1, (LPARAM)strdefault))
801801 {
802802 *majormask = 0;
@@ -946,10 +946,10 @@
947947 void ProcessResolutionString(LPTSTR input)
948948 {
949949 TCHAR buffer[32];
950 - int ptr;
 950+ size_t ptr;
951951 int number[3];
952 - int length;
953 - int i;
 952+ size_t length;
 953+ size_t i;
954954 BOOL found = FALSE;
955955 BOOL skip = FALSE;
956956 length = _tcslen(input);
@@ -1172,7 +1172,7 @@
11731173 {
11741174 GetDlgItemText(hWnd,DlgItem,str,MAX_PATH+1);
11751175 if(str[0] == 0) mask[0] = 0;
1176 - else mask[0] = 0xff;
 1176+ else mask[0] = (TCHAR)0xff;
11771177 }
11781178
11791179 void DrawCheck(HDC hdc, BOOL selected, BOOL checked, BOOL grayed, BOOL tristate, RECT *r)
@@ -1480,7 +1480,7 @@
14811481 if(!cfgmask->AddColorDepths) _tcscpy(combotext, strdefault);
14821482 else _tcscpy(combotext, colormodes[cfg->AddColorDepths & 31]);
14831483 }
1484 - DrawText(drawitem->hDC, combotext, _tcslen(combotext), &drawitem->rcItem,
 1484+ DrawText(drawitem->hDC, combotext, (int)_tcslen(combotext), &drawitem->rcItem,
14851485 DT_LEFT | DT_SINGLELINE | DT_VCENTER);
14861486 SetTextColor(drawitem->hDC, OldTextColor);
14871487 SetBkColor(drawitem->hDC, OldBackColor);
@@ -1560,7 +1560,7 @@
15611561 }
15621562 }
15631563 }
1564 - DrawText(drawitem->hDC, combotext, _tcslen(combotext), &drawitem->rcItem,
 1564+ DrawText(drawitem->hDC, combotext, (int)_tcslen(combotext), &drawitem->rcItem,
15651565 DT_LEFT | DT_SINGLELINE | DT_VCENTER);
15661566 SetTextColor(drawitem->hDC, OldTextColor);
15671567 SetBkColor(drawitem->hDC, OldBackColor);
@@ -1588,7 +1588,7 @@
15891589 {
15901590 if (ColorDepth_Dropdown)
15911591 {
1592 - cursel = SendDlgItemMessage(hWnd, IDC_COLORDEPTH, CB_GETCURSEL, 0, 0);
 1592+ cursel = (DWORD)SendDlgItemMessage(hWnd, IDC_COLORDEPTH, CB_GETCURSEL, 0, 0);
15931593 if (cursel == 5)
15941594 {
15951595 if (cfgmask->AddColorDepths) cfgmask->AddColorDepths = 0;
@@ -1620,7 +1620,7 @@
16211621 {
16221622 if (ExtraModes_Dropdown)
16231623 {
1624 - cursel = SendDlgItemMessage(hWnd, IDC_EXTRAMODES, CB_GETCURSEL, 0, 0);
 1624+ cursel = (DWORD)SendDlgItemMessage(hWnd, IDC_EXTRAMODES, CB_GETCURSEL, 0, 0);
16251625 if (cursel == 8)
16261626 {
16271627 if (cfgmask->AddModes) cfgmask->AddModes = 0;
@@ -2028,7 +2028,8 @@
20292029 else if (error != ERROR_SUCCESS)
20302030 {
20312031 _tcscpy(errormsg, _T("Error writing .ini file:\r\n"));
2032 - FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, error, 0, errormsg + _tcslen(errormsg), 2048 - _tcslen(errormsg), NULL);
 2032+ FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, error, 0, errormsg + _tcslen(errormsg),
 2033+ (DWORD)(2048 - _tcslen(errormsg)), NULL);
20332034 MessageBox(hWnd, errormsg, _T("Error"), MB_OK | MB_ICONERROR);
20342035 }
20352036 else
@@ -2329,7 +2330,7 @@
23302331 case IDC_DEBUGLIST:
23312332 if ((HIWORD(wParam) == LBN_SELCHANGE) || (HIWORD(wParam) == LBN_DBLCLK))
23322333 {
2333 - item = SendDlgItemMessage(hWnd, IDC_DEBUGLIST, LB_GETCURSEL, 0, 0);
 2334+ item = (DWORD)SendDlgItemMessage(hWnd, IDC_DEBUGLIST, LB_GETCURSEL, 0, 0);
23342335 ReadDebugItem(item, &debugvalue, &debugmask);
23352336 if (tristate)
23362337 {
@@ -2396,7 +2397,7 @@
23972398 DrawCheck(drawitem->hDC, drawitem->itemState & ODS_SELECTED, debugvalue, FALSE, !debugmask, &r);
23982399 drawitem->rcItem.left += GetSystemMetrics(SM_CXSMICON)+5;
23992400 SendDlgItemMessage(hWnd, IDC_DEBUGLIST, LB_GETTEXT, drawitem->itemID, (LPARAM)str);
2400 - DrawText(drawitem->hDC, str, _tcslen(str), &drawitem->rcItem,
 2401+ DrawText(drawitem->hDC, str, (int)_tcslen(str), &drawitem->rcItem,
24012402 DT_LEFT | DT_SINGLELINE | DT_VCENTER);
24022403 drawitem->rcItem.left -= GetSystemMetrics(SM_CXSMICON)+5;
24032404 if (drawitem->itemState & ODS_FOCUS) DrawFocusRect(drawitem->hDC, &drawitem->rcItem);
@@ -2570,7 +2571,7 @@
25712572 default:
25722573 str = strUnknown;
25732574 }
2574 - DrawText(hdc, str, _tcslen(str), r, DT_LEFT | DT_SINGLELINE | DT_VCENTER);
 2575+ DrawText(hdc, str, (int)_tcslen(str), r, DT_LEFT | DT_SINGLELINE | DT_VCENTER);
25752576 }
25762577
25772578 LRESULT CALLBACK HacksTabCallback(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
@@ -2688,7 +2689,7 @@
26892690 case IDC_HACKSLIST:
26902691 if ((HIWORD(wParam) == LBN_SELCHANGE) || (HIWORD(wParam) == LBN_DBLCLK))
26912692 {
2692 - hackstabitem = SendDlgItemMessage(hWnd, IDC_HACKSLIST, LB_GETCURSEL, 0, 0);
 2693+ hackstabitem = (DWORD)SendDlgItemMessage(hWnd, IDC_HACKSLIST, LB_GETCURSEL, 0, 0);
26932694 SendDlgItemMessage(hWnd, IDC_HACKSLIST, LB_GETITEMRECT, hackstabitem, (LPARAM)&r2);
26942695 if ((hackstabitem == 3) || (hackstabitem == 6))
26952696 {
@@ -2740,7 +2741,7 @@
27412742 r.right = r.left + GetSystemMetrics(SM_CXMENUCHECK);
27422743 drawitem->rcItem.left += 1;
27432744 SendDlgItemMessage(hWnd, IDC_HACKSLIST, LB_GETTEXT, drawitem->itemID, (LPARAM)str);
2744 - DrawText(drawitem->hDC, str, _tcslen(str), &drawitem->rcItem,
 2745+ DrawText(drawitem->hDC, str, (int)_tcslen(str), &drawitem->rcItem,
27452746 DT_LEFT | DT_SINGLELINE | DT_VCENTER);
27462747 drawitem->rcItem.left -= 1;
27472748 if ((hackstabitem == 3) || (hackstabitem == 6))
@@ -3896,7 +3897,7 @@
38973898 break;
38983899 }
38993900 // Get exe attributes
3900 - error = SHGetFileInfo(path, 0, &fileinfo, sizeof(SHFILEINFO), SHGFI_ICON | SHGFI_SMALLICON | SHGFI_ADDOVERLAYS);
 3901+ error = (LONG)SHGetFileInfo(path, 0, &fileinfo, sizeof(SHFILEINFO), SHGFI_ICON | SHGFI_SMALLICON | SHGFI_ADDOVERLAYS);
39013902 apps[appcount - 1].icon = fileinfo.hIcon;
39023903 apps[appcount - 1].icon_shared = FALSE;
39033904 verinfosize = GetFileVersionInfoSize(path, NULL);
@@ -3994,7 +3995,7 @@
39953996 nm = (LPNMHDR)lParam;
39963997 if (nm->code == TCN_SELCHANGE)
39973998 {
3998 - newtab = SendDlgItemMessage(hWnd, IDC_TABS, TCM_GETCURSEL, 0, 0);
 3999+ newtab = (int)SendDlgItemMessage(hWnd, IDC_TABS, TCM_GETCURSEL, 0, 0);
39994000 if (newtab != tabopen)
40004001 {
40014002 ShowWindow(hTabs[tabopen], SW_HIDE);
@@ -4027,7 +4028,7 @@
40284029 apps[drawitem->itemID].icon,GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),0,NULL,DI_NORMAL);
40294030 drawitem->rcItem.left += GetSystemMetrics(SM_CXSMICON)+5;
40304031 DrawText(drawitem->hDC,apps[drawitem->itemID].name,
4031 - _tcslen(apps[drawitem->itemID].name),&drawitem->rcItem,
 4032+ (int)_tcslen(apps[drawitem->itemID].name),&drawitem->rcItem,
40324033 DT_LEFT|DT_SINGLELINE|DT_VCENTER);
40334034 drawitem->rcItem.left -= GetSystemMetrics(SM_CXSMICON)+5;
40344035 if (drawitem->itemState & ODS_FOCUS) DrawFocusRect(drawitem->hDC, &drawitem->rcItem);
@@ -4067,7 +4068,7 @@
40684069 case IDC_APPS:
40694070 if(HIWORD(wParam) == CBN_SELCHANGE)
40704071 {
4071 - cursel = SendDlgItemMessage(hWnd,IDC_APPS,CB_GETCURSEL,0,0);
 4072+ cursel = (DWORD)SendDlgItemMessage(hWnd,IDC_APPS,CB_GETCURSEL,0,0);
40724073 if(cursel == current_app) break;
40734074 current_app = cursel;
40744075 cfg = &apps[current_app].cfg;
@@ -4145,7 +4146,7 @@
41464147 else
41474148 {
41484149 // Get exe attributes
4149 - error = SHGetFileInfo(path, 0, &fileinfo, sizeof(SHFILEINFO), SHGFI_ICON | SHGFI_SMALLICON | SHGFI_ADDOVERLAYS);
 4150+ error = (LONG)SHGetFileInfo(path, 0, &fileinfo, sizeof(SHFILEINFO), SHGFI_ICON | SHGFI_SMALLICON | SHGFI_ADDOVERLAYS);
41504151 apps[appcount - 1].icon = fileinfo.hIcon;
41514152 apps[appcount - 1].icon_shared = FALSE;
41524153 verinfosize = GetFileVersionInfoSize(path, NULL);