Skip to content

Commit

Permalink
Merge pull request #9614 from albert-github/feature/bug_9605_preproce…
Browse files Browse the repository at this point in the history
…ssor

PR #9605 different fixes
  • Loading branch information
doxygen committed Sep 28, 2022
2 parents 36b1fa7 + 25ef956 commit 2d64523
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 10 deletions.
24 changes: 14 additions & 10 deletions src/pre.l
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
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

0 comments on commit 2d64523

Please sign in to comment.