]> cygwin.com Git - cygwin-apps/setup.git/commitdiff
Fix logical expressions checking if buttons are checked
authorCorinna Vinschen <corinna@vinschen.de>
Thu, 7 Jan 2016 21:28:03 +0000 (22:28 +0100)
committerCorinna Vinschen <corinna@vinschen.de>
Thu, 7 Jan 2016 21:28:03 +0000 (22:28 +0100)
* AntiVirus.cc (AntiVirusPage::OnActivate): Fix logical expressions
checking if a button is checked.
* net.cc (NetPage::OnInit): Ditto.
* source.cc (SourcePage::OnActivate): Ditto.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
AntiVirus.cc
net.cc
source.cc

index 7dd01c414136c7c44b87039af0525b64905acc09..876eb02756450f6c016ce8cbd1fb0f2123cb7d37 100644 (file)
@@ -85,15 +85,11 @@ AntiVirusPage::OnActivate ()
 {
   load_dialog (GetHWND ());
   // Check to see if any radio buttons are selected. If not, select a default.
-  if ((!SendMessage
-       (GetDlgItem (IDC_DISABLE_AV), BM_GETCHECK, 0,
-       0) == BST_CHECKED)
-      && (!SendMessage (GetDlgItem (IDC_LEAVE_AV), BM_GETCHECK, 0, 0)
-         == BST_CHECKED))
-    {
-      SendMessage (GetDlgItem (IDC_LEAVE_AV), BM_SETCHECK,
-                  BST_CHECKED, 0);
-    }
+  if (SendMessage (GetDlgItem (IDC_DISABLE_AV), BM_GETCHECK, 0, 0)
+      != BST_CHECKED
+      && SendMessage (GetDlgItem (IDC_LEAVE_AV), BM_GETCHECK, 0, 0)
+        != BST_CHECKED)
+    SendMessage (GetDlgItem (IDC_LEAVE_AV), BM_SETCHECK, BST_CHECKED, 0);
 }
 
 bool
diff --git a/net.cc b/net.cc
index 1402c67f495a9b81e40f48202fcd6433bde72cdf..aa734da938842aaebf36712685e5a556a7ce3958 100644 (file)
--- a/net.cc
+++ b/net.cc
@@ -135,13 +135,10 @@ NetPage::OnInit ()
   CheckIfEnableNext();
 
   // Check to see if any radio buttons are selected. If not, select a default.
-  if ((!SendMessage (GetDlgItem (IDC_NET_IE5), BM_GETCHECK, 0, 0) ==
-       BST_CHECKED)
-      && (!SendMessage (GetDlgItem (IDC_NET_PROXY), BM_GETCHECK, 0, 0)
-         == BST_CHECKED))
-    {
-      SendMessage (GetDlgItem (IDC_NET_DIRECT), BM_CLICK, 0, 0);
-    }
+  if (SendMessage (GetDlgItem (IDC_NET_IE5), BM_GETCHECK, 0, 0) != BST_CHECKED
+      && SendMessage (GetDlgItem (IDC_NET_PROXY), BM_GETCHECK, 0, 0)
+        != BST_CHECKED)
+    SendMessage (GetDlgItem (IDC_NET_DIRECT), BM_CLICK, 0, 0);
 }
 
 long
index 70751d206cc9c059fbe47eb39d3b40182c7d024b..90c98b5c3ba59e59b7bfb8c20937dde598a25473 100644 (file)
--- a/source.cc
+++ b/source.cc
@@ -103,15 +103,12 @@ SourcePage::OnActivate ()
 
   load_dialog (GetHWND ());
   // Check to see if any radio buttons are selected. If not, select a default.
-  if ((!SendMessage
-       (GetDlgItem (IDC_SOURCE_DOWNLOAD), BM_GETCHECK, 0,
-       0) == BST_CHECKED)
-      && (!SendMessage (GetDlgItem (IDC_SOURCE_LOCALDIR), BM_GETCHECK, 0, 0)
-         == BST_CHECKED))
-    {
-      SendMessage (GetDlgItem (IDC_SOURCE_NETINST), BM_SETCHECK,
-                  BST_CHECKED, 0);
-    }
+  if (SendMessage (GetDlgItem (IDC_SOURCE_DOWNLOAD), BM_GETCHECK, 0, 0)
+      != BST_CHECKED
+      && SendMessage (GetDlgItem (IDC_SOURCE_LOCALDIR), BM_GETCHECK, 0, 0)
+        != BST_CHECKED)
+    SendMessage (GetDlgItem (IDC_SOURCE_NETINST), BM_SETCHECK,
+                BST_CHECKED, 0);
 }
 
 long
This page took 0.034988 seconds and 5 git commands to generate.