mirror of
https://github.com/curl/curl.git
synced 2026-08-25 14:53:34 +03:00
cppcheck: fix warnings
- Get rid of variable that was generating false positive warning (unitialized) - Fix issues in tests - Reduce scope of several variables all over etc Closes #2631
This commit is contained in:
parent
38203f1585
commit
c45360d463
61 changed files with 213 additions and 273 deletions
|
|
@ -264,7 +264,7 @@ UNITTEST_START
|
|||
fail_unless(llist_destination.tail != NULL,
|
||||
"llist_destination tail set to null after moving an element");
|
||||
|
||||
fail_unless(llist_destination.tail == llist_destination.tail,
|
||||
fail_unless(llist_destination.tail == llist_destination.head,
|
||||
"llist_destination tail doesn't equal llist_destination head");
|
||||
}
|
||||
UNITTEST_STOP
|
||||
|
|
|
|||
|
|
@ -75,7 +75,6 @@ struct timetest {
|
|||
UNITTEST_START
|
||||
{
|
||||
struct curltime now;
|
||||
time_t timeout;
|
||||
unsigned int i;
|
||||
|
||||
const struct timetest run[] = {
|
||||
|
|
@ -139,6 +138,7 @@ UNITTEST_START
|
|||
data->progress.t_startop.tv_usec = 0;
|
||||
|
||||
for(i = 0; i < sizeof(run)/sizeof(run[0]); i++) {
|
||||
time_t timeout;
|
||||
NOW(run[i].now_s, run[i].now_us);
|
||||
TIMEOUTS(run[i].timeout_ms, run[i].connecttimeout_ms);
|
||||
timeout = Curl_timeleft(data, &now, run[i].connecting);
|
||||
|
|
|
|||
|
|
@ -272,7 +272,7 @@ enum system {
|
|||
UNITTEST_START
|
||||
{
|
||||
int testnum = sizeof(tests) / sizeof(struct testcase);
|
||||
int i, rc;
|
||||
int i;
|
||||
enum system machine;
|
||||
|
||||
#ifdef HAVE_FNMATCH
|
||||
|
|
@ -290,7 +290,7 @@ UNITTEST_START
|
|||
|
||||
for(i = 0; i < testnum; i++) {
|
||||
int result = tests[i].result;
|
||||
rc = Curl_fnmatch(NULL, tests[i].pattern, tests[i].string);
|
||||
int rc = Curl_fnmatch(NULL, tests[i].pattern, tests[i].string);
|
||||
if(result & (LINUX_DIFFER|MAC_DIFFER)) {
|
||||
if((result & LINUX_DIFFER) && (machine == SYSTEM_LINUX))
|
||||
result >>= LINUX_SHIFT;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue