bool astIsSignedChar(const Token *tok) { if (!tok) return false; if (tok->str() == "*" && tok->astOperand1() && !tok->astOperand2()) { const Variable *var = tok->astOperand1()->variable(); if (!var || !var->isPointer()) return false; const Token *type = var->typeStartToken(); while (type && type->str() == "const") type = type->next(); return (type && type->str() == "char" && !type->isUnsigned()); } return isSignedChar(tok->variable()); }
bool Type::isAnyChar() const { return isPlainChar() || isUnsignedChar() || isSignedChar(); }
bool Type::isSigned() const { //XXX what about plain char? return isSignedChar() || isShort() || isInt() || isLong() || isLongLong(); }