aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2000-11-21 09:38:41 +0000
committerDaniel Stenberg <daniel@haxx.se>2000-11-21 09:38:41 +0000
commit7b49d40bb0509a5fe5371a2bb90c1209abfbc29b (patch)
tree23f37f9335159ecee1bd78eb9f2a9ed20ae69857 /src
parent3e5ba33e2dcf2fe5959ee63e46944d2b2e2f1aa5 (diff)
removed pedantic compiler warnings
Diffstat (limited to 'src')
-rw-r--r--src/main.c51
-rw-r--r--src/urlglob.h1
-rw-r--r--src/writeout.c4
3 files changed, 12 insertions, 44 deletions
diff --git a/src/main.c b/src/main.c
index a1d0e1c9c..eeb5a3502 100644
--- a/src/main.c
+++ b/src/main.c
@@ -53,6 +53,8 @@
#include <curl/mprintf.h>
#include "urlglob.h"
+#include "writeout.h"
+
#define CURLseparator "--_curl_--"
#define MIMEseparator "_curl_"
@@ -360,7 +362,6 @@ struct Configurable {
static int parseconfig(char *filename,
struct Configurable *config);
static char *my_get_line(FILE *fp);
-static char *my_get_token(const char *line);
static void GetStr(char **string,
char *value)
@@ -408,14 +409,13 @@ static char *file2string(FILE *file)
static char *file2memory(FILE *file, long *size)
{
char buffer[1024];
- char *ptr;
char *string=NULL;
char *newstring=NULL;
long len=0;
long stringlen=0;
if(file) {
- while(len = fread(buffer, 1, sizeof(buffer), file)) {
+ while((len = fread(buffer, 1, sizeof(buffer), file))) {
if(string) {
newstring = realloc(string, len+stringlen);
if(newstring)
@@ -708,7 +708,6 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */
/* the data begins with a '@' letter, it means that a file name
or - (stdin) follows */
FILE *file;
- char *ptr;
nextarg++; /* pass the @ */
@@ -962,7 +961,6 @@ static int parseconfig(char *filename,
{
int res;
FILE *file;
- char configbuffer[4096];
char filebuffer[256];
bool usedarg;
char *home=NULL;
@@ -1007,7 +1005,7 @@ static int parseconfig(char *filename,
alloced_param=FALSE;
/* lines with # in the fist column is a comment! */
- while(isspace(*line))
+ while(isspace((int)*line))
line++;
switch(*line) {
@@ -1023,7 +1021,7 @@ static int parseconfig(char *filename,
/* the option keywords starts here */
option = line;
- while(*line && !isspace(*line) && !isseparator(*line))
+ while(*line && !isspace((int)*line) && !isseparator(*line))
line++;
/* ... and has ended here */
@@ -1034,7 +1032,7 @@ static int parseconfig(char *filename,
#endif
/* pass spaces and separator(s) */
- while(isspace(*line) || isseparator(*line))
+ while(isspace((int)*line) || isseparator(*line))
line++;
/* the parameter starts here (unless quoted) */
@@ -1079,7 +1077,7 @@ static int parseconfig(char *filename,
}
else {
param=line; /* parameter starts here */
- while(*line && !isspace(*line))
+ while(*line && !isspace((int)*line))
line++;
*line=0; /* zero terminate */
}
@@ -1185,8 +1183,6 @@ int myprogress (void *clientp,
int barwidth;
int num;
int i;
- int prevblock;
- int thisblock;
struct ProgressData *bar = (struct ProgressData *)clientp;
size_t total = dltotal + ultotal;
@@ -1774,36 +1770,3 @@ static char *my_get_line(FILE *fp)
return retval;
}
-
-static char *my_get_token(const char *line)
-{
- static const char *save = NULL;
- const char *first = NULL;
- const char *last = NULL;
- char *retval = NULL;
- size_t size;
-
- if (NULL == line)
- line = save;
- if (NULL == line)
- return NULL;
-
- while (('\0' != *line) && (isspace(*line)))
- line++;
- first = line;
- while (('\0' != *line) && (!isspace(*line)))
- line++;
- save = line;
- while ('\0' != *line)
- line++;
- last = line;
-
- size = last - first;
- if (0 == size)
- return NULL;
- if (NULL == (retval = malloc(size + 1)))
- return NULL;
- memcpy(retval, first, size);
- retval[size] = '\0';
- return retval;
-}
diff --git a/src/urlglob.h b/src/urlglob.h
index d364f095e..4cb445106 100644
--- a/src/urlglob.h
+++ b/src/urlglob.h
@@ -70,5 +70,6 @@ typedef struct {
int glob_url(URLGlob**, char*, int *);
char* next_url(URLGlob*);
char* match_url(char*, URLGlob);
+void glob_cleanup(URLGlob* glob);
#endif
diff --git a/src/writeout.c b/src/writeout.c
index be48f84cc..a269d607b 100644
--- a/src/writeout.c
+++ b/src/writeout.c
@@ -44,6 +44,8 @@
#include <curl/curl.h>
#include <curl/types.h>
#include <curl/easy.h>
+
+#define _MPRINTF_REPLACE /* we want curl-functions instead of native ones */
#include <curl/mprintf.h>
#include "writeout.h"
@@ -175,6 +177,8 @@ void ourWriteOut(CURL *curl, char *writeinfo)
curl_easy_getinfo(curl, CURLINFO_SPEED_UPLOAD, &doubleinfo))
fprintf(stream, "%.3f", doubleinfo);
break;
+ default:
+ break;
}
break;
}