mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-25 01:30:38 +00:00
codegen/argtypes.py (UInt64Arg.write_param): Parse long arguments using ParseTuple and friends; allows ints to passed...
Original commit message from CVS: 2006-02-06 Andy Wingo <wingo@pobox.com> * codegen/argtypes.py (UInt64Arg.write_param): Parse long arguments using ParseTuple and friends; allows ints to passed for longs as a side benefit.
This commit is contained in:
parent
b92ae45a82
commit
fd727fd969
3 changed files with 13 additions and 13 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2006-02-06 Andy Wingo <wingo@pobox.com>
|
||||||
|
|
||||||
|
* codegen/argtypes.py (UInt64Arg.write_param): Parse long
|
||||||
|
arguments using ParseTuple and friends; allows ints to passed for
|
||||||
|
longs as a side benefit.
|
||||||
|
|
||||||
2006-02-02 Edward Hervey <edward@fluendo.com>
|
2006-02-02 Edward Hervey <edward@fluendo.com>
|
||||||
|
|
||||||
* gst/gst.override:
|
* gst/gst.override:
|
||||||
|
|
|
@ -294,19 +294,13 @@ class Int64Arg(ArgType):
|
||||||
info.codeafter.append(' return PyLong_FromLongLong(ret);')
|
info.codeafter.append(' return PyLong_FromLongLong(ret);')
|
||||||
|
|
||||||
class UInt64Arg(ArgType):
|
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):
|
def write_param(self, ptype, pname, pdflt, pnull, keeprefcount, info):
|
||||||
if pdflt:
|
if pdflt:
|
||||||
info.varlist.add('guint64', pname + ' = ' + pdflt)
|
info.varlist.add('guint64', pname + ' = ' + pdflt)
|
||||||
info.codebefore.append(self.dflt % {'name':pname})
|
else:
|
||||||
else:
|
info.varlist.add('guint64', pname)
|
||||||
info.varlist.add('guint64', pname)
|
info.arglist.append(pname)
|
||||||
info.codebefore.append(self.before % {'name':pname})
|
info.add_parselist('K', ['&' + pname], [pname])
|
||||||
info.varlist.add('PyObject', "*py_" + pname + ' = NULL')
|
|
||||||
info.arglist.append(pname)
|
|
||||||
info.add_parselist('O!', ['&PyLong_Type', '&py_' + pname], [pname])
|
|
||||||
def write_return(self, ptype, ownsreturn, info):
|
def write_return(self, ptype, ownsreturn, info):
|
||||||
info.varlist.add('guint64', 'ret')
|
info.varlist.add('guint64', 'ret')
|
||||||
info.codeafter.append(' return PyLong_FromUnsignedLongLong(ret);')
|
info.codeafter.append(' return PyLong_FromUnsignedLongLong(ret);')
|
||||||
|
|
2
common
2
common
|
@ -1 +1 @@
|
||||||
Subproject commit 79d67fe009b6120b82d51df860c78e8361f02aea
|
Subproject commit 58567e5519f2d00a4592491db1a6e8302993279e
|
Loading…
Reference in a new issue