aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/cplusplus/TypePrettyPrinter.cpp
diff options
context:
space:
mode:
authorChristian Kamm <christian.d.kamm@nokia.com>2009-12-23 11:38:05 +0100
committerChristian Kamm <christian.d.kamm@nokia.com>2009-12-23 11:38:05 +0100
commitb3d308995589d095a934e8ceb7158d86d925c42d (patch)
tree1f40e68e1db8c05f8cb18f953334c670fd87e3af /src/libs/cplusplus/TypePrettyPrinter.cpp
parenta266e638d6387baf07d34dd26cafbf92c393427a (diff)
Fix two small bugs in TypePrettyPrinter.
- unsigned* was printed as unsigned - Type **name was printed as Type**name
Diffstat (limited to 'src/libs/cplusplus/TypePrettyPrinter.cpp')
-rw-r--r--src/libs/cplusplus/TypePrettyPrinter.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/libs/cplusplus/TypePrettyPrinter.cpp b/src/libs/cplusplus/TypePrettyPrinter.cpp
index 3f4e1274c3..4d08bd7109 100644
--- a/src/libs/cplusplus/TypePrettyPrinter.cpp
+++ b/src/libs/cplusplus/TypePrettyPrinter.cpp
@@ -141,12 +141,12 @@ QList<FullySpecifiedType> TypePrettyPrinter::switchPtrOperators(const QList<Full
void TypePrettyPrinter::applyPtrOperators(bool wantSpace)
{
+ if (wantSpace && !_ptrOperators.isEmpty())
+ space();
+
for (int i = _ptrOperators.size() - 1; i != -1; --i) {
const FullySpecifiedType op = _ptrOperators.at(i);
- if (i == 0 && wantSpace)
- space();
-
if (op->isPointerType()) {
_text += QLatin1Char('*');
outCV(op);
@@ -161,6 +161,11 @@ void TypePrettyPrinter::applyPtrOperators(bool wantSpace)
}
}
+void TypePrettyPrinter::visit(UndefinedType *)
+{
+ applyPtrOperators();
+}
+
void TypePrettyPrinter::visit(VoidType *)
{
_text += QLatin1String("void");