mirror of
https://git.zap.org.au/git/trader.git
synced 2025-01-03 14:57:41 -05:00
Avoid a Clang warning about a comparison that is always false
Rewrite a check that unscramble_table[] is of the right size as an assertion, which prevents Clang from issuing a warning that the "result of comparison of constant 256 with expression of type 'const unsigned char' is always false". Oh for the day that C11's _Static_assert can be used amongst all compilers! But perhaps Gnulib's assert-h module can be used instead...
This commit is contained in:
parent
0a1e837c4d
commit
097c9b0e5b
@ -868,13 +868,13 @@ ssize_t b64decode (const void *restrict in, size_t inlen,
|
||||
assert(u_in != NULL);
|
||||
assert(u_out != NULL);
|
||||
assert(outlen > 0);
|
||||
assert(UNSCRAMBLE_TABLE_SIZE == UCHAR_MAX + 1);
|
||||
|
||||
count = 0;
|
||||
n = 1;
|
||||
|
||||
for (size_t i = 0; i < inlen && *u_in != '\0'; i++, u_in++) {
|
||||
int v = *u_in > UNSCRAMBLE_TABLE_SIZE ?
|
||||
UNSCRAMBLE_INVALID : unscramble_table[*u_in];
|
||||
int v = unscramble_table[*u_in];
|
||||
|
||||
switch (v) {
|
||||
case UNSCRAMBLE_INVALID:
|
||||
|
Loading…
Reference in New Issue
Block a user