platform_bionic/libc/upstream-netbsd
David 'Digit' Turner c30396f5f2 libc: Fix alphasort() signature (and implementation).
The declaration for alphasort() in <dirent.h> used the deprecated:

  int alphasort(const void*, const void*);

while both Posix and GLibc use instead:

  int alphasort(const struct dirent** a, const struct dirent** b);

See: http://pubs.opengroup.org/onlinepubs/9699919799/functions/alphasort.html

This patch does the following:

- Update the declaration to match Posix/GLibc
- Get rid of the upstream BSD code which isn't compatible with the new
  signature.
- Implement a new trivial alphasort() with the right signature, and
  ensure that it uses strcoll() instead of strcmp().
- Remove Bionic-specific #ifdef .. #else .. #endif block in
  dirent_test.cpp which uses alphasort().

Even through strcoll() currently uses strcmp(), this does the right
thing in the case where we decide to update strcoll() to properly
implement locale-specific ordered comparison.

Change-Id: I4fd45604d8a940aaf2eb0ecd7d73e2f11c9bca96
2012-10-29 07:44:27 -07:00
..
common/lib/libc Upgrade more functions to the current upstream NetBSD copy. 2012-10-23 12:29:53 -07:00
libc libc: Fix alphasort() signature (and implementation). 2012-10-29 07:44:27 -07:00
extern.h Fix several compiler warnings. 2012-09-26 14:20:22 -07:00
fd_setsize.h More upstream NetBSD upgrades. 2012-10-23 16:05:09 -07:00
namespace.h Fix nice... 2012-08-13 16:38:29 -07:00
netbsd-compat.h Switch to the current NetBSD regex implementation. 2012-08-15 15:39:11 -07:00
port_after.h Upgrade more functions to the current upstream NetBSD copy. 2012-10-23 12:29:53 -07:00
port_before.h More upstream NetBSD upgrades. 2012-10-23 16:05:09 -07:00
README.txt Revert "Revert "Switch to NetBSD's strxfrm(3)."" 2012-08-10 12:10:10 -07:00
reentrant.h Add getdelim(3) and getline(3) to bionic 2012-09-27 11:38:57 -07:00

This directory contains upstream NetBSD source. You should not edit these
files directly. Make fixes upstream and then pull down the new version of
the file.

Note that code in the other 'netbsd' directory contains Android modifications.
We should work towards getting as many of those changes as possible upstream
and then losing those files in favor of pure upstream copies here instead.

TODO: write a script to make this process automated.