summaryrefslogtreecommitdiff
path: root/ident.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2023-11-04 10:43:35 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2023-11-06 14:19:08 -0800
commitffd69eb38f153229f5033ef5cc789c0ab3704edd (patch)
tree762208a0c2e80bdb9d82010721aef6702faa47da /ident.c
parent568f31aefd6e060779572c1fe593519714f0d50b (diff)
ident.c: clear -Wdeclaration-after-statement warning
ident.c: In function ‘getInt32’: ident.c:228:5: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] 228 | unsigned int u[4] = { c[0], c[1], c[2], c[3] }; | ^~~~~~~~ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'ident.c')
-rw-r--r--ident.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/ident.c b/ident.c
index 23aa7b0..6d3cff3 100644
--- a/ident.c
+++ b/ident.c
@@ -224,14 +224,15 @@ getInt32(fontFile *f, int format)
rc = fontFileRead(f, c, 4);
if (rc != 4)
return -1;
-
- unsigned int u[4] = { c[0], c[1], c[2], c[3] };
-
- if (format & (1 << 2)) {
- return (int) ((u[0] << 24) | (u[1] << 16) | (u[2] << 8) | (u[3]));
- }
else {
- return (int) ((u[0]) | (u[1] << 8) | (u[2] << 16) | (u[3] << 24));
+ unsigned int u[4] = { c[0], c[1], c[2], c[3] };
+
+ if (format & (1 << 2)) {
+ return (int) ((u[0] << 24) | (u[1] << 16) | (u[2] << 8) | (u[3]));
+ }
+ else {
+ return (int) ((u[0]) | (u[1] << 8) | (u[2] << 16) | (u[3] << 24));
+ }
}
}