mirror of
https://github.com/curl/curl.git
synced 2026-08-24 19:03:40 +03:00
build: fix -Wformat-signedness by adjusting printf masks
- sync printf masks with the passed value. - fix a couple of casts. Cherry-picked from #20848 Closes #21335
This commit is contained in:
parent
54cc65595d
commit
548c16a824
56 changed files with 127 additions and 127 deletions
|
|
@ -45,7 +45,7 @@ static CURLcode test_unit1323(const char *arg)
|
|||
for(i = 0; i < CURL_ARRAYSIZE(tests); i++) {
|
||||
timediff_t result = curlx_timediff_ms(tests[i].first, tests[i].second);
|
||||
if(result != tests[i].result) {
|
||||
curl_mprintf("%ld.%06u to %ld.%06u got %" FMT_TIMEDIFF_T
|
||||
curl_mprintf("%ld.%06d to %ld.%06d got %" FMT_TIMEDIFF_T
|
||||
", but expected %" FMT_TIMEDIFF_T "\n",
|
||||
(long)tests[i].first.tv_sec,
|
||||
tests[i].first.tv_usec,
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ static CURLcode test_unit1652(const char *arg)
|
|||
fail_unless(verify(output, input) == 0, "Simple string test");
|
||||
|
||||
/* Injecting a few different variables with a format */
|
||||
Curl_infof(easy, "%s %u testing %lu", input, 42, 43L);
|
||||
Curl_infof(easy, "%s %d testing %ld", input, 42, 43L);
|
||||
fail_unless(verify(output, "Simple Test 42 testing 43\n") == 0,
|
||||
"Format string");
|
||||
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ static CURLcode test_unit1660(const char *arg)
|
|||
continue;
|
||||
}
|
||||
else if(result) {
|
||||
curl_mprintf("Input %u: error %d\n", i, (int)result);
|
||||
curl_mprintf("Input %d: error %d\n", i, (int)result);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ static CURLcode test_unit1664(const char *arg)
|
|||
const char *line = wordparse[i];
|
||||
const char *orgline = line;
|
||||
int rc = curlx_str_word(&line, &out, 7);
|
||||
curl_mprintf("%u: (\"%s\") %d, \"%.*s\" [%d], line %d\n",
|
||||
curl_mprintf("%d: (\"%s\") %d, \"%.*s\" [%d], line %d\n",
|
||||
i, orgline, rc, (int)out.len, out.str, (int)out.len,
|
||||
(int)(line - orgline));
|
||||
}
|
||||
|
|
@ -72,7 +72,7 @@ static CURLcode test_unit1664(const char *arg)
|
|||
const char *line = wordparse[i];
|
||||
const char *orgline = line;
|
||||
int rc = curlx_str_until(&line, &out, 7, 'd');
|
||||
curl_mprintf("%u: (\"%s\") %d, \"%.*s\" [%d], line %d\n",
|
||||
curl_mprintf("%d: (\"%s\") %d, \"%.*s\" [%d], line %d\n",
|
||||
i, orgline, rc, (int)out.len, out.str, (int)out.len,
|
||||
(int)(line - orgline));
|
||||
}
|
||||
|
|
@ -105,7 +105,7 @@ static CURLcode test_unit1664(const char *arg)
|
|||
const char *line = qwords[i];
|
||||
const char *orgline = line;
|
||||
int rc = curlx_str_quotedword(&line, &out, 7);
|
||||
curl_mprintf("%u: (\"%s\") %d, \"%.*s\" [%d], line %d\n",
|
||||
curl_mprintf("%d: (\"%s\") %d, \"%.*s\" [%d], line %d\n",
|
||||
i, orgline, rc, (int)out.len, out.str, (int)out.len,
|
||||
(int)(line - orgline));
|
||||
}
|
||||
|
|
@ -127,7 +127,7 @@ static CURLcode test_unit1664(const char *arg)
|
|||
const char *line = single[i];
|
||||
const char *orgline = line;
|
||||
int rc = curlx_str_single(&line, 'a');
|
||||
curl_mprintf("%u: (\"%s\") %d, line %d\n",
|
||||
curl_mprintf("%d: (\"%s\") %d, line %d\n",
|
||||
i, orgline, rc, (int)(line - orgline));
|
||||
}
|
||||
}
|
||||
|
|
@ -150,7 +150,7 @@ static CURLcode test_unit1664(const char *arg)
|
|||
const char *line = single[i];
|
||||
const char *orgline = line;
|
||||
int rc = curlx_str_singlespace(&line);
|
||||
curl_mprintf("%u: (\"%s\") %d, line %d\n",
|
||||
curl_mprintf("%d: (\"%s\") %d, line %d\n",
|
||||
i, orgline, rc, (int)(line - orgline));
|
||||
}
|
||||
}
|
||||
|
|
@ -171,7 +171,7 @@ static CURLcode test_unit1664(const char *arg)
|
|||
const char *line = single[i];
|
||||
const char *orgline = line;
|
||||
int rc = curlx_str_single(&line, 'a');
|
||||
curl_mprintf("%u: (\"%s\") %d, line %d\n",
|
||||
curl_mprintf("%d: (\"%s\") %d, line %d\n",
|
||||
i, orgline, rc, (int)(line - orgline));
|
||||
}
|
||||
}
|
||||
|
|
@ -198,7 +198,7 @@ static CURLcode test_unit1664(const char *arg)
|
|||
const char *line = nums[i];
|
||||
const char *orgline = line;
|
||||
int rc = curlx_str_number(&line, &num, 1235);
|
||||
curl_mprintf("%u: (\"%s\") %d, [%" CURL_FORMAT_CURL_OFF_T "] line %d\n",
|
||||
curl_mprintf("%d: (\"%s\") %d, [%" CURL_FORMAT_CURL_OFF_T "] line %d\n",
|
||||
i, orgline, rc, num, (int)(line - orgline));
|
||||
}
|
||||
}
|
||||
|
|
@ -230,7 +230,7 @@ static CURLcode test_unit1664(const char *arg)
|
|||
const char *line = nums[i].str;
|
||||
const char *orgline = line;
|
||||
int rc = curlx_str_number(&line, &num, nums[i].max);
|
||||
curl_mprintf("%u: (\"%s\") max %" CURL_FORMAT_CURL_OFF_T
|
||||
curl_mprintf("%d: (\"%s\") max %" CURL_FORMAT_CURL_OFF_T
|
||||
" == %d, [%" CURL_FORMAT_CURL_OFF_T "]\n",
|
||||
i, orgline, nums[i].max, rc, num);
|
||||
}
|
||||
|
|
@ -270,7 +270,7 @@ static CURLcode test_unit1664(const char *arg)
|
|||
const char *line = nums[i].str;
|
||||
const char *orgline = line;
|
||||
int rc = curlx_str_hex(&line, &num, nums[i].max);
|
||||
curl_mprintf("%u: (\"%s\") max %" CURL_FORMAT_CURL_OFF_T
|
||||
curl_mprintf("%d: (\"%s\") max %" CURL_FORMAT_CURL_OFF_T
|
||||
" == %d, [%" CURL_FORMAT_CURL_OFF_T "]\n",
|
||||
i, orgline, nums[i].max, rc, num);
|
||||
}
|
||||
|
|
@ -305,7 +305,7 @@ static CURLcode test_unit1664(const char *arg)
|
|||
const char *line = nums[i].str;
|
||||
const char *orgline = line;
|
||||
int rc = curlx_str_octal(&line, &num, nums[i].max);
|
||||
curl_mprintf("%u: (\"%s\") max %" CURL_FORMAT_CURL_OFF_T
|
||||
curl_mprintf("%d: (\"%s\") max %" CURL_FORMAT_CURL_OFF_T
|
||||
" == %d, [%" CURL_FORMAT_CURL_OFF_T "]\n",
|
||||
i, orgline, nums[i].max, rc, num);
|
||||
}
|
||||
|
|
@ -341,7 +341,7 @@ static CURLcode test_unit1664(const char *arg)
|
|||
const char *line = nums[i];
|
||||
const char *orgline = line;
|
||||
int rc = curlx_str_number(&line, &num, CURL_OFF_T_MAX);
|
||||
curl_mprintf("%u: (\"%s\") %d, [%" CURL_FORMAT_CURL_OFF_T "] line %d\n",
|
||||
curl_mprintf("%d: (\"%s\") %d, [%" CURL_FORMAT_CURL_OFF_T "] line %d\n",
|
||||
i, orgline, rc, num, (int)(line - orgline));
|
||||
}
|
||||
}
|
||||
|
|
@ -366,7 +366,7 @@ static CURLcode test_unit1664(const char *arg)
|
|||
const char *line = newl[i];
|
||||
const char *orgline = line;
|
||||
int rc = curlx_str_newline(&line);
|
||||
curl_mprintf("%u: (%%%02x) %d, line %d\n",
|
||||
curl_mprintf("%d: (%%%02x) %d, line %d\n",
|
||||
i, *orgline, rc, (int)(line - orgline));
|
||||
}
|
||||
}
|
||||
|
|
@ -393,7 +393,7 @@ static CURLcode test_unit1664(const char *arg)
|
|||
const char *line = nums[i];
|
||||
const char *orgline = line;
|
||||
int rc = curlx_str_hex(&line, &num, 0x1235);
|
||||
curl_mprintf("%u: (\"%s\") %d, [%" CURL_FORMAT_CURL_OFF_T "] line %d\n",
|
||||
curl_mprintf("%d: (\"%s\") %d, [%" CURL_FORMAT_CURL_OFF_T "] line %d\n",
|
||||
i, orgline, rc, num, (int)(line - orgline));
|
||||
}
|
||||
}
|
||||
|
|
@ -420,7 +420,7 @@ static CURLcode test_unit1664(const char *arg)
|
|||
const char *line = nums[i];
|
||||
const char *orgline = line;
|
||||
int rc = curlx_str_octal(&line, &num, 01235);
|
||||
curl_mprintf("%u: (\"%s\") %d, [%" CURL_FORMAT_CURL_OFF_T "] line %d\n",
|
||||
curl_mprintf("%d: (\"%s\") %d, [%" CURL_FORMAT_CURL_OFF_T "] line %d\n",
|
||||
i, orgline, rc, num, (int)(line - orgline));
|
||||
}
|
||||
}
|
||||
|
|
@ -444,7 +444,7 @@ static CURLcode test_unit1664(const char *arg)
|
|||
const char *line = nums[i];
|
||||
const char *orgline = line;
|
||||
int rc = curlx_str_octal(&line, &num, CURL_OFF_T_MAX);
|
||||
curl_mprintf("%u: (\"%s\") %d, [%" CURL_FORMAT_CURL_OFF_T "] line %d\n",
|
||||
curl_mprintf("%d: (\"%s\") %d, [%" CURL_FORMAT_CURL_OFF_T "] line %d\n",
|
||||
i, orgline, rc, num, (int)(line - orgline));
|
||||
}
|
||||
}
|
||||
|
|
@ -480,7 +480,7 @@ static CURLcode test_unit1664(const char *arg)
|
|||
const char *line = nums[i];
|
||||
const char *orgline = line;
|
||||
int rc = curlx_str_hex(&line, &num, CURL_OFF_T_MAX);
|
||||
curl_mprintf("%u: (\"%s\") %d, [%" CURL_FORMAT_CURL_OFF_T "] line %d\n",
|
||||
curl_mprintf("%d: (\"%s\") %d, [%" CURL_FORMAT_CURL_OFF_T "] line %d\n",
|
||||
i, orgline, rc, num, (int)(line - orgline));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -185,7 +185,7 @@ static CURLcode test_unit1675(const char *arg)
|
|||
uc = urlencode_str(&out, tests[i].in, strlen(tests[i].in),
|
||||
tests[i].relative, tests[i].query);
|
||||
if(uc || strcmp(curlx_dyn_ptr(&out), tests[i].out)) {
|
||||
curl_mfprintf(stderr, "urlencode_str('%s', query=%d) failed:"
|
||||
curl_mfprintf(stderr, "urlencode_str('%s', query=%u) failed:"
|
||||
" expected '%s', got '%s'\n",
|
||||
tests[i].in, tests[i].query, tests[i].out,
|
||||
uc ? "error" : curlx_dyn_ptr(&out));
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ static void parse_success(const struct tcase *t)
|
|||
in_consumed += nread;
|
||||
if(nread != buflen) {
|
||||
if(!p.done) {
|
||||
curl_mfprintf(stderr, "only %zd/%zu consumed for: '%s'\n",
|
||||
curl_mfprintf(stderr, "only %zu/%zu consumed for: '%s'\n",
|
||||
nread, buflen, buf);
|
||||
fail("not all consumed");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ static CURLcode test_unit2604(const char *arg)
|
|||
char *path;
|
||||
const char *cp = i == 0 ? cp0 : list[i].cp;
|
||||
CURLcode result = Curl_get_pathname(&cp, &path, list[i].home);
|
||||
curl_mprintf("%u - Curl_get_pathname(\"%s\", ... \"%s\") == %u\n", i,
|
||||
curl_mprintf("%d - Curl_get_pathname(\"%s\", ... \"%s\") == %d\n", i,
|
||||
list[i].cp, list[i].home, list[i].result);
|
||||
if(result != list[i].result) {
|
||||
curl_mprintf("... returned %d\n", result);
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ static CURLcode test_unit2605(const char *arg)
|
|||
curl_off_t start;
|
||||
curl_off_t size;
|
||||
CURLcode result;
|
||||
curl_mprintf("%u: '%s' (file size: %" FMT_OFF_T ")\n", i, list[i].r,
|
||||
curl_mprintf("%d: '%s' (file size: %" FMT_OFF_T ")\n", i, list[i].r,
|
||||
list[i].filesize);
|
||||
result = Curl_ssh_range(curl, list[i].r, list[i].filesize, &start,
|
||||
&size);
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ static CURLcode test_unit3200(const char *arg)
|
|||
fp = curlx_fopen(arg, "rb");
|
||||
abort_unless(fp != NULL, "Cannot open testfile");
|
||||
|
||||
curl_mfprintf(stderr, "Test %zd...", i);
|
||||
curl_mfprintf(stderr, "Test %zu...", i);
|
||||
switch(i) {
|
||||
case 0:
|
||||
result = Curl_get_line(&buf, fp, &eof);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue