changeset 18146:5d1058768970

Remove the warning about signedness.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Sun, 17 Jun 2007 03:42:10 +0000
parents b2438a35c5f7
children 88dc7c826752
files libpurple/dbus-analyze-functions.py
diffstat 1 files changed, 12 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/dbus-analyze-functions.py	Sun Jun 17 03:00:13 2007 +0000
+++ b/libpurple/dbus-analyze-functions.py	Sun Jun 17 03:42:10 2007 +0000
@@ -138,7 +138,7 @@
             # strings
             if type[0] in ["char", "gchar"]:
                 if const:
-                    return self.inputstring(type, name)
+                    return self.inputstring(type, name, unsigned)
                 else:
                     raise myexception
 
@@ -244,8 +244,11 @@
         else:
             self.inputparams.append(("G_TYPE_INT", name))
 
-    def inputstring(self, type, name):
-        self.paramshdr.append("const char *%s" % name)
+    def inputstring(self, type, name, us):
+        if us:
+            self.paramshdr.append("const unsigned char *%s" % name)
+        else:
+            self.paramshdr.append("const char *%s" % name)
         self.inputparams.append(("G_TYPE_STRING", name))
         
     def inputpurplestructure(self, type, name):
@@ -366,10 +369,13 @@
             self.cparams.append(("UINT32", name))
             self.addintype("u", name)
 
-    def inputstring(self, type, name):
-        self.cdecls.append("\tconst char *%s;" % name)
+    def inputstring(self, type, name, us):
+        if us:
+            self.cdecls.append("\tconst unsigned char *%s;" % name)
+        else:
+            self.cdecls.append("\tconst char *%s;" % name)
         self.cparams.append(("STRING", name))
-        self.ccode  .append("\tNULLIFY(%s);" % name)
+        self.ccode.append("\t%s = (%s && %s[0]) ? %s : NULL;" % (name,name,name,name))
         self.addintype("s", name)
 
     def inputhash(self, type, name):