1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-22 08:08:50 -05:00

fix compiler warning

This commit is contained in:
Yang Tse 2007-04-02 03:38:18 +00:00
parent 8a7d58378b
commit e4d4ee8db5

View File

@ -78,36 +78,38 @@ CURLcode Curl_getinfo(struct SessionHandle *data, CURLINFO info, ...)
#ifdef MSG_PEEK #ifdef MSG_PEEK
char buf; char buf;
#endif #endif
CURLINFO type; int type;
if(!data) if(!data)
return CURLE_BAD_FUNCTION_ARGUMENT; return CURLE_BAD_FUNCTION_ARGUMENT;
va_start(arg, info); va_start(arg, info);
type = info&CURLINFO_TYPEMASK; type = CURLINFO_TYPEMASK & (int)info;
if(type == CURLINFO_STRING) { switch(type) {
case CURLINFO_STRING:
param_charp = va_arg(arg, char **); param_charp = va_arg(arg, char **);
if(NULL == param_charp) if(NULL == param_charp)
return CURLE_BAD_FUNCTION_ARGUMENT; return CURLE_BAD_FUNCTION_ARGUMENT;
} break;
else if(type == CURLINFO_LONG) { case CURLINFO_LONG:
param_longp = va_arg(arg, long *); param_longp = va_arg(arg, long *);
if(NULL == param_longp) if(NULL == param_longp)
return CURLE_BAD_FUNCTION_ARGUMENT; return CURLE_BAD_FUNCTION_ARGUMENT;
} break;
else if(type == CURLINFO_DOUBLE) { case CURLINFO_DOUBLE:
param_doublep = va_arg(arg, double *); param_doublep = va_arg(arg, double *);
if(NULL == param_doublep) if(NULL == param_doublep)
return CURLE_BAD_FUNCTION_ARGUMENT; return CURLE_BAD_FUNCTION_ARGUMENT;
} break;
else if(type == CURLINFO_SLIST) { case CURLINFO_SLIST:
param_slistp = va_arg(arg, struct curl_slist **); param_slistp = va_arg(arg, struct curl_slist **);
if(NULL == param_slistp) if(NULL == param_slistp)
return CURLE_BAD_FUNCTION_ARGUMENT; return CURLE_BAD_FUNCTION_ARGUMENT;
} break;
else default:
return CURLE_BAD_FUNCTION_ARGUMENT; return CURLE_BAD_FUNCTION_ARGUMENT;
}
switch(info) { switch(info) {
case CURLINFO_EFFECTIVE_URL: case CURLINFO_EFFECTIVE_URL: