Bug 1372554, Fix some -Wmisleading-indentation warnings in the nspr testsuite, r=kaie
authorSylvestre Ledru <sledru@mozilla.com>
Fri, 23 Jun 2017 17:28:45 +0200
changeset 4744 17303e0dde44
parent 4743 6b85368f8775
child 4745 6bbe01dd9325
push id262
push userkaie@kuix.de
push date2017-06-23 15:28 +0000
reviewerskaie
bugs1372554
Bug 1372554, Fix some -Wmisleading-indentation warnings in the nspr testsuite, r=kaie
pr/tests/accept.c
pr/tests/alarm.c
--- a/pr/tests/accept.c
+++ b/pr/tests/accept.c
@@ -138,22 +138,23 @@ ClientThread(void *_action)
                         "client: unable to connect to server (%ld, %ld, %ld, %ld)\n",
                         iterations, rv, PR_GetError(), PR_GetOSError());
                 goto ErrorExit;
             }
 
             if (action != CLIENT_TIMEOUT_SEND) {
                 if ((rv = PR_Send(sock, buf, CLIENT_DATA,
                     0, timeoutTime))< 0) {
-                    if (!debug_mode)
+                    if (!debug_mode) {
                         failed_already=1;
-                    else    
-                        PR_fprintf(output, 
+                    } else {
+                        PR_fprintf(output,
                             "client: unable to send to server (%d, %ld, %ld)\n",
                             CLIENT_DATA, rv, PR_GetError());
+                    }
                 	goto ErrorExit;
                 }
             } else {
                 PR_Sleep(PR_SecondsToInterval(TIMEOUTSECS + 1));
             }
         } else {
             PR_Sleep(PR_SecondsToInterval(TIMEOUTSECS + 1));
         }
@@ -195,18 +196,19 @@ int i;
     i = 0;
     while (PR_Bind(listenSock, &listenAddr) == PR_FAILURE) {
         if (PR_GetError() == PR_ADDRESS_IN_USE_ERROR) {
             listenAddr.inet.port += 2;
             if (i++ < SERVER_MAX_BIND_COUNT)
                 continue;
         }
         failed_already=1;
-        if (debug_mode)
+        if (debug_mode) {
         	PR_fprintf(output,"accept: ERROR - PR_Bind failed\n");
+        }
 		return;
     }
 
 
     rv = PR_Listen(listenSock, 100);
     if (rv == PR_FAILURE) {
         failed_already=1;
         if (debug_mode)
--- a/pr/tests/alarm.c
+++ b/pr/tests/alarm.c
@@ -406,25 +406,25 @@ static PRIntervalTime Alarms3(PRUint32 l
 }  /* Alarms3 */
 
 static PRUint32 TimeThis(
     const char *msg, PRUint32 (*func)(PRUint32 loops), PRUint32 loops)
 {
     PRUint32 overhead, usecs;
     PRIntervalTime predicted, timein, timeout, ticks;
 
- if (debug_mode)
-    printf("Testing %s ...", msg);
+    if (debug_mode)
+      printf("Testing %s ...", msg);
 
     timein = PR_IntervalNow();
     predicted = func(loops);
     timeout = PR_IntervalNow();
 
-  if (debug_mode)
-    printf(" done\n");
+    if (debug_mode)
+      printf(" done\n");
 
     ticks = timeout - timein;
     usecs = PR_IntervalToMicroseconds(ticks);
     overhead = PR_IntervalToMicroseconds(predicted);
 
     if(ticks < predicted)
     {
 		if (debug_mode) {
@@ -486,27 +486,27 @@ int prmain(int argc, char** argv)
 	if (debug_mode)
 		printf("Alarm: Using %d loops\n", loops);
 
 	if (debug_mode)		
         printf("Alarm: Using %d cpu(s)\n", cpus);
 
     for (cpu = 1; cpu <= cpus; ++cpu)
     {
-    if (debug_mode)
+      if (debug_mode)
         printf("\nAlarm: Using %d CPU(s)\n", cpu);
 
-	PR_SetConcurrency(cpu);
-        
-        /* some basic time test */
-        (void)TimeThis("ConditionNotify", ConditionNotify, loops);
-        (void)TimeThis("ConditionTimeout", ConditionTimeout, loops);
-        (void)TimeThis("Alarms1", Alarms1, loops);
-        (void)TimeThis("Alarms2", Alarms2, loops);
-        (void)TimeThis("Alarms3", Alarms3, loops);
+      PR_SetConcurrency(cpu);
+
+      /* some basic time test */
+      (void)TimeThis("ConditionNotify", ConditionNotify, loops);
+      (void)TimeThis("ConditionTimeout", ConditionTimeout, loops);
+      (void)TimeThis("Alarms1", Alarms1, loops);
+      (void)TimeThis("Alarms2", Alarms2, loops);
+      (void)TimeThis("Alarms3", Alarms3, loops);
     }
     return 0;
 }
 
 int main(int argc, char** argv)
 {
      PR_Initialize(prmain, argc, argv, 0);
      PR_STDIO_INIT();