Example #1
0
def callable_body_returning_other(callable_, cfg):
    ret = callable_.return_type()['base']
    return_type = gencommon.map_type(callable_.return_type(), 'cpp', cfg)
    invocation = form_invocation(callable_, cfg)
    if declarations.type_traits.is_enum(ret):
        invocation = 'static_cast<%s>(%s)' % (return_type, invocation)
    return locals()
Example #2
0
def callable_body_returning_other(callable_, cfg):
    ret = callable_.return_type()['base']
    return_type = gencommon.map_type(callable_.return_type(), 'cpp', cfg)
    invocation=form_invocation(callable_,cfg)
    if declarations.type_traits.is_enum(ret):
        invocation='static_cast<%s>(%s)' % (return_type, invocation)
    return locals()
Example #3
0
def c_callable_body_returning_other(callable_, cfg):
    arglist, pre = c_prepare_args(callable_)
    pre = "\n        ".join(pre)
    arglist = ', '.join(arglist)
    return_type = gencommon.map_type(callable_.return_type(), 'c', cfg)
    invocation = "%s%s(%s)" % (callable_.is_memfun() and 'this__->' or '',
                               callable_.callable_object().name(), arglist)
    if callable_.return_type()['category'] == 'const_pointer':
        err_ret_value = '0'
    else:
        err_ret_value = cfg['err_ret_value'](return_type)
    return locals()
Example #4
0
def c_callable_body_returning_other(callable_, cfg):
    arglist, pre = c_prepare_args(callable_)
    pre = "\n        ".join(pre)
    arglist = ', '.join(arglist)
    return_type = gencommon.map_type(callable_.return_type(), 'c', cfg)
    invocation = "%s%s(%s)" % (callable_.is_memfun() and 'this__->' or '',
                                callable_.callable_object().name(),
                                arglist)
    if callable_.return_type()['category'] == 'const_pointer':
        err_ret_value = '0'
    else:
        err_ret_value = cfg['err_ret_value'](return_type)
    return locals()