[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xen-cvs
Subject:    [Xen-changelog] [xen master] xenalyze: fix misleading indentation.
From:       patchbot () xen ! org
Date:       2016-01-29 13:56:17
Message-ID: E1aP9X7-0002g9-4W () xenbits ! xen ! org
[Download RAW message or body]

commit ebdba150bff1d914805d60efa576337bbef0c305
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Jan 22 14:27:28 2016 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jan 26 16:24:39 2016 +0000

    xenalyze: fix misleading indentation.
    
    gcc-6 adds -Wmisleading-indentation which found these issues.
    
    xenalyze.c: In function 'weighted_percentile':
    xenalyze.c:2136:18: error: statement is indented as if it were guarded by... \
[-Werror=misleading-indentation]  L=I; L_weight = I_weight;
                      ^~~~~~~~
    
    xenalyze.c:2135:9: note: ...this 'if' clause, but it is not
             if(J_weight<K_weight)
             ^~
    
    xenalyze.c:2138:18: error: statement is indented as if it were guarded by... \
[-Werror=misleading-indentation]  R=J; R_weight = J_weight;
                      ^~~~~~~~
    
    xenalyze.c:2137:9: note: ...this 'if' clause, but it is not
             if(K_weight<I_weight)
             ^~
    
    xenalyze.c: In function 'self_weighted_percentile':
    xenalyze.c:2215:18: error: statement is indented as if it were guarded by... \
[-Werror=misleading-indentation]  L=I; L_weight = I_weight;
                      ^~~~~~~~
    
    xenalyze.c:2214:9: note: ...this 'if' clause, but it is not
             if(J_weight<K_weight)
             ^~
    
    xenalyze.c:2217:18: error: statement is indented as if it were guarded by... \
[-Werror=misleading-indentation]  R=J; R_weight = J_weight;
                      ^~~~~~~~
    
    xenalyze.c:2216:9: note: ...this 'if' clause, but it is not
             if(K_weight<I_weight)
             ^~
    
    I've modified according to what I think the intention is, i.e. added braces
    rather than moving the line in question out a level.
    
    I have only build tested the result.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
---
 tools/xentrace/xenalyze.c | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/tools/xentrace/xenalyze.c b/tools/xentrace/xenalyze.c
index 5a2735c..4bcaf83 100644
--- a/tools/xentrace/xenalyze.c
+++ b/tools/xentrace/xenalyze.c
@@ -2132,10 +2132,14 @@ float weighted_percentile(float * A, /* values */
         } while (I <= J); /* Keep going until our pointers meet or pass */
 
         /* Re-adjust L and R, based on which element we're looking for */
-        if(J_weight<K_weight)
-            L=I; L_weight = I_weight;
-        if(K_weight<I_weight)
-            R=J; R_weight = J_weight;
+        if(J_weight<K_weight) {
+            L=I;
+            L_weight = I_weight;
+        }
+        if(K_weight<I_weight) {
+            R=J;
+            R_weight = J_weight;
+        }
     }
 
     return A[L];
@@ -2211,10 +2215,14 @@ long long self_weighted_percentile(long long * A,
         } while (I <= J); /* Keep going until our pointers meet or pass */
 
         /* Re-adjust L and R, based on which element we're looking for */
-        if(J_weight<K_weight)
-            L=I; L_weight = I_weight;
-        if(K_weight<I_weight)
-            R=J; R_weight = J_weight;
+        if(J_weight<K_weight) {
+            L=I;
+            L_weight = I_weight;
+        }
+        if(K_weight<I_weight) {
+            R=J;
+            R_weight = J_weight;
+        }
     }
 
     return A[L];
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic