diff options
author | Marian Klymov <nekto1989@gmail.com> | 2018-06-02 23:52:56 +0300 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2018-06-11 11:14:48 +0200 |
commit | c45360d4633850839bb9c2d77dbf8a8285e9ad49 (patch) | |
tree | 20159c553a74ed98c2431fc8f2852067f79ac4e9 /lib/multi.c | |
parent | 38203f1585da53e07e54e37c7d5da4d72f509a2e (diff) | |
download | curl-c45360d4633850839bb9c2d77dbf8a8285e9ad49.tar.gz |
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
Diffstat (limited to 'lib/multi.c')
-rw-r--r-- | lib/multi.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/multi.c b/lib/multi.c index b318ce713..9cad600e2 100644 --- a/lib/multi.c +++ b/lib/multi.c @@ -917,7 +917,6 @@ CURLMcode curl_multi_fdset(struct Curl_multi *multi, struct Curl_easy *data; int this_max_fd = -1; curl_socket_t sockbunch[MAX_SOCKSPEREASYHANDLE]; - int bitmap; int i; (void)exc_fd_set; /* not used */ @@ -929,7 +928,7 @@ CURLMcode curl_multi_fdset(struct Curl_multi *multi, data = multi->easyp; while(data) { - bitmap = multi_getsock(data, sockbunch, MAX_SOCKSPEREASYHANDLE); + int bitmap = multi_getsock(data, sockbunch, MAX_SOCKSPEREASYHANDLE); for(i = 0; i< MAX_SOCKSPEREASYHANDLE; i++) { curl_socket_t s = CURL_SOCKET_BAD; @@ -2943,7 +2942,6 @@ void Curl_expire(struct Curl_easy *data, time_t milli, expire_id id) { struct Curl_multi *multi = data->multi; struct curltime *nowp = &data->state.expiretime; - int rc; struct curltime set; /* this is only interesting while there is still an associated multi struct @@ -2974,6 +2972,7 @@ void Curl_expire(struct Curl_easy *data, time_t milli, expire_id id) Compare if the new time is earlier, and only remove-old/add-new if it is. */ timediff_t diff = Curl_timediff(set, *nowp); + int rc; if(diff > 0) { /* The current splay tree entry is sooner than this new expiry time. @@ -3019,7 +3018,6 @@ void Curl_expire_clear(struct Curl_easy *data) { struct Curl_multi *multi = data->multi; struct curltime *nowp = &data->state.expiretime; - int rc; /* this is only interesting while there is still an associated multi struct remaining! */ @@ -3030,6 +3028,7 @@ void Curl_expire_clear(struct Curl_easy *data) /* Since this is an cleared time, we must remove the previous entry from the splay tree */ struct curl_llist *list = &data->state.timeoutlist; + int rc; rc = Curl_splayremovebyaddr(multi->timetree, &data->state.timenode, |