mirror of
https://github.com/zeldaret/tp
synced 2026-08-30 17:29:39 -04:00
change split.py to output extern vars/functions into generate CPP (#98)
* change split.py to output extern vars/functions into generate CPP also change demangling to use short type names * don't take files for extern funcs/vars anymore Co-authored-by: Pheenoh <pheenoh@gmail.com>
This commit is contained in:
@@ -10,14 +10,21 @@ types = {
|
||||
'l': 'long',
|
||||
's': 'short',
|
||||
'c': 'char',
|
||||
'f': 'float',
|
||||
'd': 'double',
|
||||
'f': 'f32',
|
||||
'd': 'f64',
|
||||
'v': 'void',
|
||||
'x': 'long long',
|
||||
'b': 'bool',
|
||||
'e': 'varargs...',
|
||||
}
|
||||
|
||||
short_type_names = {
|
||||
'char': '8',
|
||||
'short': '16',
|
||||
'long' : '32',
|
||||
'long long': '64',
|
||||
}
|
||||
|
||||
# {'defctor', 'ops',}
|
||||
|
||||
special_funcs = {
|
||||
@@ -55,9 +62,13 @@ class Param:
|
||||
ret = ''
|
||||
if self.is_const:
|
||||
ret += 'const '
|
||||
if self.is_unsigned:
|
||||
ret += 'unsigned '
|
||||
ret += self.name
|
||||
if self.name in short_type_names:
|
||||
ret += 'u' if self.is_unsigned else 's'
|
||||
ret += short_type_names[self.name]
|
||||
else:
|
||||
if self.is_unsigned:
|
||||
ret += 'unsigned '
|
||||
ret += self.name
|
||||
for _ in range(self.pointer_lvl):
|
||||
ret += '*'
|
||||
if self.is_ref:
|
||||
|
||||
Reference in New Issue
Block a user