changeset 883:0aa9015f06df

Remove some more libjabber warnings
author Mikael Berthe <mikael@lilotux.net>
date Sat, 27 May 2006 19:17:01 +0200
parents c3c2f7a0c5d5
children 9e6d9f0cf9eb
files mcabber/libjabber/xmlparse.c mcabber/libjabber/xmltok.c mcabber/libjabber/xstream.c
diffstat 3 files changed, 8 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/mcabber/libjabber/xmlparse.c	Sat May 27 18:53:56 2006 +0200
+++ b/mcabber/libjabber/xmlparse.c	Sat May 27 19:17:01 2006 +0200
@@ -939,7 +939,7 @@
         XML_T("error in processing external entity reference"),
         XML_T("document is not standalone")
     };
-    if (code > 0 && code < sizeof(message)/sizeof(message[0]))
+    if (code > 0 && code < (int)(sizeof(message)/sizeof(message[0])))
         return message[code];
     return 0;
 }
--- a/mcabber/libjabber/xmltok.c	Sat May 27 18:53:56 2006 +0200
+++ b/mcabber/libjabber/xmltok.c	Sat May 27 19:17:01 2006 +0200
@@ -1263,7 +1263,7 @@
 {
     int i;
     struct unknown_encoding *e = mem;
-    for (i = 0; i < sizeof(struct normal_encoding); i++)
+    for (i = 0; i < (int)sizeof(struct normal_encoding); i++)
 	((char *)mem)[i] = ((char *)&latin1_encoding)[i];
     for (i = 0; i < 128; i++)
 	if (latin1_encoding.type[i] != BT_OTHER
@@ -1362,7 +1362,7 @@
     int i;
     if (name == 0)
 	return NO_ENC;
-    for (i = 0; i < sizeof(encodingNames)/sizeof(encodingNames[0]); i++)
+    for (i = 0; i < (int)(sizeof(encodingNames)/sizeof(encodingNames[0])); i++)
 	if (streqci(name, encodingNames[i]))
 	    return i;
     return UNKNOWN_ENC;
--- a/mcabber/libjabber/xstream.c	Sat May 27 18:53:56 2006 +0200
+++ b/mcabber/libjabber/xstream.c	Sat May 27 19:17:01 2006 +0200
@@ -158,8 +158,11 @@
     /* create expat parser and ensure cleanup */
     newx->parser = XML_ParserCreate(NULL);
     XML_SetUserData(newx->parser, (void *)newx);
-    XML_SetElementHandler(newx->parser, (void *)_xstream_startElement, (void *)_xstream_endElement);
-    XML_SetCharacterDataHandler(newx->parser, (void *)_xstream_charData);
+    XML_SetElementHandler(newx->parser,
+                          (XML_StartElementHandler)_xstream_startElement,
+                          (XML_EndElementHandler)_xstream_endElement);
+    XML_SetCharacterDataHandler(newx->parser,
+                                (XML_CharacterDataHandler)_xstream_charData);
     pool_cleanup(p, _xstream_cleanup, (void *)newx);
 
     return newx;