Commit b3d30899 authored by Christian Kamm's avatar Christian Kamm

Fix two small bugs in TypePrettyPrinter.

- unsigned* was printed as unsigned
- Type **name was printed as Type**name
parent a266e638
...@@ -141,12 +141,12 @@ QList<FullySpecifiedType> TypePrettyPrinter::switchPtrOperators(const QList<Full ...@@ -141,12 +141,12 @@ QList<FullySpecifiedType> TypePrettyPrinter::switchPtrOperators(const QList<Full
void TypePrettyPrinter::applyPtrOperators(bool wantSpace) void TypePrettyPrinter::applyPtrOperators(bool wantSpace)
{ {
if (wantSpace && !_ptrOperators.isEmpty())
space();
for (int i = _ptrOperators.size() - 1; i != -1; --i) { for (int i = _ptrOperators.size() - 1; i != -1; --i) {
const FullySpecifiedType op = _ptrOperators.at(i); const FullySpecifiedType op = _ptrOperators.at(i);
if (i == 0 && wantSpace)
space();
if (op->isPointerType()) { if (op->isPointerType()) {
_text += QLatin1Char('*'); _text += QLatin1Char('*');
outCV(op); outCV(op);
...@@ -161,6 +161,11 @@ void TypePrettyPrinter::applyPtrOperators(bool wantSpace) ...@@ -161,6 +161,11 @@ void TypePrettyPrinter::applyPtrOperators(bool wantSpace)
} }
} }
void TypePrettyPrinter::visit(UndefinedType *)
{
applyPtrOperators();
}
void TypePrettyPrinter::visit(VoidType *) void TypePrettyPrinter::visit(VoidType *)
{ {
_text += QLatin1String("void"); _text += QLatin1String("void");
......
...@@ -58,6 +58,7 @@ protected: ...@@ -58,6 +58,7 @@ protected:
void applyPtrOperators(bool wantSpace = true); void applyPtrOperators(bool wantSpace = true);
void acceptType(const FullySpecifiedType &ty); void acceptType(const FullySpecifiedType &ty);
virtual void visit(UndefinedType *type);
virtual void visit(VoidType *type); virtual void visit(VoidType *type);
virtual void visit(IntegerType *type); virtual void visit(IntegerType *type);
virtual void visit(FloatType *type); virtual void visit(FloatType *type);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment