9
9
#endif
10
10
11
11
#include "base64.h"
12
+ #include "compiler.h"
12
13
13
14
static const int CHARS_PER_LINE = 72 ;
14
15
static const char * ENCODING =
@@ -41,6 +42,7 @@ int base64_encode_block(const char *plaintext_in, int length_in, char *code_out,
41
42
42
43
switch (state_in -> step ) {
43
44
while (1 ) {
45
+ fallthrough ;
44
46
case step_A :
45
47
if (plainchar == plaintextend ) {
46
48
state_in -> result = result ;
@@ -51,7 +53,7 @@ int base64_encode_block(const char *plaintext_in, int length_in, char *code_out,
51
53
result = (fragment & 0x0fc ) >> 2 ;
52
54
* codechar ++ = base64_encode_value (result );
53
55
result = (fragment & 0x003 ) << 4 ;
54
- /* fall through */
56
+ fallthrough ;
55
57
case step_B :
56
58
if (plainchar == plaintextend ) {
57
59
state_in -> result = result ;
@@ -62,7 +64,7 @@ int base64_encode_block(const char *plaintext_in, int length_in, char *code_out,
62
64
result |= (fragment & 0x0f0 ) >> 4 ;
63
65
* codechar ++ = base64_encode_value (result );
64
66
result = (fragment & 0x00f ) << 2 ;
65
- /* fall through */
67
+ fallthrough ;
66
68
case step_C :
67
69
if (plainchar == plaintextend ) {
68
70
state_in -> result = result ;
@@ -146,6 +148,7 @@ int base64_decode_block(const char *code_in, int length_in, char *plaintext_out,
146
148
147
149
switch (state_in -> step ) {
148
150
while (1 ) {
151
+ fallthrough ;
149
152
case step_a :
150
153
do {
151
154
if (codec == code_in + length_in ) {
@@ -156,7 +159,7 @@ int base64_decode_block(const char *code_in, int length_in, char *plaintext_out,
156
159
fragmt = base64_decode_value (* codec ++ );
157
160
} while (fragmt < 0 );
158
161
* plainc = (fragmt & 0x03f ) << 2 ;
159
- /* fall through */
162
+ fallthrough ;
160
163
case step_b :
161
164
do {
162
165
if (codec == code_in + length_in ) {
@@ -168,7 +171,7 @@ int base64_decode_block(const char *code_in, int length_in, char *plaintext_out,
168
171
} while (fragmt < 0 );
169
172
* plainc ++ |= (fragmt & 0x030 ) >> 4 ;
170
173
* plainc = (fragmt & 0x00f ) << 4 ;
171
- /* fall through */
174
+ fallthrough ;
172
175
case step_c :
173
176
do {
174
177
if (codec == code_in + length_in ) {
@@ -180,7 +183,7 @@ int base64_decode_block(const char *code_in, int length_in, char *plaintext_out,
180
183
} while (fragmt < 0 );
181
184
* plainc ++ |= (fragmt & 0x03c ) >> 2 ;
182
185
* plainc = (fragmt & 0x003 ) << 6 ;
183
- /* fall through */
186
+ fallthrough ;
184
187
case step_d :
185
188
do {
186
189
if (codec == code_in + length_in ) {
0 commit comments