Skip to content

Commit

Permalink
PR doxygen#9605 different fixes
Browse files Browse the repository at this point in the history
- compilation on github
- a missing tests, were also not in my original code
- shadowed variable
  • Loading branch information
albert-github committed Sep 27, 2022
1 parent 36b1fa7 commit af398b2
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 10 deletions.
23 changes: 13 additions & 10 deletions src/pre.l
Expand Up @@ -2755,14 +2755,17 @@ 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) },
{ "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 +2777,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 af398b2

Please sign in to comment.