| 1968 | } |
| 1969 | |
| 1970 | void CheckIOImpl::argumentType(std::ostream& os, const ArgumentInfo * argInfo) |
| 1971 | { |
| 1972 | if (argInfo) { |
| 1973 | os << "\'"; |
| 1974 | const Token *type = argInfo->typeToken; |
| 1975 | if (type->tokType() == Token::eString) { |
| 1976 | if (type->isLong()) |
| 1977 | os << "const wchar_t *"; |
| 1978 | else |
| 1979 | os << "const char *"; |
| 1980 | } else { |
| 1981 | if (type->originalName().empty()) { |
| 1982 | if (type->strAt(-1) == "const") |
| 1983 | os << "const "; |
| 1984 | while (Token::Match(type, "const|struct")) { |
| 1985 | os << type->str() << " "; |
| 1986 | type = type->next(); |
| 1987 | } |
| 1988 | while (Token::Match(type, "%any% ::")) { |
| 1989 | os << type->str() << "::"; |
| 1990 | type = type->tokAt(2); |
| 1991 | } |
| 1992 | os << type->stringify(false, true, false); |
| 1993 | if (type->strAt(1) == "*" && !argInfo->element) |
| 1994 | os << " *"; |
| 1995 | else if (argInfo->variableInfo && !argInfo->element && argInfo->variableInfo->isArray()) |
| 1996 | os << " *"; |
| 1997 | else if (type->strAt(1) == "*" && argInfo->variableInfo && argInfo->element && argInfo->variableInfo->isArray()) |
| 1998 | os << " *"; |
| 1999 | if (argInfo->address) |
| 2000 | os << " *"; |
| 2001 | } else { |
| 2002 | if (type->isUnsigned()) { |
| 2003 | if (type->originalName() == "__int64" || type->originalName() == "__int32" || type->originalName() == "ptrdiff_t") |
| 2004 | os << "unsigned "; |
| 2005 | } |
| 2006 | os << type->originalName(); |
| 2007 | if (type->strAt(1) == "*" || argInfo->address) |
| 2008 | os << " *"; |
| 2009 | os << " {aka " << type->stringify(false, true, false); |
| 2010 | if (type->strAt(1) == "*" || argInfo->address) |
| 2011 | os << " *"; |
| 2012 | os << "}"; |
| 2013 | } |
| 2014 | } |
| 2015 | os << "\'"; |
| 2016 | } else |
| 2017 | os << "Unknown"; |
| 2018 | } |
| 2019 | |
| 2020 | void CheckIOImpl::invalidLengthModifierError(const Token* tok, nonneg int numFormat, const std::string& modifier) |
| 2021 | { |
no test coverage detected