diff --git a/Source/CTest/Curl/getdate.c b/Source/CTest/Curl/getdate.c index 6cece1fcd..45d1dcd3e 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 c2012ca88..b525007d8 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 5e26e4bc7..fb4bb79cf 100644 --- a/Source/CTest/Curl/ldap.c +++ b/Source/CTest/Curl/ldap.c @@ -54,11 +54,14 @@ #include -#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) {