diff options
author | Martin Braun <martin.braun@ettus.com> | 2015-05-20 09:21:55 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2015-05-20 09:21:55 -0700 |
commit | 5b34e51e3b7f8e5161edaf69941f30599d16c77f (patch) | |
tree | 1d39d6ea622fb551932df07bd917c211a4579649 /gr-utils | |
parent | 608c13518e2d5e30b4eed633d7286eb1ebb60ad9 (diff) |
modtool: Fixed correct pointer arg type stripping
Diffstat (limited to 'gr-utils')
-rw-r--r-- | gr-utils/python/modtool/util_functions.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/gr-utils/python/modtool/util_functions.py b/gr-utils/python/modtool/util_functions.py index ea7af0cf7c..47799ac461 100644 --- a/gr-utils/python/modtool/util_functions.py +++ b/gr-utils/python/modtool/util_functions.py @@ -71,10 +71,17 @@ def strip_default_values(string): return re.sub(' *=[^,)]*', '', string) def strip_arg_types(string): - """" Strip the argument types from a list of arguments - Example: "int arg1, double arg2" -> "arg1, arg2" """ + """" + Strip the argument types from a list of arguments. + Example: "int arg1, double arg2" -> "arg1, arg2" + Note that some types have qualifiers, which also are part of + the type, e.g. "const std::string &name" -> "name", or + "const char *str" -> "str". + """ string = strip_default_values(string) - return ", ".join([part.strip().split(' ')[-1] for part in string.split(',')]).replace('&', '') + return ", ".join( + [part.strip().split(' ')[-1] for part in string.split(',')] + ).translate(None, '*&') def strip_arg_types_grc(string): """" Strip the argument types from a list of arguments for GRC make tag. |