Weak points:
- alignof
- js problems
Todo:
- make js work with C++ and mozjs-17
- then mozjs-24
- then mozjs-52
- then mozjs-60
- decrease number of warnings
Make u2cp_() map code points U+0080 to U+009F via strange_chars[] even
if the target codepage is UTF-8. This helps with buggy web pages that
use ’ when they mean ’. This change does not affect how
ELinks decodes raw bytes 0x80 to 0x9F in HTML.
u2cp_() is used only via the u2cp and u2cp_no_nbsp macros.
Possible side effects of this change at each use of these macros:
* get_translation_table(): Not affected because it does not call u2cp
if the target codepage is UTF-8.
* get_entity_string(): Numeric character references are affected, as intended.
Character entity references are not affected because entities[]
does not define any entities in the U+0080...U+009F range.
* kbd_field(), term_send_ucs(), field_op(): Affected. It is no longer
possible to enter code points U+0080...U+009F from the terminal.
This should not be a problem in practice because those would be
control characters anyway and should therefore be filtered by the
slave process (which doesn't yet recognize them; bug 777).
After viewing a page with Big5 charset and next a page with UTF-8
charset iconv was used, so slows down a bit.
Now iconv is used only for those charsets, which has the iconv
bitfield set.
C99 6.7.4p3 and 6.7.4p6 set some constraints on what can be done in
inline functions and how they can be declared. In particular, any
function declared inline must also be defined in the same translation
unit. To comply with that, remove inline specifiers from function
declarations in header files when the functions are not also defined
in those header files.
Sun Studio 11 on Solaris 9 is stricter than C99 and does not allow
references to static identifiers in extern inline functions. Make the
configure script detect this and define NONSTATIC_INLINE accordingly
in config.h. Then use that in the definitions of all non-static
inline functions.
Document the restrictions and this scheme in doc/hacking.txt.
In get_entity_string and point_intersect, do not initialise arrays with
static storage duration to zero; the C standard states that such objects
are automatically initialised to zero.
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.