1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-21 23:58:49 -05:00

checksrc: use space before paren in "return (expr);"

This commit is contained in:
Daniel Stenberg 2015-03-17 13:05:01 +01:00
parent 3dbe12a1e9
commit a6b8fe2a5f
7 changed files with 27 additions and 16 deletions

View File

@ -6,7 +6,7 @@
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
# Copyright (C) 2011 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al.
# Copyright (C) 2011 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
@ -144,6 +144,17 @@ sub scanfile {
}
}
# check for "return(" without space
if($l =~ /^(.*)return\(/) {
if($1 =~ / *\#/) {
# this is a #if, treat it differently
}
else {
checkwarn($line, length($1)+6, $file, $l,
"return without space before paren");
}
}
# check for "} else"
if($l =~ /^(.*)\} *else/) {
checkwarn($line, length($1), $file, $l, "else after closing brace on same line");

View File

@ -4087,7 +4087,7 @@ CURLcode Curl_ftpsendf(struct connectdata *conn,
result = Curl_convert_to_network(conn->data, s, write_len);
/* Curl_convert_to_network calls failf if unsuccessful */
if(result)
return(result);
return result;
for(;;) {
#ifdef HAVE_GSSAPI

View File

@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@ -573,6 +573,6 @@ int tpf_select_libcurl(int maxfds, fd_set* reads, fd_set* writes,
rc = tpf_select_bsd(maxfds, reads, writes, excepts, tv);
tpf_process_signals();
return(rc);
return rc;
}
#endif /* TPF */

View File

@ -52,7 +52,7 @@ static size_t convert_lineends(struct SessionHandle *data,
/* sanity check */
if((startPtr == NULL) || (size < 1)) {
return(size);
return size;
}
if(data->state.prev_block_had_trailing_cr) {
@ -114,9 +114,9 @@ static size_t convert_lineends(struct SessionHandle *data,
/* tidy up by null terminating the now shorter data */
*outPtr = '\0';
return(outPtr - startPtr);
return (outPtr - startPtr);
}
return(size);
return size;
}
#endif /* CURL_DO_LINEEND_CONV */

View File

@ -92,10 +92,10 @@ static int check_gss_err(struct SessionHandle *data,
gss_release_buffer(&min_stat, &status_string);
}
failf(data, "GSS-API error: %s failed:\n%s", function, buf);
return(1);
return 1;
}
return(0);
return 0;
}
CURLcode Curl_SOCKS5_gssapi_negotiate(int sockindex,

View File

@ -408,7 +408,7 @@ static size_t tftp_option_add(tftp_state_data_t *state, size_t csize,
if(( strlen(option) + csize + 1 ) > (size_t)state->blksize)
return 0;
strcpy(buf, option);
return( strlen(option) + 1 );
return strlen(option) + 1;
}
static CURLcode tftp_connect_for_tx(tftp_state_data_t *state,
@ -423,7 +423,7 @@ static CURLcode tftp_connect_for_tx(tftp_state_data_t *state,
state->state = TFTP_STATE_TX;
result = tftp_set_timeouts(state);
if(result)
return(result);
return result;
return tftp_tx(state, event);
}
@ -439,7 +439,7 @@ static CURLcode tftp_connect_for_rx(tftp_state_data_t *state,
state->state = TFTP_STATE_RX;
result = tftp_set_timeouts(state);
if(result)
return(result);
return result;
return tftp_rx(state, event);
}
@ -1210,7 +1210,7 @@ static CURLcode tftp_multi_statemach(struct connectdata *conn, bool *done)
else if(event != TFTP_EVENT_NONE) {
result = tftp_state_machine(state, event);
if(result)
return(result);
return result;
*done = (state->state == TFTP_STATE_FIN) ? TRUE : FALSE;
if(*done)
/* Tell curl we're done */
@ -1229,10 +1229,10 @@ static CURLcode tftp_multi_statemach(struct connectdata *conn, bool *done)
else if(rc != 0) {
result = tftp_receive_packet(conn);
if(result)
return(result);
return result;
result = tftp_state_machine(state, state->event);
if(result)
return(result);
return result;
*done = (state->state == TFTP_STATE_FIN) ? TRUE : FALSE;
if(*done)
/* Tell curl we're done */

View File

@ -214,7 +214,7 @@ CURLcode Curl_fillreadbuffer(struct connectdata *conn, int bytes, int *nreadp)
result = Curl_convert_to_network(data, data->req.upload_fromhere, length);
/* Curl_convert_to_network calls failf if unsuccessful */
if(result)
return(result);
return result;
#endif /* CURL_DOES_CONVERSIONS */
if((nread - hexlen) == 0)