1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-11-04 08:17:17 -05:00
elinks/src/intl
Kalle Olavi Niemitalo e2cc0bd434 Don't cast qsort comparison function pointers.
Instead, convert the element pointers inside the comparison functions.

The last argument of qsort() is supposed to be of type
int (*)(const void *, const void *).  Previously, comp_links() was
defined to take struct link * instead of const void *, and the type
mismatch was silenced by casting the function pointer to void *.
This was in principle not portable because:

(1) The different pointer types may have different representations.
    In a word-oriented machine, the const void * might include a byte
    selector while the struct link * might not.

(2) Casting a function pointer to a data pointer can lose bits in some
    memory models.  Apparently this does not occur in POSIX-conforming
    systems though, as dlsym() would fail if it did.

This commit also fixes hits_cmp() and compare_dir_entries(), which
had similar problems.  However, I'm leaving alias_compare() in
src/intl/gettext/localealias.c unchanged for now, so as not to diverge
from the GNU version.

I also checked the bsearch() calls but they were all okay, apart from
one that used the alias_compare() mentioned above.
2007-10-06 23:05:05 +03:00
..
gettext Bug 960: Redefine LOADMSGCAT_USE_MMAP instead of HAVE_MMAP. 2007-07-02 23:48:03 +03:00
charsets.c Don't cast qsort comparison function pointers. 2007-10-06 23:05:05 +03:00
charsets.h Bug 879: New constant UCS_SOFT_HYPHEN; use where applicable. 2007-04-22 22:38:40 +03:00
codepage.inc cp1250, cp1257: Don't map undefined bytes to U+0000. 2007-01-27 09:58:18 +02:00
entity.inc Make entities[] static const. 2007-02-03 19:51:45 +02:00
Makefile path_to_top -> top_builddir 2005-10-20 04:00:35 +02:00
uni_7b.inc Make unicode_7b[] static const. 2007-02-03 23:25:16 +02:00