Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
doxverilog
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
doxverilog
Commits
41887832
Commit
41887832
authored
Aug 31, 2014
by
Dimitri van Heesch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed a number of issues (resource leaks, uninitialized members, etc) found by coverity
parent
b59edd27
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
42 additions
and
36 deletions
+42
-36
qgstring.cpp
qtools/qgstring.cpp
+1
-1
qthread.cpp
qtools/qthread.cpp
+1
-0
docparser.cpp
src/docparser.cpp
+2
-1
doxygen.cpp
src/doxygen.cpp
+26
-27
htmlhelp.cpp
src/htmlhelp.cpp
+1
-0
index.cpp
src/index.cpp
+1
-1
msc.cpp
src/msc.cpp
+1
-0
pre.l
src/pre.l
+3
-0
template.cpp
src/template.cpp
+6
-6
No files found.
qtools/qgstring.cpp
View file @
41887832
...
...
@@ -209,7 +209,7 @@ QGString &QGString::operator+=( const QGString &s )
assert
(
memSize
>=
len1
+
len2
+
1
);
char
*
newData
=
memSize
!=
m_memSize
?
(
char
*
)
realloc
(
m_data
,
memSize
)
:
m_data
;
m_memSize
=
memSize
;
if
(
m_d
ata
)
if
(
newD
ata
)
{
m_data
=
newData
;
memcpy
(
m_data
+
len1
,
s
,
len2
+
1
);
...
...
qtools/qthread.cpp
View file @
41887832
...
...
@@ -52,6 +52,7 @@ QThread::~QThread()
QMutexLocker
locker
(
&
d
->
mutex
);
if
(
d
->
running
&&
!
d
->
finished
)
qWarning
(
"QThread: Destroyed while thread is still running"
);
delete
d
;
}
bool
QThread
::
isFinished
()
const
...
...
src/docparser.cpp
View file @
41887832
...
...
@@ -76,7 +76,8 @@ static const char *sectionLevelToName[] =
"section"
,
"subsection"
,
"subsubsection"
,
"paragraph"
"paragraph"
,
"subparagraph"
};
//---------------------------------------------------------------------------
...
...
src/doxygen.cpp
View file @
41887832
...
...
@@ -2077,18 +2077,15 @@ static void findUsingDeclarations(EntryNav *rootNav)
usingCd
->
name
().
data
(),
nd
?
nd
->
name
().
data
()
:
fd
->
name
().
data
());
}
if
(
usingCd
)
// add the class to the correct scope
if
(
nd
)
{
if
(
nd
)
{
//printf("Inside namespace %s\n",nd->name().data());
nd
->
addUsingDeclaration
(
usingCd
);
}
else
if
(
fd
)
{
//printf("Inside file %s\n",fd->name().data());
fd
->
addUsingDeclaration
(
usingCd
);
}
//printf("Inside namespace %s\n",nd->name().data());
nd
->
addUsingDeclaration
(
usingCd
);
}
else
if
(
fd
)
{
//printf("Inside file %s\n",fd->name().data());
fd
->
addUsingDeclaration
(
usingCd
);
}
}
...
...
@@ -4107,8 +4104,12 @@ static QDict<int> *getTemplateArgumentsInName(ArgumentList *templateArguments,co
*/
static
ClassDef
*
findClassWithinClassContext
(
Definition
*
context
,
ClassDef
*
cd
,
const
QCString
&
name
)
{
FileDef
*
fd
=
cd
->
getFileDef
();
ClassDef
*
result
=
0
;
if
(
cd
==
0
)
{
return
result
;
}
FileDef
*
fd
=
cd
->
getFileDef
();
if
(
context
&&
cd
!=
context
)
{
result
=
getResolvedClass
(
context
,
0
,
name
,
0
,
0
,
TRUE
,
TRUE
);
...
...
@@ -4121,7 +4122,7 @@ static ClassDef *findClassWithinClassContext(Definition *context,ClassDef *cd,co
{
result
=
getClass
(
name
);
}
if
(
result
==
0
&&
cd
&&
if
(
result
==
0
&&
(
cd
->
getLanguage
()
==
SrcLangExt_CSharp
||
cd
->
getLanguage
()
==
SrcLangExt_Java
)
&&
name
.
find
(
'<'
)
!=-
1
)
{
...
...
@@ -4243,13 +4244,10 @@ static void findUsedClassesForClass(EntryNav *rootNav,
usedCd
->
setLanguage
(
masterCd
->
getLanguage
());
Doxygen
::
hiddenClasses
->
append
(
usedName
,
usedCd
);
}
if
(
usedCd
)
{
if
(
isArtificial
)
usedCd
->
setArtificial
(
TRUE
);
Debug
::
print
(
Debug
::
Classes
,
0
,
" Adding used class `%s' (1)
\n
"
,
usedCd
->
name
().
data
());
instanceCd
->
addUsedClass
(
usedCd
,
md
->
name
(),
md
->
protection
());
usedCd
->
addUsedByClass
(
instanceCd
,
md
->
name
(),
md
->
protection
());
}
if
(
isArtificial
)
usedCd
->
setArtificial
(
TRUE
);
Debug
::
print
(
Debug
::
Classes
,
0
,
" Adding used class `%s' (1)
\n
"
,
usedCd
->
name
().
data
());
instanceCd
->
addUsedClass
(
usedCd
,
md
->
name
(),
md
->
protection
());
usedCd
->
addUsedByClass
(
instanceCd
,
md
->
name
(),
md
->
protection
());
}
}
}
...
...
@@ -6585,7 +6583,7 @@ static void findMember(EntryNav *rootNav,
funcType
,
funcName
,
funcArgs
,
exceptions
,
root
->
protection
,
root
->
virt
,
root
->
stat
&&
!
isMemberOf
,
isMemberOf
?
Foreign
:
isRelated
?
Related
:
Member
,
isMemberOf
?
Foreign
:
Related
,
mtype
,
(
root
->
tArgLists
?
root
->
tArgLists
->
getLast
()
:
0
),
funcArgs
.
isEmpty
()
?
0
:
root
->
argList
);
...
...
@@ -8062,13 +8060,14 @@ static void generateClassList(ClassSDict &classSDict)
ClassDef
*
cd
=
cli
.
current
();
//printf("cd=%s getOuterScope=%p global=%p\n",cd->name().data(),cd->getOuterScope(),Doxygen::globalScope);
if
((
cd
->
getOuterScope
()
==
0
||
// <-- should not happen, but can if we read an old tag file
if
(
cd
&&
(
cd
->
getOuterScope
()
==
0
||
// <-- should not happen, but can if we read an old tag file
cd
->
getOuterScope
()
==
Doxygen
::
globalScope
// only look at global classes
)
&&
!
cd
->
isHidden
()
&&
!
cd
->
isEmbeddedInOuterScope
()
)
)
{
// skip external references, anonymous compounds and
// template instances
// skip external references, anonymous compounds and
// template instances
if
(
cd
->
isLinkableInProject
()
&&
cd
->
templateMaster
()
==
0
)
{
msg
(
"Generating docs for compound %s...
\n
"
,
cd
->
name
().
data
());
...
...
@@ -9003,9 +9002,9 @@ static void generateNamespaceDocs()
// for each class in the namespace...
ClassSDict
::
Iterator
cli
(
*
nd
->
getClassSDict
());
for
(
;
cli
.
current
()
;
++
cli
)
ClassDef
*
cd
;
for
(
;
(
cd
=
cli
.
current
())
;
++
cli
)
{
ClassDef
*
cd
=
cli
.
current
();
if
(
(
cd
->
isLinkableInProject
()
&&
cd
->
templateMaster
()
==
0
)
// skip external references, anonymous compounds and
...
...
src/htmlhelp.cpp
View file @
41887832
...
...
@@ -281,6 +281,7 @@ HtmlHelp::HtmlHelp() : indexFileDict(1009)
HtmlHelp
::~
HtmlHelp
()
{
if
(
m_fromUtf8
!=
(
void
*
)(
-
1
))
portable_iconv_close
(
m_fromUtf8
);
delete
index
;
}
#if 0
/*! return a reference to the one and only instance of this class.
...
...
src/index.cpp
View file @
41887832
...
...
@@ -1640,7 +1640,7 @@ static void writeAnnotatedClassList(OutputList &ol)
static
QCString
letterToLabel
(
uint
startLetter
)
{
char
s
[
1
0
];
char
s
[
1
1
];
// max 0x12345678 + '\0'
if
(
startLetter
>
0x20
&&
startLetter
<=
0x7f
)
// printable ASCII character
{
s
[
0
]
=
(
char
)
startLetter
;
...
...
src/msc.cpp
View file @
41887832
...
...
@@ -74,6 +74,7 @@ static bool convertMapFile(FTextStream &t,const char *mapName,const QCString rel
t
<<
externalRef
(
relPath
,
df
->
ref
(),
TRUE
);
if
(
!
df
->
file
().
isEmpty
())
t
<<
df
->
file
()
<<
Doxygen
::
htmlFileExtension
;
if
(
!
df
->
anchor
().
isEmpty
())
t
<<
"#"
<<
df
->
anchor
();
delete
df
;
}
else
{
...
...
src/pre.l
View file @
41887832
...
...
@@ -207,6 +207,7 @@ class DefineManager
if (dpf==0)
{
dpf = new DefinesPerFile;
m_fileMap.insert(fileName,dpf);
}
dpf->addDefine(def);
}
...
...
@@ -223,6 +224,7 @@ class DefineManager
if (dpf==0)
{
dpf = new DefinesPerFile;
m_fileMap.insert(fromFileName,dpf);
}
dpf->addInclude(toFileName);
}
...
...
@@ -2283,6 +2285,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
}
<DefName>{ID}/("\\\n")*"(" { // define with argument
//printf("Define() `%s'\n",yytext);
delete g_argDict;
g_argDict = new QDict<int>(31);
g_argDict->setAutoDelete(TRUE);
g_defArgs = 0;
...
...
src/template.cpp
View file @
41887832
...
...
@@ -1165,7 +1165,7 @@ class FilterAlphaIndex
}
static
QCString
keyToLabel
(
uint
startLetter
)
{
char
s
[
1
0
];
char
s
[
1
1
];
// 0x12345678 + '\0'
if
(
startLetter
>
0x20
&&
startLetter
<=
0x7f
)
// printable ASCII character
{
s
[
0
]
=
tolower
((
char
)
startLetter
);
...
...
@@ -2403,7 +2403,7 @@ TemplateVariant TemplateContextImpl::get(const QCString &name) const
warn
(
m_templateName
,
m_line
,
"using . on an object '%s' is not an struct or list"
,
objName
.
data
());
return
TemplateVariant
();
}
}
while
(
i
!=-
1
);
}
return
v
;
}
}
...
...
@@ -2860,7 +2860,7 @@ class TemplateNodeRange : public TemplateNodeCreator<TemplateNodeRange>
{
public
:
TemplateNodeRange
(
TemplateParser
*
parser
,
TemplateNode
*
parent
,
int
line
,
const
QCString
&
data
)
:
TemplateNodeCreator
<
TemplateNodeRange
>
(
parser
,
parent
,
line
)
:
TemplateNodeCreator
<
TemplateNodeRange
>
(
parser
,
parent
,
line
)
,
m_down
(
FALSE
)
{
TRACE
((
"{TemplateNodeRange(%s)
\n
"
,
data
.
data
()));
QCString
start
,
end
;
...
...
@@ -3030,7 +3030,7 @@ class TemplateNodeFor : public TemplateNodeCreator<TemplateNodeFor>
{
public
:
TemplateNodeFor
(
TemplateParser
*
parser
,
TemplateNode
*
parent
,
int
line
,
const
QCString
&
data
)
:
TemplateNodeCreator
<
TemplateNodeFor
>
(
parser
,
parent
,
line
)
:
TemplateNodeCreator
<
TemplateNodeFor
>
(
parser
,
parent
,
line
)
,
m_reversed
(
FALSE
)
{
TRACE
((
"{TemplateNodeFor(%s)
\n
"
,
data
.
data
()));
QCString
exprStr
;
...
...
@@ -3438,7 +3438,7 @@ class TemplateNodeCreate : public TemplateNodeCreator<TemplateNodeCreate>
{
public
:
TemplateNodeCreate
(
TemplateParser
*
parser
,
TemplateNode
*
parent
,
int
line
,
const
QCString
&
data
)
:
TemplateNodeCreator
<
TemplateNodeCreate
>
(
parser
,
parent
,
line
)
:
TemplateNodeCreator
<
TemplateNodeCreate
>
(
parser
,
parent
,
line
)
,
m_templateExpr
(
0
),
m_fileExpr
(
0
)
{
TRACE
((
"TemplateNodeCreate(%s)
\n
"
,
data
.
data
()));
ExpressionParser
ep
(
parser
,
line
);
...
...
@@ -4013,7 +4013,7 @@ class TemplateNodeMarkers : public TemplateNodeCreator<TemplateNodeMarkers>
{
public
:
TemplateNodeMarkers
(
TemplateParser
*
parser
,
TemplateNode
*
parent
,
int
line
,
const
QCString
&
data
)
:
TemplateNodeCreator
<
TemplateNodeMarkers
>
(
parser
,
parent
,
line
)
:
TemplateNodeCreator
<
TemplateNodeMarkers
>
(
parser
,
parent
,
line
)
,
m_listExpr
(
0
),
m_patternExpr
(
0
)
{
TRACE
((
"{TemplateNodeMarkers(%s)
\n
"
,
data
.
data
()));
int
i
=
data
.
find
(
" in "
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment