summaryrefslogtreecommitdiff
path: root/libpurple/dbus-analyze-functions.py
diff options
context:
space:
mode:
authorSadrul Habib Chowdhury <sadrul@pidgin.im>2007-06-17 03:42:10 +0000
committerSadrul Habib Chowdhury <sadrul@pidgin.im>2007-06-17 03:42:10 +0000
commite6398112c45daeb15346e46cb21112a465b26c69 (patch)
tree42b842f588cd35794f02564cbfb6f73830141e84 /libpurple/dbus-analyze-functions.py
parentee6c059629faca0da39e2e0a605efdcf2836290f (diff)
downloadpidgin-e6398112c45daeb15346e46cb21112a465b26c69.tar.gz
Remove the warning about signedness.
Diffstat (limited to 'libpurple/dbus-analyze-functions.py')
-rw-r--r--libpurple/dbus-analyze-functions.py18
1 files changed, 12 insertions, 6 deletions
diff --git a/libpurple/dbus-analyze-functions.py b/libpurple/dbus-analyze-functions.py
index 8571851c45..053473914c 100644
--- a/libpurple/dbus-analyze-functions.py
+++ b/libpurple/dbus-analyze-functions.py
@@ -138,7 +138,7 @@ class Binding:
# 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 @@ class ClientBinding (Binding):
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 @@ class ServerBinding (Binding):
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):