summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoralbert-github <albert.tests@gmail.com>2021-01-13 17:26:35 (GMT)
committeralbert-github <albert.tests@gmail.com>2021-01-13 17:26:35 (GMT)
commit4dba9fbdda10889d2285b85b7e9ff6282b34fccf (patch)
treef94d74cab726675800b6f7bb25bae8b4466bfb0a
parent6acb8c375f28e9f058769f3a0c7d0325a3bf58e7 (diff)
downloadDoxygen-4dba9fbdda10889d2285b85b7e9ff6282b34fccf.zip
Doxygen-4dba9fbdda10889d2285b85b7e9ff6282b34fccf.tar.gz
Doxygen-4dba9fbdda10889d2285b85b7e9ff6282b34fccf.tar.bz2
bug_305773 Volatile declaration is missing for variables in XML output
Handle "const" and "volatile" in the same way, they are bit cv-qualifiers
-rw-r--r--src/doxygen.cpp9
-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, 5 deletions
diff --git a/src/doxygen.cpp b/src/doxygen.cpp
index 3fdde9b..f3e5ef0 100644
--- a/src/doxygen.cpp
+++ b/src/doxygen.cpp
@@ -2613,9 +2613,12 @@ static bool isVarWithConstructor(const Entry *root)
{
resType=resType.left(len);
//printf("resType=%s\n",resType.data());
- if (resType=="int" || resType=="long" || resType=="float" ||
- resType=="double" || resType=="char" || resType=="signed" ||
- resType=="const" || resType=="unsigned" || resType=="void")
+ if (resType=="int" || resType=="long" ||
+ resType=="float" || resType=="double" ||
+ resType=="char" ||
+ resType=="signed" || resType=="unsigned" ||
+ resType=="const" || resType=="volatile" ||
+ resType=="void")
{
result=FALSE; // type keyword -> function prototype
goto done;
diff --git a/src/scanner.l b/src/scanner.l
index 66437bc..6441165 100644
--- a/src/scanner.l
+++ b/src/scanner.l
@@ -2196,6 +2196,18 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
}
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 67adebf..f0d2a12 100644
--- a/src/sqlite3gen.cpp
+++ b/src/sqlite3gen.cpp
@@ -1143,7 +1143,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 9f80c15..80ec700 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 3feb8db..7bc9565 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -510,6 +510,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', '?', '?', '?' };
@@ -580,6 +581,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;
@@ -605,6 +607,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
@@ -742,6 +754,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++=' ';
@@ -779,6 +796,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 70fcd70..118a6cd 100644
--- a/src/xmlgen.cpp
+++ b/src/xmlgen.cpp
@@ -487,7 +487,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;
}