Skip to content

Commit

Permalink
rename CURL_FALLTHROUGH -> FALLTHROUGH
Browse files Browse the repository at this point in the history
  • Loading branch information
vszakats committed Dec 14, 2023
1 parent 723a190 commit 48ea49a
Show file tree
Hide file tree
Showing 32 changed files with 87 additions and 87 deletions.
8 changes: 4 additions & 4 deletions lib/cf-h1-proxy.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ static void h1_tunnel_go_state(struct Curl_cfilter *cf,
infof(data, "CONNECT phase completed");
data->state.authproxy.done = TRUE;
data->state.authproxy.multipass = FALSE;
CURL_FALLTHROUGH();
FALLTHROUGH();
case H1_TUNNEL_FAILED:
if(new_state == H1_TUNNEL_FAILED)
CURL_TRC_CF(data, cf, "new tunnel state 'failed'");
Expand Down Expand Up @@ -912,7 +912,7 @@ static CURLcode H1_CONNECT(struct Curl_cfilter *cf,
if(result)
goto out;
h1_tunnel_go_state(cf, ts, H1_TUNNEL_CONNECT, data);
CURL_FALLTHROUGH();
FALLTHROUGH();

case H1_TUNNEL_CONNECT:
/* see that the request is completely sent */
Expand All @@ -921,7 +921,7 @@ static CURLcode H1_CONNECT(struct Curl_cfilter *cf,
if(result || !done)
goto out;
h1_tunnel_go_state(cf, ts, H1_TUNNEL_RECEIVE, data);
CURL_FALLTHROUGH();
FALLTHROUGH();

case H1_TUNNEL_RECEIVE:
/* read what is there */
Expand All @@ -936,7 +936,7 @@ static CURLcode H1_CONNECT(struct Curl_cfilter *cf,
goto out;
/* got it */
h1_tunnel_go_state(cf, ts, H1_TUNNEL_RESPONSE, data);
CURL_FALLTHROUGH();
FALLTHROUGH();

case H1_TUNNEL_RESPONSE:
CURL_TRC_CF(data, cf, "CONNECT response");
Expand Down
6 changes: 3 additions & 3 deletions lib/cf-h2-proxy.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ static void h2_tunnel_go_state(struct Curl_cfilter *cf,
infof(data, "CONNECT phase completed");
data->state.authproxy.done = TRUE;
data->state.authproxy.multipass = FALSE;
CURL_FALLTHROUGH();
FALLTHROUGH();
case H2_TUNNEL_FAILED:
if(new_state == H2_TUNNEL_FAILED)
CURL_TRC_CF(data, cf, "[%d] new tunnel state 'failed'", ts->stream_id);
Expand Down Expand Up @@ -1033,7 +1033,7 @@ static CURLcode H2_CONNECT(struct Curl_cfilter *cf,
if(result)
goto out;
h2_tunnel_go_state(cf, ts, H2_TUNNEL_CONNECT, data);
CURL_FALLTHROUGH();
FALLTHROUGH();

case H2_TUNNEL_CONNECT:
/* see that the request is completely sent */
Expand All @@ -1052,7 +1052,7 @@ static CURLcode H2_CONNECT(struct Curl_cfilter *cf,
result = CURLE_OK;
goto out;
}
CURL_FALLTHROUGH();
FALLTHROUGH();

case H2_TUNNEL_RESPONSE:
DEBUGASSERT(ts->has_final_response);
Expand Down
4 changes: 2 additions & 2 deletions lib/cf-haproxy.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ static CURLcode cf_haproxy_connect(struct Curl_cfilter *cf,
if(result)
goto out;
ctx->state = HAPROXY_SEND;
CURL_FALLTHROUGH();
FALLTHROUGH();
case HAPROXY_SEND:
len = Curl_dyn_len(&ctx->data_out);
if(len > 0) {
Expand All @@ -141,7 +141,7 @@ static CURLcode cf_haproxy_connect(struct Curl_cfilter *cf,
}
}
ctx->state = HAPROXY_DONE;
CURL_FALLTHROUGH();
FALLTHROUGH();
default:
Curl_dyn_free(&ctx->data_out);
break;
Expand Down
2 changes: 1 addition & 1 deletion lib/cf-https-connect.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ static CURLcode cf_hc_connect(struct Curl_cfilter *cf,
cf_hc_baller_init(&ctx->h21_baller, cf, data, "h21",
cf->conn->transport);
ctx->state = CF_HC_CONNECT;
CURL_FALLTHROUGH();
FALLTHROUGH();

case CF_HC_CONNECT:
if(cf_hc_baller_is_active(&ctx->h3_baller)) {
Expand Down
2 changes: 1 addition & 1 deletion lib/cf-socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -1568,7 +1568,7 @@ static CURLcode cf_socket_query(struct Curl_cfilter *cf,
*when = ctx->first_byte_at;
break;
}
CURL_FALLTHROUGH();
FALLTHROUGH();
default:
*when = ctx->connected_at;
break;
Expand Down
2 changes: 1 addition & 1 deletion lib/connect.c
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,7 @@ static CURLcode cf_he_connect(struct Curl_cfilter *cf,
if(result)
return result;
ctx->state = SCFST_WAITING;
CURL_FALLTHROUGH();
FALLTHROUGH();
case SCFST_WAITING:
result = is_connected(cf, data, done);
if(!result && *done) {
Expand Down
2 changes: 1 addition & 1 deletion lib/cookie.c
Original file line number Diff line number Diff line change
Expand Up @@ -925,7 +925,7 @@ Curl_cookie_add(struct Curl_easy *data,
if(!co->spath)
badcookie = TRUE;
fields++; /* add a field and fall down to secure */
CURL_FALLTHROUGH();
FALLTHROUGH();
case 3:
co->secure = FALSE;
if(strcasecompare(ptr, "TRUE")) {
Expand Down
2 changes: 1 addition & 1 deletion lib/curl_ntlm_wb.c
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ CURLcode Curl_output_ntlm_wb(struct Curl_easy *data, struct connectdata *conn,
/* connection is already authenticated,
* don't send a header in future requests */
*state = NTLMSTATE_LAST;
CURL_FALLTHROUGH();
FALLTHROUGH();
case NTLMSTATE_LAST:
Curl_safefree(*allocuserpwd);
authp->done = TRUE;
Expand Down
6 changes: 3 additions & 3 deletions lib/curl_setup.h
Original file line number Diff line number Diff line change
Expand Up @@ -650,12 +650,12 @@

/* fallthrough attribute */

#if !defined(CURL_FALLTHROUGH)
#if !defined(FALLTHROUGH)
#if (defined(__GNUC__) && __GNUC__ >= 7) || \
(defined(__clang__) && __clang_major__ >= 10)
# define CURL_FALLTHROUGH() __attribute__((fallthrough))
# define FALLTHROUGH() __attribute__((fallthrough))
#else
# define CURL_FALLTHROUGH() do {} while (0)
# define FALLTHROUGH() do {} while (0)
#endif
#endif

Expand Down
4 changes: 2 additions & 2 deletions lib/formdata.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
case CURLFORM_PTRNAME:
current_form->flags |= HTTPPOST_PTRNAME; /* fall through */

CURL_FALLTHROUGH();
FALLTHROUGH();
case CURLFORM_COPYNAME:
if(current_form->name)
return_value = CURL_FORMADD_OPTION_TWICE;
Expand All @@ -303,7 +303,7 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
*/
case CURLFORM_PTRCONTENTS:
current_form->flags |= HTTPPOST_PTRCONTENTS;
CURL_FALLTHROUGH();
FALLTHROUGH();
case CURLFORM_COPYCONTENTS:
if(current_form->value)
return_value = CURL_FORMADD_OPTION_TWICE;
Expand Down
2 changes: 1 addition & 1 deletion lib/ftp.c
Original file line number Diff line number Diff line change
Expand Up @@ -3256,7 +3256,7 @@ static CURLcode ftp_done(struct Curl_easy *data, CURLcode status,

/* until we cope better with prematurely ended requests, let them
* fallback as if in complete failure */
CURL_FALLTHROUGH();
FALLTHROUGH();
default: /* by default, an error means the control connection is
wedged and should not be used anymore */
ftpc->ctl_valid = FALSE;
Expand Down
2 changes: 1 addition & 1 deletion lib/http.c
Original file line number Diff line number Diff line change
Expand Up @@ -3888,7 +3888,7 @@ CURLcode Curl_http_statusline(struct Curl_easy *data,
* fields. */
if(data->set.timecondition)
data->info.timecond = TRUE;
CURL_FALLTHROUGH();
FALLTHROUGH();
case 204:
/* (quote from RFC2616, section 10.2.5): The server has
* fulfilled the request but does not need to return an
Expand Down
6 changes: 3 additions & 3 deletions lib/mime.c
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ static size_t read_part_content(curl_mimepart *part,
case MIMEKIND_FILE:
if(part->fp && feof(part->fp))
break; /* At EOF. */
CURL_FALLTHROUGH();
FALLTHROUGH();
default:
if(part->readfunc) {
if(!(part->flags & MIME_FAST_READ)) {
Expand Down Expand Up @@ -936,7 +936,7 @@ static size_t readback_part(curl_mimepart *part,
mimesetstate(&part->state, MIMESTATE_USERHEADERS, hdr->next);
break;
}
CURL_FALLTHROUGH();
FALLTHROUGH();
case MIMESTATE_CURLHEADERS:
if(!hdr)
mimesetstate(&part->state, MIMESTATE_USERHEADERS, part->userheaders);
Expand Down Expand Up @@ -970,7 +970,7 @@ static size_t readback_part(curl_mimepart *part,
fclose(part->fp);
part->fp = NULL;
}
CURL_FALLTHROUGH();
FALLTHROUGH();
case CURL_READFUNC_ABORT:
case CURL_READFUNC_PAUSE:
case READ_ERROR:
Expand Down
6 changes: 3 additions & 3 deletions lib/mprintf.c
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ static int dprintf_Pass1(const char *format, struct va_stack *vto,
case '0':
if(!(flags & FLAGS_LEFT))
flags |= FLAGS_PAD_NIL;
CURL_FALLTHROUGH();
FALLTHROUGH();
case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
flags |= FLAGS_WIDTH;
Expand All @@ -385,7 +385,7 @@ static int dprintf_Pass1(const char *format, struct va_stack *vto,
break;
case '\0':
fmt--;
CURL_FALLTHROUGH();
FALLTHROUGH();
default:
break;
}
Expand All @@ -402,7 +402,7 @@ static int dprintf_Pass1(const char *format, struct va_stack *vto,
switch(*fmt) {
case 'S':
flags |= FLAGS_ALT;
CURL_FALLTHROUGH();
FALLTHROUGH();
case 's':
vto[i].type = FORMAT_STRING;
break;
Expand Down
4 changes: 2 additions & 2 deletions lib/mqtt.c
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ static CURLcode mqtt_read_publish(struct Curl_easy *data, bool *done)
data->req.bytecount = 0;
data->req.size = remlen;
mq->npacket = remlen; /* get this many bytes */
CURL_FALLTHROUGH();
FALLTHROUGH();
case MQTT_PUB_REMAIN: {
/* read rest of packet, but no more. Cap to buffer size */
size_t rest = mq->npacket;
Expand Down Expand Up @@ -776,7 +776,7 @@ static CURLcode mqtt_doing(struct Curl_easy *data, bool *done)
/* remember the first byte */
mq->npacket = 0;
mqstate(data, MQTT_REMAINING_LENGTH, MQTT_NOSTATE);
CURL_FALLTHROUGH();
FALLTHROUGH();
case MQTT_REMAINING_LENGTH:
do {
result = Curl_read(data, sockfd, (char *)&byte, 1, &nread);
Expand Down
2 changes: 1 addition & 1 deletion lib/multi.c
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ static CURLcode multi_done(struct Curl_easy *data,
many callbacks and protocols work differently, we could potentially do
this more fine-grained in the future. */
premature = TRUE;
CURL_FALLTHROUGH();
FALLTHROUGH();
default:
break;
}
Expand Down
6 changes: 3 additions & 3 deletions lib/openldap.c
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ static CURLcode oldap_state_mechs_resp(struct Curl_easy *data,
switch(code) {
case LDAP_SIZELIMIT_EXCEEDED:
infof(data, "Too many authentication mechanisms\n");
CURL_FALLTHROUGH();
FALLTHROUGH();
case LDAP_SUCCESS:
case LDAP_NO_RESULTS_RETURNED:
if(Curl_sasl_can_authenticate(&li->sasl, data))
Expand Down Expand Up @@ -793,7 +793,7 @@ static CURLcode oldap_connecting(struct Curl_easy *data, bool *done)
result = oldap_perform_bind(data, OLDAP_BIND);
break;
}
CURL_FALLTHROUGH();
FALLTHROUGH();
case OLDAP_TLS:
result = oldap_ssl_connect(data, OLDAP_TLS);
if(result && data->set.use_ssl != CURLUSESSL_TRY)
Expand Down Expand Up @@ -1014,7 +1014,7 @@ static ssize_t oldap_recv(struct Curl_easy *data, int sockindex, char *buf,
switch(code) {
case LDAP_SIZELIMIT_EXCEEDED:
infof(data, "There are more than %d entries", lr->nument);
CURL_FALLTHROUGH();
FALLTHROUGH();
case LDAP_SUCCESS:
data->req.size = data->req.bytecount;
break;
Expand Down
Loading

0 comments on commit 48ea49a

Please sign in to comment.