lib/src: white space edits to comply better with code style

... as checksrc now finds and complains about these.

Closes #14921
This commit is contained in:
Daniel Stenberg 2024-09-18 15:29:51 +02:00
parent a57b45c386
commit fbf5d507ce
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
128 changed files with 854 additions and 837 deletions

View file

@ -273,7 +273,7 @@ int main(int argc, char *argv[])
host, port);
resolve = curl_slist_append(resolve, resolve_buf);
for(i = 0; i<HANDLECOUNT; i++) {
for(i = 0; i < HANDLECOUNT; i++) {
handles[i].idx = i;
handles[i].paused = 0;
handles[i].resumed = 0;
@ -301,7 +301,7 @@ int main(int argc, char *argv[])
if(!multi_handle)
err();
for(i = 0; i<HANDLECOUNT; i++) {
for(i = 0; i < HANDLECOUNT; i++) {
if(curl_multi_add_handle(multi_handle, handles[i].h) != CURLM_OK)
err();
}
@ -314,7 +314,7 @@ int main(int argc, char *argv[])
if(!still_running) {
int as_expected = 1;
fprintf(stderr, "INFO: no more handles running\n");
for(i = 0; i<HANDLECOUNT; i++) {
for(i = 0; i < HANDLECOUNT; i++) {
if(!handles[i].paused) {
fprintf(stderr, "ERROR: [%d] NOT PAUSED\n", i);
as_expected = 0;
@ -348,7 +348,7 @@ int main(int argc, char *argv[])
/* !checksrc! disable EQUALSNULL 1 */
while((msg = curl_multi_info_read(multi_handle, &msgs_left)) != NULL) {
if(msg->msg == CURLMSG_DONE) {
for(i = 0; i<HANDLECOUNT; i++) {
for(i = 0; i < HANDLECOUNT; i++) {
if(msg->easy_handle == handles[i].h) {
if(handles[i].paused != 1 || !handles[i].resumed) {
fprintf(stderr, "ERROR: [%d] done, pauses=%d, resumed=%d, "
@ -364,7 +364,7 @@ int main(int argc, char *argv[])
/* Successfully paused? */
if(!all_paused) {
for(i = 0; i<HANDLECOUNT; i++) {
for(i = 0; i < HANDLECOUNT; i++) {
if(!handles[i].paused) {
break;
}
@ -378,7 +378,7 @@ int main(int argc, char *argv[])
}
if(resume_round > 0 && rounds == resume_round) {
/* time to resume */
for(i = 0; i<HANDLECOUNT; i++) {
for(i = 0; i < HANDLECOUNT; i++) {
fprintf(stderr, "INFO: [%d] resumed\n", i);
handles[i].resumed = 1;
curl_easy_pause(handles[i].h, CURLPAUSE_CONT);
@ -387,7 +387,7 @@ int main(int argc, char *argv[])
}
out:
for(i = 0; i<HANDLECOUNT; i++) {
for(i = 0; i < HANDLECOUNT; i++) {
curl_multi_remove_handle(multi_handle, handles[i].h);
curl_easy_cleanup(handles[i].h);
}

View file

@ -52,7 +52,7 @@ void dump(const char *text, unsigned char *ptr, size_t size,
fprintf(stderr, "%s, %lu bytes (0x%lx)\n",
text, (unsigned long)size, (unsigned long)size);
for(i = 0; i<size; i += width) {
for(i = 0; i < size; i += width) {
fprintf(stderr, "%4.4lx: ", (unsigned long)i);
@ -73,7 +73,7 @@ void dump(const char *text, unsigned char *ptr, size_t size,
break;
}
fprintf(stderr, "%c",
(ptr[i + c] >= 0x20) && (ptr[i + c]<0x80)?ptr[i + c]:'.');
(ptr[i + c] >= 0x20) && (ptr[i + c] < 0x80) ? ptr[i + c] : '.');
/* check again for 0D0A, to avoid an extra \n if it's at width */
if(nohex && (i + c + 2 < size) && ptr[i + c + 1] == 0x0D &&
ptr[i + c + 2] == 0x0A) {
@ -183,7 +183,7 @@ static int server_push_callback(CURL *parent,
fprintf(stderr, "**** push callback approves stream %u, got %lu headers!\n",
count, (unsigned long)num_headers);
for(i = 0; i<num_headers; i++) {
for(i = 0; i < num_headers; i++) {
headp = curl_pushheader_bynum(headers, i);
fprintf(stderr, "**** header %lu: %s\n", (unsigned long)i, headp);
}

View file

@ -367,7 +367,7 @@ int main(int argc, char *argv[])
t->pause_at = (curl_off_t)pause_offset;
}
n = (max_parallel < transfer_count)? max_parallel : transfer_count;
n = (max_parallel < transfer_count) ? max_parallel : transfer_count;
for(i = 0; i < n; ++i) {
t = &transfers[i];
t->easy = curl_easy_init();

View file

@ -446,7 +446,7 @@ int main(int argc, char *argv[])
multi_handle = curl_multi_init();
curl_multi_setopt(multi_handle, CURLMOPT_PIPELINING, CURLPIPE_MULTIPLEX);
n = (max_parallel < transfer_count)? max_parallel : transfer_count;
n = (max_parallel < transfer_count) ? max_parallel : transfer_count;
for(i = 0; i < n; ++i) {
t = &transfers[i];
t->easy = curl_easy_init();

View file

@ -60,7 +60,7 @@ void dump(const char *text, unsigned char *ptr, size_t size,
fprintf(stderr, "%s, %lu bytes (0x%lx)\n",
text, (unsigned long)size, (unsigned long)size);
for(i = 0; i<size; i += width) {
for(i = 0; i < size; i += width) {
fprintf(stderr, "%4.4lx: ", (unsigned long)i);
@ -81,7 +81,7 @@ void dump(const char *text, unsigned char *ptr, size_t size,
break;
}
fprintf(stderr, "%c",
(ptr[i + c] >= 0x20) && (ptr[i + c]<0x80)?ptr[i + c]:'.');
(ptr[i + c] >= 0x20) && (ptr[i + c] < 0x80) ? ptr[i + c] : '.');
/* check again for 0D0A, to avoid an extra \n if it's at width */
if(nohex && (i + c + 2 < size) && ptr[i + c + 1] == 0x0D &&
ptr[i + c + 2] == 0x0A) {

View file

@ -439,7 +439,7 @@ static int curltest_tweak_handler(request_rec *r)
ap_log_rerror(APLOG_MARK, APLOG_TRACE1, 0, r, "error_handler: processing "
"request, %s", r->args? r->args : "(no args)");
r->status = http_status;
r->clength = with_cl? (chunks * chunk_size) : -1;
r->clength = with_cl ? (chunks * chunk_size) : -1;
r->chunked = (r->proto_num >= HTTP_VERSION(1, 1)) && !with_cl;
apr_table_setn(r->headers_out, "request-id", request_id);
if(r->clength >= 0) {