Mercurial > pidgin.yaz
diff libpurple/dbus-analyze-functions.py @ 29693:7925bb7f2aa7
propagate from branch 'im.pidgin.pidgin' (head 92e101e3698042e7600729bc09dec9e28f81de8f)
to branch 'im.pidgin.cpw.attention_ui' (head 563c35d20efcc234a74567ebb88c059d10ce1e09)
author | Marcus Lundblad <ml@update.uu.se> |
---|---|
date | Mon, 24 Aug 2009 19:23:56 +0000 |
parents | b168718d1072 |
children | cb74b2877ea7 |
line wrap: on
line diff
--- a/libpurple/dbus-analyze-functions.py Thu Aug 13 17:42:44 2009 +0000 +++ b/libpurple/dbus-analyze-functions.py Mon Aug 24 19:23:56 2009 +0000 @@ -181,15 +181,20 @@ def processoutput(self, type, name): + const = False + unsigned = False # the "void" type is simple ... if type == ["void"]: return self.outputvoid(type, name) - const = False if type[0] == "const": type = type[1:] const = True + if type[0] == "unsigned": + type = type[1:] + unsigned = True + # a string if type == ["char", pointer] or type == ["gchar", pointer]: return self.outputstring(type, name, const) @@ -197,7 +202,7 @@ # simple types (ints, booleans, enums, ...) if (len(type) == 1) and \ ((type[0] in simpletypes) or (type[0].startswith("Purple"))): - return self.outputsimple(type, name) + return self.outputsimple(type, name, unsigned) # pointers ... if (len(type) == 2) and (type[1] == pointer): @@ -303,10 +308,13 @@ # self.returncode.append("NULLIFY(%s);" % name) self.returncode.append("return %s;" % name); - def outputsimple(self, type, name): + def outputsimple(self, type, name, us): self.functiontype = type[0] self.decls.append("%s %s = 0;" % (type[0], name)) - self.outputparams.append(("G_TYPE_INT", name)) + if us: + self.outputparams.append(("G_TYPE_UINT", name)) + else: + self.outputparams.append(("G_TYPE_INT", name)) self.returncode.append("return %s;" % name); # we could add "const" to the return type but this would probably @@ -455,11 +463,16 @@ if not const: self.ccodeout.append("\tg_free(%s);" % name) - def outputsimple(self, type, name): - self.cdecls.append("\tdbus_int32_t %s;" % name) + def outputsimple(self, type, name, us): + if us: + self.cdecls.append("\tdbus_uint32_t %s;" % name) + self.cparamsout.append(("UINT32", name)) + self.addouttype("u", name) + else: + self.cdecls.append("\tdbus_int32_t %s;" % name) + self.cparamsout.append(("INT32", name)) + self.addouttype("i", name) self.ccode.append("\t%s = %s;" % (name, self.call)) - self.cparamsout.append(("INT32", name)) - self.addouttype("i", name) def outputpurplestructure(self, type, name): self.cdecls.append("\tdbus_int32_t %s;" % name)