Michael Stefaniuc : wineconsole: Avoid TRUE:FALSE conditional expressions.

Alexandre Julliard julliard at winehq.org
Mon Aug 27 14:35:04 CDT 2012


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

Author: Michael Stefaniuc <mstefani at redhat.de>
Date:   Mon Aug 27 13:29:31 2012 +0200

wineconsole: Avoid TRUE:FALSE conditional expressions.

---

 programs/wineconsole/curses.c |    2 +-
 programs/wineconsole/dialog.c |    4 ++--
 programs/wineconsole/user.c   |    2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/programs/wineconsole/curses.c b/programs/wineconsole/curses.c
index 4c75a6f..735ec97 100644
--- a/programs/wineconsole/curses.c
+++ b/programs/wineconsole/curses.c
@@ -300,7 +300,7 @@ static void	WCCURSES_ShapeCursor(struct inner_data* data, int size, int vis, BOO
 {
     /* we can't do much about the size... */
     data->curcfg.cursor_size = size;
-    data->curcfg.cursor_visible = vis ? TRUE : FALSE;
+    data->curcfg.cursor_visible = vis != 0;
     WCCURSES_PosCursor(data);
 }
 
diff --git a/programs/wineconsole/dialog.c b/programs/wineconsole/dialog.c
index 831b2a9..d69432e 100644
--- a/programs/wineconsole/dialog.c
+++ b/programs/wineconsole/dialog.c
@@ -118,7 +118,7 @@ static INT_PTR WINAPI WCUSER_OptionDlgProc(HWND hDlg, UINT msg, WPARAM wParam, L
  	    val = GetDlgItemInt(hDlg, IDC_OPT_HIST_SIZE, &done, FALSE);
 	    if (done) di->config.history_size = val;
 
-            val = (IsDlgButtonChecked(hDlg, IDC_OPT_HIST_NODOUBLE) & BST_CHECKED) ? TRUE : FALSE;
+            val = (IsDlgButtonChecked(hDlg, IDC_OPT_HIST_NODOUBLE) & BST_CHECKED) != 0;
             di->config.history_nodup = val;
 
             val = 0;
@@ -126,7 +126,7 @@ static INT_PTR WINAPI WCUSER_OptionDlgProc(HWND hDlg, UINT msg, WPARAM wParam, L
             if (IsDlgButtonChecked(hDlg, IDC_OPT_CONF_SHIFT) & BST_CHECKED) val |= MK_SHIFT;
             di->config.menu_mask = val;
 
-            val = (IsDlgButtonChecked(hDlg, IDC_OPT_QUICK_EDIT) & BST_CHECKED) ? TRUE : FALSE;
+            val = (IsDlgButtonChecked(hDlg, IDC_OPT_QUICK_EDIT) & BST_CHECKED) != 0;
             di->config.quick_edit = val;
 
             SetWindowLongPtrW(hDlg, DWLP_MSGRESULT, PSNRET_NOERROR);
diff --git a/programs/wineconsole/user.c b/programs/wineconsole/user.c
index 8a07e3a..9b8ad15 100644
--- a/programs/wineconsole/user.c
+++ b/programs/wineconsole/user.c
@@ -191,7 +191,7 @@ static void	WCUSER_ShapeCursor(struct inner_data* data, int size, int vis, BOOL
 	data->curcfg.cursor_visible = -1;
     }
 
-    vis = (vis) ? TRUE : FALSE;
+    vis = vis != 0;
     if (force || vis != data->curcfg.cursor_visible)
     {
 	data->curcfg.cursor_visible = vis;




More information about the wine-cvs mailing list