Make more human readable and maintainable previous

compiler warning fix since it was Ok and actually
avoids the targeted compiler warning.
This commit is contained in:
Yang Tse
2006-10-29 14:58:59 +00:00
parent 1be60dde7f
commit ba481718a4
2 changed files with 23 additions and 9 deletions

View File

@@ -3,7 +3,7 @@
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2006, Daniel Stenberg, <daniel@haxx.se>, et al.
*
@@ -115,6 +115,13 @@
#undef HAVE_LIBDL
#endif
/*
* We use this ZERO_NULL to avoid picky compiler warnings,
* when assigning a NULL pointer to a function pointer var.
*/
#define ZERO_NULL 0
typedef void * (*dynafunc)(void *input);
/***********************************************************************
@@ -189,7 +196,7 @@ static void DynaClose(void)
static dynafunc DynaGetFunction(const char *name)
{
dynafunc func = (void *(*)(void *))0;
dynafunc func = (dynafunc)ZERO_NULL;
#if defined(HAVE_DLOPEN) || defined(HAVE_LIBDL)
if (libldap) {