]> git.pld-linux.org Git - packages/xen.git/blame - fix-misleading-indentation.patch
- rebuild with ocaml 4.04.1
[packages/xen.git] / fix-misleading-indentation.patch
CommitLineData
3e18837d
JR
1From ebdba150bff1d914805d60efa576337bbef0c305 Mon Sep 17 00:00:00 2001
2From: Ian Campbell <ian.campbell@citrix.com>
3Date: Fri, 22 Jan 2016 14:27:28 +0000
4Subject: [PATCH] xenalyze: fix misleading indentation.
5
6gcc-6 adds -Wmisleading-indentation which found these issues.
7
8xenalyze.c: In function 'weighted_percentile':
9xenalyze.c:2136:18: error: statement is indented as if it were guarded by... [-Werror=misleading-indentation]
10 L=I; L_weight = I_weight;
11 ^~~~~~~~
12
13xenalyze.c:2135:9: note: ...this 'if' clause, but it is not
14 if(J_weight<K_weight)
15 ^~
16
17xenalyze.c:2138:18: error: statement is indented as if it were guarded by... [-Werror=misleading-indentation]
18 R=J; R_weight = J_weight;
19 ^~~~~~~~
20
21xenalyze.c:2137:9: note: ...this 'if' clause, but it is not
22 if(K_weight<I_weight)
23 ^~
24
25xenalyze.c: In function 'self_weighted_percentile':
26xenalyze.c:2215:18: error: statement is indented as if it were guarded by... [-Werror=misleading-indentation]
27 L=I; L_weight = I_weight;
28 ^~~~~~~~
29
30xenalyze.c:2214:9: note: ...this 'if' clause, but it is not
31 if(J_weight<K_weight)
32 ^~
33
34xenalyze.c:2217:18: error: statement is indented as if it were guarded by... [-Werror=misleading-indentation]
35 R=J; R_weight = J_weight;
36 ^~~~~~~~
37
38xenalyze.c:2216:9: note: ...this 'if' clause, but it is not
39 if(K_weight<I_weight)
40 ^~
41
42I've modified according to what I think the intention is, i.e. added braces
43rather than moving the line in question out a level.
44
45I have only build tested the result.
46
47Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
48Reviewed-by: George Dunlap <george.dunlap@citrix.com>
49---
50 tools/xentrace/xenalyze.c | 24 ++++++++++++++++--------
51 1 file changed, 16 insertions(+), 8 deletions(-)
52
53diff --git a/tools/xentrace/xenalyze.c b/tools/xentrace/xenalyze.c
54index 5a2735c..4bcaf83 100644
55--- a/tools/xentrace/xenalyze.c
56+++ b/tools/xentrace/xenalyze.c
57@@ -2132,10 +2132,14 @@ float weighted_percentile(float * A, /* values */
58 } while (I <= J); /* Keep going until our pointers meet or pass */
59
60 /* Re-adjust L and R, based on which element we're looking for */
61- if(J_weight<K_weight)
62- L=I; L_weight = I_weight;
63- if(K_weight<I_weight)
64- R=J; R_weight = J_weight;
65+ if(J_weight<K_weight) {
66+ L=I;
67+ L_weight = I_weight;
68+ }
69+ if(K_weight<I_weight) {
70+ R=J;
71+ R_weight = J_weight;
72+ }
73 }
74
75 return A[L];
76@@ -2211,10 +2215,14 @@ long long self_weighted_percentile(long long * A,
77 } while (I <= J); /* Keep going until our pointers meet or pass */
78
79 /* Re-adjust L and R, based on which element we're looking for */
80- if(J_weight<K_weight)
81- L=I; L_weight = I_weight;
82- if(K_weight<I_weight)
83- R=J; R_weight = J_weight;
84+ if(J_weight<K_weight) {
85+ L=I;
86+ L_weight = I_weight;
87+ }
88+ if(K_weight<I_weight) {
89+ R=J;
90+ R_weight = J_weight;
91+ }
92 }
93
94 return A[L];
95--
962.1.4
97
98From 9fdffbbab3ada427bac07076f042f0265e5ae05f Mon Sep 17 00:00:00 2001
99From: =?utf8?q?C=C3=A9dric=20Bosdonnat?= <cbosdonnat@suse.com>
100Date: Thu, 10 Nov 2016 10:23:31 +0100
101Subject: [PATCH] Fix misleading indentation warnings
102MIME-Version: 1.0
103Content-Type: text/plain; charset=utf8
104Content-Transfer-Encoding: 8bit
105
106Gcc6 build reports misleading indentation as warnings. Fix a few
107warnings in stubdom.
108
109Signed-off-by: Cédric Bosdonnat <cbosdonnat@suse.com>
110Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
111Acked-by: Quan Xu <xuquan8@huawei.com>
112Release-acked-by: Wei Liu <wei.liu2@citrix.com>
113---
114 stubdom/vtpmmgr/disk_read.c | 8 ++++----
115 stubdom/vtpmmgr/log.c | 2 +-
116 2 files changed, 5 insertions(+), 5 deletions(-)
117
118diff --git a/stubdom/vtpmmgr/disk_read.c b/stubdom/vtpmmgr/disk_read.c
119index 944d3ff..48cfbfe 100644
120--- a/stubdom/vtpmmgr/disk_read.c
121+++ b/stubdom/vtpmmgr/disk_read.c
122@@ -123,10 +123,10 @@ static int parse_root_key(struct mem_tpm_mgr *dst, struct disk_seal_entry *src)
123 struct disk_root_sealed_data sealed;
124
125 /*TPM 2.0 unbind | TPM 1.x unseal*/
126- if (hw_is_tpm2())
127- rc = TPM2_disk_unbind(&sealed, &olen, src);
128- else
129- rc = TPM_disk_unseal(&sealed, sizeof(sealed), src);
130+ if (hw_is_tpm2())
131+ rc = TPM2_disk_unbind(&sealed, &olen, src);
132+ else
133+ rc = TPM_disk_unseal(&sealed, sizeof(sealed), src);
134
135 if (rc)
136 return rc;
137diff --git a/stubdom/vtpmmgr/log.c b/stubdom/vtpmmgr/log.c
138index a82c913..c1bc8f3 100644
139--- a/stubdom/vtpmmgr/log.c
140+++ b/stubdom/vtpmmgr/log.c
141@@ -147,5 +147,5 @@ const char* tpm_get_error_name (TPM_RESULT code) {
142 if (code == error_msgs[i].code)
143 return error_msgs[i].code_name;
144
145- return("Unknown Error Code");
146+ return("Unknown Error Code");
147 }
148--
1492.1.4
150
This page took 0.042218 seconds and 4 git commands to generate.