1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-30 06:01:21 +03:00

More janitorial work: remove the explicit casting of NULL literals to a

pointer type when it is not necessary to do so.

For future reference, casting NULL to a pointer type is only necessary
when (a) invoking a function AND either (b) the function has no prototype
OR (c) the function is a varargs function.
This commit is contained in:
Neil Conway
2004-01-07 18:56:30 +00:00
parent afca5d50dc
commit 192ad63bd7
71 changed files with 424 additions and 436 deletions

View File

@@ -3,7 +3,7 @@
* available with a PostgreSQL-compatible license. Kudos Wilfredo
* S<>nchez <wsanchez@apple.com>.
*
* $PostgreSQL: pgsql/src/backend/port/dynloader/darwin.c,v 1.9 2003/11/29 19:51:54 pgsql Exp $
* $PostgreSQL: pgsql/src/backend/port/dynloader/darwin.c,v 1.10 2004/01/07 18:56:27 neilc Exp $
*/
#include "postgres.h"
@@ -50,7 +50,7 @@ pg_dlsym(void *handle, char *funcname)
else
{
free(symname);
return (PGFunction) NULL;
return NULL;
}
}

View File

@@ -52,7 +52,7 @@ BSD44_derived_dlerror(void)
strcpy(ret, error_message);
error_message[0] = 0;
return (ret[0] == 0) ? (char *) NULL : ret;
return (ret[0] == 0) ? NULL : ret;
}
void *
@@ -65,7 +65,7 @@ BSD44_derived_dlopen(const char *file, int num)
#else
void *vp;
if ((vp = dlopen((char *) file, num)) == (void *) NULL)
if ((vp = dlopen((char *) file, num)) == NULL)
snprintf(error_message, sizeof(error_message),
"dlopen '%s' failed. (%s)", file, dlerror());
return vp;
@@ -91,7 +91,7 @@ BSD44_derived_dlsym(void *handle, const char *name)
name = buf;
}
#endif
if ((vp = dlsym(handle, (char *) name)) == (void *) NULL)
if ((vp = dlsym(handle, (char *) name)) == NULL)
snprintf(error_message, sizeof(error_message),
"dlsym (%s) failed", name);
return vp;

View File

@@ -53,7 +53,7 @@ BSD44_derived_dlerror(void)
strcpy(ret, error_message);
error_message[0] = 0;
return (ret[0] == 0) ? (char *) NULL : ret;
return (ret[0] == 0) ? NULL : ret;
}
void *
@@ -66,7 +66,7 @@ BSD44_derived_dlopen(const char *file, int num)
#else
void *vp;
if ((vp = dlopen((char *) file, num)) == (void *) NULL)
if ((vp = dlopen((char *) file, num)) == NULL)
snprintf(error_message, sizeof(error_message),
"dlopen (%s) failed", file);
return vp;
@@ -91,7 +91,7 @@ BSD44_derived_dlsym(void *handle, const char *name)
snprintf(buf, sizeof(buf), "_%s", name);
name = buf;
}
if ((vp = dlsym(handle, (char *) name)) == (void *) NULL)
if ((vp = dlsym(handle, (char *) name)) == NULL)
snprintf(error_message, sizeof(error_message),
"dlsym (%s) failed", name);
return vp;

View File

@@ -53,7 +53,7 @@ BSD44_derived_dlerror(void)
strcpy(ret, error_message);
error_message[0] = 0;
return (ret[0] == 0) ? (char *) NULL : ret;
return (ret[0] == 0) ? NULL : ret;
}
void *
@@ -66,7 +66,7 @@ BSD44_derived_dlopen(const char *file, int num)
#else
void *vp;
if ((vp = dlopen((char *) file, num)) == (void *) NULL)
if ((vp = dlopen((char *) file, num)) == NULL)
snprintf(error_message, sizeof(error_message),
"dlopen (%s) failed", file);
return vp;
@@ -91,7 +91,7 @@ BSD44_derived_dlsym(void *handle, const char *name)
snprintf(buf, sizeof(buf), "_%s", name);
name = buf;
}
if ((vp = dlsym(handle, (char *) name)) == (void *) NULL)
if ((vp = dlsym(handle, (char *) name)) == NULL)
snprintf(error_message, sizeof(error_message),
"dlsym (%s) failed", name);
return vp;

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/port/dynloader/qnx4.c,v 1.5 2003/11/29 19:51:54 pgsql Exp $
* $PostgreSQL: pgsql/src/backend/port/dynloader/qnx4.c,v 1.6 2004/01/07 18:56:27 neilc Exp $
*
* NOTES
*
@@ -28,7 +28,7 @@
void *
pg_dlopen(char *filename)
{
return (void *) NULL;
return NULL;
}
PGFunction