[MPLAY32][MSPAINT][NOTEPAD][REGEDIT][WINHLP32]
authorAmine Khaldi <amine.khaldi@reactos.org>
Wed, 30 Apr 2014 18:41:39 +0000 (18:41 +0000)
committerAmine Khaldi <amine.khaldi@reactos.org>
Wed, 30 Apr 2014 18:41:39 +0000 (18:41 +0000)
* Fix some format string / argument mismatches. By Andre Guibert de Bruet.
CORE-7995

svn path=/trunk/; revision=63080

reactos/base/applications/mplay32/mplay32.c
reactos/base/applications/mspaint/registry.c
reactos/base/applications/mspaint/winproc.c
reactos/base/applications/notepad/dialog.c
reactos/base/applications/regedit/regproc.c
reactos/base/applications/winhlp32/hlpfile.c

index f4220f2..2dbec3c 100644 (file)
@@ -112,7 +112,7 @@ ShowMCIError(HWND hwnd, DWORD dwError)
         LoadString(hInstance, IDS_DEFAULTMCIERRMSG, szErrorMessage, sizeof(szErrorMessage) / sizeof(TCHAR));
     }
 
-    _stprintf(szTempMessage, _T("MMSYS%u: %s"), dwError, szErrorMessage);
+    _stprintf(szTempMessage, _T("MMSYS%lu: %s"), dwError, szErrorMessage);
     MessageBox(hwnd, szTempMessage, szAppTitle, MB_OK | MB_ICONEXCLAMATION);
 }
 
index 06bc840..fca10a0 100644 (file)
@@ -31,8 +31,8 @@ SetWallpaper(TCHAR * FileName, DWORD dwStyle, DWORD dwTile) //FIXME: Has to be c
         RegSetValueEx(hDesktop, _T("Wallpaper"), 0, REG_SZ, (LPBYTE) FileName,
                       _tcslen(FileName) * sizeof(TCHAR));
 
-        _stprintf(szStyle, _T("%i"), dwStyle);
-        _stprintf(szTile, _T("%i"), dwTile);
+        _stprintf(szStyle, _T("%lu"), dwStyle);
+        _stprintf(szTile, _T("%lu"), dwTile);
 
         RegSetValueEx(hDesktop, _T("WallpaperStyle"), 0, REG_SZ, (LPBYTE) szStyle,
                       _tcslen(szStyle) * sizeof(TCHAR));
index 2826df0..76af666 100644 (file)
@@ -595,7 +595,7 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
                     if (!drawing)
                     {
                         TCHAR coordStr[100];
-                        _stprintf(coordStr, _T("%d, %d"), xNow, yNow);
+                        _stprintf(coordStr, _T("%ld, %ld"), xNow, yNow);
                         SendMessage(hStatusBar, SB_SETTEXT, 1, (LPARAM) coordStr);
                     }
                 }
@@ -634,7 +634,7 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
                         case TOOL_SHAPE:
                         {
                             TCHAR coordStr[100];
-                            _stprintf(coordStr, _T("%d, %d"), xNow, yNow);
+                            _stprintf(coordStr, _T("%ld, %ld"), xNow, yNow);
                             SendMessage(hStatusBar, SB_SETTEXT, 1, (LPARAM) coordStr);
                             break;
                         }
@@ -648,7 +648,7 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
                             TCHAR sizeStr[100];
                             if ((activeTool >= TOOL_LINE) && (GetAsyncKeyState(VK_SHIFT) < 0))
                                 yRel = xRel;
-                            _stprintf(sizeStr, _T("%d x %d"), xRel, yRel);
+                            _stprintf(sizeStr, _T("%ld x %ld"), xRel, yRel);
                             SendMessage(hStatusBar, SB_SETTEXT, 2, (LPARAM) sizeStr);
                         }
                     }
@@ -661,7 +661,7 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
                             TCHAR sizeStr[100];
                             if ((activeTool >= TOOL_LINE) && (GetAsyncKeyState(VK_SHIFT) < 0))
                                 yRel = xRel;
-                            _stprintf(sizeStr, _T("%d x %d"), xRel, yRel);
+                            _stprintf(sizeStr, _T("%ld x %ld"), xRel, yRel);
                             SendMessage(hStatusBar, SB_SETTEXT, 2, (LPARAM) sizeStr);
                         }
                     }
index 2f1e094..2aea43a 100644 (file)
@@ -965,7 +965,7 @@ static INT_PTR CALLBACK DIALOG_GoTo_DialogProc(HWND hwndDialog, UINT uMsg, WPARA
     switch(uMsg) {
     case WM_INITDIALOG:
         hTextBox = GetDlgItem(hwndDialog, ID_LINENUMBER);
-        _sntprintf(szText, SIZEOF(szText), _T("%d"), lParam);
+        _sntprintf(szText, SIZEOF(szText), _T("%ld"), lParam);
         SetWindowText(hTextBox, szText);
         break;
     case WM_COMMAND:
index 138c2bf..8d09bb3 100644 (file)
@@ -893,7 +893,7 @@ static void REGPROC_print_error(void)
     status = FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
                             NULL, error_code, 0, (LPSTR) &lpMsgBuf, 0, NULL);
     if (!status) {
-        fprintf(stderr,"%S: Cannot display message for error %ld, status %ld\n",
+        fprintf(stderr,"%S: Cannot display message for error %lu, status %lu\n",
                 getAppName(), error_code, GetLastError());
         exit(1);
     }
index 096904f..50710c0 100644 (file)
@@ -1049,7 +1049,7 @@ static BOOL     HLPFILE_RtfAddMetaFile(struct RtfData* rd, HLPFILE* file, const
     ptr = beg + 2; /* for type and pack */
 
     mm = fetch_ushort(&ptr); /* mapping mode */
-    sprintf(tmp, "{\\pict\\wmetafile%d\\picw%d\\pich%d",
+    sprintf(tmp, "{\\pict\\wmetafile%u\\picw%u\\pich%u",
             mm, GET_USHORT(ptr, 0), GET_USHORT(ptr, 2));
     if (!HLPFILE_RtfAddControl(rd, tmp)) return FALSE;
     ptr += 4;
@@ -1465,11 +1465,10 @@ static BOOL HLPFILE_BrowseParagraph(HLPFILE_PAGE* page, struct RtfData* rd,
                     }
                     /* FIXME: missing at least colors, also bold attribute looses information */
 
-                    sprintf(tmp, "\\f%d\\cf%d\\fs%d%s%s%s%s",
+                    sprintf(tmp, "\\f%u\\cf%u\\fs%u%s%s%s%s",
                             font, font + 2, fs,
                             page->file->fonts[font].LogFont.lfWeight > 400 ? "\\b" : "\\b0",
-                            page->file->fonts[font].LogFont.lfItalic ? "\\i" : "\\i0",
-                            page->file->fonts[font].LogFont.lfUnderline ? "\\ul" : "\\ul0",
+                            page->file->fonts[font].LogFont.lfItalic ? "\\i" : "\\i0",                            page->file->fonts[font].LogFont.lfUnderline ? "\\ul" : "\\ul0",
                             page->file->fonts[font].LogFont.lfStrikeOut ? "\\strike" : "\\strike0");
                     if (!HLPFILE_RtfAddControl(rd, tmp)) goto done;
                 }