diff options
author | Daniel Veillard <veillard@src.gnome.org> | 2001-08-27 14:26:30 +0000 |
---|---|---|
committer | Daniel Veillard <veillard@src.gnome.org> | 2001-08-27 14:26:30 +0000 |
commit | b06c61455f86758511aa050a06ff1bbd33f8c3c3 (patch) | |
tree | cd7aa7842e15da0f153950f1752b3cc3f71d5c91 /xpath.c | |
parent | 268fd1bc97f79b43290041cfda2287fb0b0ef2d6 (diff) | |
download | android_external_libxml2-b06c61455f86758511aa050a06ff1bbd33f8c3c3.tar.gz android_external_libxml2-b06c61455f86758511aa050a06ff1bbd33f8c3c3.tar.bz2 android_external_libxml2-b06c61455f86758511aa050a06ff1bbd33f8c3c3.zip |
hum, restrict the integer usage gcc bug workaround to only gcc compilers
* xpath.c: hum, restrict the integer usage gcc bug workaround
to only gcc compilers so that other architecture don't get
penalized by this limitation.
* include/libxml/xpath.h: small typo fix from Heiko W. Rupp
Daniel
Diffstat (limited to 'xpath.c')
-rw-r--r-- | xpath.c | 16 |
1 files changed, 14 insertions, 2 deletions
@@ -6546,10 +6546,13 @@ xmlXPathStringEvalNumber(const xmlChar *str) { const xmlChar *cur = str; double ret = 0.0; double mult = 1; - int ok = 0, tmp = 0; + int ok = 0; int isneg = 0; int exponent = 0; int is_exponent_negative = 0; +#ifdef __GNUC__ + unsigned long tmp = 0; +#endif while (IS_BLANK(*cur)) cur++; if ((*cur != '.') && ((*cur < '0') || (*cur > '9')) && (*cur != '-')) { @@ -6559,8 +6562,10 @@ xmlXPathStringEvalNumber(const xmlChar *str) { isneg = 1; cur++; } + +#ifdef __GNUC__ /* - * tmp is a workaroudn against a gcc compiler bug + * tmp is a workaround against a gcc compiler bug */ while ((*cur >= '0') && (*cur <= '9')) { tmp = tmp * 10 + (*cur - '0'); @@ -6568,6 +6573,13 @@ xmlXPathStringEvalNumber(const xmlChar *str) { cur++; } ret = (double) tmp; +#else + while ((*cur >= '0') && (*cur <= '9')) { + ret = ret * 10 + (*cur - '0'); + ok = 1; + cur++; + } +#endif if (*cur == '.') { cur++; |