codegen/argtypes.py: Revert the UInt64Arg modifications from upstream. It forces...
authorEdward Hervey <bilboed@bilboed.com>
Tue, 3 Oct 2006 09:24:11 +0000 (09:24 +0000)
committerEdward Hervey <bilboed@bilboed.com>
Tue, 3 Oct 2006 09:24:11 +0000 (09:24 +0000)
Original commit message from CVS:
* codegen/argtypes.py:
Revert the UInt64Arg modifications from upstream. It forces us to give
a PyLong, whereas we can directly use the 'K' argument parsing for that.

ChangeLog
codegen/argtypes.py
common

index 6adc84f..dba7719 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-10-03  Edward Hervey  <edward@fluendo.com>
+
+       * codegen/argtypes.py:
+       Revert the UInt64Arg modifications from upstream. It forces us to give
+       a PyLong, whereas we can directly use the 'K' argument parsing for that.
+
 2006-09-29  Edward Hervey  <edward@fluendo.com>
 
        * ltihooks.py:
index 32ca33c..e578a8c 100644 (file)
@@ -320,19 +320,13 @@ class Int64Arg(ArgType):
         info.codeafter.append('    return PyLong_FromLongLong(ret);')
 
 class UInt64Arg(ArgType):
-    dflt = '    if (py_%(name)s)\n' \
-           '        %(name)s = PyLong_AsUnsignedLongLong(py_%(name)s);\n'
-    before = '    %(name)s = PyLong_AsUnsignedLongLong(py_%(name)s);\n'
     def write_param(self, ptype, pname, pdflt, pnull, keeprefcount, info):
         if pdflt:
             info.varlist.add('guint64', pname + ' = ' + pdflt)
-            info.codebefore.append(self.dflt % {'name':pname})
         else:
             info.varlist.add('guint64', pname)
-            info.codebefore.append(self.before % {'name':pname})
-        info.varlist.add('PyObject', "*py_" + pname + ' = NULL')
         info.arglist.append(pname)
-        info.add_parselist('O!', ['&PyLong_Type', '&py_' + pname], [pname])
+        info.add_parselist('K', ['&' + pname], [pname])
     def write_return(self, ptype, ownsreturn, info):
         info.varlist.add('guint64', 'ret')
         info.codeafter.append('    return PyLong_FromUnsignedLongLong(ret);')
diff --git a/common b/common
index bdd0108..9991f6f 160000 (submodule)
--- a/common
+++ b/common
@@ -1 +1 @@
-Subproject commit bdd0108b3540ffadeb82cee28b8867a8a6e7ae78
+Subproject commit 9991f6fa61ee11475c390dd6675ef7952f079e43