ERR: Attempt to fix more Curl warnings

This commit is contained in:
Andy Cedilnik 2003-05-22 10:56:57 -04:00
parent f5cf6676a7
commit bf91178565
3 changed files with 20 additions and 17 deletions

View File

@ -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)
{

View File

@ -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;

View File

@ -55,10 +55,13 @@
#define DYNA_GET_FUNCTION(type, fnc) \
(fnc) = (type)DynaGetFunction(#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) {