diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2003-05-22 14:56:57 (GMT) |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2003-05-22 14:56:57 (GMT) |
commit | bf911785658862ed91fd164a02849e65c77e4e07 (patch) | |
tree | 8f340d858bb7235293343f521937d7a1b290f97e /Source/CTest/Curl | |
parent | f5cf6676a77291356907de22c6d2d47f837e701e (diff) | |
download | CMake-bf911785658862ed91fd164a02849e65c77e4e07.zip CMake-bf911785658862ed91fd164a02849e65c77e4e07.tar.gz CMake-bf911785658862ed91fd164a02849e65c77e4e07.tar.bz2 |
ERR: Attempt to fix more Curl warnings
Diffstat (limited to 'Source/CTest/Curl')
-rw-r--r-- | Source/CTest/Curl/getdate.c | 2 | ||||
-rw-r--r-- | Source/CTest/Curl/hostip.c | 4 | ||||
-rw-r--r-- | Source/CTest/Curl/ldap.c | 31 |
3 files changed, 20 insertions, 17 deletions
diff --git a/Source/CTest/Curl/getdate.c b/Source/CTest/Curl/getdate.c index 6cece1f..45d1dcd 100644 --- a/Source/CTest/Curl/getdate.c +++ b/Source/CTest/Curl/getdate.c @@ -1796,7 +1796,7 @@ LookupWord (yylval, buff) /* Make it lowercase. */ for (p = buff; *p; p++) if (ISUPPER ((unsigned int)(*p))) - *p = (char)tolower (*p); + *p = (char)tolower ((unsigned int)(*p)); if (strcmp (buff, "am") == 0 || strcmp (buff, "a.m.") == 0) { diff --git a/Source/CTest/Curl/hostip.c b/Source/CTest/Curl/hostip.c index c2012ca..b525007 100644 --- a/Source/CTest/Curl/hostip.c +++ b/Source/CTest/Curl/hostip.c @@ -474,11 +474,11 @@ static struct hostent* pack_hostent(char** buf, struct hostent* orig) /* now, shrink the allocated buffer to the size we actually need, which most often is only a fraction of the original alloc */ - newbuf=(struct hostent *)realloc(*buf, (int)bufptr-(int)(*buf)); + newbuf=(struct hostent *)realloc(*buf, (int)(bufptr-*buf)); /* if the alloc moved, we need to adjust things again */ if((char*)newbuf != *buf) - hostcache_fixoffset((struct hostent*)newbuf, (int)newbuf-(int)*buf); + hostcache_fixoffset((struct hostent*)newbuf, (int)((char*)newbuf-*buf)); /* setup the return */ *buf = (char*)newbuf; diff --git a/Source/CTest/Curl/ldap.c b/Source/CTest/Curl/ldap.c index 5e26e4b..fb4bb79 100644 --- a/Source/CTest/Curl/ldap.c +++ b/Source/CTest/Curl/ldap.c @@ -54,11 +54,14 @@ #include <curl/mprintf.h> -#define DYNA_GET_FUNCTION(type, fnc) \ - (fnc) = (type)DynaGetFunction(#fnc); \ - if ((fnc) == NULL) { \ - return CURLE_FUNCTION_NOT_FOUND; \ - } \ +#define DYNA_GET_FUNCTION(type, fnc) \ + { \ + void* dyna_get_res = DynaGetFunction(#fnc); \ + (fnc) = *((type)&dyna_get_res); \ + if ((fnc) == NULL) { \ + return CURLE_FUNCTION_NOT_FOUND; \ + } \ + } /*********************************************************************** */ @@ -163,15 +166,15 @@ CURLcode Curl_ldap(struct connectdata *conn) /* The types are needed because ANSI C distinguishes between * pointer-to-object (data) and pointer-to-function. */ - DYNA_GET_FUNCTION(void *(*)(char *, int), ldap_open); - DYNA_GET_FUNCTION(int (*)(void *, char *, char *), ldap_simple_bind_s); - DYNA_GET_FUNCTION(int (*)(void *), ldap_unbind_s); - DYNA_GET_FUNCTION(int (*)(void *, char *, int, void **), ldap_url_search_s); - DYNA_GET_FUNCTION(void *(*)(void *, void *), ldap_first_entry); - DYNA_GET_FUNCTION(void *(*)(void *, void *), ldap_next_entry); - DYNA_GET_FUNCTION(char *(*)(int), ldap_err2string); - DYNA_GET_FUNCTION(int (*)(void *, char *, void *, void *, char **, char **, int (*)(void *, char *, int), void *, char *, int, unsigned long), ldap_entry2text); - DYNA_GET_FUNCTION(int (*)(void *, char *, void *, void *, char **, char **, int (*)(void *, char *, int), void *, char *, int, unsigned long, char *, char *), ldap_entry2html); + DYNA_GET_FUNCTION(void *(**)(char *, int), ldap_open); + DYNA_GET_FUNCTION(int (**)(void *, char *, char *), ldap_simple_bind_s); + DYNA_GET_FUNCTION(int (**)(void *), ldap_unbind_s); + DYNA_GET_FUNCTION(int (**)(void *, char *, int, void **), ldap_url_search_s); + DYNA_GET_FUNCTION(void *(**)(void *, void *), ldap_first_entry); + DYNA_GET_FUNCTION(void *(**)(void *, void *), ldap_next_entry); + DYNA_GET_FUNCTION(char *(**)(int), ldap_err2string); + DYNA_GET_FUNCTION(int (**)(void *, char *, void *, void *, char **, char **, int (*)(void *, char *, int), void *, char *, int, unsigned long), ldap_entry2text); + DYNA_GET_FUNCTION(int (**)(void *, char *, void *, void *, char **, char **, int (*)(void *, char *, int), void *, char *, int, unsigned long, char *, char *), ldap_entry2html); server = ldap_open(conn->hostname, conn->port); if (server == NULL) { |