codegen/: Updates from pygtk's codegen and typo fix
authorEdward Hervey <bilboed@bilboed.com>
Mon, 8 Aug 2005 13:47:14 +0000 (13:47 +0000)
committerEdward Hervey <bilboed@bilboed.com>
Mon, 8 Aug 2005 13:47:14 +0000 (13:47 +0000)
Original commit message from CVS:
* codegen/codegen.py:
* codegen/argtypes.py:
Updates from pygtk's codegen and typo fix

ChangeLog
codegen/argtypes.py
codegen/codegen.py
common

index 4177d18..64b24d4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2005-08-08  Edward Hervey  <edward@fluendo.com>
+
+       * codegen/codegen.py:
+       * codegen/argtypes.py:
+       Updates from pygtk's codegen and typo fix
+
 2005-08-04  Edward Hervey  <edward@fluendo.com>
 
        * gst/gst.defs:
index cef862b..53c12cd 100644 (file)
@@ -141,18 +141,6 @@ class CharArg(ArgType):
        info.varlist.add('gchar', 'ret')
         info.codeafter.append('    return PyString_FromStringAndSize(&ret, 1);')
 class GUniCharArg(ArgType):
-    param_tmpl = ('    if (py_%(name)s[1] != 0) {\n'
-                  '        PyErr_SetString(PyExc_TypeError, "%(name)s should be a 1 character unicode string");\n'
-                  '        return NULL;\n'
-                  '    }\n'
-                  '    %(name)s = (gunichar)py_%(name)s[0];\n')
-    dflt_tmpl = ('    if (py_%(name)s != NULL) {\n'
-                 '        if (py_%(name)s[1] != 0) {\n'
-                 '            PyErr_SetString(PyExc_TypeError, "%(name)s should be a 1 character unicode string");\n'
-                 '            return NULL;\n'
-                 '        }\n'
-                 '        %(name)s = (gunichar)py_%(name)s[0];\n'
-                 '     }\n')
     ret_tmpl = ('#if !defined(Py_UNICODE_SIZE) || Py_UNICODE_SIZE == 2\n'
                 '    if (ret > 0xffff) {\n'
                 '        PyErr_SetString(PyExc_RuntimeError, "returned character can not be represented in 16-bit unicode");\n'
@@ -164,13 +152,10 @@ class GUniCharArg(ArgType):
     def write_param(self, ptype, pname, pdflt, pnull, info):
        if pdflt:
            info.varlist.add('gunichar', pname + " = '" + pdflt + "'")
-            info.codebefore.append(self.dflt_tmpl % {'name':pname})
        else:
            info.varlist.add('gunichar', pname)
-            info.codebefore.append(self.param_tmpl % {'name':pname})
-        info.varlist.add('Py_UNICODE', '*py_' + pname + ' = NULL')
        info.arglist.append(pname)
-        info.add_parselist('u', ['&py_' + pname], [pname])
+        info.add_parselist('O&', ['pyg_pyobj_to_unichar_conv', '&' + pname], [pname])
     def write_return(self, ptype, ownsreturn, info):
         info.varlist.add('gunichar', 'ret')
         info.varlist.add('Py_UNICODE', 'py_ret')
index 3da0e42..936c3be 100644 (file)
@@ -865,7 +865,7 @@ class GstMiniObjectWrapper(Wrapper):
     def get_initial_constructor_substdict(self, constructor):
         substdict = Wrapper.get_initial_constructor_substdict(self, constructor)
         if not constructor.caller_owns_return:
-            substdict['aftercreate'] = "    g_object_ref(self->obj);\n"
+            substdict['aftercreate'] = "    gst_mini_object_ref(self->obj);\n"
         else:
             substdict['aftercreate'] = ''
         return substdict
diff --git a/common b/common
index 694de4d..856fbbf 160000 (submodule)
--- a/common
+++ b/common
@@ -1 +1 @@
-Subproject commit 694de4dbf4827f372321f0634643a254d7edd986
+Subproject commit 856fbbfa88621ab67df141ead8d4d3df32c5c176