Tabs, makefile modification and no warnings
This commit is contained in:
parent
3e27f25236
commit
018f0d64e4
3 changed files with 32 additions and 40 deletions
|
@ -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)
|
||||||
|
|
|
@ -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);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Add table
Reference in a new issue