diff options
author | CoprDistGit <infra@openeuler.org> | 2023-09-14 03:04:49 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2023-09-14 03:04:49 +0000 |
commit | c7ce84c1d067a19220abb6dbbf87c4118a2e14fe (patch) | |
tree | 21b3d6375c71d5a9930c021fbde26f0c4bf4ec92 /1195.patch | |
parent | 2fc16999fe6f92aead8f85c10ce3451da4c7eabd (diff) |
automatic import of stbopeneuler23.03
Diffstat (limited to '1195.patch')
-rw-r--r-- | 1195.patch | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/1195.patch b/1195.patch new file mode 100644 index 0000000..312eacd --- /dev/null +++ b/1195.patch @@ -0,0 +1,59 @@ +From 5818c4e48a7e7d4c21aacf3cd6f1c7e12f770924 Mon Sep 17 00:00:00 2001 +From: "Benjamin A. Beasley" <code@musicinmybrain.net> +Date: Wed, 18 Aug 2021 13:22:14 -0400 +Subject: [PATCH] Fix misleading indentation in stb_divide.h +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +With -Wmisleading-indentation (part of -Wall), gcc 11.2.1 warns: + + In file included from test_c_compilation.c:22: + ../stb_divide.h: In function 'test': + ../stb_divide.h:316:4: warning: this 'if' clause does not guard... [-Wmisleading-indentation] + 316 | if (show) printf("(%+11d,%+2d) ", q,r); stbdiv_check(q,r,a,b, "trunc",a); + | ^~ + ../stb_divide.h:316:45: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if' + 316 | if (show) printf("(%+11d,%+2d) ", q,r); stbdiv_check(q,r,a,b, "trunc",a); + | ^~~~~~~~~~~~ + ../stb_divide.h:318:4: warning: this 'if' clause does not guard... [-Wmisleading-indentation] + 318 | if (show) printf("(%+11d,%+2d) ", q,r); stbdiv_check(q,r,a,b, "floor",b); + | ^~ + ../stb_divide.h:318:45: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if' + 318 | if (show) printf("(%+11d,%+2d) ", q,r); stbdiv_check(q,r,a,b, "floor",b); + | ^~~~~~~~~~~~ + ../stb_divide.h:320:4: warning: this 'if' clause does not guard... [-Wmisleading-indentation] + 320 | if (show) printf("(%+11d,%+2d)\n", q,r); stbdiv_check(q,r,a,b, "euclidean",1); + | ^~ + ../stb_divide.h:320:45: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if' + 320 | if (show) printf("(%+11d,%+2d)\n", q,r); stbdiv_check(q,r,a,b, "euclidean",1); + | ^~~~~~~~~~~~ + +This commit moves each call to stbdiv_check(…) to the following line to +make clear that it is unconditional and to resolve the warning. +--- + stb_divide.h | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +diff --git a/stb_divide.h b/stb_divide.h +index 6a51e3f2e..4c24143c4 100644 +--- a/stb_divide.h ++++ b/stb_divide.h +@@ -313,11 +313,14 @@ void test(int a, int b) + int q,r; + if (show) printf("(%+11d,%+d) | ", a,b); + q = stb_div_trunc(a,b), r = stb_mod_trunc(a,b); +- if (show) printf("(%+11d,%+2d) ", q,r); stbdiv_check(q,r,a,b, "trunc",a); ++ if (show) printf("(%+11d,%+2d) ", q,r); ++ stbdiv_check(q,r,a,b, "trunc",a); + q = stb_div_floor(a,b), r = stb_mod_floor(a,b); +- if (show) printf("(%+11d,%+2d) ", q,r); stbdiv_check(q,r,a,b, "floor",b); ++ if (show) printf("(%+11d,%+2d) ", q,r); ++ stbdiv_check(q,r,a,b, "floor",b); + q = stb_div_eucl (a,b), r = stb_mod_eucl (a,b); +- if (show) printf("(%+11d,%+2d)\n", q,r); stbdiv_check(q,r,a,b, "euclidean",1); ++ if (show) printf("(%+11d,%+2d)\n", q,r); ++ stbdiv_check(q,r,a,b, "euclidean",1); + } + + void testh(int a, int b) |