aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2007-04-02 03:38:18 +0000
committerYang Tse <yangsita@gmail.com>2007-04-02 03:38:18 +0000
commite4d4ee8db5cc81227c17fa5d750d0a0fe6cba48a (patch)
treedc3fe363eb93f3d67fb6bb178361aeec18777163 /lib
parent8a7d58378b3fa0d33b638113f29ad501e7e62dd8 (diff)
fix compiler warning
Diffstat (limited to 'lib')
-rw-r--r--lib/getinfo.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/lib/getinfo.c b/lib/getinfo.c
index afe549380..c94ca2cb9 100644
--- a/lib/getinfo.c
+++ b/lib/getinfo.c
@@ -78,36 +78,38 @@ CURLcode Curl_getinfo(struct SessionHandle *data, CURLINFO info, ...)
#ifdef MSG_PEEK
char buf;
#endif
- CURLINFO type;
+ int type;
if(!data)
return CURLE_BAD_FUNCTION_ARGUMENT;
va_start(arg, info);
- type = info&CURLINFO_TYPEMASK;
- if(type == CURLINFO_STRING) {
+ type = CURLINFO_TYPEMASK & (int)info;
+ switch(type) {
+ case CURLINFO_STRING:
param_charp = va_arg(arg, char **);
if(NULL == param_charp)
return CURLE_BAD_FUNCTION_ARGUMENT;
- }
- else if(type == CURLINFO_LONG) {
+ break;
+ case CURLINFO_LONG:
param_longp = va_arg(arg, long *);
if(NULL == param_longp)
return CURLE_BAD_FUNCTION_ARGUMENT;
- }
- else if(type == CURLINFO_DOUBLE) {
+ break;
+ case CURLINFO_DOUBLE:
param_doublep = va_arg(arg, double *);
if(NULL == param_doublep)
return CURLE_BAD_FUNCTION_ARGUMENT;
- }
- else if(type == CURLINFO_SLIST) {
+ break;
+ case CURLINFO_SLIST:
param_slistp = va_arg(arg, struct curl_slist **);
if(NULL == param_slistp)
return CURLE_BAD_FUNCTION_ARGUMENT;
- }
- else
+ break;
+ default:
return CURLE_BAD_FUNCTION_ARGUMENT;
+ }
switch(info) {
case CURLINFO_EFFECTIVE_URL: