Tabs, makefile modification and no warnings

This commit is contained in:
qorg11 2021-03-10 09:49:56 +01:00
parent 3e27f25236
commit 018f0d64e4
No known key found for this signature in database
GPG key ID: 343FC20A4ACA62B9
3 changed files with 32 additions and 40 deletions

View file

@ -3,7 +3,7 @@
TARGET = clainsafecli TARGET = clainsafecli
OBJS = clainsafecli.o OBJS = clainsafecli.o
CC = cc CC = cc
CFLAGS = -MD -Wall -Wextra -O2 -march=native -lcurl CFLAGS = -MD -std=c11 -Wall -Wextra -O2 -march=native -lcurl
$(TARGET): clainsafecli.o $(TARGET): clainsafecli.o
$(CC) $(CFLAGS) $(OBJS) -o $(TARGET) $(CC) $(CFLAGS) $(OBJS) -o $(TARGET)

View file

@ -144,13 +144,6 @@ main(int argc, char **argv)
CURLFORM_COPYCONTENTS,argv[optind], CURLFORM_COPYCONTENTS,argv[optind],
CURLFORM_END); CURLFORM_END);
/* Progress bar
*
* TODO: Use a custom progress bar rather than
* default curl progress bar
*
*/
curl_easy_setopt(easy_handle,CURLOPT_NOPROGRESS,silent_flag); curl_easy_setopt(easy_handle,CURLOPT_NOPROGRESS,silent_flag);
curl_easy_setopt(easy_handle,CURLOPT_PROGRESSFUNCTION,progress); curl_easy_setopt(easy_handle,CURLOPT_PROGRESSFUNCTION,progress);
@ -174,7 +167,7 @@ main(int argc, char **argv)
return 0; return 0;
} }
static size_t size_t
write_data(void *buffer, size_t size, size_t nmemb, write_data(void *buffer, size_t size, size_t nmemb,
void *userp) void *userp)
{ {
@ -223,12 +216,11 @@ progress(void *clientp,
double ultotal, double ultotal,
double ulnow) double ulnow)
{ {
clientp = NULL; /* So I don't get a warning */
dltotal = 0; clientp++;
dlnow = 0; dltotal += 1;
dlnow += 1;
printf("\r%0.f uploaded of %0.f (%0.f%%)",ulnow,ultotal, printf("\r%0.f uploaded of %0.f (%0.f%%)",ulnow,ultotal,
ulnow*100/ultotal); ulnow*100/ultotal);
fflush(stdout); fflush(stdout);
} }

View file

@ -1,7 +1,7 @@
#include <stdlib.h> #include <stdlib.h>
size_t size_t
static write_data(void *buffer, size_t size, size_t nmemb, write_data(void *buffer, size_t size, size_t nmemb,
void *userp); void *userp);
void void