Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR #9605 different fixes #9614

Merged
merged 2 commits into from
Sep 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 14 additions & 10 deletions src/pre.l
Original file line number Diff line number Diff line change
Expand Up @@ -2755,14 +2755,18 @@ static QCString removeIdsAndMarkers(const QCString &s)
static const std::vector<std::string> signs = { "signed", "unsigned" };
struct TypeInfo { std::string name; size_t size; };
static const std::vector<TypeInfo> types = {
{ "int", sizeof(int) },
{ "bool", sizeof(bool) },
{ "long long", sizeof(long long) }, // longest first
{ "long", sizeof(long) },
{ "char", sizeof(char) },
{ "short", sizeof(short) },
{ "float", sizeof(float) },
{ "double", sizeof(double) },
{ "short int", sizeof(short int) },
{ "long long int", sizeof(long long int) },
{ "long int", sizeof(long int) },
{ "long long", sizeof(long long) },
{ "long double", sizeof(long double) },
{ "int", sizeof(int) },
{ "short", sizeof(short) },
{ "bool", sizeof(bool) },
{ "long", sizeof(long) },
{ "char", sizeof(char) },
{ "float", sizeof(float) },
{ "double", sizeof(double) },
};

// Check if string p starts with basic types ending with a ')', such as 'signed long)' or ' float )'
Expand All @@ -2774,9 +2778,9 @@ static QCString removeIdsAndMarkers(const QCString &s)
while (*q==' ' || *q=='\t') q++;
bool found=false;
size_t size = sizeof(int); // '(signed)' or '(unsigned)' is an int type
for (const auto &s : signs)
for (const auto &sgn : signs)
{
if (qstrncmp(q,s.c_str(),s.length())==0) { q+=s.length(); found=true; }
if (qstrncmp(q,sgn.c_str(),sgn.length())==0) { q+=sgn.length(); found=true; }
}
if (!found || *q==' ' || *q=='\t' || *q==')') // continue searching
{
Expand Down
12 changes: 12 additions & 0 deletions src/qcstring.h
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,18 @@ class QCString
return *this;
}

QCString &setNum(long long n)
{
m_rep = std::to_string(n);
return *this;
}

QCString &setNum(unsigned long long n)
{
m_rep = std::to_string(n);
return *this;
}

QCString &setNum(ulong n)
{
m_rep = std::to_string(n);
Expand Down