[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 01/01: modtool: Fixed correct pointer arg t
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 01/01: modtool: Fixed correct pointer arg type stripping |
Date: |
Wed, 27 May 2015 16:59:46 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
jcorgan pushed a commit to branch maint
in repository gnuradio.
commit 5b34e51e3b7f8e5161edaf69941f30599d16c77f
Author: Martin Braun <address@hidden>
Date: Wed May 20 09:21:55 2015 -0700
modtool: Fixed correct pointer arg type stripping
---
gr-utils/python/modtool/util_functions.py | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/gr-utils/python/modtool/util_functions.py
b/gr-utils/python/modtool/util_functions.py
index ea7af0c..47799ac 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.