Use {}, not semicolon, when the statement of an "if" does nothing
authorSimon McVittie <simon.mcvittie@collabora.co.uk>
Fri, 5 Aug 2011 12:40:44 +0000 (13:40 +0100)
committerSimon McVittie <simon.mcvittie@collabora.co.uk>
Mon, 19 Sep 2011 12:50:38 +0000 (13:50 +0100)
The uses in bus/activation.c are also probably wrong because they ignore
the result of the test, but that's orthogonal.
(<https://bugs.freedesktop.org/show_bug.cgi?id=39858>)

bus/activation.c
dbus/dbus-spawn.c

index 6101173..dea6243 100644 (file)
@@ -2535,14 +2535,18 @@ bus_activation_service_reload_test (const DBusString *test_data_dir)
     _dbus_assert_not_reached ("could not initiate service reload test");
 
   if (!do_service_reload_test (&directory, FALSE))
-    ; /* Do nothing? */
+    {
+      /* Do nothing? */
+    }
 
   /* Do OOM tests */
   if (!init_service_reload_test (&directory))
     _dbus_assert_not_reached ("could not initiate service reload test");
 
   if (!do_service_reload_test (&directory, TRUE))
-    ; /* Do nothing? */
+    {
+      /* Do nothing? */
+    }
 
   /* Cleanup test directory */
   if (!cleanup_service_reload_test (&directory))
index a4652a3..9f6be26 100644 (file)
@@ -1103,7 +1103,9 @@ babysit (pid_t grandchild_pid,
         {
           char b;
           if (read (sigchld_pipe[READ_END], &b, 1) == -1)
-            /* ignore */;
+            {
+              /* ignore */
+            }
           /* do waitpid check */
           check_babysit_events (grandchild_pid, parent_pipe, 0);
         }