Call correct functions for various integer types (even though they don't do the right thing yet)

This commit is contained in:
Yevgen Muntyan 2011-01-24 23:30:00 -08:00
parent 3c4555766c
commit f27300b4c3
3 changed files with 28 additions and 10 deletions

View File

@ -77,11 +77,10 @@ class SimpleArgHelper(ArgHelper):
_arg_helpers = {}
_arg_helpers['int'] = SimpleArgHelper('int', 'int')
_arg_helpers['uint'] = SimpleArgHelper('guint', 'int')
_arg_helpers['gint'] = SimpleArgHelper('int', 'int')
_arg_helpers['guint'] = SimpleArgHelper('guint', 'int')
_arg_helpers['glong'] = SimpleArgHelper('long', 'int')
_arg_helpers['gulong'] = SimpleArgHelper('gulong', 'int')
_arg_helpers['guint'] = SimpleArgHelper('guint', 'uint')
_arg_helpers['glong'] = SimpleArgHelper('long', 'long')
_arg_helpers['gulong'] = SimpleArgHelper('gulong', 'ulong')
_arg_helpers['gboolean'] = SimpleArgHelper('gboolean', 'bool')
_arg_helpers['index'] = SimpleArgHelper('int', 'index')
_arg_helpers['double'] = SimpleArgHelper('double', 'double')
@ -98,12 +97,12 @@ def find_arg_helper(param):
return _arg_helpers[param.type.name]
_pod_ret_helpers = {}
_pod_ret_helpers['int'] = ('int', 'int')
_pod_ret_helpers['uint'] = ('guint', 'int')
_pod_ret_helpers['gint'] = ('int', 'int')
_pod_ret_helpers['guint'] = ('guint', 'int')
_pod_ret_helpers['glong'] = ('long', 'int')
_pod_ret_helpers['gulong'] = ('gulong', 'int')
_pod_ret_helpers['int'] = ('int', 'int64')
_pod_ret_helpers['uint'] = ('guint', 'uint64')
_pod_ret_helpers['gint'] = ('int', 'int64')
_pod_ret_helpers['guint'] = ('guint', 'uint64')
_pod_ret_helpers['glong'] = ('long', 'int64')
_pod_ret_helpers['gulong'] = ('gulong', 'uint64')
_pod_ret_helpers['gboolean'] = ('gboolean', 'bool')
_pod_ret_helpers['index'] = ('int', 'index')
def find_pod_ret_helper(name):

View File

@ -958,6 +958,21 @@ moo_lua_push_bool (lua_State *L,
int
moo_lua_push_int (lua_State *L,
int value)
{
return moo_lua_push_int64 (L, value);
}
int
moo_lua_push_int64 (lua_State *L,
gint64 value)
{
lua_pushinteger (L, value);
return 1;
}
int
moo_lua_push_uint64 (lua_State *L,
guint64 value)
{
lua_pushinteger (L, value);
return 1;

View File

@ -195,6 +195,10 @@ int moo_lua_push_bool (lua_State *L,
gboolean value);
int moo_lua_push_int (lua_State *L,
int value);
int moo_lua_push_int64 (lua_State *L,
gint64 value);
int moo_lua_push_uint64 (lua_State *L,
guint64 value);
int moo_lua_push_index (lua_State *L,
int value);
int moo_lua_push_strv (lua_State *L,