]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
[BZ #9759]
authorUlrich Drepper <drepper@redhat.com>
Sun, 15 Mar 2009 21:33:19 +0000 (21:33 +0000)
committerUlrich Drepper <drepper@redhat.com>
Sun, 15 Mar 2009 21:33:19 +0000 (21:33 +0000)
* dirent/dirent.h: Adjust prototypes of scandir, scandir64, alphasort,
alphasort64, versionsort, and versionsort64 to POSIX 2008.
* dirent/alphasort.c: Adjust implementation to type change.
* dirent/alphasort64.c: Likewise.
* dirent/scandir.c: Likewise.
* dirent/versionsort.c: Likewise.
* dirent/versionsort64.c: Likewise.
* sysdeps/wordsize-64/alphasort.c: Add hack to hide alphasort64
declaration.
* sysdeps/wordsize-64/versionsort.c: Add hack to hide versionsort64
declaration.

ChangeLog
dirent/alphasort.c
dirent/alphasort64.c
dirent/dirent.h
dirent/scandir.c
dirent/versionsort.c
dirent/versionsort64.c
localedata/ChangeLog
localedata/locales/iso14651_t1_common
sysdeps/wordsize-64/alphasort.c
sysdeps/wordsize-64/versionsort.c

index 727b2957f8cbeb06525f37b6583d86e7eee74e51..2f9f842e3be03e70a9681312c7c52bf5035f7ebc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,18 @@
 2009-03-15  Ulrich Drepper  <drepper@redhat.com>
 
+       [BZ #9759]
+       * dirent/dirent.h: Adjust prototypes of scandir, scandir64, alphasort,
+       alphasort64, versionsort, and versionsort64 to POSIX 2008.
+       * dirent/alphasort.c: Adjust implementation to type change.
+       * dirent/alphasort64.c: Likewise.
+       * dirent/scandir.c: Likewise.
+       * dirent/versionsort.c: Likewise.
+       * dirent/versionsort64.c: Likewise.
+       * sysdeps/wordsize-64/alphasort.c: Add hack to hide alphasort64
+       declaration.
+       * sysdeps/wordsize-64/versionsort.c: Add hack to hide versionsort64
+       declaration.
+
        [BZ #9880]
        * inet/inet6_rth.c (inet6_rth_reverse): Compute number of segments
        correctly.  Set segleft member in output as required.
index b378626f6c45fb416537876f93a237f5e1f3c5e7..360b17c5a0b17de4dcef508ba07df4602dd7ce1d 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1997, 1998, 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
@@ -20,8 +20,7 @@
 #include <string.h>
 
 int
-alphasort (const void *a, const void *b)
+alphasort (const struct dirent **a, const struct dirent **b)
 {
-  return strcoll ((*(const struct dirent **) a)->d_name,
-                 (*(const struct dirent **) b)->d_name);
+  return strcoll ((*a)->d_name, (*b)->d_name);
 }
index fe84aec2f1b85560b80099cc57c1ead8d8b0b0ef..f91cba50886f7f0f4758b9697ef052c1ef88362d 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1997, 1998, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1997, 1998, 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
@@ -20,8 +20,7 @@
 #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);
 }
index cb6d0bc2d5a56932e0e19e4a012bbbd5623830ed..369ccdc9ee798ca37551f57343ec3eeff90bd933 100644 (file)
@@ -252,7 +252,8 @@ extern int dirfd (DIR *__dirp) __THROW __nonnull ((1));
 extern int scandir (__const char *__restrict __dir,
                    struct dirent ***__restrict __namelist,
                    int (*__selector) (__const struct dirent *),
-                   int (*__cmp) (__const void *, __const void *))
+                   int (*__cmp) (__const struct dirent **,
+                                 __const struct dirent **))
      __nonnull ((1, 2));
 # else
 #  ifdef __REDIRECT
@@ -260,7 +261,8 @@ extern int __REDIRECT (scandir,
                       (__const char *__restrict __dir,
                        struct dirent ***__restrict __namelist,
                        int (*__selector) (__const struct dirent *),
-                       int (*__cmp) (__const void *, __const void *)),
+                       int (*__cmp) (__const struct dirent **,
+                                     __const struct dirent **)),
                       scandir64) __nonnull ((1, 2));
 #  else
 #   define scandir scandir64
@@ -273,18 +275,21 @@ extern int __REDIRECT (scandir,
 extern int scandir64 (__const char *__restrict __dir,
                      struct dirent64 ***__restrict __namelist,
                      int (*__selector) (__const struct dirent64 *),
-                     int (*__cmp) (__const void *, __const void *))
+                     int (*__cmp) (__const struct dirent64 **,
+                                   __const struct dirent64 **))
      __nonnull ((1, 2));
 # endif
 
 /* Function to compare two `struct dirent's alphabetically.  */
 # ifndef __USE_FILE_OFFSET64
-extern int alphasort (__const void *__e1, __const void *__e2)
+extern int alphasort (__const struct dirent **__e1,
+                     __const struct dirent **__e2)
      __THROW __attribute_pure__ __nonnull ((1, 2));
 # else
 #  ifdef __REDIRECT
 extern int __REDIRECT_NTH (alphasort,
-                          (__const void *__e1, __const void *__e2),
+                          (__const struct dirent **__e1,
+                           __const struct dirent **__e2),
                           alphasort64) __attribute_pure__ __nonnull ((1, 2));
 #  else
 #   define alphasort alphasort64
@@ -292,51 +297,54 @@ extern int __REDIRECT_NTH (alphasort,
 # endif
 
 # if defined __USE_GNU && defined __USE_LARGEFILE64
-extern int alphasort64 (__const void *__e1, __const void *__e2)
+extern int alphasort64 (__const struct dirent64 **__e1,
+                       __const struct dirent64 **__e2)
      __THROW __attribute_pure__ __nonnull ((1, 2));
 # endif
+#endif /* Use BSD or misc or XPG7.  */
 
 
-# if defined __USE_BSD || defined __USE_MISC
+#if defined __USE_BSD || defined __USE_MISC
 /* Read directory entries from FD into BUF, reading at most NBYTES.
    Reading starts at offset *BASEP, and *BASEP is updated with the new
    position after reading.  Returns the number of bytes read; zero when at
    end of directory; or -1 for errors.  */
-#  ifndef __USE_FILE_OFFSET64
+# ifndef __USE_FILE_OFFSET64
 extern __ssize_t getdirentries (int __fd, char *__restrict __buf,
                                size_t __nbytes,
                                __off_t *__restrict __basep)
      __THROW __nonnull ((2, 4));
-#  else
-#   ifdef __REDIRECT
+# else
+#  ifdef __REDIRECT
 extern __ssize_t __REDIRECT_NTH (getdirentries,
                                 (int __fd, char *__restrict __buf,
                                  size_t __nbytes,
                                  __off64_t *__restrict __basep),
                                 getdirentries64) __nonnull ((2, 4));
-#   else
-#    define getdirentries getdirentries64
-#   endif
+#  else
+#   define getdirentries getdirentries64
 #  endif
+# endif
 
-#  ifdef __USE_LARGEFILE64
+# ifdef __USE_LARGEFILE64
 extern __ssize_t getdirentries64 (int __fd, char *__restrict __buf,
                                  size_t __nbytes,
                                  __off64_t *__restrict __basep)
      __THROW __nonnull ((2, 4));
-#  endif
-# endif /* Use BSD or misc.  */
-#endif /* Use BSD or misc or XPG7.  */
+# endif
+#endif /* Use BSD or misc.  */
 
 #ifdef __USE_GNU
 /* Function to compare two `struct dirent's by name & version.  */
 # ifndef __USE_FILE_OFFSET64
-extern int versionsort (__const void *__e1, __const void *__e2)
+extern int versionsort (__const struct dirent **__e1,
+                       __const struct dirent **__e2)
      __THROW __attribute_pure__ __nonnull ((1, 2));
 # else
 #  ifdef __REDIRECT
 extern int __REDIRECT_NTH (versionsort,
-                          (__const void *__e1, __const void *__e2),
+                          (__const struct dirent **__e1,
+                           __const struct dirent **__e2),
                           versionsort64)
      __attribute_pure__ __nonnull ((1, 2));
 #  else
@@ -345,7 +353,8 @@ extern int __REDIRECT_NTH (versionsort,
 # endif
 
 # ifdef __USE_LARGEFILE64
-extern int versionsort64 (__const void *__e1, __const void *__e2)
+extern int versionsort64 (__const struct dirent64 **__e1,
+                         __const struct dirent64 **__e2)
      __THROW __attribute_pure__ __nonnull ((1, 2));
 # endif
 #endif /* Use GNU.  */
index 89bd9e94fe876d835cc8967c43aaf726865c96ae..2e03578a3cca7eb14cc74e0e1b6ee0bf0b1e48d8 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-1998, 2000, 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1992-1998,2000,2002,2003,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
@@ -57,7 +57,7 @@ SCANDIR (dir, namelist, select, cmp)
      const char *dir;
      DIRENT_TYPE ***namelist;
      int (*select) (const DIRENT_TYPE *);
-     int (*cmp) (const void *, const void *);
+     int (*cmp) (const DIRENT_TYPE **, const DIRENT_TYPE **);
 {
   DIR *dp = __opendir (dir);
   DIRENT_TYPE **v = NULL;
@@ -134,7 +134,8 @@ SCANDIR (dir, namelist, select, cmp)
     {
       /* Sort the list if we have a comparison function to sort with.  */
       if (cmp != NULL)
-       qsort (v, c.cnt, sizeof (*v), cmp);
+       qsort (v, c.cnt, sizeof (*v),
+              (int (*) (const void *, const void *)) cmp);
 
       *namelist = v;
     }
index d986981bcec1632eb0102850bba9ddde728d44de..f7bd717848b35977ec60a969b5d6664bb42d058f 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1997, 1998, 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
@@ -20,8 +20,7 @@
 #include <string.h>
 
 int
-versionsort (const void *a, const void *b)
+versionsort (const struct dirent **a, const struct dirent **b)
 {
-  return __strverscmp ((*(const struct dirent **) a)->d_name,
-                      (*(const struct dirent **) b)->d_name);
+  return __strverscmp ((*a)->d_name, (*b)->d_name);
 }
index e47182702309c10542dcfd925f8834e4d8b5bee8..5b2833111be8dce2483e68031ee9d22fef5c8f26 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1997, 1998, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1997, 1998, 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
@@ -20,8 +20,7 @@
 #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);
 }
index f8eb4c3db6dc9f295789b0f1729d129a6fb6b178..17f26f68c1ea785885f76c3d509586b40f45d6c7 100644 (file)
@@ -1,5 +1,8 @@
 2009-03-15  Ulrich Drepper  <drepper@redhat.com>
 
+       [BZ #9844]
+       * locales/iso14651_t1_common: Move U0138 entry.
+
        [BZ #9833]
        * locales/ko_KR: Fix noexpr.  Add nostr.
 
index 1c9963aaf6421143044ad69f4c0b9093a7f0d641..6bdc795f4acdc7e2626195abf00f43e6501e8875 100644 (file)
@@ -917,7 +917,7 @@ collating-symbol <k-ai_lenght_mark>
 # mlvw- denotes Malayalam vowel
 # ml-visarga - dentos Malayalam Visarga
 # consonant + virama is considered half of consonant or consonant without vowel part
-# so it consonant + virama should be considered as cluster and should be 
+# so it consonant + virama should be considered as cluster and should be
 # sorted before the consonant. All consonants are considered to have an implicit a vowel
 # part associated with it.
 collating-element <ml-chillu-n> from "<U0D28><U0D4D>"
@@ -2362,7 +2362,6 @@ endif
 <U1E33> <k>;<BPT>;<MIN>;IGNORE # 337 ḳ
 <U1E35> <k>;<BMA>;<MIN>;IGNORE # 338 ḵ
 <U0199> <k>;<CRL>;<MIN>;IGNORE # 339 ƙ
-<U0138> <k>;<PCL>;<MIN>;IGNORE # 340 <kk>
 <U006C> <l>;<BAS>;<MIN>;IGNORE # 341 l
 <U013A> <l>;<ACA>;<MIN>;IGNORE # 342 <l'>
 <U013E> <l>;<CAR>;<MIN>;IGNORE # 343 <l<>
@@ -2436,6 +2435,7 @@ endif
 <U1E55> <p>;<ACA>;<MIN>;IGNORE # 411 <p'>
 <U1E57> <p>;<PCT>;<MIN>;IGNORE # 412 <p.>
 <U0071> <q>;<BAS>;<MIN>;IGNORE # 413 q
+<U0138> <q>;<PCL>;<MIN>;IGNORE # 340 <kk>
 <U0072> <r>;<BAS>;<MIN>;IGNORE # 414 r
 <U0155> <r>;<ACA>;<MIN>;IGNORE # 415 <r'>
 <U0159> <r>;<CAR>;<MIN>;IGNORE # 416 <r<>
@@ -4309,7 +4309,7 @@ order_start <MALAYALAM>;forward;forward;forward;forward,position
 <ml-dh>        "<ml-dha><ml-virama>";<BAS>;<MIN>;IGNORE
 <U0D22>        "<ml-dha><ml-virama><mlvw-shorta>";<BAS>;<MIN>;IGNORE
 <ml-chillu-nn> "<ml-nna><ml-virama>";<BAS>;<MIN>;IGNORE # ണ്‍ = ണ  + ്  + zwj
-<U0D23>        "<ml-nna><ml-virama><mlvw-shorta>";<BAS>;<MIN>;IGNORE # ണ = ണ + ് + അ 
+<U0D23>        "<ml-nna><ml-virama><mlvw-shorta>";<BAS>;<MIN>;IGNORE # ണ = ണ + ് + അ
 <ml-th>        "<ml-tha><ml-virama>";<BAS>;<MIN>;IGNORE
 <U0D24>        "<ml-tha><ml-virama><mlvw-shorta>";<BAS>;<MIN>;IGNORE
 <ml-thh> "<ml-thha><ml-virama>";<BAS>;<MIN>;IGNORE
@@ -4329,14 +4329,14 @@ order_start <MALAYALAM>;forward;forward;forward;forward,position
 <ml-bh>        "<ml-bha><ml-virama>";<BAS>;<MIN>;IGNORE
 <U0D2D>        "<ml-bha><ml-virama><mlvw-shorta>";<BAS>;<MIN>;IGNORE
 <U0D02>        "<ml-ma><ml-virama>";<BAS>;<MIN>;IGNORE # ം = മ + ്
-<ml-m> "<ml-ma><ml-virama>";"<BAS><ml-virama>";<MIN>;IGNORE # ം = മ + ്  
-<U0D2E>        "<ml-ma><ml-virama><mlvw-shorta>";<BAS>;<MIN>;IGNORE # മ = മ + ് + അ 
+<ml-m> "<ml-ma><ml-virama>";"<BAS><ml-virama>";<MIN>;IGNORE # ം = മ + ്
+<U0D2E>        "<ml-ma><ml-virama><mlvw-shorta>";<BAS>;<MIN>;IGNORE # മ = മ + ് + അ
 <ml-y>  "<ml-ya><ml-virama>";<BAS>;<MIN>;IGNORE
 <U0D2F>        "<ml-ya><ml-virama><mlvw-shorta>";<BAS>;<MIN>;IGNORE
 <ml-chillu-r> "<ml-ra><ml-virama>";<BAS>;<MIN>;IGNORE # ര = ര + ്  + zwj
-<U0D30>        "<ml-ra><ml-virama><mlvw-shorta>";<BAS>;<MIN>;IGNORE # ര = ര + ് + അ 
+<U0D30>        "<ml-ra><ml-virama><mlvw-shorta>";<BAS>;<MIN>;IGNORE # ര = ര + ് + അ
 <ml-chillu-l> <ml-la>;<BAS>;<MIN>;IGNORE # ല്‍ = ല + ്  + zwj
-<U0D32>        "<ml-la><ml-virama><mlvw-shorta>";<BAS>;<MIN>;IGNORE # ല = ല + ് + അ 
+<U0D32>        "<ml-la><ml-virama><mlvw-shorta>";<BAS>;<MIN>;IGNORE # ല = ല + ് + അ
 <ml-v> "<ml-va><ml-virama>";<BAS>;<MIN>;IGNORE
 <U0D35>        "<ml-va><ml-virama><mlvw-shorta>";<BAS>;<MIN>;IGNORE
 <ml-ss>        "<ml-ssa><ml-virama>";<BAS>;<MIN>;IGNORE
@@ -4348,7 +4348,7 @@ order_start <MALAYALAM>;forward;forward;forward;forward,position
 <ml-h> "<ml-ha><ml-virama>";<BAS>;<MIN>;IGNORE
 <U0D39>        "<ml-ha><ml-virama><mlvw-shorta>";<BAS>;<MIN>;IGNORE
 <ml-chillu-ll> "<ml-lla><ml-virama>";<BAS>;<MIN>;IGNORE # ള്‍ = ള  + ്  + zwj
-<U0D33>        "<ml-lla><ml-virama><mlvw-shorta>";<BAS>;<MIN>;IGNORE # ള = ള + ് + അ 
+<U0D33>        "<ml-lla><ml-virama><mlvw-shorta>";<BAS>;<MIN>;IGNORE # ള = ള + ് + അ
 <ml-zh>        "<ml-zha><ml-virama>";<BAS>;<MIN>;IGNORE
 <U0D34>        "<ml-zha><ml-virama><mlvw-shorta>";<BAS>;<MIN>;IGNORE
 <ml-rr>        "<ml-rra><ml-virama>";<BAS>;<MIN>;IGNORE
index 5096166625dcd7db9592a1e671ad06a27f2b2d24..edc410129d8a42279ca7854d03bb24e0795693b0 100644 (file)
@@ -1,3 +1,7 @@
+#define alphasort64 rename_alphasort64
+
 #include "../../dirent/alphasort.c"
 
+#undef alphasort64
+
 weak_alias (alphasort, alphasort64)
index 90365a4b25516bd75a5f94c3b327464adff786cd..bb25550d3d909129246fe395410969875d3a668c 100644 (file)
@@ -1,3 +1,7 @@
+#define versionsort64 rename_versionsort64
+
 #include "../../dirent/versionsort.c"
 
+#undef versionsort64
+
 weak_alias (versionsort, versionsort64)