aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2001-08-14 09:16:46 +0000
committerDaniel Stenberg <daniel@haxx.se>2001-08-14 09:16:46 +0000
commit3a37c0ae23311230a85507d51023c120311bf6a7 (patch)
treebefc85a20302a15a78ffea4ad3caa08f620adcb9
parentccb3a13ce6ad5e5c3c5e0411ca57c8dd904f3d0d (diff)
(un)signed and const cleanup
-rw-r--r--src/main.c20
-rw-r--r--src/urlglob.c6
-rw-r--r--src/writeout.c4
3 files changed, 15 insertions, 15 deletions
diff --git a/src/main.c b/src/main.c
index 8e3a7a383..a70fc5947 100644
--- a/src/main.c
+++ b/src/main.c
@@ -269,7 +269,7 @@ int SetHTTPrequest(HttpReq req, HttpReq *store)
return 1;
}
-static void helpf(char *fmt, ...)
+static void helpf(const char *fmt, ...)
{
va_list ap;
if(fmt) {
@@ -363,8 +363,8 @@ static void help(void)
}
struct LongShort {
- char *letter;
- char *lname;
+ const char *letter;
+ const char *lname;
bool extraparam;
};
@@ -573,9 +573,9 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */
char letter;
char subletter=0; /* subletters can only occur on long options */
- char *parse=NULL;
+ const char *parse=NULL;
int res;
- int j;
+ unsigned int j;
time_t now;
int hit=-1;
bool longopt=FALSE;
@@ -715,7 +715,7 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */
return PARAM_OPTION_UNKNOWN;
}
if(!longopt && aliases[hit].extraparam && parse[1]) {
- nextarg=&parse[1]; /* this is the actual extra parameter */
+ nextarg=(char *)&parse[1]; /* this is the actual extra parameter */
singleopt=TRUE; /* don't loop anymore after this */
}
else if((!nextarg || !*nextarg) && aliases[hit].extraparam) {
@@ -1146,7 +1146,7 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */
}
now=time(NULL);
config->condtime=curl_getdate(nextarg, &now);
- if(((unsigned ) ~0) == config->condtime) {
+ if(-1 == (int)config->condtime) {
/* now let's see if it is a file name to get the time from instead! */
struct stat statbuf;
if(-1 == stat(nextarg, &statbuf)) {
@@ -1311,10 +1311,10 @@ static int parseconfig(char *filename,
if(res != PARAM_OK) {
/* the help request isn't really an error */
if(!strcmp(filename, "-")) {
- filename="<stdin>";
+ filename=(char *)"<stdin>";
}
if(PARAM_HELP_REQUESTED != res) {
- char *reason;
+ const char *reason;
switch(res) {
default:
case PARAM_GOT_EXTRA_PARAMETER:
@@ -1623,7 +1623,7 @@ operate(struct Configurable *config, int argc, char *argv[])
else {
bool used;
/* just add the URL please */
- res = getparameter("--url", argv[i], &used, config);
+ res = getparameter((char *)"--url", argv[i], &used, config);
if(res)
return res;
}
diff --git a/src/urlglob.c b/src/urlglob.c
index 69d33c958..c6b6dd731 100644
--- a/src/urlglob.c
+++ b/src/urlglob.c
@@ -395,7 +395,7 @@ char *match_url(char *filename, URLGlob *glob)
int stringlen=0;
char numbuf[18];
char *appendthis;
- size_t appendlen;
+ int appendlen;
/* We cannot use the glob_buffer for storage here since the filename may
* be longer than the URL we use. We allocate a good start size, then
@@ -424,7 +424,7 @@ char *match_url(char *filename, URLGlob *glob)
switch (pat.type) {
case UPTSet:
appendthis = pat.content.Set.elements[pat.content.Set.ptr_s];
- appendlen = strlen(pat.content.Set.elements[pat.content.Set.ptr_s]);
+ appendlen = (int)strlen(pat.content.Set.elements[pat.content.Set.ptr_s]);
break;
case UPTCharRange:
numbuf[0]=pat.content.CharRange.ptr_c;
@@ -435,7 +435,7 @@ char *match_url(char *filename, URLGlob *glob)
case UPTNumRange:
sprintf(numbuf, "%0*d", pat.content.NumRange.padlength, pat.content.NumRange.ptr_n);
appendthis = numbuf;
- appendlen = strlen(numbuf);
+ appendlen = (int)strlen(numbuf);
break;
default:
printf("internal error: invalid pattern type (%d)\n", pat.type);
diff --git a/src/writeout.c b/src/writeout.c
index 7f2fa907a..2c1b3aa24 100644
--- a/src/writeout.c
+++ b/src/writeout.c
@@ -49,7 +49,7 @@ typedef enum {
} replaceid;
struct variable {
- char *name;
+ const char *name;
replaceid id;
};
@@ -67,7 +67,7 @@ static struct variable replacements[]={
{"size_upload", VAR_SIZE_UPLOAD},
{"speed_download", VAR_SPEED_DOWNLOAD},
{"speed_upload", VAR_SPEED_UPLOAD},
- {NULL}
+ {NULL, 0}
};
void ourWriteOut(CURL *curl, char *writeinfo)