notepad: Use BOOL type where appropriate

Frédéric Delanoy frederic.delanoy at gmail.com
Wed Oct 16 04:12:18 CDT 2013


---
 programs/notepad/dialog.c | 22 +++++++++++-----------
 programs/notepad/main.c   |  8 ++++----
 2 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/programs/notepad/dialog.c b/programs/notepad/dialog.c
index 1ea2ef9..d35fd8a 100644
--- a/programs/notepad/dialog.c
+++ b/programs/notepad/dialog.c
@@ -298,7 +298,7 @@ static SAVE_STATUS DoSaveFile(LPCWSTR szFileName, ENCODING enc)
     CloseHandle(hFile);
     HeapFree(GetProcessHeap(), 0, pBytes);
 
-    SendMessageW(Globals.hEdit, EM_SETMODIFY, FALSE, 0);
+    SendMessageW(Globals.hEdit, EM_SETMODIFY, 0, 0);
     return SAVED_OK;
 }
 
@@ -467,7 +467,7 @@ void DoOpenFile(LPCWSTR szFileName, ENCODING enc)
 
     HeapFree(GetProcessHeap(), 0, textW);
 
-    SendMessageW(Globals.hEdit, EM_SETMODIFY, FALSE, 0);
+    SendMessageW(Globals.hEdit, EM_SETMODIFY, 0, 0);
     SendMessageW(Globals.hEdit, EM_EMPTYUNDOBUFFER, 0, 0);
     SetFocus(Globals.hEdit);
     
@@ -476,9 +476,9 @@ void DoOpenFile(LPCWSTR szFileName, ENCODING enc)
     {
 	static const WCHAR lfW[] = { '\r','\n',0 };
         SendMessageW(Globals.hEdit, EM_SETSEL, GetWindowTextLengthW(Globals.hEdit), -1);
-        SendMessageW(Globals.hEdit, EM_REPLACESEL, TRUE, (LPARAM)lfW);
+        SendMessageW(Globals.hEdit, EM_REPLACESEL, 1, (LPARAM)lfW);
 	DIALOG_EditTimeDate();
-        SendMessageW(Globals.hEdit, EM_REPLACESEL, TRUE, (LPARAM)lfW);
+        SendMessageW(Globals.hEdit, EM_REPLACESEL, 1, (LPARAM)lfW);
     }
 
     SetFileNameAndEncoding(szFileName, enc);
@@ -1065,12 +1065,12 @@ VOID DIALOG_EditTimeDate(VOID)
     GetLocalTime(&st);
 
     GetTimeFormatW(LOCALE_USER_DEFAULT, TIME_NOSECONDS, &st, NULL, szDate, MAX_STRING_LEN);
-    SendMessageW(Globals.hEdit, EM_REPLACESEL, TRUE, (LPARAM)szDate);
+    SendMessageW(Globals.hEdit, EM_REPLACESEL, 1, (LPARAM)szDate);
 
-    SendMessageW(Globals.hEdit, EM_REPLACESEL, TRUE, (LPARAM)spaceW);
+    SendMessageW(Globals.hEdit, EM_REPLACESEL, 1, (LPARAM)spaceW);
 
     GetDateFormatW(LOCALE_USER_DEFAULT, 0, &st, NULL, szDate, MAX_STRING_LEN);
-    SendMessageW(Globals.hEdit, EM_REPLACESEL, TRUE, (LPARAM)szDate);
+    SendMessageW(Globals.hEdit, EM_REPLACESEL, 1, (LPARAM)szDate);
 }
 
 VOID DIALOG_EditWrap(VOID)
@@ -1098,7 +1098,7 @@ VOID DIALOG_EditWrap(VOID)
     Globals.hEdit = CreateWindowExW(WS_EX_CLIENTEDGE, editW, NULL, dwStyle,
                          0, 0, rc.right, rc.bottom, Globals.hMainWnd,
                          NULL, Globals.hInstance, NULL);
-    SendMessageW(Globals.hEdit, WM_SETFONT, (WPARAM)Globals.hFont, FALSE);
+    SendMessageW(Globals.hEdit, WM_SETFONT, (WPARAM)Globals.hFont, 0);
     SetWindowTextW(Globals.hEdit, pTemp);
     SendMessageW(Globals.hEdit, EM_SETMODIFY, modify, 0);
     SetFocus(Globals.hEdit);
@@ -1126,7 +1126,7 @@ VOID DIALOG_SelectFont(VOID)
 
         Globals.hFont=CreateFontIndirectW( &lf );
         Globals.lfFont=lf;
-        SendMessageW( Globals.hEdit, WM_SETFONT, (WPARAM)Globals.hFont, TRUE );
+        SendMessageW( Globals.hEdit, WM_SETFONT, (WPARAM)Globals.hFont, 1 );
         if( currfont!=NULL )
             DeleteObject( currfont );
     }
@@ -1254,7 +1254,7 @@ static INT_PTR WINAPI DIALOG_PAGESETUP_DlgProc(HWND hDlg, UINT msg, WPARAM wPara
           static const WCHAR sorryW[] = { 'S','o','r','r','y',',',' ','n','o',' ','h','e','l','p',' ','a','v','a','i','l','a','b','l','e',0 };
           static const WCHAR helpW[] = { 'H','e','l','p',0 };
           MessageBoxW(Globals.hMainWnd, sorryW, helpW, MB_ICONEXCLAMATION);
-          return TRUE;
+          return 1;
         }
 
 	default:
@@ -1273,5 +1273,5 @@ static INT_PTR WINAPI DIALOG_PAGESETUP_DlgProc(HWND hDlg, UINT msg, WPARAM wPara
        break;
     }
 
-  return FALSE;
+  return 0;
 }
diff --git a/programs/notepad/main.c b/programs/notepad/main.c
index 235981f..1307097 100644
--- a/programs/notepad/main.c
+++ b/programs/notepad/main.c
@@ -434,11 +434,11 @@ static void NOTEPAD_DoReplace(FINDREPLACEW *fr)
     {
         case FR_DOWN:
             if ( pos-pos_start == len && StrCmpNIW(fr->lpstrFindWhat, content+pos_start, len) == 0)
-                SendMessageW(Globals.hEdit, EM_REPLACESEL, TRUE, (LPARAM)fr->lpstrReplaceWith);
+                SendMessageW(Globals.hEdit, EM_REPLACESEL, 1, (LPARAM)fr->lpstrReplaceWith);
             break;
         case FR_DOWN|FR_MATCHCASE:
             if ( pos-pos_start == len && StrCmpNW(fr->lpstrFindWhat, content+pos_start, len) == 0)
-                SendMessageW(Globals.hEdit, EM_REPLACESEL, TRUE, (LPARAM)fr->lpstrReplaceWith);
+                SendMessageW(Globals.hEdit, EM_REPLACESEL, 1, (LPARAM)fr->lpstrReplaceWith);
             break;
         default:    /* shouldn't happen */
             return;
@@ -483,7 +483,7 @@ static void NOTEPAD_DoReplaceAll(FINDREPLACEW *fr)
             return;
         }
         SendMessageW(Globals.hEdit, EM_SETSEL, found - content, found - content + len);
-        SendMessageW(Globals.hEdit, EM_REPLACESEL, TRUE, (LPARAM)fr->lpstrReplaceWith);
+        SendMessageW(Globals.hEdit, EM_REPLACESEL, 1, (LPARAM)fr->lpstrReplaceWith);
     }
 }
 
@@ -535,7 +535,7 @@ static LRESULT WINAPI NOTEPAD_WndProc(HWND hWnd, UINT msg, WPARAM wParam,
                              NULL, Globals.hInstance, NULL);
 
         Globals.hFont = CreateFontIndirectW(&Globals.lfFont);
-        SendMessageW(Globals.hEdit, WM_SETFONT, (WPARAM)Globals.hFont, FALSE);
+        SendMessageW(Globals.hEdit, WM_SETFONT, (WPARAM)Globals.hFont, 0);
         SendMessageW(Globals.hEdit, EM_LIMITTEXT, 0, 0);
         break;
     }
-- 
1.8.4




More information about the wine-patches mailing list