Skip to content

Commit 7d39f8a

Browse files
committed
Fix format issues caught by clang-format-18
Signed-off-by: Chun-Hung Tseng <henrybear327@gmail.com>
1 parent 7346561 commit 7d39f8a

File tree

3 files changed

+25
-26
lines changed

3 files changed

+25
-26
lines changed

src/rv32_template.c

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,7 @@
119119
*/
120120

121121
/* Internal */
122-
RVOP(
123-
nop,
124-
{ rv->X[rv_reg_zero] = 0; },
125-
GEN({/* no operation */}))
122+
RVOP(nop, { rv->X[rv_reg_zero] = 0; }, GEN({/* no operation */}))
126123

127124
/* LUI is used to build 32-bit constants and uses the U-type format. LUI
128125
* places the U-immediate value in the top 20 bits of the destination
@@ -297,13 +294,14 @@ RVOP(
297294
if (!untaken) \
298295
goto nextop; \
299296
IIF(RV32_HAS(JIT)) \
300-
({ \
301-
cache_get(rv->block_cache, PC + 4, true); \
302-
if (!set_add(&pc_set, PC + 4)) \
303-
has_loops = true; \
304-
if (cache_hot(rv->block_cache, PC + 4)) \
305-
goto nextop; \
306-
}, ); \
297+
( \
298+
{ \
299+
cache_get(rv->block_cache, PC + 4, true); \
300+
if (!set_add(&pc_set, PC + 4)) \
301+
has_loops = true; \
302+
if (cache_hot(rv->block_cache, PC + 4)) \
303+
goto nextop; \
304+
}, ); \
307305
PC += 4; \
308306
last_pc = PC; \
309307
MUST_TAIL return untaken->impl(rv, untaken, cycle, PC); \
@@ -316,13 +314,14 @@ RVOP(
316314
struct rv_insn *taken = ir->branch_taken; \
317315
if (taken) { \
318316
IIF(RV32_HAS(JIT)) \
319-
({ \
320-
cache_get(rv->block_cache, PC, true); \
321-
if (!set_add(&pc_set, PC)) \
322-
has_loops = true; \
323-
if (cache_hot(rv->block_cache, PC)) \
324-
goto end_op; \
325-
}, ); \
317+
( \
318+
{ \
319+
cache_get(rv->block_cache, PC, true); \
320+
if (!set_add(&pc_set, PC)) \
321+
has_loops = true; \
322+
if (cache_hot(rv->block_cache, PC)) \
323+
goto end_op; \
324+
}, ); \
326325
last_pc = PC; \
327326
MUST_TAIL return taken->impl(rv, taken, cycle, PC); \
328327
} \

tests/aes.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -951,7 +951,7 @@ static void doubleBGF128(block_t block)
951951
{ /* first: left-shift, then */
952952
c |= block[--i] << 1; /* append the previous MSBit */
953953
block[i] = (uint8_t) c;
954-
} /* if first MSBit is carried */
954+
} /* if first MSBit is carried */
955955
block[LAST] ^= c * 0x87; /* .. B ^= 10000111b (B.E.) */
956956
}
957957
#endif
@@ -1132,7 +1132,7 @@ static char padBlock(const uint8_t len, block_t block)
11321132
memset(p, n * (AES_PADDING != 2), n);
11331133
*p ^= '\x80' * (AES_PADDING == 2); /* either PKCS#7 / IEC7816-4 */
11341134
#else
1135-
if (len) /* default (zero) padding */
1135+
if (len) /* default (zero) padding */
11361136
{
11371137
memset(block + len, 0, BLOCKSIZE - len);
11381138
}
@@ -1294,7 +1294,7 @@ char AES_CBC_decrypt(const uint8_t *key,
12941294
xorBlock(iv, y); /* IV_next = C */
12951295
iv = x;
12961296
x += BLOCKSIZE;
1297-
} /* r = 0 unless CTS enabled */
1297+
} /* r = 0 unless CTS enabled */
12981298
if (r) { /* P2 = Dec(C1) ^ C2 */
12991299
mixThenXor(&rijndaelDecrypt, x, y, x + BLOCKSIZE, r, y + BLOCKSIZE);
13001300
memcpy(y, x + BLOCKSIZE, r);
@@ -1544,7 +1544,7 @@ static void XEX_Cipher(fmix_t cipher,
15441544

15451545
if (sectid == ~(size_t) 0) { /* the `i` block is either */
15461546
memcpy(T, tweak, BLOCKSIZE); /* ..a little-endian number */
1547-
} /* ..or a byte array. */
1547+
} /* ..or a byte array. */
15481548
else {
15491549
memset(T, 0, BLOCKSIZE);
15501550
copyLVal(T, sectid, 0);
@@ -2537,7 +2537,7 @@ static void modP1305(uint8_t *block, const int ovrfl)
25372537
{
25382538
t += block[i]; /* to get mod, first derive */
25392539
block[i++] = (uint8_t) t; /* .. B + (5 * q) and then */
2540-
} /* .. subtract q * (2^130) */
2540+
} /* .. subtract q * (2^130) */
25412541
block[SP - 1] -= 4 * (uint8_t) q;
25422542
}
25432543

tests/line.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ void svpng(FILE *fp, unsigned w, unsigned h, const uint8_t *img, bool alpha)
7777
SVPNG_PUT((u) >> 24); \
7878
SVPNG_PUT(((u) >> 16) & 255); \
7979
SVPNG_PUT(((u) >> 8) & 255); \
80-
SVPNG_PUT((u) &255); \
80+
SVPNG_PUT((u) & 255); \
8181
} while (0)
8282

8383
#define SVPNG_U8C(u) \
@@ -94,7 +94,7 @@ void svpng(FILE *fp, unsigned w, unsigned h, const uint8_t *img, bool alpha)
9494

9595
#define SVPNG_U16LC(u) \
9696
do { \
97-
SVPNG_U8C((u) &255); \
97+
SVPNG_U8C((u) & 255); \
9898
SVPNG_U8C(((u) >> 8) & 255); \
9999
} while (0)
100100

@@ -103,7 +103,7 @@ void svpng(FILE *fp, unsigned w, unsigned h, const uint8_t *img, bool alpha)
103103
SVPNG_U8C((u) >> 24); \
104104
SVPNG_U8C(((u) >> 16) & 255); \
105105
SVPNG_U8C(((u) >> 8) & 255); \
106-
SVPNG_U8C((u) &255); \
106+
SVPNG_U8C((u) & 255); \
107107
} while (0)
108108

109109
#define SVPNG_U8ADLER(u) \

0 commit comments

Comments
 (0)