return 1;
}
-static void helpf(char *fmt, ...)
+static void helpf(const char *fmt, ...)
{
va_list ap;
if(fmt) {
}
struct LongShort {
- char *letter;
- char *lname;
+ const char *letter;
+ const char *lname;
bool extraparam;
};
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;
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) {
}
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)) {
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:
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;
}
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
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;
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);
} replaceid;
struct variable {
- char *name;
+ const char *name;
replaceid id;
};
{"size_upload", VAR_SIZE_UPLOAD},
{"speed_download", VAR_SPEED_DOWNLOAD},
{"speed_upload", VAR_SPEED_UPLOAD},
- {NULL}
+ {NULL, 0}
};
void ourWriteOut(CURL *curl, char *writeinfo)