mirror of
https://github.com/postgres/postgres.git
synced 2025-07-27 12:41:57 +03:00
Clean up unnecessary unportability and compiler warnings by removing the
cmp parameter for pg_scandir(). The code failed to support this anyway for Sun/Windows, so pretending we could accept a parameter other than NULL was just asking for trouble.
This commit is contained in:
@ -239,8 +239,8 @@ copy_file(const char *srcfile, const char *dstfile, bool force)
|
||||
*/
|
||||
int
|
||||
pg_scandir(migratorContext *ctx, const char *dirname,
|
||||
struct dirent *** namelist, int (*selector) (const struct dirent *),
|
||||
int (*cmp) (const void *, const void *))
|
||||
struct dirent ***namelist,
|
||||
int (*selector) (const struct dirent *))
|
||||
{
|
||||
#if defined(sun) || defined(WIN32)
|
||||
return pg_scandir_internal(ctx, dirname, namelist, selector);
|
||||
@ -258,10 +258,10 @@ pg_scandir(migratorContext *ctx, const char *dirname,
|
||||
*/
|
||||
#elif defined(freebsd) || defined(bsdi) || defined(darwin) || defined(openbsd)
|
||||
/* no const */
|
||||
return scandir(dirname, namelist, (int (*) (struct dirent *)) selector, cmp);
|
||||
return scandir(dirname, namelist, (int (*) (struct dirent *)) selector, NULL);
|
||||
#else
|
||||
/* use const */
|
||||
return scandir(dirname, namelist, selector, cmp);
|
||||
return scandir(dirname, namelist, selector, NULL);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user