def mut(value, ty):
nty = ''
if ty in ['io_string_t', 'io_name_t']:
ret = '{'
for x in value[1:-1].split(','):
ret += 'mut_byte(%s),'%x
ret = ret[:-1]+'}'
return ret
elif '*' in ty or ty in const.TYPE_PTR:
nty = 'ptr'
elif ty in const.TYPE_SIZE:
size = const.TYPE_SIZE[ty]
if size == 1:
nty = 'byte'
elif size == 2:
nty = 'short'
elif size == 4:
nty = 'int'
elif size == 8:
nty = 'long'
if nty == '':
utils.error('mut error : %s'%ty)
return '(%s) mut_%s(%s)'%(ty, nty, str(value))
评论列表
文章目录