mirror of
https://github.com/postgres/postgres.git
synced 2025-06-30 21:42:05 +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:
@ -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;
|
||||
|
Reference in New Issue
Block a user