mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-09 08:10:09 +08: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:
parent
b460b5cd11
commit
c9c25a982c
@ -239,8 +239,8 @@ copy_file(const char *srcfile, const char *dstfile, bool force)
|
|||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
pg_scandir(migratorContext *ctx, const char *dirname,
|
pg_scandir(migratorContext *ctx, const char *dirname,
|
||||||
struct dirent *** namelist, int (*selector) (const struct dirent *),
|
struct dirent ***namelist,
|
||||||
int (*cmp) (const void *, const void *))
|
int (*selector) (const struct dirent *))
|
||||||
{
|
{
|
||||||
#if defined(sun) || defined(WIN32)
|
#if defined(sun) || defined(WIN32)
|
||||||
return pg_scandir_internal(ctx, dirname, namelist, selector);
|
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)
|
#elif defined(freebsd) || defined(bsdi) || defined(darwin) || defined(openbsd)
|
||||||
/* no const */
|
/* no const */
|
||||||
return scandir(dirname, namelist, (int (*) (struct dirent *)) selector, cmp);
|
return scandir(dirname, namelist, (int (*) (struct dirent *)) selector, NULL);
|
||||||
#else
|
#else
|
||||||
/* use const */
|
/* use const */
|
||||||
return scandir(dirname, namelist, selector, cmp);
|
return scandir(dirname, namelist, selector, NULL);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -330,8 +330,8 @@ typedef void *pageCnvCtx;
|
|||||||
|
|
||||||
int dir_matching_filenames(const struct dirent *scan_ent);
|
int dir_matching_filenames(const struct dirent *scan_ent);
|
||||||
int pg_scandir(migratorContext *ctx, const char *dirname,
|
int pg_scandir(migratorContext *ctx, const char *dirname,
|
||||||
struct dirent ***namelist, int (*selector) (const struct dirent *),
|
struct dirent ***namelist,
|
||||||
int (*cmp) (const void *, const void *));
|
int (*selector) (const struct dirent *));
|
||||||
const char *copyAndUpdateFile(migratorContext *ctx,
|
const char *copyAndUpdateFile(migratorContext *ctx,
|
||||||
pageCnvCtx *pageConverter, const char *src,
|
pageCnvCtx *pageConverter, const char *src,
|
||||||
const char *dst, bool force);
|
const char *dst, bool force);
|
||||||
|
@ -140,7 +140,7 @@ transfer_single_new_db(migratorContext *ctx, pageCnvCtx *pageConverter,
|
|||||||
* Now copy/link any fsm and vm files, if they exist
|
* Now copy/link any fsm and vm files, if they exist
|
||||||
*/
|
*/
|
||||||
snprintf(scandir_file_pattern, sizeof(scandir_file_pattern), "%u_", maps[mapnum].old);
|
snprintf(scandir_file_pattern, sizeof(scandir_file_pattern), "%u_", maps[mapnum].old);
|
||||||
numFiles = pg_scandir(ctx, maps[mapnum].old_file, &namelist, dir_matching_filenames, NULL);
|
numFiles = pg_scandir(ctx, maps[mapnum].old_file, &namelist, dir_matching_filenames);
|
||||||
|
|
||||||
while (numFiles--)
|
while (numFiles--)
|
||||||
{
|
{
|
||||||
@ -168,7 +168,7 @@ transfer_single_new_db(migratorContext *ctx, pageCnvCtx *pageConverter,
|
|||||||
* copied.
|
* copied.
|
||||||
*/
|
*/
|
||||||
snprintf(scandir_file_pattern, sizeof(scandir_file_pattern), "%u.", maps[mapnum].old);
|
snprintf(scandir_file_pattern, sizeof(scandir_file_pattern), "%u.", maps[mapnum].old);
|
||||||
numFiles = pg_scandir(ctx, maps[mapnum].old_file, &namelist, dir_matching_filenames, NULL);
|
numFiles = pg_scandir(ctx, maps[mapnum].old_file, &namelist, dir_matching_filenames);
|
||||||
|
|
||||||
while (numFiles--)
|
while (numFiles--)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user