summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/arguments.h2
-rw-r--r--src/commentcnv.l2
-rw-r--r--src/doctokenizer.l2
-rw-r--r--src/dot.cpp51
-rw-r--r--src/dot.h4
-rw-r--r--src/dotrunner.cpp10
-rw-r--r--src/dotrunner.h6
-rw-r--r--src/doxygen.cpp8
-rw-r--r--src/linkedmap.h4
-rw-r--r--src/membername.h4
-rw-r--r--src/section.h2
-rw-r--r--src/util.cpp2
12 files changed, 57 insertions, 40 deletions
diff --git a/src/arguments.h b/src/arguments.h
index 892de92..181a8d3 100644
--- a/src/arguments.h
+++ b/src/arguments.h
@@ -90,7 +90,7 @@ class ArgumentList
const_iterator cbegin() const { return m_args.cbegin(); }
const_iterator cend() const { return m_args.cend(); }
bool empty() const { return m_args.empty(); }
- int size() const { return m_args.size(); }
+ size_t size() const { return m_args.size(); }
void clear() { m_args.clear(); }
void push_back(const Argument &a) { m_args.push_back(a); }
Argument &back() { return m_args.back(); }
diff --git a/src/commentcnv.l b/src/commentcnv.l
index 63ecaaf..e05634a 100644
--- a/src/commentcnv.l
+++ b/src/commentcnv.l
@@ -71,7 +71,7 @@ struct commentcnvYY_state
{
BufStr * inBuf = 0;
BufStr * outBuf = 0;
- int inBufPos = 0;
+ yy_size_t inBufPos = 0;
int col = 0;
int blockHeadCol = 0;
bool mlBrief = FALSE;
diff --git a/src/doctokenizer.l b/src/doctokenizer.l
index de7d162..7f3fbc9 100644
--- a/src/doctokenizer.l
+++ b/src/doctokenizer.l
@@ -55,7 +55,7 @@
// context for tokenizer phase
static int g_commentState;
TokenInfo *g_token = 0;
-static int g_inputPos = 0;
+static yy_size_t g_inputPos = 0;
static const char *g_inputString;
static QCString g_fileName;
static bool g_insidePre;
diff --git a/src/dot.cpp b/src/dot.cpp
index acf4db9..675ead6 100644
--- a/src/dot.cpp
+++ b/src/dot.cpp
@@ -83,6 +83,12 @@ DotManager *DotManager::instance()
return m_theInstance;
}
+void DotManager::deleteInstance()
+{
+ delete m_theInstance;
+ m_theInstance=0;
+}
+
DotManager::DotManager() : m_runners(), m_filePatchers()
{
m_queue = new DotRunnerQueue;
@@ -92,18 +98,17 @@ DotManager::DotManager() : m_runners(), m_filePatchers()
{
for (i=0;i<dotNumThreads;i++)
{
- DotWorkerThread *thread = new DotWorkerThread(m_queue);
+ std::unique_ptr<DotWorkerThread> thread = std::make_unique<DotWorkerThread>(m_queue);
thread->start();
if (thread->isRunning())
{
- m_workers.append(thread);
+ m_workers.push_back(std::move(thread));
}
else // no more threads available!
{
- delete thread;
}
}
- ASSERT(m_workers.count()>0);
+ ASSERT(m_workers.size()>0);
}
}
@@ -140,7 +145,7 @@ DotFilePatcher *DotManager::createFilePatcher(const std::string &fileName)
auto patcher = m_filePatchers.find(fileName);
if (patcher != m_filePatchers.end()) return &(patcher->second);
-
+
auto rv = m_filePatchers.emplace(fileName, fileName.c_str());
assert(rv.second);
return &(rv.first->second);
@@ -148,20 +153,20 @@ DotFilePatcher *DotManager::createFilePatcher(const std::string &fileName)
bool DotManager::run() const
{
- uint numDotRuns = m_runners.size();
- uint numFilePatchers = m_filePatchers.size();
+ size_t numDotRuns = m_runners.size();
+ size_t numFilePatchers = m_filePatchers.size();
if (numDotRuns+numFilePatchers>1)
{
- if (m_workers.count()==0)
+ if (m_workers.size()==0)
{
msg("Generating dot graphs in single threaded mode...\n");
}
else
{
- msg("Generating dot graphs using %d parallel threads...\n",QMIN(numDotRuns+numFilePatchers,m_workers.count()));
+ msg("Generating dot graphs using %zu parallel threads...\n",QMIN(numDotRuns+numFilePatchers,m_workers.size()));
}
}
- int i=1;
+ size_t i=1;
bool setPath=FALSE;
if (Config_getBool(GENERATE_HTML))
@@ -186,12 +191,12 @@ bool DotManager::run() const
}
Portable::sysTimerStart();
// fill work queue with dot operations
- int prev=1;
- if (m_workers.count()==0) // no threads to work with
+ size_t prev=1;
+ if (m_workers.size()==0) // no threads to work with
{
for (auto & dr : m_runners)
{
- msg("Running dot for graph %d/%d\n",prev,numDotRuns);
+ msg("Running dot for graph %zu/%zu\n",prev,numDotRuns);
dr.second->run();
prev++;
}
@@ -203,28 +208,28 @@ bool DotManager::run() const
m_queue->enqueue(dr.second.get());
}
// wait for the queue to become empty
- while ((i=m_queue->count())>0)
+ while ((i=m_queue->size())>0)
{
i = numDotRuns - i;
while (i>=prev)
{
- msg("Running dot for graph %d/%d\n",prev,numDotRuns);
+ msg("Running dot for graph %zu/%zu\n",prev,numDotRuns);
prev++;
}
Portable::sleep(100);
}
- while ((int)numDotRuns>=prev)
+ while (numDotRuns>=prev)
{
- msg("Running dot for graph %d/%d\n",prev,numDotRuns);
+ msg("Running dot for graph %zu/%zu\n",prev,numDotRuns);
prev++;
}
// signal the workers we are done
- for (i=0;i<(int)m_workers.count();i++)
+ for (i=0;i<m_workers.size();i++)
{
m_queue->enqueue(0); // add terminator for each worker
}
// wait for the workers to finish
- for (i=0;i<(int)m_workers.count();i++)
+ for (i=0;i<m_workers.size();i++)
{
m_workers.at(i)->wait();
}
@@ -239,13 +244,13 @@ bool DotManager::run() const
i=1;
// since patching the svg files may involve patching the header of the SVG
// (for zoomable SVGs), and patching the .html files requires reading that
- // header after the SVG is patched, we first process the .svg files and
- // then the other files.
+ // header after the SVG is patched, we first process the .svg files and
+ // then the other files.
for (auto & fp : m_filePatchers)
{
if (fp.second.isSVGFile())
{
- msg("Patching output file %d/%d\n",i,numFilePatchers);
+ msg("Patching output file %zu/%zu\n",i,numFilePatchers);
if (!fp.second.run()) return FALSE;
i++;
}
@@ -254,7 +259,7 @@ bool DotManager::run() const
{
if (!fp.second.isSVGFile())
{
- msg("Patching output file %d/%d\n",i,numFilePatchers);
+ msg("Patching output file %zu/%zu\n",i,numFilePatchers);
if (!fp.second.run()) return FALSE;
i++;
}
diff --git a/src/dot.h b/src/dot.h
index 3c9af66..d14c38a 100644
--- a/src/dot.h
+++ b/src/dot.h
@@ -16,7 +16,6 @@
#ifndef DOT_H
#define DOT_H
-#include <qlist.h>
#include <qcstring.h>
#include <map>
@@ -35,6 +34,7 @@ class DotManager
{
public:
static DotManager *instance();
+ static void deleteInstance();
DotRunner* createRunner(const std::string& absDotName, const std::string& md5Hash);
DotFilePatcher *createFilePatcher(const std::string &fileName);
bool run() const;
@@ -47,7 +47,7 @@ class DotManager
std::map<std::string, DotFilePatcher> m_filePatchers;
static DotManager *m_theInstance;
DotRunnerQueue *m_queue;
- QList<DotWorkerThread> m_workers;
+ std::vector< std::unique_ptr<DotWorkerThread> > m_workers;
};
void writeDotGraphFromFile(const char *inFile,const char *outDir,
diff --git a/src/dotrunner.cpp b/src/dotrunner.cpp
index c9ff284..8cf09fa 100644
--- a/src/dotrunner.cpp
+++ b/src/dotrunner.cpp
@@ -272,7 +272,7 @@ DotRunner *DotRunnerQueue::dequeue()
return result;
}
-uint DotRunnerQueue::count() const
+size_t DotRunnerQueue::size() const
{
std::lock_guard<std::mutex> locker(m_mutex);
return m_queue.size();
@@ -285,6 +285,14 @@ DotWorkerThread::DotWorkerThread(DotRunnerQueue *queue)
{
}
+DotWorkerThread::~DotWorkerThread()
+{
+ if (isRunning())
+ {
+ wait();
+ }
+}
+
void DotWorkerThread::run()
{
DotRunner *runner;
diff --git a/src/dotrunner.h b/src/dotrunner.h
index 555ea78..1b54617 100644
--- a/src/dotrunner.h
+++ b/src/dotrunner.h
@@ -16,7 +16,6 @@
#ifndef DOTRUNNER_H
#define DOTRUNNER_H
-#include <qglobal.h> //uint
#include <string>
#include <thread>
#include <list>
@@ -72,7 +71,7 @@ class DotRunnerQueue
public:
void enqueue(DotRunner *runner);
DotRunner *dequeue();
- uint count() const;
+ size_t size() const;
private:
std::condition_variable m_bufferNotEmpty;
std::queue<DotRunner *> m_queue;
@@ -80,10 +79,11 @@ class DotRunnerQueue
};
/** Worker thread to execute a dot run */
-class DotWorkerThread
+class DotWorkerThread
{
public:
DotWorkerThread(DotRunnerQueue *queue);
+ ~DotWorkerThread();
void run();
void start();
bool isRunning() { return m_thread && m_thread->joinable(); }
diff --git a/src/doxygen.cpp b/src/doxygen.cpp
index fb82bb2..0728d8f 100644
--- a/src/doxygen.cpp
+++ b/src/doxygen.cpp
@@ -4704,7 +4704,7 @@ static void computeClassRelations()
{
findBaseClassesForClass(root,cd,cd,cd,DocumentedOnly,FALSE);
}
- int numMembers = cd ? cd->memberNameInfoLinkedMap().size() : 0;
+ size_t numMembers = cd ? cd->memberNameInfoLinkedMap().size() : 0;
if ((cd==0 || (!cd->hasDocumentation() && !cd->isReference())) && numMembers>0 &&
bName.right(2)!="::")
{
@@ -8978,8 +8978,10 @@ static void generateDiskNames()
// as the common prefix between the first and last entry
const FileEntry &first = fileEntries[0];
const FileEntry &last = fileEntries[size-1];
+ int first_path_size = static_cast<int>(first.path.size());
+ int last_path_size = static_cast<int>(last.path.size());
int j=0;
- for (size_t i=0;i<first.path.size() && i<last.path.size();i++)
+ for (int i=0;i<first_path_size && i<last_path_size;i++)
{
if (first.path[i]=='/') j=i;
if (first.path[i]!=last.path[i]) break;
@@ -9788,6 +9790,8 @@ void cleanUpDoxygen()
delete Doxygen::namespaceSDict;
delete Doxygen::directories;
+ DotManager::deleteInstance();
+
//delete Doxygen::symbolMap; <- we cannot do this unless all static lists
// (such as Doxygen::namespaceSDict)
// with objects based on Definition are made
diff --git a/src/linkedmap.h b/src/linkedmap.h
index 84c4a91..84dcf26 100644
--- a/src/linkedmap.h
+++ b/src/linkedmap.h
@@ -93,7 +93,7 @@ class LinkedMap
const_iterator begin() const { return m_entries.cbegin(); }
const_iterator end() const { return m_entries.cend(); }
bool empty() const { return m_entries.empty(); }
- int size() const { return m_entries.size(); }
+ size_t size() const { return m_entries.size(); }
void clear()
{
@@ -159,7 +159,7 @@ class LinkedRefMap
const_iterator begin() const { return m_entries.cbegin(); }
const_iterator end() const { return m_entries.cend(); }
bool empty() const { return m_entries.empty(); }
- int size() const { return m_entries.size(); }
+ size_t size() const { return m_entries.size(); }
void clear()
{
diff --git a/src/membername.h b/src/membername.h
index 406d406..88d8832 100644
--- a/src/membername.h
+++ b/src/membername.h
@@ -47,7 +47,7 @@ class MemberName
const_reverse_iterator crbegin() const { return m_members.crbegin(); }
const_reverse_iterator crend() const { return m_members.crend(); }
bool empty() const { return m_members.empty(); }
- int size() const { return m_members.size(); }
+ size_t size() const { return m_members.size(); }
Ptr &back() { return m_members.back(); }
const Ptr &back() const { return m_members.back(); }
Ptr &front() { return m_members.front(); }
@@ -113,7 +113,7 @@ class MemberNameInfo
const_iterator begin() const { return m_members.begin(); }
const_iterator end() const { return m_members.end(); }
bool empty() const { return m_members.empty(); }
- int size() const { return m_members.size(); }
+ size_t size() const { return m_members.size(); }
Ptr &back() { return m_members.back(); }
const Ptr &back() const { return m_members.back(); }
Ptr &front() { return m_members.front(); }
diff --git a/src/section.h b/src/section.h
index cf453bc..74eb04b 100644
--- a/src/section.h
+++ b/src/section.h
@@ -116,7 +116,7 @@ class SectionRefs
const_iterator begin() const { return m_entries.cbegin(); }
const_iterator end() const { return m_entries.cend(); }
bool empty() const { return m_entries.empty(); }
- int size() const { return (int)m_entries.size(); }
+ size_t size() const { return m_entries.size(); }
private:
SectionInfoVec m_entries;
diff --git a/src/util.cpp b/src/util.cpp
index 5b409ea..f16a28e 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -6626,7 +6626,7 @@ void replaceNamespaceAliases(QCString &scope,int i)
if (it!=Doxygen::namespaceAliasMap.end())
{
scope=it->second.data()+scope.right(scope.length()-i);
- i=it->second.length();
+ i=static_cast<int>(it->second.length());
}
}
if (i>0 && ns==scope.left(i)) break;