Skip to content

Commit

Permalink
Remove unused local and static global variables
Browse files Browse the repository at this point in the history
Remove unused local and static global variables. Variables have been identified by Understand (version 758) from Scitools.
  • Loading branch information
albert-github committed Dec 27, 2014
1 parent ed39dab commit d03e4c2
Show file tree
Hide file tree
Showing 33 changed files with 12 additions and 101 deletions.
1 change: 0 additions & 1 deletion src/cite.cpp
Expand Up @@ -63,7 +63,6 @@ void CiteDict::writeLatexBibliography(FTextStream &t)
t << "\\bibliographystyle{" << style << "}\n"
"\\bibliography{";
QStrList &citeDataList = Config_getList("CITE_BIB_FILES");
QCString latexOutputDir = Config_getString("LATEX_OUTPUT")+"/";
int i = 0;
const char *bibdata = citeDataList.first();
while (bibdata)
Expand Down
1 change: 0 additions & 1 deletion src/classdef.cpp
Expand Up @@ -4031,7 +4031,6 @@ int ClassDef::countMemberDeclarations(MemberListType lt,ClassDef *inheritedFrom,
static bool inlineInheritedMembers = Config_getBool("INLINE_INHERITED_MEMB");
if (!inlineInheritedMembers) // show inherited members as separate lists
{
QPtrDict<void> visited(17);
count+=countInheritedDecMembers(lt,inheritedFrom,invert,showAlways,visitedClasses);
}
}
Expand Down
1 change: 0 additions & 1 deletion src/code.l
Expand Up @@ -1236,7 +1236,6 @@ static void generateMemberLink(CodeOutputInterface &ol,const QCString &varName,
{
int vi;
QCString vn=varName;
QCString scope;
if ((vi=vn.findRev("::"))!=-1 || (vi=vn.findRev('.'))!=-1) // explicit scope A::b(), probably static member
{
ClassDef *jcd = getClass(vn.left(vi));
Expand Down
8 changes: 0 additions & 8 deletions src/config.l
Expand Up @@ -431,19 +431,11 @@ static bool *b=0;
static QStrList *l=0;
static int lastState;
static QCString elemStr;
static QCString includeName;
static QStrList includePathList;
static QStack<ConfigFileState> includeStack;
static int includeDepth;
static bool config_upd = FALSE;

static QCString tabSizeString;
static QCString maxInitLinesString;
static QCString colsInAlphaIndexString;
static QCString enumValuesPerLineString;
static QCString treeViewWidthString;
static QCString maxDotGraphWidthString;
static QCString maxDotGraphHeightString;
static QCString encoding;

static Config *config;
Expand Down
1 change: 0 additions & 1 deletion src/declinfo.l
Expand Up @@ -45,7 +45,6 @@ static QCString funcTempList;
static QCString type;
static QCString name;
static QCString args;
static QCString tmpType;
static int sharpCount;
static bool classTempListFound;
static bool funcTempListFound;
Expand Down
3 changes: 1 addition & 2 deletions src/dirdef.cpp
Expand Up @@ -80,8 +80,6 @@ void DirDef::addFile(FileDef *fd)

static QCString encodeDirName(const QCString &anchor)
{
QCString result;

// convert to md5 hash
uchar md5_sig[16];
QCString sigStr(33);
Expand All @@ -90,6 +88,7 @@ static QCString encodeDirName(const QCString &anchor)
return sigStr;

// old algorithm
// QCString result;

// int l = anchor.length(),i;
// for (i=0;i<l;i++)
Expand Down
5 changes: 1 addition & 4 deletions src/docbookgen.cpp
Expand Up @@ -589,11 +589,9 @@ static void generateDocbookForMember(MemberDef *md,FTextStream &t,Definition *de
t << "_1" << md->anchor() << "\">" << convertToXML(md->name()) << "</link>";
t << " (" << endl;
ArgumentList *declAl = md->declArgumentList();
ArgumentList *defAl = md->argumentList();
if (declAl && declAl->count()>0)
{
ArgumentListIterator declAli(*declAl);
ArgumentListIterator defAli(*defAl);
Argument *a;
int cnt=0;
for (declAli.toFirst();(a=declAli.current());++declAli)
Expand Down Expand Up @@ -812,15 +810,14 @@ static void generateDocbookForMember(MemberDef *md,FTextStream &t,Definition *de
}
}

static void generateDocbookSection(Definition *d,FTextStream &t,MemberList *ml,const char *kind,
static void generateDocbookSection(Definition *d,FTextStream &t,MemberList *ml,const char *,
bool detailed=0, const char *header=0,const char *documentation=0)
{
if (ml==0) return;
MemberListIterator mli(*ml);
MemberDef *md;
int count=0;
int doc_count=0;
QCString compkind = kind;
QCString title, desctitle;

for (mli.toFirst();(md=mli.current());++mli)
Expand Down
1 change: 0 additions & 1 deletion src/docbookvisitor.cpp
Expand Up @@ -1326,7 +1326,6 @@ void DocbookDocVisitor::writeDotFile(const QCString &baseName, DocVerbatim *s)
shortName=shortName.right(shortName.length()-i-1);
}
QCString outDir = Config_getString("DOCBOOK_OUTPUT");
QCString imgExt = Config_getEnum("DOT_IMAGE_FORMAT");
writeDotGraphFromFile(baseName+".dot",outDir,shortName,GOF_BITMAP);
visitPreStart(m_t, s->hasCaption(), baseName + ".dot", s->width(),s->height());
visitCaption(this, s->children());
Expand Down
4 changes: 0 additions & 4 deletions src/docparser.cpp
Expand Up @@ -844,7 +844,6 @@ static int handleStyleArgument(DocNode *parent,QList<DocNode> &children,
const QCString &cmdName)
{
DBG(("handleStyleArgument(%s)\n",qPrint(cmdName)));
QCString tokenName = g_token->name;
int tok=doctokenizerYYlex();
if (tok!=TK_WHITESPACE)
{
Expand Down Expand Up @@ -1178,7 +1177,6 @@ static void handleParameterType(DocNode *parent,QList<DocNode> &children,const Q
{
QCString name = g_token->name;
int p=0,i;
QCString type;
while ((i=paramTypes.find('|',p))!=-1)
{
g_token->name = paramTypes.mid(p,i-p);
Expand Down Expand Up @@ -2137,7 +2135,6 @@ DocXRefItem::DocXRefItem(DocNode *parent,int id,const char *key) :

bool DocXRefItem::parse()
{
QCString listName;
RefList *refList = Doxygen::xrefLists->find(m_key);
if (refList &&
(
Expand Down Expand Up @@ -2571,7 +2568,6 @@ DocCite::DocCite(DocNode *parent,const QCString &target,const QCString &) //cont
{
static uint numBibFiles = Config_getList("CITE_BIB_FILES").count();
m_parent = parent;
QCString anchor;
//printf("DocCite::DocCite(target=%s)\n",target.data());
ASSERT(!target.isEmpty());
m_relPath = g_relPath;
Expand Down
10 changes: 0 additions & 10 deletions src/dot.cpp
Expand Up @@ -156,8 +156,6 @@ static const char svgZoomFooter[] =

//--------------------------------------------------------------------

static const int maxCmdLine = 40960;

/*! mapping from protection levels to color names */
static const char *normalEdgeColorMap[] =
{
Expand Down Expand Up @@ -3147,8 +3145,6 @@ QCString DotClassGraph::writeGraph(FTextStream &out,
regenerate=TRUE;
if (graphFormat==GOF_BITMAP) // run dot to create a bitmap image
{
QCString dotArgs(maxCmdLine);

DotRunner *dotRun = new DotRunner(absDotName,
d.absPath().data(),TRUE,absImgName);
dotRun->addJob(imgExt,absImgName);
Expand Down Expand Up @@ -3506,7 +3502,6 @@ QCString DotInclDepGraph::writeGraph(FTextStream &out,
if (graphFormat==GOF_BITMAP)
{
// run dot to create a bitmap image
QCString dotArgs(maxCmdLine);
DotRunner *dotRun = new DotRunner(absDotName,d.absPath().data(),TRUE,absImgName);
dotRun->addJob(imgExt,absImgName);
if (generateImageMap) dotRun->addJob(MAP_CMD,absMapName);
Expand Down Expand Up @@ -3819,7 +3814,6 @@ QCString DotCallGraph::writeGraph(FTextStream &out, GraphOutputFormat graphForma
if (graphFormat==GOF_BITMAP)
{
// run dot to create a bitmap image
QCString dotArgs(maxCmdLine);
DotRunner *dotRun = new DotRunner(absDotName,d.absPath().data(),TRUE,absImgName);
dotRun->addJob(imgExt,absImgName);
if (generateImageMap) dotRun->addJob(MAP_CMD,absMapName);
Expand Down Expand Up @@ -3984,7 +3978,6 @@ QCString DotDirDeps::writeGraph(FTextStream &out,
if (graphFormat==GOF_BITMAP)
{
// run dot to create a bitmap image
QCString dotArgs(maxCmdLine);
DotRunner *dotRun = new DotRunner(absDotName,d.absPath().data(),TRUE,absImgName);
dotRun->addJob(imgExt,absImgName);
if (generateImageMap) dotRun->addJob(MAP_CMD,absMapName);
Expand Down Expand Up @@ -4512,7 +4505,6 @@ QCString DotGroupCollaboration::writeGraph( FTextStream &t,
QCString imgExt = Config_getEnum("DOT_IMAGE_FORMAT");
QCString baseName = m_diskName;
QCString imgName = baseName+"."+imgExt;
QCString mapName = baseName+".map";
QCString absPath = d.absPath().data();
QCString absBaseName = absPath+"/"+baseName;
QCString absDotName = absBaseName+".dot";
Expand All @@ -4539,8 +4531,6 @@ QCString DotGroupCollaboration::writeGraph( FTextStream &t,

if (graphFormat==GOF_BITMAP) // run dot to create a bitmap image
{
QCString dotArgs(maxCmdLine);

DotRunner *dotRun = new DotRunner(absDotName,d.absPath().data(),FALSE);
dotRun->addJob(imgExt,absImgName);
if (writeImageMap) dotRun->addJob(MAP_CMD,absMapName);
Expand Down
2 changes: 0 additions & 2 deletions src/doxygen.cpp
Expand Up @@ -2458,7 +2458,6 @@ static MemberDef *addVariableToFile(

// see if the function is inside a namespace
NamespaceDef *nd = 0;
QCString nscope;
if (!scope.isEmpty())
{
if (scope.find('@')!=-1) return 0; // anonymous scope!
Expand Down Expand Up @@ -5493,7 +5492,6 @@ static bool findGlobalMember(EntryNav *rootNav,
{
Debug::print(Debug::FindMembers,0,"4. Try to add member `%s' to scope `%s'\n",
md->name().data(),namespaceName.data());
QCString nsName = nd ? nd->name().data() : "";

NamespaceDef *rnd = 0;
if (!namespaceName.isEmpty()) rnd = Doxygen::namespaceSDict->find(namespaceName);
Expand Down
2 changes: 0 additions & 2 deletions src/filedef.cpp
Expand Up @@ -1296,7 +1296,6 @@ void FileDef::addIncludedUsingDirectives()
visited=TRUE;
//printf("( FileDef::addIncludedUsingDirectives for file %s\n",name().data());

NamespaceList nl;
if (m_includeList) // file contains #includes
{
{
Expand Down Expand Up @@ -1542,7 +1541,6 @@ static Directory *findDirNode(Directory *root,const QCString &name)

static void mergeFileDef(Directory *root,FileDef *fd)
{
QCString rootPath = root->name();
QCString filePath = fd->absFilePath();
//printf("merging %s\n",filePath.data());
Directory *dirNode = findDirNode(root,filePath);
Expand Down
1 change: 0 additions & 1 deletion src/fortranscanner.l
Expand Up @@ -165,7 +165,6 @@ static ScanVar v_type = V_IGNORE; // type of parsed variable
static QList<Entry> moduleProcedures; // list of all interfaces which contain unresolved
// module procedures
static QCString docBlock;
static QCString docBlockName;
static bool docBlockInBody = FALSE;
static bool docBlockJavaStyle;

Expand Down
1 change: 0 additions & 1 deletion src/htags.cpp
Expand Up @@ -105,7 +105,6 @@ bool Htags::execute(const QCString &htmldir)
bool Htags::loadFilemap(const QCString &htmlDir)
{
QCString fileMapName = htmlDir+"/HTML/FILEMAP";
QCString fileMap;
QFileInfo fi(fileMapName);
/*
* Construct FILEMAP dictionary using QDict.
Expand Down
1 change: 0 additions & 1 deletion src/htmldocvisitor.cpp
Expand Up @@ -1063,7 +1063,6 @@ void HtmlDocVisitor::visitPost(DocPara *p)
}
}

QCString context;
// if the last element of a paragraph is something that should be outside of
// the paragraph (<ul>,<dl>,<table>) then that will already have ended the
// paragraph and we don't need to do it here
Expand Down
1 change: 0 additions & 1 deletion src/index.cpp
Expand Up @@ -1601,7 +1601,6 @@ static void writeAnnotatedClassList(OutputList &ol)
}
if (cd->isLinkableInProject() && cd->templateMaster()==0)
{
QCString type=cd->compoundTypeString();
ol.startIndexKey();
if (cd->getLanguage()==SrcLangExt_VHDL)
{
Expand Down
1 change: 0 additions & 1 deletion src/mangen.cpp
Expand Up @@ -107,7 +107,6 @@ ManGenerator::~ManGenerator()

void ManGenerator::init()
{
QCString ext = getExtension();
QCString &manOutput = Config_getString("MAN_OUTPUT");

QDir d(manOutput);
Expand Down
1 change: 0 additions & 1 deletion src/markdown.cpp
Expand Up @@ -810,7 +810,6 @@ static int processLink(GrowBuf &out,const char *data,int,int size)
{
return 0;
}
static QRegExp re("^[@\\]ref ");
if (isToc) // special case for [TOC]
{
if (g_current) g_current->stat=TRUE;
Expand Down
1 change: 0 additions & 1 deletion src/memberdef.cpp
Expand Up @@ -2553,7 +2553,6 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,

QCString cname = container->name();
QCString cfname = getOutputFileBase();
QCString cfiname = container->getOutputFileBase();

// get member name
QCString doxyName=name();
Expand Down
2 changes: 0 additions & 2 deletions src/msc.cpp
Expand Up @@ -169,7 +169,6 @@ QCString getMscImageMapFromFile(const QCString& inFile, const QCString& outDir,
QCString mscExe = Config_getString("MSCGEN_PATH")+"mscgen"+portable_commandExtension();
QCString mscArgs = "-T ismap -i \"";
mscArgs+=inFile;
QFileInfo fi(inFile);
mscArgs+="\" -o \"";
mscArgs+=outFile + "\"";

Expand Down Expand Up @@ -201,7 +200,6 @@ void writeMscImageMapFromFile(FTextStream &t,const QCString &inFile,
)
{
QCString mapName = baseName+".map";
QCString mapFile = inFile+".map";
t << "<img src=\"" << relPath << baseName << ".";
switch (format)
{
Expand Down
1 change: 0 additions & 1 deletion src/perlmodgen.cpp
Expand Up @@ -1371,7 +1371,6 @@ void PerlModDocVisitor::visitPost(DocParBlock *)

static void addTemplateArgumentList(ArgumentList *al,PerlModOutput &output,const char *)
{
QCString indentStr;
if (!al)
return;
output.openList("template_parameters");
Expand Down
5 changes: 4 additions & 1 deletion src/portable.cpp
Expand Up @@ -194,7 +194,10 @@ uint portable_pid()
return pid;
}

static char **last_environ;
#if defined(_WIN32) && !defined(__CYGWIN__)
#else
static char **last_environ;
#endif

void portable_setenv(const char *name,const char *value)
{
Expand Down
1 change: 0 additions & 1 deletion src/pycode.l
Expand Up @@ -79,7 +79,6 @@ static int g_paramParens;

static bool g_exampleBlock;
static QCString g_exampleName;
static QCString g_exampleFile;

static QCString g_type;
static QCString g_name;
Expand Down
3 changes: 0 additions & 3 deletions src/pyscanner.l
Expand Up @@ -83,7 +83,6 @@ static Specifier virt;

static int docBlockContext;
static QCString docBlock;
static QCString docBlockName;
static bool docBlockInBody;
static bool docBlockJavaStyle;
static bool docBrief;
Expand All @@ -97,7 +96,6 @@ static int g_indent = 0;
static int g_curIndent = 0;

static QDict<QCString> g_packageNameCache(257);
static QCString g_packageScope;

static char g_atomStart;
static char g_atomEnd;
Expand Down Expand Up @@ -931,7 +929,6 @@ STARTDOCSYMS "##"
"=" { // default value
// TODO: this rule is too simple, need to be able to
// match things like =")" as well!
QCString defVal=&yytext[1];
g_defVal.resize(0);
g_braceCount=0;
BEGIN(FunctionParamDefVal);
Expand Down
8 changes: 0 additions & 8 deletions src/scanner.l
Expand Up @@ -83,7 +83,6 @@ static int roundCount = 0 ;
static int curlyCount = 0 ;
static int squareCount = 0 ;
static int padCount = 0 ;
static QCString slString;
static Entry* current_root = 0 ;
static Entry* global_root = 0 ;
static Entry* current = 0 ;
Expand Down Expand Up @@ -114,7 +113,6 @@ static QCString aliasName;
static QCString baseName;
static QCString* specName;
static QCString formulaText;
static QCString formulaEnd;
static bool useOverrideCommands = FALSE;

static SrcLangExt language;
Expand Down Expand Up @@ -162,13 +160,7 @@ static bool needsSemi;

//static int depthIf;
static int initBracketCount;
static QCString memberGroupRelates;
static QCString memberGroupInside;
static QCString xrefItemKey;
static QCString xrefItemTitle;
static QCString xrefListTitle;

static QCString g_skipBlockName;
static QCString oldStyleArgType;
static QCString docBackup;
static QCString briefBackup;
Expand Down
2 changes: 0 additions & 2 deletions src/searchindex.cpp
Expand Up @@ -310,7 +310,6 @@ void SearchIndex::write(const char *fileName)
padding = size - padding;

//int statsOffset = size;
QDictIterator<IndexWord> wdi(m_words);
//IndexWord *iw;
int *wordStatOffsets = new int[m_words.count()];

Expand Down Expand Up @@ -1077,7 +1076,6 @@ void writeJavascriptSearchIndex()
for (li.toFirst();(dl=li.current());++li)
{
Definition *d = dl->getFirst();
QCString id = d->localName();

if (!firstEntry)
{
Expand Down

0 comments on commit d03e4c2

Please sign in to comment.