Author: akhaldi
Date: Wed Apr 30 18:41:39 2014
New Revision: 63080
URL:
http://svn.reactos.org/svn/reactos?rev=63080&view=rev
Log:
[MPLAY32][MSPAINT][NOTEPAD][REGEDIT][WINHLP32]
* Fix some format string / argument mismatches. By Andre Guibert de Bruet.
CORE-7995
Modified:
trunk/reactos/base/applications/mplay32/mplay32.c
trunk/reactos/base/applications/mspaint/registry.c
trunk/reactos/base/applications/mspaint/winproc.c
trunk/reactos/base/applications/notepad/dialog.c
trunk/reactos/base/applications/regedit/regproc.c
trunk/reactos/base/applications/winhlp32/hlpfile.c
Modified: trunk/reactos/base/applications/mplay32/mplay32.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
==============================================================================
--- trunk/reactos/base/applications/mplay32/mplay32.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mplay32/mplay32.c [iso-8859-1] Wed Apr 30 18:41:39
2014
@@ -112,7 +112,7 @@
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);
}
Modified: trunk/reactos/base/applications/mspaint/registry.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mspaint/…
==============================================================================
--- trunk/reactos/base/applications/mspaint/registry.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mspaint/registry.c [iso-8859-1] Wed Apr 30 18:41:39
2014
@@ -31,8 +31,8 @@
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));
Modified: trunk/reactos/base/applications/mspaint/winproc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mspaint/…
==============================================================================
--- trunk/reactos/base/applications/mspaint/winproc.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mspaint/winproc.c [iso-8859-1] Wed Apr 30 18:41:39
2014
@@ -595,7 +595,7 @@
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 @@
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 @@
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 @@
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);
}
}
Modified: trunk/reactos/base/applications/notepad/dialog.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/notepad/…
==============================================================================
--- trunk/reactos/base/applications/notepad/dialog.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/notepad/dialog.c [iso-8859-1] Wed Apr 30 18:41:39
2014
@@ -965,7 +965,7 @@
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:
Modified: trunk/reactos/base/applications/regedit/regproc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/regedit/…
==============================================================================
--- trunk/reactos/base/applications/regedit/regproc.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/regedit/regproc.c [iso-8859-1] Wed Apr 30 18:41:39
2014
@@ -893,7 +893,7 @@
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);
}
Modified: trunk/reactos/base/applications/winhlp32/hlpfile.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/winhlp32…
==============================================================================
--- trunk/reactos/base/applications/winhlp32/hlpfile.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/winhlp32/hlpfile.c [iso-8859-1] Wed Apr 30 18:41:39
2014
@@ -1049,7 +1049,7 @@
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 @@
}
/* 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;
}