summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDimitri van Heesch <doxygen@gmail.com>2021-05-02 09:28:42 (GMT)
committerGitHub <noreply@github.com>2021-05-02 09:28:42 (GMT)
commit3463d27b600f7ce7c38354e45b86f030a1531928 (patch)
tree159c2a2049bc19c2028a6298c50ebf9c2b4f40e8
parentc2e278d30d613de23f6ecb86be3a562d20e82fb1 (diff)
parentb8a3ff6c33264c43cdf30c04baa9793e7e8d51a2 (diff)
downloadDoxygen-3463d27b600f7ce7c38354e45b86f030a1531928.zip
Doxygen-3463d27b600f7ce7c38354e45b86f030a1531928.tar.gz
Doxygen-3463d27b600f7ce7c38354e45b86f030a1531928.tar.bz2
Merge pull request #8333 from albert-github/feature/bug_305773
bug_305773 Volatile declaration is missing for variables in XML output
-rw-r--r--src/doxygen.cpp10
-rw-r--r--src/scanner.l12
-rw-r--r--src/sqlite3gen.cpp1
-rw-r--r--src/symbolresolver.cpp1
-rw-r--r--src/util.cpp24
-rw-r--r--src/xmlgen.cpp1
6 files changed, 43 insertions, 6 deletions
diff --git a/src/doxygen.cpp b/src/doxygen.cpp
index 8835b05..51fcd16 100644
--- a/src/doxygen.cpp
+++ b/src/doxygen.cpp
@@ -2729,10 +2729,12 @@ static bool isVarWithConstructor(const Entry *root)
if (reg::search(resType,match,idChars) && match.position()==0) // resType starts with identifier
{
resType=match.str();
- //printf("resType=%s\n",qPrint(resType));
- if (resType=="int" || resType=="long" || resType=="float" ||
- resType=="double" || resType=="char" || resType=="signed" ||
- resType=="const" || resType=="unsigned" || resType=="void")
+ //printf("resType=%s\n",resType.data());
+ if (resType=="int" || resType=="long" ||
+ resType=="float" || resType=="double" ||
+ resType=="char" || resType=="void" ||
+ resType=="signed" || resType=="unsigned" ||
+ resType=="const" || resType=="volatile" )
{
result=FALSE; // type keyword -> function prototype
goto done;
diff --git a/src/scanner.l b/src/scanner.l
index fdd8b93..00fa3b4 100644
--- a/src/scanner.l
+++ b/src/scanner.l
@@ -2317,6 +2317,18 @@ NONLopt [^\n]*
}
yyextra->current->name=yyextra->current->name.mid(6);
}
+ else if (yyextra->current->name.left(9)=="volatile ")
+ {
+ if (yyextra->current->type.isEmpty())
+ {
+ yyextra->current->type="volatile";
+ }
+ else
+ {
+ yyextra->current->type+="volatile ";
+ }
+ yyextra->current->name=yyextra->current->name.mid(9);
+ }
}
QCString tmp=yytext;
if (nameIsOperator(tmp))
diff --git a/src/sqlite3gen.cpp b/src/sqlite3gen.cpp
index 7824fca..6943fb9 100644
--- a/src/sqlite3gen.cpp
+++ b/src/sqlite3gen.cpp
@@ -1136,7 +1136,6 @@ static void stripQualifiers(QCString &typeStr)
{
if (typeStr.stripPrefix("static "));
else if (typeStr.stripPrefix("virtual "));
- else if (typeStr.stripPrefix("volatile "));
else if (typeStr=="virtual") typeStr="";
else done=TRUE;
}
diff --git a/src/symbolresolver.cpp b/src/symbolresolver.cpp
index f509c7d..17843a1 100644
--- a/src/symbolresolver.cpp
+++ b/src/symbolresolver.cpp
@@ -533,6 +533,7 @@ const ClassDef *SymbolResolver::Private::newResolveTypedef(
}
type=type.left(ip+1);
type.stripPrefix("const "); // strip leading "const"
+ type.stripPrefix("volatile "); // strip leading "volatile"
type.stripPrefix("struct "); // strip leading "struct"
type.stripPrefix("union "); // strip leading "union"
int sp=0;
diff --git a/src/util.cpp b/src/util.cpp
index 9941d09..37c5e62 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -495,6 +495,7 @@ int computeQualifiedIndex(const QCString &name)
//-------------------------------------------------------------------------
static const char constScope[] = { 'c', 'o', 'n', 's', 't', ':' };
+static const char volatileScope[] = { 'v', 'o', 'l', 'a', 't', 'i', 'l', 'e', ':' };
static const char virtualScope[] = { 'v', 'i', 'r', 't', 'u', 'a', 'l', ':' };
static const char operatorScope[] = { 'o', 'p', 'e', 'r', 'a', 't', 'o', 'r', '?', '?', '?' };
@@ -565,6 +566,7 @@ QCString removeRedundantWhiteSpace(const QCString &s)
uint i=0;
uint l=s.length();
uint csp=0;
+ uint vosp=0;
uint vsp=0;
uint osp=0;
char c;
@@ -590,6 +592,16 @@ QCString removeRedundantWhiteSpace(const QCString &s)
else // reset counter
csp=0;
+ if (vosp<6 && c==volatileScope[vosp] && // character matches substring "volatile"
+ (vosp>0 || // inside search string
+ i==0 || // if it is the first character
+ !isId(pc) // the previous may not be a digit
+ )
+ )
+ vosp++;
+ else // reset counter
+ vosp=0;
+
// search for "virtual"
if (vsp<8 && c==virtualScope[vsp] && // character matches substring "virtual"
(vsp>0 || // inside search string
@@ -727,6 +739,11 @@ QCString removeRedundantWhiteSpace(const QCString &s)
*dst++=' ';
csp=0;
}
+ else if (vosp==9) // replace volatile::A by volatile ::A
+ {
+ *dst++=' ';
+ vosp=0;
+ }
else if (vsp==8) // replace virtual::A by virtual ::A
{
*dst++=' ';
@@ -764,6 +781,13 @@ QCString removeRedundantWhiteSpace(const QCString &s)
*dst++=' ';
csp=0;
}
+ else if (c=='e' && vosp==8 && i<l-1 && // found 'e' in 'volatile'
+ !(isId(nc) || nc==')' || nc==',' || isspace((uchar)nc))
+ ) // prevent volatile ::A from being converted to volatile::A
+ {
+ *dst++=' ';
+ vosp=0;
+ }
else if (c=='l' && vsp==7 && i<l-1 && // found 'l' in 'virtual'
!(isId(nc) || nc==')' || nc==',' || isspace((uchar)nc))
) // prevent virtual ::A from being converted to virtual::A
diff --git a/src/xmlgen.cpp b/src/xmlgen.cpp
index 86f3081..46b0084 100644
--- a/src/xmlgen.cpp
+++ b/src/xmlgen.cpp
@@ -489,7 +489,6 @@ static void stripQualifiers(QCString &typeStr)
{
if (typeStr.stripPrefix("static "));
else if (typeStr.stripPrefix("virtual "));
- else if (typeStr.stripPrefix("volatile "));
else if (typeStr=="virtual") typeStr="";
else done=TRUE;
}