summaryrefslogtreecommitdiff
path: root/lib/xmlparse.c
diff options
context:
space:
mode:
authorkwaclaw <kwaclaw>2006-09-06 14:32:12 +0000
committerkwaclaw <kwaclaw>2006-09-06 14:32:12 +0000
commit2f5f5269ce8b0fc12c60dc8c8ccba7f88362bb6e (patch)
tree3e33c2a29ef60b53a2ca019e8e7ace177771ca7d /lib/xmlparse.c
parent2f230265f2d4d8270879cb93c044e9b81a984e9c (diff)
downloadlibexpat-2f5f5269ce8b0fc12c60dc8c8ccba7f88362bb6e.tar.gz
(s - NULL & 1) would not compiler under GCC 4.0.0. Changed to char*
subtraction so that it will compile under MS VC++ and GCC.
Diffstat (limited to 'lib/xmlparse.c')
-rw-r--r--lib/xmlparse.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/xmlparse.c b/lib/xmlparse.c
index 184d8f6..449bd92 100644
--- a/lib/xmlparse.c
+++ b/lib/xmlparse.c
@@ -28,7 +28,8 @@
#define XmlGetInternalEncoding XmlGetUtf16InternalEncoding
#define XmlGetInternalEncodingNS XmlGetUtf16InternalEncodingNS
#define XmlEncode XmlUtf16Encode
-#define MUST_CONVERT(enc, s) (!(enc)->isUtf16 || ((s - NULL) & 1))
+/* Using pointer subtraction to convert to integer type. */
+#define MUST_CONVERT(enc, s) (!(enc)->isUtf16 || (((char *)(s) - (char *)NULL) & 1))
typedef unsigned short ICHAR;
#else
#define XML_ENCODE_MAX XML_UTF8_ENCODE_MAX