From 5b34e51e3b7f8e5161edaf69941f30599d16c77f Mon Sep 17 00:00:00 2001
From: Martin Braun <martin.braun@ettus.com>
Date: Wed, 20 May 2015 09:21:55 -0700
Subject: modtool: Fixed correct pointer arg type stripping

---
 gr-utils/python/modtool/util_functions.py | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

(limited to 'gr-utils/python/modtool/util_functions.py')

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.
-- 
cgit v1.2.3