summaryrefslogtreecommitdiffstats
path: root/src/defargs.l
diff options
context:
space:
mode:
Diffstat (limited to 'src/defargs.l')
-rw-r--r--src/defargs.l35
1 files changed, 25 insertions, 10 deletions
diff --git a/src/defargs.l b/src/defargs.l
index 86e2529..d726fa9 100644
--- a/src/defargs.l
+++ b/src/defargs.l
@@ -104,17 +104,32 @@ static int yyread(char *buf,int max_size)
}
/* bug_520975 */
-static bool checkSpecialType(QCString &typ, QCString &nam)
+static bool nameIsActuallyPartOfType(QCString &name)
{
- if (nam == "unsigned" || nam == "signed" ||
- nam == "int" || nam == "long" ||
- nam == "volatile" || nam == "const") return TRUE;
- QCStringList qsl=QCStringList::split(' ',typ);
- for (uint j=0;j<qsl.count();j++)
+ static bool first=TRUE;
+ static QDict<void> keywords(17);
+ if (first) // fill keyword dict first time
{
- if (!(qsl[j] == "volatile" || qsl[j] == "const")) return FALSE;
+ #define DUMMY_ADDR (void*)0x8
+ keywords.insert("unsigned", DUMMY_ADDR); // foo(... unsigned)
+ keywords.insert("signed", DUMMY_ADDR); // foo(... signed)
+ keywords.insert("bool", DUMMY_ADDR); // foo(... bool)
+ keywords.insert("char", DUMMY_ADDR); // foo(... char)
+ keywords.insert("int", DUMMY_ADDR); // foo(... int)
+ keywords.insert("long", DUMMY_ADDR); // foo(... long)
+ keywords.insert("float", DUMMY_ADDR); // foo(... float)
+ keywords.insert("double", DUMMY_ADDR); // foo(... double)
+ keywords.insert("int8_t", DUMMY_ADDR); // foo(... int8_t)
+ keywords.insert("uint8_t", DUMMY_ADDR); // foo(... uint8_t)
+ keywords.insert("int16_t", DUMMY_ADDR); // foo(... int16_t)
+ keywords.insert("uint16_t", DUMMY_ADDR); // foo(... uint16_t)
+ keywords.insert("int32_t", DUMMY_ADDR); // foo(... int32_t)
+ keywords.insert("uint32_t", DUMMY_ADDR); // foo(... uint32_t)
+ keywords.insert("const", DUMMY_ADDR); // foo(... const)
+ keywords.insert("volatile", DUMMY_ADDR); // foo(... volatile)
+ first=FALSE;
}
- return TRUE;
+ return keywords.find(name)!=0;
}
%}
@@ -398,9 +413,9 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\"
a->type.mid(sv)=="union" ||
a->type.mid(sv)=="class" ||
a->type.mid(sv)=="typename" ||
- checkSpecialType(a->type, a->name)
+ nameIsActuallyPartOfType(a->name)
)
- {
+ {
a->type = a->type + " " + a->name;
a->name.resize(0);
}