=?UTF-8?Q?Fr=C3=A9d=C3=A9ric=20Delanoy=20?=: user32: Use BOOL type where appropriate.

Alexandre Julliard julliard at winehq.org
Fri Sep 27 11:33:13 CDT 2013


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

Author: Frédéric Delanoy <frederic.delanoy at gmail.com>
Date:   Fri Sep 27 08:43:21 2013 +0200

user32: Use BOOL type where appropriate.

---

 dlls/user32/text.c |   22 ++++++++++------------
 1 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/dlls/user32/text.c b/dlls/user32/text.c
index a32792e..12432b8 100644
--- a/dlls/user32/text.c
+++ b/dlls/user32/text.c
@@ -357,7 +357,7 @@ static void TEXT_WordBreak (HDC hdc, WCHAR *str, unsigned int max_str,
                             unsigned int *chars_used, SIZE *size)
 {
     WCHAR *p;
-    int word_fits;
+    BOOL word_fits;
     SCRIPT_LOGATTR *sla;
     SCRIPT_ANALYSIS sa;
     int i;
@@ -395,7 +395,7 @@ static void TEXT_WordBreak (HDC hdc, WCHAR *str, unsigned int max_str,
     /* If there was one or the first character didn't fit then */
     if (word_fits)
     {
-        int next_is_space;
+        BOOL next_is_space;
         /* break the line before/after that character */
         if (!(format & (DT_RIGHT | DT_CENTER)) || *p != SPACE)
             p++;
@@ -562,7 +562,7 @@ static int TEXT_Reprefix (const WCHAR *str, unsigned int ns,
  *  newline representation or nothing
  */
 
-static int remainder_is_none_or_newline (int num_chars, const WCHAR *str)
+static BOOL remainder_is_none_or_newline (int num_chars, const WCHAR *str)
 {
     if (!num_chars) return TRUE;
     if (*str != LF && *str != CR) return FALSE;
@@ -615,10 +615,8 @@ static const WCHAR *TEXT_NextLineW( HDC hdc, const WCHAR *str, int *count,
     int seg_i, seg_count, seg_j;
     int max_seg_width;
     int num_fit;
-    int word_broken;
-    int line_fits;
+    BOOL word_broken, line_fits, ellipsified;
     unsigned int j_in_seg;
-    int ellipsified;
     *pprefix_offset = -1;
 
     /* For each text segment in the line */
@@ -699,7 +697,7 @@ static const WCHAR *TEXT_NextLineW( HDC hdc, const WCHAR *str, int *count,
          * combined, and may differ between versions (to say nothing of the
          * several bugs in the Microsoft versions).
          */
-        word_broken = 0;
+        word_broken = FALSE;
         line_fits = (num_fit >= j_in_seg);
         if (!line_fits && (format & DT_WORDBREAK))
         {
@@ -712,19 +710,19 @@ static const WCHAR *TEXT_NextLineW( HDC hdc, const WCHAR *str, int *count,
             TEXT_SkipChars (count, &s, seg_count, str+seg_i, i-seg_i,
                             chars_used, !(format & DT_NOPREFIX));
             i = s - str;
-            word_broken = 1;
+            word_broken = TRUE;
         }
         pellip->before = j_in_seg;
         pellip->under = 0;
         pellip->after = 0;
         pellip->len = 0;
-        ellipsified = 0;
+        ellipsified = FALSE;
         if (!line_fits && (format & DT_PATH_ELLIPSIS))
         {
             TEXT_PathEllipsify (hdc, dest + seg_j, maxl-seg_j, &j_in_seg,
                                 max_seg_width, &size, *p_retstr, pellip);
             line_fits = (size.cx <= max_seg_width);
-            ellipsified = 1;
+            ellipsified = TRUE;
         }
         /* NB we may end up ellipsifying a word-broken or path_ellipsified
          * string */
@@ -885,7 +883,7 @@ INT WINAPI DrawTextExW( HDC hdc, LPWSTR str, INT i_count,
     int tabwidth /* to keep gcc happy */ = 0;
     int prefix_offset;
     ellipsis_data ellip;
-    int invert_y=0;
+    BOOL invert_y=FALSE;
 
     TRACE("%s, %d, [%s] %08x\n", debugstr_wn (str, count), count,
         wine_dbgstr_rect(rect), flags);
@@ -935,7 +933,7 @@ INT WINAPI DrawTextExW( HDC hdc, LPWSTR str, INT i_count,
         GetWindowExtEx(hdc, &window_ext);
         GetViewportExtEx(hdc, &viewport_ext);
         if ((window_ext.cy > 0) != (viewport_ext.cy > 0))
-            invert_y = 1;
+            invert_y = TRUE;
     }
 
     if (dtp)




More information about the wine-cvs mailing list