Mercurial > pidgin
comparison libpurple/dbus-analyze-functions.py @ 17429:f187d935486b
The DBus bindings have a lot of warnings about calling g_free() on a
const char *RESULT. o_sukhodolsky created a patch to eliminate all the
g_free()s, which seems wrong. (The DBus code appears to copy the bytes.)
This revision changes the types to char * as necessary.
References #1344
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Sat, 02 Jun 2007 06:00:35 +0000 |
parents | 98ef77c2455f |
children | a90e2e720762 |
comparison
equal
deleted
inserted
replaced
17428:df911a06e09e | 17429:f187d935486b |
---|---|
1 import re | 1 import re |
2 import string | 2 import string |
3 import sys | 3 import sys |
4 | |
5 | 4 |
6 # types translated into "int" | 5 # types translated into "int" |
7 simpletypes = ["int", "gint", "guint", "gboolean"] | 6 simpletypes = ["int", "gint", "guint", "gboolean"] |
8 | 7 |
9 # List "excluded" contains functions that shouldn't be exported via | 8 # List "excluded" contains functions that shouldn't be exported via |
360 | 359 |
361 def outputvoid(self, type, name): | 360 def outputvoid(self, type, name): |
362 self.ccode.append("\t%s;" % self.call) # just call the function | 361 self.ccode.append("\t%s;" % self.call) # just call the function |
363 | 362 |
364 def outputstring(self, type, name, const): | 363 def outputstring(self, type, name, const): |
365 self.cdecls.append("\tconst char *%s;" % name) | 364 if const: |
365 self.cdecls.append("\tconst char *%s;" % name) | |
366 else: | |
367 self.cdecls.append("\tchar *%s;" % name) | |
366 self.ccode.append("\t%s = null_to_empty(%s);" % (name, self.call)) | 368 self.ccode.append("\t%s = null_to_empty(%s);" % (name, self.call)) |
367 self.cparamsout.append(("STRING", name)) | 369 self.cparamsout.append(("STRING", name)) |
368 self.addouttype("s", name) | 370 self.addouttype("s", name) |
369 if not const: | 371 if not const: |
370 self.ccodeout.append("\tg_free(%s);" % name) | 372 self.ccodeout.append("\tg_free(%s);" % name) |