Skip to content

Commit

Permalink
Yet more changes to match sort function type change.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ulrich Drepper committed Mar 17, 2009
1 parent ae8d7b4 commit 3fb8a93
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 21 deletions.
8 changes: 5 additions & 3 deletions include/dirent.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,16 @@ extern int __readdir64_r (DIR *__dirp, struct dirent64 *__entry,
extern int __scandir64 (__const char * __dir,
struct dirent64 *** __namelist,
int (*__selector) (__const struct dirent64 *),
int (*__cmp) (__const void *, __const void *));
int (*__cmp) (__const struct dirent64 **,
__const struct dirent64 **));
extern __ssize_t __getdents (int __fd, char *__buf, size_t __nbytes)
internal_function;
extern __ssize_t __getdents64 (int __fd, char *__buf, size_t __nbytes)
internal_function;
extern int __alphasort64 (const void *a, const void *b)
extern int __alphasort64 (const struct dirent64 **a, const struct dirent64 **b)
__attribute_pure__;
extern int __versionsort64 (const void *a, const void *b)
extern int __versionsort64 (const struct dirent64 **a,
const struct dirent64 **b)
__attribute_pure__;
extern DIR *__alloc_dir (int fd, bool close_fd, const struct stat64 *statp)
internal_function;
Expand Down
16 changes: 8 additions & 8 deletions sysdeps/unix/sysv/linux/i386/alphasort64.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (C) 1992, 1997, 1998, 2000, 2004 Free Software Foundation, Inc.
/* Copyright (C) 1992, 1997,1998,2000,2004,2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
Expand All @@ -20,10 +20,9 @@
#include <string.h>

int
__alphasort64 (const void *a, const void *b)
__alphasort64 (const struct dirent64 **a, const struct dirent64 **b)
{
return strcoll ((*(const struct dirent64 **) a)->d_name,
(*(const struct dirent64 **) b)->d_name);
return strcoll ((*a)->d_name, (*b)->d_name);
}

#include <shlib-compat.h>
Expand All @@ -35,14 +34,15 @@ versioned_symbol (libc, __alphasort64, alphasort64, GLIBC_2_2);
#include <sysdeps/unix/sysv/linux/i386/olddirent.h>

int
__old_alphasort64 (const void *a, const void *b);
__old_alphasort64 (const struct __old_dirent64 **a,
const struct __old_dirent64 **b);

int
attribute_compat_text_section
__old_alphasort64 (const void *a, const void *b)
__old_alphasort64 (const struct __old_dirent64 **a,
const struct __old_dirent64 **b)
{
return strcoll ((*(const struct __old_dirent64 **) a)->d_name,
(*(const struct __old_dirent64 **) b)->d_name);
return strcoll ((*a)->d_name, (*b)->d_name);
}

compat_symbol (libc, __old_alphasort64, alphasort64, GLIBC_2_1);
Expand Down
5 changes: 3 additions & 2 deletions sysdeps/unix/sysv/linux/i386/olddirent.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (C) 2000 Free Software Foundation, Inc.
/* Copyright (C) 2000, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
Expand Down Expand Up @@ -39,6 +39,7 @@ extern __ssize_t __old_getdents64 (int __fd, char *__buf, size_t __nbytes)
int __old_scandir64 (__const char * __dir,
struct __old_dirent64 *** __namelist,
int (*__selector) (__const struct __old_dirent64 *),
int (*__cmp) (__const void *, __const void *));
int (*__cmp) (__const struct __old_dirent64 **,
__const struct __old_dirent64 **));

#endif
16 changes: 8 additions & 8 deletions sysdeps/unix/sysv/linux/i386/versionsort64.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (C) 1992, 1997, 1998, 2000, 2004 Free Software Foundation, Inc.
/* Copyright (C) 1992,1997,1998,2000,2004,2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
Expand All @@ -20,10 +20,9 @@
#include <string.h>

int
__versionsort64 (const void *a, const void *b)
__versionsort64 (const struct dirent64 **a, const struct dirent64 **b)
{
return __strverscmp ((*(const struct dirent64 **) a)->d_name,
(*(const struct dirent64 **) b)->d_name);
return __strverscmp ((*a)->d_name, (*b)->d_name);
}

#include <shlib-compat.h>
Expand All @@ -35,14 +34,15 @@ versioned_symbol (libc, __versionsort64, versionsort64, GLIBC_2_2);
#include <sysdeps/unix/sysv/linux/i386/olddirent.h>

int
__old_versionsort64 (const void *a, const void *b);
__old_versionsort64 (const struct __old_dirent64 **a,
const struct __old_dirent64 **b);

int
attribute_compat_text_section
__old_versionsort64 (const void *a, const void *b)
__old_versionsort64 (const struct __old_dirent64 **a,
const struct __old_dirent64 **b)
{
return __strverscmp ((*(const struct __old_dirent64 **) a)->d_name,
(*(const struct __old_dirent64 **) b)->d_name);
return __strverscmp ((*a)->d_name, (*b)->d_name);
}

compat_symbol (libc, __old_versionsort64, versionsort64, GLIBC_2_1);
Expand Down

0 comments on commit 3fb8a93

Please sign in to comment.