mirror of
https://github.com/curl/curl.git
synced 2026-08-26 04:13:31 +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
|
|
@ -113,12 +113,6 @@ int tool_progress_cb(void *clientp,
|
|||
/* The original progress-bar source code was written for curl by Lars Aas,
|
||||
and this new edition inherits some of his concepts. */
|
||||
|
||||
char line[MAX_BARLENGTH + 1];
|
||||
char format[40];
|
||||
double frac;
|
||||
double percent;
|
||||
int barwidth;
|
||||
int num;
|
||||
struct timeval now = tvnow();
|
||||
struct ProgressData *bar = (struct ProgressData *)clientp;
|
||||
curl_off_t total;
|
||||
|
|
@ -154,6 +148,12 @@ int tool_progress_cb(void *clientp,
|
|||
bar->calls++;
|
||||
|
||||
if((total > 0) && (point != bar->prev)) {
|
||||
char line[MAX_BARLENGTH + 1];
|
||||
char format[40];
|
||||
double frac;
|
||||
double percent;
|
||||
int barwidth;
|
||||
int num;
|
||||
if(point > total)
|
||||
/* we have got more than the expected total! */
|
||||
total = point;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue