Use fallthrough statement attribute (moar)

This commit is contained in:
Nicolas Williams
2022-01-14 16:53:28 -06:00
parent ddc6113610
commit c607135a03
16 changed files with 28 additions and 23 deletions

View File

@@ -205,22 +205,24 @@ wind_ucs4utf8(const uint32_t *in, size_t in_len, char *out, size_t *out_len)
case 4:
out[3] = (ch | 0x80) & 0xbf;
ch = ch >> 6;
fallthrough
/* FALLTHROUGH */
fallthrough
case 3:
out[2] = (ch | 0x80) & 0xbf;
ch = ch >> 6;
fallthrough
/* FALLTHROUGH */
fallthrough
case 2:
out[1] = (ch | 0x80) & 0xbf;
ch = ch >> 6;
fallthrough
/* FALLTHROUGH */
fallthrough
case 1:
out[0] = ch | first_char[len - 1];
fallthrough
/* FALLTHROUGH */
fallthrough
default:
break;
}
}
out += len;
@@ -488,17 +490,19 @@ wind_ucs2utf8(const uint16_t *in, size_t in_len, char *out, size_t *out_len)
case 3:
out[2] = (ch | 0x80) & 0xbf;
ch = ch >> 6;
fallthrough
/* FALLTHROUGH */
fallthrough
case 2:
out[1] = (ch | 0x80) & 0xbf;
ch = ch >> 6;
fallthrough
/* FALLTHROUGH */
fallthrough
case 1:
out[0] = ch | first_char[len - 1];
fallthrough
/* FALLTHROUGH */
fallthrough
default:
break;
}
out += len;
}