Andrey Turkin : wordpad: Fix some compile-time warnings.

Alexandre Julliard julliard at winehq.org
Fri Oct 10 08:06:43 CDT 2008


Module: wine
Branch: master
Commit: fbfb165d567d205a6f4f72aa2caf007940eb43af
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=fbfb165d567d205a6f4f72aa2caf007940eb43af

Author: Andrey Turkin <andrey.turkin at gmail.com>
Date:   Thu Oct  9 22:34:27 2008 +0400

wordpad: Fix some compile-time warnings.

---

 programs/wordpad/print.c    |    6 +++---
 programs/wordpad/registry.c |    8 ++++----
 programs/wordpad/wordpad.c  |   12 ++++++------
 3 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/programs/wordpad/print.c b/programs/wordpad/print.c
index 933c8b8..d3c13e6 100644
--- a/programs/wordpad/print.c
+++ b/programs/wordpad/print.c
@@ -135,7 +135,7 @@ static LONG twips_to_centmm(int twips)
     return MulDiv(twips, 1000, TWIPS_PER_CM);
 }
 
-LONG centmm_to_twips(int mm)
+static LONG centmm_to_twips(int mm)
 {
     return MulDiv(mm, TWIPS_PER_CM, 1000);
 }
@@ -620,7 +620,7 @@ LRESULT CALLBACK ruler_proc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
     return 0;
 }
 
-void draw_preview_page(HDC hdc, HDC* hdcSized, FORMATRANGE* lpFr, float ratio, int bmNewWidth, int bmNewHeight, int bmWidth, int bmHeight)
+static void draw_preview_page(HDC hdc, HDC* hdcSized, FORMATRANGE* lpFr, float ratio, int bmNewWidth, int bmNewHeight, int bmWidth, int bmHeight)
 {
     HBITMAP hBitmapScaled = CreateCompatibleBitmap(hdc, bmNewWidth, bmNewHeight);
     HPEN hPen;
@@ -800,7 +800,7 @@ LRESULT print_preview(HWND hMainWnd)
     return 0;
 }
 
-void update_preview(HWND hWnd)
+static void update_preview(HWND hWnd)
 {
     RECT rc;
 
diff --git a/programs/wordpad/registry.c b/programs/wordpad/registry.c
index 7bf7c49..28508de 100644
--- a/programs/wordpad/registry.c
+++ b/programs/wordpad/registry.c
@@ -81,7 +81,7 @@ void registry_set_options(HWND hMainWnd)
     HKEY hKey;
     DWORD action;
 
-    if(registry_get_handle(&hKey, &action, (LPWSTR)key_options) == ERROR_SUCCESS)
+    if(registry_get_handle(&hKey, &action, key_options) == ERROR_SUCCESS)
     {
         WINDOWPLACEMENT wp;
         DWORD isMaximized;
@@ -104,7 +104,7 @@ void registry_read_winrect(RECT* rc)
     HKEY hKey;
     DWORD size = sizeof(RECT);
 
-    if(registry_get_handle(&hKey, 0, (LPWSTR)key_options) != ERROR_SUCCESS ||
+    if(registry_get_handle(&hKey, 0, key_options) != ERROR_SUCCESS ||
        RegQueryValueExW(hKey, var_framerect, 0, NULL, (LPBYTE)rc, &size) !=
        ERROR_SUCCESS || size != sizeof(RECT))
     {
@@ -122,7 +122,7 @@ void registry_read_maximized(DWORD *bMaximized)
     HKEY hKey;
     DWORD size = sizeof(DWORD);
 
-    if(registry_get_handle(&hKey, 0, (LPWSTR)key_options) != ERROR_SUCCESS ||
+    if(registry_get_handle(&hKey, 0, key_options) != ERROR_SUCCESS ||
        RegQueryValueExW(hKey, var_maximized, 0, NULL, (LPBYTE)bMaximized, &size) !=
        ERROR_SUCCESS || size != sizeof(DWORD))
     {
@@ -314,7 +314,7 @@ void registry_set_filelist(LPCWSTR newFile, HWND hMainWnd)
             for(i = 0; pFiles[i] && i < FILELIST_ENTRIES; i++)
             {
                 wsprintfW(buffer, var_file, i+1);
-                RegSetValueExW(hKey, (LPWSTR)&buffer, 0, REG_SZ, (LPBYTE)pFiles[i],
+                RegSetValueExW(hKey, (LPWSTR)&buffer, 0, REG_SZ, (const BYTE*)pFiles[i],
                                (lstrlenW(pFiles[i])+1)*sizeof(WCHAR));
             }
         }
diff --git a/programs/wordpad/wordpad.c b/programs/wordpad/wordpad.c
index 0cc0454..7c92fcf 100644
--- a/programs/wordpad/wordpad.c
+++ b/programs/wordpad/wordpad.c
@@ -317,7 +317,7 @@ static void populate_size_list(HWND hSizeListWnd)
     HDC hdc = GetDC(hMainWnd);
     static const unsigned choices[] = {8,9,10,11,12,14,16,18,20,22,24,26,28,36,48,72};
     WCHAR buffer[3];
-    int i;
+    size_t i;
     DWORD fontStyle;
 
     ZeroMemory(&fmt, sizeof(fmt));
@@ -440,7 +440,7 @@ static void set_font(LPCWSTR wszFaceName)
 
     populate_size_list(hSizeListWnd);
 
-    SendMessageW(hFontListEditWnd, WM_SETTEXT, 0, (LPARAM)(LPWSTR)wszFaceName);
+    SendMessageW(hFontListEditWnd, WM_SETTEXT, 0, (LPARAM)wszFaceName);
 }
 
 static void set_default_font(void)
@@ -478,7 +478,7 @@ static void on_fontlist_modified(LPWSTR wszNewFaceName)
         set_font((LPCWSTR) wszNewFaceName);
 }
 
-static void add_font(LPCWSTR fontName, DWORD fontType, HWND hListWnd, NEWTEXTMETRICEXW *ntmc)
+static void add_font(LPCWSTR fontName, DWORD fontType, HWND hListWnd, const NEWTEXTMETRICEXW *ntmc)
 {
     COMBOBOXEXITEMW cbItem;
     WCHAR buffer[MAX_PATH];
@@ -557,7 +557,7 @@ static void dialog_choose_font(void)
 }
 
 
-int CALLBACK enum_font_proc(const LOGFONTW *lpelfe, const TEXTMETRICW *lpntme,
+static int CALLBACK enum_font_proc(const LOGFONTW *lpelfe, const TEXTMETRICW *lpntme,
                             DWORD FontType, LPARAM lParam)
 {
     HWND hListWnd = (HWND) lParam;
@@ -565,7 +565,7 @@ int CALLBACK enum_font_proc(const LOGFONTW *lpelfe, const TEXTMETRICW *lpntme,
     if(SendMessageW(hListWnd, CB_FINDSTRINGEXACT, -1, (LPARAM)lpelfe->lfFaceName) == CB_ERR)
     {
 
-        add_font((LPWSTR)lpelfe->lfFaceName, FontType, hListWnd, (NEWTEXTMETRICEXW*)lpntme);
+        add_font(lpelfe->lfFaceName, FontType, hListWnd, (const NEWTEXTMETRICEXW*)lpntme);
     }
 
     return 1;
@@ -1061,7 +1061,7 @@ static void dialog_viewproperties(void)
 {
     PROPSHEETPAGEW psp[2];
     PROPSHEETHEADERW psh;
-    int i;
+    size_t i;
     HINSTANCE hInstance = (HINSTANCE)GetWindowLongPtr(hMainWnd, GWLP_HINSTANCE);
     LPCPROPSHEETPAGEW ppsp = (LPCPROPSHEETPAGEW)&psp;
 




More information about the wine-cvs mailing list