summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--addon/doxyparse/doxyparse.cpp2
-rwxr-xr-xaddon/doxywizard/doxywizard.cpp20
-rw-r--r--addon/doxywizard/expert.cpp2
-rw-r--r--addon/doxywizard/wizard.cpp4
-rw-r--r--libversion/doxyversion.cpp.in2
-rw-r--r--libversion/version.h2
-rw-r--r--qtools/CMakeLists.txt8
-rw-r--r--qtools/qmutex.cpp95
-rw-r--r--qtools/qmutex.h83
-rw-r--r--qtools/qmutex_p.h90
-rw-r--r--qtools/qmutex_unix.cpp117
-rw-r--r--qtools/qmutex_win32.cpp108
-rw-r--r--qtools/qtextcodec.cpp2
-rw-r--r--qtools/qthread.cpp86
-rw-r--r--qtools/qthread.h77
-rw-r--r--qtools/qthread_p.h85
-rw-r--r--qtools/qthread_unix.cpp239
-rw-r--r--qtools/qthread_win32.cpp158
-rw-r--r--qtools/qtools.pro.in19
-rw-r--r--qtools/qwaitcondition.h68
-rw-r--r--qtools/qwaitcondition_unix.cpp134
-rw-r--r--qtools/qwaitcondition_win32.cpp186
-rw-r--r--src/configimpl.l14
-rw-r--r--src/context.cpp2
-rw-r--r--src/definition.cpp20
-rw-r--r--src/definition.h12
-rw-r--r--src/definitionimpl.h7
-rw-r--r--src/docparser.cpp452
-rw-r--r--src/dot.cpp70
-rw-r--r--src/dot.h10
-rw-r--r--src/dotgraph.cpp12
-rw-r--r--src/dotlegendgraph.cpp2
-rw-r--r--src/dotrunner.cpp83
-rw-r--r--src/dotrunner.h96
-rw-r--r--src/doxygen.cpp91
-rw-r--r--src/fortranscanner.l12
-rw-r--r--src/ftvhelp.cpp4
-rw-r--r--src/htmlgen.cpp18
-rw-r--r--src/language.cpp2
-rw-r--r--src/latexgen.cpp8
-rw-r--r--src/layout.cpp2
-rw-r--r--src/memberdef.cpp6
-rw-r--r--src/message.h27
-rw-r--r--src/resourcemgr.cpp2
-rw-r--r--src/rtfdocvisitor.cpp34
-rw-r--r--src/rtfgen.cpp44
-rw-r--r--src/rtfgen.h3
-rw-r--r--src/searchindex.cpp8
-rw-r--r--src/tagreader.cpp148
-rw-r--r--src/util.cpp625
-rw-r--r--src/util.h1
-rw-r--r--src/vhdldocgen.cpp18
-rw-r--r--src/xmlgen.cpp4
-rw-r--r--templates/html/htmlsearchresult.tpl6
-rw-r--r--templates/html/search.js5
55 files changed, 971 insertions, 2464 deletions
diff --git a/addon/doxyparse/doxyparse.cpp b/addon/doxyparse/doxyparse.cpp
index 78a91d3..24769e0 100644
--- a/addon/doxyparse/doxyparse.cpp
+++ b/addon/doxyparse/doxyparse.cpp
@@ -434,7 +434,7 @@ int main(int argc,char **argv) {
exit(1);
}
if (qstrcmp(&argv[1][2], "version") == 0) {
- QCString versionString = getVersion();
+ QCString versionString = getDoxygenVersion();
printf("%s\n", versionString.data());
exit(0);
}
diff --git a/addon/doxywizard/doxywizard.cpp b/addon/doxywizard/doxywizard.cpp
index dc0a6dc..27c99da 100755
--- a/addon/doxywizard/doxywizard.cpp
+++ b/addon/doxywizard/doxywizard.cpp
@@ -228,7 +228,7 @@ void MainWindow::about()
QString msg;
QTextStream t(&msg,QIODevice::WriteOnly);
t << QString::fromLatin1("<qt><center>A tool to configure and run doxygen version ")+
- QString::fromLatin1(getVersion())+
+ QString::fromLatin1(getDoxygenVersion())+
QString::fromLatin1(" on your source files.</center><p><br>"
"<center>Written by<br> Dimitri van Heesch<br>&copy; 2000-2019</center><p>"
"</qt>");
@@ -343,7 +343,7 @@ void MainWindow::clearRecent()
m_recentFiles.clear();
for (int i=0;i<MAX_RECENT_FILES;i++)
{
- m_settings.setValue(QString().sprintf("recent/config%d",i++),QString::fromLatin1(""));
+ m_settings.setValue(QString::fromLatin1("recent/config%1").arg(i++),QString::fromLatin1(""));
}
m_settings.sync();
}
@@ -389,7 +389,7 @@ void MainWindow::loadSettings()
/* due to prepend use list in reversed order */
for (int i=MAX_RECENT_FILES;i>=0;i--)
{
- QString entry = m_settings.value(QString().sprintf("recent/config%d",i)).toString();
+ QString entry = m_settings.value(QString::fromLatin1("recent/config%1").arg(i)).toString();
if (!entry.isEmpty() && QFileInfo(entry).exists())
{
addRecentFileList(entry);
@@ -448,11 +448,11 @@ void MainWindow::updateRecentFile(void)
foreach( QString str, m_recentFiles )
{
m_recentMenu->addAction(str);
- m_settings.setValue(QString().sprintf("recent/config%d",i++),str);
+ m_settings.setValue(QString::fromLatin1("recent/config%1").arg(i++),str);
}
for (;i<MAX_RECENT_FILES;i++)
{
- m_settings.setValue(QString().sprintf("recent/config%d",i++),QString::fromLatin1(""));
+ m_settings.setValue(QString::fromLatin1("recent/config%1").arg(i),QString::fromLatin1(""));
}
}
@@ -548,7 +548,11 @@ void MainWindow::readStdout()
{
text1 += text;
m_outputLog->clear();
- m_outputLog->append(APPQT(text1.trimmed()));
+#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
+ m_outputLog->append(APPQT(text1.toHtmlEscaped().trimmed()));
+#else
+ m_outputLog->append(APPQT(Qt::escape(text1).trimmed()));
+#endif
}
}
}
@@ -690,7 +694,7 @@ int main(int argc,char **argv)
if (!qstrcmp(argv[1],"--help"))
{
QMessageBox msgBox;
- msgBox.setText(QString().sprintf("Usage: %s [config file]",argv[0]));
+ msgBox.setText(QString::fromLatin1("Usage: %1 [config file]").arg(QString::fromLatin1(argv[0])));
msgBox.exec();
exit(0);
}
@@ -698,7 +702,7 @@ int main(int argc,char **argv)
if (argc > 2)
{
QMessageBox msgBox;
- msgBox.setText(QString().sprintf("Too many arguments specified\n\nUsage: %s [config file]",argv[0]));
+ msgBox.setText(QString::fromLatin1("Too many arguments specified\n\nUsage: %1 [config file]").arg(QString::fromLatin1(argv[0])));
msgBox.exec();
exit(1);
}
diff --git a/addon/doxywizard/expert.cpp b/addon/doxywizard/expert.cpp
index 1303a22..c043994 100644
--- a/addon/doxywizard/expert.cpp
+++ b/addon/doxywizard/expert.cpp
@@ -796,7 +796,7 @@ void Expert::saveTopic(QTextStream &t,QDomElement &elem,QTextCodec *codec,
bool Expert::writeConfig(QTextStream &t,bool brief)
{
// write global header
- t << "# Doxyfile " << getVersion() << endl << endl;
+ t << "# Doxyfile " << getDoxygenVersion() << endl << endl;
if (!brief)
{
t << convertToComment(m_header);
diff --git a/addon/doxywizard/wizard.cpp b/addon/doxywizard/wizard.cpp
index 2233379..c3c1b57 100644
--- a/addon/doxywizard/wizard.cpp
+++ b/addon/doxywizard/wizard.cpp
@@ -369,8 +369,8 @@ void ColorPicker::paintEvent(QPaintEvent*)
p.drawPixmap(1, coff, *m_pix);
const QPalette &g = palette();
qDrawShadePanel(&p, r, g, true);
- p.setPen(g.foreground().color());
- p.setBrush(g.foreground());
+ p.setPen(g.windowText().color());
+ p.setBrush(g.windowText());
QPolygon a;
int y = m_mode==Hue ? hue2y(m_hue) :
m_mode==Saturation ? sat2y(m_sat) :
diff --git a/libversion/doxyversion.cpp.in b/libversion/doxyversion.cpp.in
index 11bca8d..614aa07 100644
--- a/libversion/doxyversion.cpp.in
+++ b/libversion/doxyversion.cpp.in
@@ -1,6 +1,6 @@
#include "version.h"
-char *getVersion(void)
+char *getDoxygenVersion(void)
{
static char versionString[] = "@DOXYGEN_VERSION@";
return versionString;
diff --git a/libversion/version.h b/libversion/version.h
index a656e74..22a054d 100644
--- a/libversion/version.h
+++ b/libversion/version.h
@@ -17,6 +17,6 @@
#ifndef VERSION_H
#define VERSION_H
-char *getVersion(void);
+char *getDoxygenVersion(void);
char *getGitVersion(void);
#endif
diff --git a/qtools/CMakeLists.txt b/qtools/CMakeLists.txt
index cc64de1..a7082c7 100644
--- a/qtools/CMakeLists.txt
+++ b/qtools/CMakeLists.txt
@@ -25,8 +25,6 @@ qstringlist.cpp
qcstringlist.cpp
qxml.cpp
qmap.cpp
-qthread.cpp
-qmutex.cpp
qutfcodec.cpp
)
@@ -35,9 +33,6 @@ list(APPEND qtools_src
qfile_unix.cpp
qdir_unix.cpp
qfileinfo_unix.cpp
-qthread_unix.cpp
-qmutex_unix.cpp
-qwaitcondition_unix.cpp
)
endif()
@@ -46,9 +41,6 @@ list(APPEND qtools_src
qfile_win32.cpp
qdir_win32.cpp
qfileinfo_win32.cpp
-qthread_win32.cpp
-qmutex_win32.cpp
-qwaitcondition_win32.cpp
)
endif()
diff --git a/qtools/qmutex.cpp b/qtools/qmutex.cpp
deleted file mode 100644
index 08a13bc..0000000
--- a/qtools/qmutex.cpp
+++ /dev/null
@@ -1,95 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtCore module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://www.qtsoftware.com/contact.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <stdio.h>
-
-#include "qglobal.h"
-
-#include "qmutex.h"
-#include "qmutex_p.h"
-
-QMutex::QMutex() : d(new QMutexPrivate())
-{
-}
-
-QMutex::~QMutex()
-{
- delete d;
-}
-
-void QMutex::lock()
-{
- //printf("%p: QMutex::lock(): enter\n",this);
- bool isLocked;
- isLocked = d->contenders.testAndSet(0, 1);
- if (!isLocked)
- {
- isLocked = d->contenders.fetchAndAdd(1)==0;
- if (!isLocked)
- {
- // didn't get the lock, wait for it
- //printf("%p: QMutex::lock(): wait() %d\n",this,(int)d->contenders);
- d->wait();
-
- // release lock
- d->contenders.fetchAndAdd(-1);
- }
- }
- //printf("%p: QMutex::lock(): leave\n",this);
-}
-
-bool QMutex::tryLock()
-{
- bool isLocked = d->contenders.testAndSet(0, 1);
- return isLocked;
-}
-
-void QMutex::unlock()
-{
- //printf("%p: QMutex::unlock(): enter %d\n",this,(int)d->contenders);
- if (!d->contenders.testAndSet(1, 0))
- {
- //printf("%p: QMutex::unlock(): wakeUp()\n",this);
- d->wakeUp();
- }
- //printf("%p: QMutex::unlock(): leave\n",this);
-}
-
diff --git a/qtools/qmutex.h b/qtools/qmutex.h
deleted file mode 100644
index d3d2ac0..0000000
--- a/qtools/qmutex.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtCore module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://www.qtsoftware.com/contact.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QMUTEX_H
-#define QMUTEX_H
-
-#include "qglobal.h"
-
-class QMutexPrivate;
-
-class QMutex
-{
-public:
- QMutex();
- ~QMutex();
-
- void lock();
- bool tryLock();
- void unlock();
-
-private:
- QMutex(const QMutex &);
- QMutex &operator=(const QMutex &);
-
- QMutexPrivate *d;
-};
-
-class QMutexLocker
-{
- public:
- QMutexLocker(QMutex *m) : m_mutex(m)
- {
- m_mutex->lock();
- }
- ~QMutexLocker()
- {
- m_mutex->unlock();
- }
- QMutex *mutex() const { return m_mutex; }
-
- private:
- QMutex *m_mutex;
-};
-
-#endif // QMUTEX_H
diff --git a/qtools/qmutex_p.h b/qtools/qmutex_p.h
deleted file mode 100644
index a47b407..0000000
--- a/qtools/qmutex_p.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtCore module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://www.qtsoftware.com/contact.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QMUTEX_P_H
-#define QMUTEX_P_H
-
-#include "qglobal.h"
-
-#if defined(_OS_UNIX_) || defined(_OS_MAC_)
-#include <pthread.h>
-#elif defined(_OS_WIN32_)
-#include <windows.h>
-#endif
-
-class QAtomicInt
-{
- public:
- QAtomicInt(int v=0) : m_value(v) {}
- bool testAndSet(int expectedValue,int newValue);
- int fetchAndAdd(int valueToAdd);
- operator int () const { return m_value; }
- bool operator==(int value) const { return m_value == value; }
- bool operator!=(int value) const { return m_value != value; }
- bool operator!() const { return m_value == 0; }
-
- private:
- volatile int m_value;
-};
-
-class QMutexPrivate
-{
-public:
- QMutexPrivate();
- ~QMutexPrivate();
-
- void wait();
- void wakeUp();
-
- QAtomicInt contenders;
-
-#if defined(_OS_UNIX_) || defined(_OS_MAC_)
- volatile bool wakeup;
- pthread_mutex_t mutex;
- pthread_cond_t cond;
-#elif defined(_OS_WIN32_)
- HANDLE event;
-#else
-#error "unsupported platform"
-#endif
-};
-
-#endif // QMUTEX_P_H
diff --git a/qtools/qmutex_unix.cpp b/qtools/qmutex_unix.cpp
deleted file mode 100644
index 4fe9a58..0000000
--- a/qtools/qmutex_unix.cpp
+++ /dev/null
@@ -1,117 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtCore module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://www.qtsoftware.com/contact.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <errno.h>
-#include <pthread.h>
-
-#include "qglobal.h"
-#include "qmutex.h"
-#include "qmutex_p.h"
-
-static pthread_mutex_t qAtomicMutex = PTHREAD_MUTEX_INITIALIZER;
-
-static void report_error(int code, const char *where, const char *what)
-{
- if (code != 0)
- qWarning("%s: %s failure: %d", where, what, code);
-}
-
-
-QMutexPrivate::QMutexPrivate()
- : contenders(0), wakeup(FALSE)
-{
- report_error(pthread_mutex_init(&mutex, NULL), "QMutex", "mutex init");
- report_error(pthread_cond_init(&cond, NULL), "QMutex", "cv init");
-}
-
-QMutexPrivate::~QMutexPrivate()
-{
- report_error(pthread_cond_destroy(&cond), "QMutex", "cv destroy");
- report_error(pthread_mutex_destroy(&mutex), "QMutex", "mutex destroy");
-}
-
-void QMutexPrivate::wait()
-{
- report_error(pthread_mutex_lock(&mutex), "QMutex::lock", "mutex lock");
- int errorCode = 0;
- while (!wakeup)
- {
- errorCode = pthread_cond_wait(&cond, &mutex);
- if (errorCode)
- {
- report_error(errorCode, "QMutex::lock()", "cv wait");
- }
- }
- wakeup = FALSE;
- report_error(pthread_mutex_unlock(&mutex), "QMutex::lock", "mutex unlock");
-}
-
-void QMutexPrivate::wakeUp()
-{
- report_error(pthread_mutex_lock(&mutex), "QMutex::unlock", "mutex lock");
- wakeup = TRUE;
- report_error(pthread_cond_signal(&cond), "QMutex::unlock", "cv signal");
- report_error(pthread_mutex_unlock(&mutex), "QMutex::unlock", "mutex unlock");
-}
-
-bool QAtomicInt::testAndSet(int expectedValue,int newValue)
-{
- bool returnValue = false;
- pthread_mutex_lock(&qAtomicMutex);
- if (m_value == expectedValue)
- {
- m_value = newValue;
- returnValue = true;
- }
- pthread_mutex_unlock(&qAtomicMutex);
- return returnValue;
-}
-
-int QAtomicInt::fetchAndAdd(int valueToAdd)
-{
- int returnValue;
- pthread_mutex_lock(&qAtomicMutex);
- returnValue = m_value;
- m_value += valueToAdd;
- pthread_mutex_unlock(&qAtomicMutex);
- return returnValue;
-}
-
diff --git a/qtools/qmutex_win32.cpp b/qtools/qmutex_win32.cpp
deleted file mode 100644
index 2d662ea..0000000
--- a/qtools/qmutex_win32.cpp
+++ /dev/null
@@ -1,108 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtCore module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://www.qtsoftware.com/contact.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <windows.h>
-
-#include "qmutex.h"
-#include "qmutex_p.h"
-
-QMutexPrivate::QMutexPrivate()
- : contenders(0)
-{
- event = CreateEvent(0, FALSE, FALSE, 0);
- if (!event)
- qWarning("QMutexPrivate::QMutexPrivate: Cannot create event");
-}
-
-QMutexPrivate::~QMutexPrivate()
-{
- CloseHandle(event);
-}
-
-void QMutexPrivate::wait()
-{
- WaitForSingleObject(event, INFINITE);
-}
-
-void QMutexPrivate::wakeUp()
-{
- SetEvent(event);
-}
-
-//----------------------------------------------------------------------
-
-class QCriticalSection
-{
- public:
- QCriticalSection() { InitializeCriticalSection(&section); }
- ~QCriticalSection() { DeleteCriticalSection(&section); }
- void lock() { EnterCriticalSection(&section); }
- void unlock() { LeaveCriticalSection(&section); }
-
- private:
- CRITICAL_SECTION section;
-};
-
-static QCriticalSection qAtomicCriticalSection;
-
-bool QAtomicInt::testAndSet(int expectedValue,int newValue)
-{
- bool returnValue = false;
- qAtomicCriticalSection.lock();
- if (m_value == expectedValue)
- {
- m_value = newValue;
- returnValue = true;
- }
- qAtomicCriticalSection.unlock();
- return returnValue;
-}
-
-int QAtomicInt::fetchAndAdd(int valueToAdd)
-{
- int returnValue;
- qAtomicCriticalSection.lock();
- returnValue = m_value;
- m_value += valueToAdd;
- qAtomicCriticalSection.unlock();
- return returnValue;
-}
-
diff --git a/qtools/qtextcodec.cpp b/qtools/qtextcodec.cpp
index 8ce266d..13c3d51 100644
--- a/qtools/qtextcodec.cpp
+++ b/qtools/qtextcodec.cpp
@@ -1,5 +1,5 @@
/****************************************************************************
-**
+**
**
** Implementation of QTextCodec class
**
diff --git a/qtools/qthread.cpp b/qtools/qthread.cpp
deleted file mode 100644
index 02c99f2..0000000
--- a/qtools/qthread.cpp
+++ /dev/null
@@ -1,86 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtCore module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://www.qtsoftware.com/contact.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qthread.h"
-#include "qthread_p.h"
-
-QThread::QThread()
- : d(new QThreadPrivate)
-{
-}
-
-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
-{
- QMutexLocker locker(&d->mutex);
- return d->finished;
-}
-
-bool QThread::isRunning() const
-{
- QMutexLocker locker(&d->mutex);
- return d->running;
-}
-
-void QThread::setStackSize(unsigned int stackSize)
-{
- QMutexLocker locker(&d->mutex);
- if (d->running)
- {
- qWarning("QThread: Cannot change stack size while thread is running!");
- return;
- }
- d->stackSize = stackSize;
-}
-
-unsigned int QThread::stackSize() const
-{
- QMutexLocker locker(&d->mutex);
- return d->stackSize;
-}
-
diff --git a/qtools/qthread.h b/qtools/qthread.h
deleted file mode 100644
index 81868bd..0000000
--- a/qtools/qthread.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtCore module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://www.qtsoftware.com/contact.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QTHREAD_H
-#define QTHREAD_H
-
-class QThreadPrivate;
-
-class QThread
-{
- public:
- explicit QThread();
- virtual ~QThread();
-
- bool isFinished() const;
- bool isRunning() const;
-
- void start();
- void terminate();
- void wait();
- void setStackSize(unsigned int stackSize);
- unsigned int stackSize() const;
- static int idealThreadCount();
-
-protected:
- // events
- virtual void started() {}
- virtual void finished() {}
- virtual void terminated() {}
-
- // main loop
- virtual void run() {}
-
-private:
- QThreadPrivate *d;
- friend class QThreadPrivate;
-};
-
-#endif // QTHREAD_H
diff --git a/qtools/qthread_p.h b/qtools/qthread_p.h
deleted file mode 100644
index 87692aa..0000000
--- a/qtools/qthread_p.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtCore module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://www.qtsoftware.com/contact.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QTHREAD_P_H
-#define QTHREAD_P_H
-
-#include "qglobal.h"
-
-#if defined(_OS_UNIX_) || defined(_OS_MAC_)
-#include <pthread.h>
-#elif defined(_OS_WIN32_)
-#include <windows.h>
-#endif
-
-#include "qthread.h"
-#include "qmutex.h"
-#include "qwaitcondition.h"
-
-class QThreadPrivate
-{
-public:
- QThreadPrivate();
- ~QThreadPrivate();
-
- mutable QMutex mutex;
-
- bool running;
- bool finished;
- bool terminated;
- uint stackSize;
-
-#if defined(_OS_UNIX_) || defined(_OS_MAC_)
- pthread_t thread_id;
- QWaitCondition thread_done;
- static void *start(void *arg);
- static void finish(void *arg);
-#elif defined(_OS_WIN32_)
- HANDLE handle;
- static unsigned int __stdcall start(void *);
- static void finish(void *,bool lockAnyway=TRUE);
- int waiters;
-#else
-#error "unsupported platform!"
-#endif
-};
-
-#endif // QTHREAD_P_H
diff --git a/qtools/qthread_unix.cpp b/qtools/qthread_unix.cpp
deleted file mode 100644
index 5871605..0000000
--- a/qtools/qthread_unix.cpp
+++ /dev/null
@@ -1,239 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtCore module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://www.qtsoftware.com/contact.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qglobal.h"
-
-#if defined(_OS_HPUX_)
-#include <sys/pstat.h>
-#elif defined(_OS_MAC_)
-#undef DEBUG
-#include <CoreServices/CoreServices.h>
-#elif defined(_OS_BSDI_)
-#include <mach/mach_types.h>
-#include <sys/systm.h>
-#include <sys/types.h>
-#include <sys/sysctl.h>
-#endif
-#include <signal.h>
-#include <unistd.h>
-#include <stdio.h>
-
-#include "qthread.h"
-#include "qthread_p.h"
-
-
-/**************************************************************************
- ** QThreadPrivate
- *************************************************************************/
-
-QThreadPrivate::QThreadPrivate() :
- running(FALSE), finished(FALSE), terminated(FALSE), stackSize(0)
-{
- thread_id = 0;
-}
-
-QThreadPrivate::~QThreadPrivate()
-{
-}
-
-void *QThreadPrivate::start(void *arg)
-{
-#ifndef __ANDROID__
- pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);
-#endif
- pthread_cleanup_push(QThreadPrivate::finish, arg);
-
- QThread *thr = reinterpret_cast<QThread *>(arg);
-
- thr->started();
-#ifndef __ANDROID__
- pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
- pthread_testcancel();
-#endif
- thr->run();
-
- pthread_cleanup_pop(1);
- return 0;
-}
-
-void QThreadPrivate::finish(void *arg)
-{
- QThread *thr = reinterpret_cast<QThread *>(arg);
- QThreadPrivate *d = thr->d;
- QMutexLocker locker(&d->mutex);
-
- d->running = FALSE;
- d->finished = TRUE;
- if (d->terminated)
- thr->terminated();
- d->terminated = FALSE;
- thr->finished();
-
- d->thread_id = 0;
- d->thread_done.wakeAll();
-}
-
-
-
-
-/**************************************************************************
- ** QThread
- *************************************************************************/
-
-void QThread::start()
-{
- QMutexLocker locker(&d->mutex);
- if (d->running) return;
-
- // Block the SIGINT signal. The threads will inherit the signal mask.
- // This will avoid them catching SIGINT instead of this thread.
- sigset_t sigset, oldset;
- sigemptyset(&sigset);
- sigaddset(&sigset, SIGINT);
- pthread_sigmask(SIG_BLOCK, &sigset, &oldset);
-
- d->running = TRUE;
- d->finished = FALSE;
-
- pthread_attr_t attr;
- pthread_attr_init(&attr);
- pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_DETACHED);
-#ifndef __ANDROID__
- pthread_attr_setinheritsched(&attr, PTHREAD_INHERIT_SCHED);
-#endif
- if (d->stackSize>0)
- {
-#if defined(_POSIX_THREAD_ATTR_STACKSIZE) && (_POSIX_THREAD_ATTR_STACKSIZE-0>0)
- pthread_attr_setstacksize(&attr,d->stackSize);
-#endif
- }
- int code = pthread_create(&d->thread_id, &attr, QThreadPrivate::start, this);
- pthread_attr_destroy(&attr);
-
- if (code)
- {
- qWarning("QThread::start: Thread creation error: %d", code);
-
- d->running = FALSE;
- d->finished = FALSE;
- d->thread_id = 0;
- }
- else
- {
- // Restore the old signal mask only for this thread.
- pthread_sigmask(SIG_SETMASK, &oldset, NULL);
- }
-}
-
-void QThread::terminate()
-{
- QMutexLocker locker(&d->mutex);
-#ifndef __ANDROID__
- if (!d->thread_id) return;
-
- int code = pthread_cancel(d->thread_id);
- if (code)
- {
- qWarning("QThread::start: Thread termination error: %d", code);
- }
- else
- {
- d->terminated = TRUE;
- }
-#endif
-}
-
-void QThread::wait()
-{
- QMutexLocker locker(&d->mutex);
- if (d->finished || !d->running) return;
-
- while (d->running)
- {
- d->thread_done.wait(locker.mutex());
- }
-}
-
-#if defined(QT_LINUXBASE) && !defined(_SC_NPROCESSORS_ONLN)
-// LSB doesn't define _SC_NPROCESSORS_ONLN.
-# define _SC_NPROCESSORS_ONLN 84
-#endif
-
-int QThread::idealThreadCount()
-{
- int cores = -1;
-#if defined(_OS_MAC_)
- // Mac OS X
- cores = (int)MPProcessorsScheduled();
-#elif defined(_OS_HPUX_)
- // HP-UX
- struct pst_dynamic psd;
- if (pstat_getdynamic(&psd, sizeof(psd), 1, 0) == -1)
- {
- perror("pstat_getdynamic");
- cores = -1;
- }
- else
- {
- cores = (int)psd.psd_proc_cnt;
- }
-#elif defined(_OS_BSDI_)
- // FreeBSD, OpenBSD, NetBSD, BSD/OS
- size_t len = sizeof(cores);
- int mib[2];
- mib[0] = CTL_HW;
- mib[1] = HW_NCPU;
-
- if (sysctl(mib, 2, &cores, &len, NULL, 0) != 0)
- {
- perror("sysctl");
- cores = -1;
- }
-#elif defined(_OS_IRIX_)
- // IRIX
- cores = (int)sysconf(_SC_NPROC_ONLN);
-#else
- // the rest: Linux, Solaris, AIX, Tru64
- cores = (int)sysconf(_SC_NPROCESSORS_ONLN);
-#endif
- return cores;
-}
-
diff --git a/qtools/qthread_win32.cpp b/qtools/qthread_win32.cpp
deleted file mode 100644
index 2c62e93..0000000
--- a/qtools/qthread_win32.cpp
+++ /dev/null
@@ -1,158 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtCore module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://www.qtsoftware.com/contact.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qthread.h"
-#include "qthread_p.h"
-
-/**************************************************************************
- ** QThreadPrivate
- *************************************************************************/
-
-QThreadPrivate::QThreadPrivate() :
- running(FALSE), finished(FALSE), terminated(FALSE), stackSize(0)
-{
- handle = NULL;
- waiters = 0;
-}
-
-QThreadPrivate::~QThreadPrivate()
-{
-}
-
-unsigned int __stdcall QThreadPrivate::start(void *arg)
-{
- QThread *thr = reinterpret_cast<QThread *>(arg);
- thr->started();
- thr->run();
- finish(arg);
- return 0;
-}
-
-void QThreadPrivate::finish(void *arg,bool lockAnyway)
-{
- QThread *thr = reinterpret_cast<QThread *>(arg);
- QThreadPrivate *d = thr->d;
-
- if (lockAnyway) d->mutex.lock();
-
- d->running = FALSE;
- d->finished = TRUE;
- if (d->terminated) thr->terminated();
- d->terminated = FALSE;
- thr->finished();
-
- if (!d->waiters)
- {
- CloseHandle(d->handle);
- d->handle = 0;
- }
-
- if (lockAnyway) d->mutex.unlock();
-}
-
-/**************************************************************************
- ** QThread
- *************************************************************************/
-
-void QThread::start()
-{
- QMutexLocker locker(&d->mutex);
-
- if (d->running) return;
-
- d->running = TRUE;
- d->finished = FALSE;
- d->terminated = FALSE;
-
- d->handle = CreateThread(NULL,d->stackSize,
- (LPTHREAD_START_ROUTINE)QThreadPrivate::start,this,0,NULL);
-
- if (!d->handle)
- {
- qWarning("QThread::start: Failed to create thread: errno=%d",errno);
- d->running = FALSE;
- d->finished = TRUE;
- return;
- }
-}
-
-void QThread::terminate()
-{
- QMutexLocker locker(&d->mutex);
- if (!d->running) return;
- TerminateThread(d->handle, 0);
- d->terminated = TRUE;
- QThreadPrivate::finish(this);
-}
-
-void QThread::wait()
-{
- QMutexLocker locker(&d->mutex);
- if (d->finished || !d->running) return;
-
- ++d->waiters;
- locker.mutex()->unlock();
-
- WaitForSingleObject(d->handle,INFINITE);
-
- locker.mutex()->lock();
- --d->waiters;
- if (!d->finished) // thread was terminated by someone else
- {
- d->terminated = TRUE;
- QThreadPrivate::finish(this);
- }
-
- if (d->finished && d->waiters)
- {
- CloseHandle(d->handle);
- d->handle = 0;
- }
-}
-
-int QThread::idealThreadCount()
-{
- SYSTEM_INFO sysinfo;
- GetSystemInfo(&sysinfo);
- return sysinfo.dwNumberOfProcessors;
-}
-
-
diff --git a/qtools/qtools.pro.in b/qtools/qtools.pro.in
index ba8a086..21d26cc 100644
--- a/qtools/qtools.pro.in
+++ b/qtools/qtools.pro.in
@@ -44,12 +44,7 @@ HEADERS = qarray.h \
qvaluestack.h \
qmap.h \
qmodules.h \
- qthread.h \
- qthread_p.h \
- qmutex.h \
- qmutex_p.h \
- qutfcodec.h \
- qwaitcondition.h
+ qutfcodec.h
SOURCES = qbuffer.cpp \
qcollection.cpp \
@@ -74,23 +69,15 @@ SOURCES = qbuffer.cpp \
qstringlist.cpp \
qxml.cpp \
qmap.cpp \
- qthread.cpp \
- qmutex.cpp \
qutfcodec.cpp
unix:SOURCES += qfile_unix.cpp \
qdir_unix.cpp \
- qfileinfo_unix.cpp \
- qthread_unix.cpp \
- qmutex_unix.cpp \
- qwaitcondition_unix.cpp
+ qfileinfo_unix.cpp
win32:SOURCES += qfile_win32.cpp \
qdir_win32.cpp \
- qfileinfo_win32.cpp \
- qthread_win32.cpp \
- qmutex_win32.cpp \
- qwaitcondition_win32.cpp
+ qfileinfo_win32.cpp
INCLUDEPATH = .
#TMAKE_CXXFLAGS += -DQT_NO_CODECS -DQT_LITE_UNICODE
diff --git a/qtools/qwaitcondition.h b/qtools/qwaitcondition.h
deleted file mode 100644
index 4d5b3bd..0000000
--- a/qtools/qwaitcondition.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtCore module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://www.qtsoftware.com/contact.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QWAITCONDITION_H
-#define QWAITCONDITION_H
-
-#include "qglobal.h"
-
-class QWaitConditionPrivate;
-class QMutex;
-
-class QWaitCondition
-{
-public:
- QWaitCondition();
- ~QWaitCondition();
-
- void wait(QMutex *mutex);
-
- void wakeOne();
- void wakeAll();
-
-private:
- QWaitCondition(const QWaitCondition &);
- QWaitCondition &operator=(const QWaitCondition &);
-
- QWaitConditionPrivate * d;
-};
-
-#endif // QWAITCONDITION_H
diff --git a/qtools/qwaitcondition_unix.cpp b/qtools/qwaitcondition_unix.cpp
deleted file mode 100644
index 0a6a09b..0000000
--- a/qtools/qwaitcondition_unix.cpp
+++ /dev/null
@@ -1,134 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtCore module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://www.qtsoftware.com/contact.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qwaitcondition.h"
-#include "qmutex.h"
-#include <pthread.h>
-
-#define MIN(a,b) ((a)<(b)?(a):(b))
-
-static void report_error(int code, const char *where, const char *what)
-{
- if (code != 0)
- qWarning("%s: %s failure: %d", where, what, code);
-}
-
-class QWaitConditionPrivate
-{
- public:
- pthread_mutex_t mutex;
- pthread_cond_t cond;
- int waiters;
- int wakeups;
-
- void wait()
- {
- int code;
- for (;;)
- {
- code = pthread_cond_wait(&cond, &mutex);
- if (code == 0 && wakeups == 0)
- {
- // many vendors warn of spurious wakeups from
- // pthread_cond_wait(), especially after signal delivery,
- // even though POSIX doesn't allow for it... sigh
- continue;
- }
- break;
- }
-
- --waiters;
- if (code == 0)
- {
- --wakeups;
- }
- else
- {
- report_error(code, "QWaitCondition::wait()", "cv wait");
- }
- report_error(pthread_mutex_unlock(&mutex), "QWaitCondition::wait()", "mutex unlock");
- }
-};
-
-
-QWaitCondition::QWaitCondition()
-{
- d = new QWaitConditionPrivate;
- report_error(pthread_mutex_init(&d->mutex, NULL), "QWaitCondition", "mutex init");
- report_error(pthread_cond_init(&d->cond, NULL), "QWaitCondition", "cv init");
- d->waiters = d->wakeups = 0;
-}
-
-
-QWaitCondition::~QWaitCondition()
-{
- report_error(pthread_cond_destroy(&d->cond), "QWaitCondition", "cv destroy");
- report_error(pthread_mutex_destroy(&d->mutex), "QWaitCondition", "mutex destroy");
- delete d;
-}
-
-void QWaitCondition::wakeOne()
-{
- report_error(pthread_mutex_lock(&d->mutex), "QWaitCondition::wakeOne()", "mutex lock");
- d->wakeups = MIN(d->wakeups + 1, d->waiters);
- report_error(pthread_cond_signal(&d->cond), "QWaitCondition::wakeOne()", "cv signal");
- report_error(pthread_mutex_unlock(&d->mutex), "QWaitCondition::wakeOne()", "mutex unlock");
-}
-
-void QWaitCondition::wakeAll()
-{
- report_error(pthread_mutex_lock(&d->mutex), "QWaitCondition::wakeAll()", "mutex lock");
- d->wakeups = d->waiters;
- report_error(pthread_cond_broadcast(&d->cond), "QWaitCondition::wakeAll()", "cv broadcast");
- report_error(pthread_mutex_unlock(&d->mutex), "QWaitCondition::wakeAll()", "mutex unlock");
-}
-
-void QWaitCondition::wait(QMutex *mutex)
-{
- if (!mutex) return;
-
- report_error(pthread_mutex_lock(&d->mutex), "QWaitCondition::wait()", "mutex lock");
- ++d->waiters;
- mutex->unlock();
- d->wait();
- mutex->lock();
-}
-
diff --git a/qtools/qwaitcondition_win32.cpp b/qtools/qwaitcondition_win32.cpp
deleted file mode 100644
index 80b7b67..0000000
--- a/qtools/qwaitcondition_win32.cpp
+++ /dev/null
@@ -1,186 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtCore module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://www.qtsoftware.com/contact.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <windows.h>
-#include "qwaitcondition.h"
-#include "qmutex.h"
-#include "qinternallist.h"
-
-//***********************************************************************
-// QWaitConditionPrivate
-// **********************************************************************
-
-class QWaitConditionEvent
-{
-public:
- QWaitConditionEvent() : priority(0), wokenUp(false)
- {
- event = CreateEvent(NULL, TRUE, FALSE, NULL);
- }
- ~QWaitConditionEvent() { CloseHandle(event); }
- int priority;
- bool wokenUp;
- HANDLE event;
-};
-
-class EventQueue : public QInternalList<QWaitConditionEvent>
-{
- public:
- EventQueue() { setAutoDelete(TRUE); }
- ~EventQueue() {}
-};
-
-class QWaitConditionPrivate
-{
-public:
- QMutex mtx;
- EventQueue queue;
- EventQueue freeQueue;
-
- QWaitConditionEvent *pre();
- void wait(QWaitConditionEvent *wce);
- void post(QWaitConditionEvent *wce);
-};
-
-QWaitConditionEvent *QWaitConditionPrivate::pre()
-{
- mtx.lock();
- QWaitConditionEvent *wce =
- freeQueue.isEmpty() ? new QWaitConditionEvent : freeQueue.take(0);
- wce->priority = GetThreadPriority(GetCurrentThread());
- wce->wokenUp = FALSE;
-
- // insert 'wce' into the queue (sorted by priority)
- uint index = 0;
- for (; index < queue.count(); ++index)
- {
- QWaitConditionEvent *current = queue.at(index);
- if (current->priority < wce->priority)
- break;
- }
- queue.insert(index, wce);
- mtx.unlock();
-
- return wce;
-}
-
-void QWaitConditionPrivate::wait(QWaitConditionEvent *wce)
-{
- WaitForSingleObject(wce->event, INFINITE);
-}
-
-void QWaitConditionPrivate::post(QWaitConditionEvent *wce)
-{
- mtx.lock();
-
- // remove 'wce' from the queue
- int idx = queue.find(wce);
- ASSERT(idx!=-1);
- queue.take(idx);
- ResetEvent(wce->event);
- freeQueue.append(wce);
-
- // wakeups delivered after the timeout should be forwarded to the next waiter
- if (wce->wokenUp && !queue.isEmpty())
- {
- QWaitConditionEvent *other = queue.getFirst();
- SetEvent(other->event);
- other->wokenUp = TRUE;
- }
-
- mtx.unlock();
-}
-
-//***********************************************************************
-// QWaitCondition implementation
-//***********************************************************************
-
-QWaitCondition::QWaitCondition()
-{
- d = new QWaitConditionPrivate;
-}
-
-QWaitCondition::~QWaitCondition()
-{
- if (!d->queue.isEmpty())
- {
- qWarning("QWaitCondition: Destroyed while threads are still waiting");
- }
- delete d;
-}
-
-void QWaitCondition::wait(QMutex *mutex)
-{
- if (!mutex) return;
-
- QWaitConditionEvent *wce = d->pre();
- mutex->unlock();
- d->wait(wce);
- mutex->lock();
- d->post(wce);
-}
-
-void QWaitCondition::wakeOne()
-{
- // wake up the first waiting thread in the queue
- QMutexLocker locker(&d->mtx);
- for (uint i = 0; i < d->queue.count(); ++i)
- {
- QWaitConditionEvent *current = d->queue.at(i);
- if (current->wokenUp) continue;
- SetEvent(current->event);
- current->wokenUp = TRUE;
- break;
- }
-}
-
-void QWaitCondition::wakeAll()
-{
- // wake up the all threads in the queue
- QMutexLocker locker(&d->mtx);
- for (uint i = 0; i < d->queue.count(); ++i)
- {
- QWaitConditionEvent *current = d->queue.at(i);
- SetEvent(current->event);
- current->wokenUp = TRUE;
- }
-}
-
diff --git a/src/configimpl.l b/src/configimpl.l
index 7055e93..d07e25c 100644
--- a/src/configimpl.l
+++ b/src/configimpl.l
@@ -33,8 +33,8 @@
#include <qregexp.h>
#include <qstack.h>
#include <qglobal.h>
-#include <qthread.h>
-
+#include <thread>
+
#include "configimpl.h"
#include "version.h"
#include "portable.h"
@@ -1001,7 +1001,7 @@ void ConfigImpl::writeTemplate(FTextStream &t,bool sl,bool upd)
{
t << takeStartComment() << endl;
}
- t << "# Doxyfile " << getVersion() << endl << endl;
+ t << "# Doxyfile " << getDoxygenVersion() << endl << endl;
if (!sl)
{
t << convertToComment(m_header,"");
@@ -1022,11 +1022,7 @@ void ConfigImpl::writeTemplate(FTextStream &t,bool sl,bool upd)
void ConfigImpl::compareDoxyfile(FTextStream &t)
{
- t << "# Difference with default Doxyfile " << getVersion();
- if (strlen(getGitVersion()))
- {
- t << " (" << getGitVersion() << ")";
- }
+ t << "# Difference with default Doxyfile " << getFullVersion();
t << endl;
QListIterator<ConfigOption> it = iterator();
ConfigOption *option;
@@ -1682,7 +1678,7 @@ void Config::checkAndCorrect()
}
else if (dotNumThreads<=0)
{
- dotNumThreads=QMAX(2,QThread::idealThreadCount()+1);
+ dotNumThreads=QMAX(2,std::thread::hardware_concurrency()+1);
}
// check dot path
diff --git a/src/context.cpp b/src/context.cpp
index 682d851..badcf22 100644
--- a/src/context.cpp
+++ b/src/context.cpp
@@ -380,7 +380,7 @@ class DoxygenContext::Private
public:
TemplateVariant version() const
{
- return getVersion();
+ return getDoxygenVersion();
}
TemplateVariant date() const
{
diff --git a/src/definition.cpp b/src/definition.cpp
index d3da6b5..22a1435 100644
--- a/src/definition.cpp
+++ b/src/definition.cpp
@@ -736,7 +736,7 @@ class FilterCache
if (numBytes!=item->fileSize)
{
err("Failed to read %d bytes from position %d in filter database file %s: got %d bytes\n",
- (int)item->fileSize,(int)item->filePos,qPrint(Doxygen::filterDBFileName),numBytes);
+ (int)item->fileSize,(int)item->filePos,qPrint(Doxygen::filterDBFileName),(int)numBytes);
success=FALSE;
}
}
@@ -998,11 +998,11 @@ QCString DefinitionImpl::getSourceAnchor() const
{
if (Htags::useHtags)
{
- qsnprintf(anchorStr,maxAnchorStrLen,"L%d",m_impl->body->startLine);
+ qsnprintf(anchorStr,maxAnchorStrLen,"L%d",m_impl->body->defLine);
}
else
{
- qsnprintf(anchorStr,maxAnchorStrLen,"l%05d",m_impl->body->startLine);
+ qsnprintf(anchorStr,maxAnchorStrLen,"l%05d",m_impl->body->defLine);
}
}
return anchorStr;
@@ -1025,7 +1025,7 @@ void DefinitionImpl::writeSourceDef(OutputList &ol,const char *) const
if (lineMarkerPos!=-1 && fileMarkerPos!=-1) // should always pass this.
{
QCString lineStr;
- lineStr.sprintf("%d",m_impl->body->startLine);
+ lineStr.sprintf("%d",m_impl->body->defLine);
QCString anchorStr = getSourceAnchor();
ol.startParagraph("definition");
if (lineMarkerPos<fileMarkerPos) // line marker before file marker
@@ -1197,12 +1197,13 @@ void DefinitionImpl::writeSourceDef(OutputList &ol,const char *) const
ol.popGeneratorState();
}
-void DefinitionImpl::setBodySegment(int bls,int ble)
+void DefinitionImpl::setBodySegment(int defLine, int bls,int ble)
{
//printf("setBodySegment(%d,%d) for %s\n",bls,ble,name().data());
if (m_impl->body==0) m_impl->body = new BodyInfo;
- m_impl->body->startLine=bls;
- m_impl->body->endLine=ble;
+ m_impl->body->defLine = defLine;
+ m_impl->body->startLine = bls;
+ m_impl->body->endLine = ble;
}
void DefinitionImpl::setBodyDef(FileDef *fd)
@@ -2056,6 +2057,11 @@ bool DefinitionImpl::isReference() const
return !m_impl->ref.isEmpty();
}
+int DefinitionImpl::getStartDefLine() const
+{
+ return m_impl->body ? m_impl->body->defLine : -1;
+}
+
int DefinitionImpl::getStartBodyLine() const
{
return m_impl->body ? m_impl->body->startLine : -1;
diff --git a/src/definition.h b/src/definition.h
index f28b47f..318a35b 100644
--- a/src/definition.h
+++ b/src/definition.h
@@ -62,8 +62,9 @@ struct BriefInfo
/** Data associated with description found in the body. */
struct BodyInfo
{
- int startLine; //!< line number of the start of the definition
- int endLine; //!< line number of the end of the definition
+ int defLine; //!< line number of the start of the definition
+ int startLine; //!< line number of the start of the definition's body
+ int endLine; //!< line number of the end of the definition's body
FileDef *fileDef; //!< file definition containing the function body
};
@@ -188,7 +189,7 @@ class Definition : public DefinitionIntf
/*! returns the extension of the file in which this definition was found */
virtual QCString getDefFileExtension() const = 0;
- /*! returns the line number at which the definition was found */
+ /*! returns the line number at which the definition was found (can be the declaration) */
virtual int getDefLine() const = 0;
/*! returns the column number at which the definition was found */
@@ -242,6 +243,9 @@ class Definition : public DefinitionIntf
/*! Convenience method to return a resolved external link */
virtual QCString externalReference(const QCString &relPath) const = 0;
+ /*! Returns the first line of the implementation of this item. See also getDefLine() */
+ virtual int getStartDefLine() const = 0;
+
/*! Returns the first line of the body of this item (applicable to classes and
* functions).
*/
@@ -316,7 +320,7 @@ class Definition : public DefinitionIntf
virtual void setReference(const char *r) = 0;
// source references
- virtual void setBodySegment(int bls,int ble) = 0;
+ virtual void setBodySegment(int defLine, int bls,int ble) = 0;
virtual void setBodyDef(FileDef *fd) = 0;
virtual void setRefItems(const std::vector<RefItem*> &sli) = 0;
diff --git a/src/definitionimpl.h b/src/definitionimpl.h
index d9c222d..28d60b6 100644
--- a/src/definitionimpl.h
+++ b/src/definitionimpl.h
@@ -61,6 +61,7 @@ class DefinitionImpl : virtual public Definition
virtual QCString getReference() const;
virtual bool isReference() const;
virtual QCString externalReference(const QCString &relPath) const;
+ virtual int getStartDefLine() const;
virtual int getStartBodyLine() const;
virtual int getEndBodyLine() const;
virtual FileDef *getBodyDef() const;
@@ -85,7 +86,7 @@ class DefinitionImpl : virtual public Definition
virtual void setInbodyDocumentation(const char *d,const char *docFile,int docLine);
virtual void setReference(const char *r);
virtual void addSectionsToDefinition(const std::vector<const SectionInfo*> &anchorList);
- virtual void setBodySegment(int bls,int ble);
+ virtual void setBodySegment(int defLine,int bls,int ble);
virtual void setBodyDef(FileDef *fd);
virtual void addSourceReferencedBy(const MemberDef *d);
virtual void addSourceReferences(const MemberDef *d);
@@ -201,6 +202,8 @@ class DefinitionAliasImpl : virtual public Definition
{ return m_def->isReference(); }
virtual QCString externalReference(const QCString &relPath) const
{ return m_def->externalReference(relPath); }
+ virtual int getStartDefLine() const
+ { return m_def->getStartDefLine(); }
virtual int getStartBodyLine() const
{ return m_def->getStartBodyLine(); }
virtual int getEndBodyLine() const
@@ -245,7 +248,7 @@ class DefinitionAliasImpl : virtual public Definition
virtual void setInbodyDocumentation(const char *,const char *,int) {}
virtual void setReference(const char *) {}
virtual void addSectionsToDefinition(const std::vector<const SectionInfo*> &) {}
- virtual void setBodySegment(int,int) {}
+ virtual void setBodySegment(int,int,int) {}
virtual void setBodyDef(FileDef *) {}
virtual void addSourceReferencedBy(const MemberDef *) {}
virtual void addSourceReferences(const MemberDef *) {}
diff --git a/src/docparser.cpp b/src/docparser.cpp
index 0cc7080..a9be280 100644
--- a/src/docparser.cpp
+++ b/src/docparser.cpp
@@ -1,13 +1,13 @@
/******************************************************************************
*
- *
+ *
*
*
* Copyright (C) 1997-2015 by Dimitri van Heesch.
*
* Permission to use, copy, modify, and distribute this software and its
- * documentation under the terms of the GNU General Public License is hereby
- * granted. No representations are made about the suitability of this software
+ * documentation under the terms of the GNU General Public License is hereby
+ * granted. No representations are made about the suitability of this software
* for any purpose. It is provided "as is" without express or implied warranty.
* See the GNU General Public License for more details.
*
@@ -70,11 +70,11 @@
//#define DBG(x) myprintf x
#define INTERNAL_ASSERT(x) do {} while(0)
-//#define INTERNAL_ASSERT(x) if (!(x)) DBG(("INTERNAL_ASSERT(%s) failed retval=0x%x: file=%s line=%d\n",#x,retval,__FILE__,__LINE__));
+//#define INTERNAL_ASSERT(x) if (!(x)) DBG(("INTERNAL_ASSERT(%s) failed retval=0x%x: file=%s line=%d\n",#x,retval,__FILE__,__LINE__));
//---------------------------------------------------------------------------
-static const char *sectionLevelToName[] =
+static const char *sectionLevelToName[] =
{
"page",
"section",
@@ -116,7 +116,7 @@ static int g_includeFileLine;
static bool g_includeFileShowLineNo;
-/** Parser's context to store all global variables.
+/** Parser's context to store all global variables.
*/
struct DocParserContext
{
@@ -196,7 +196,7 @@ static void docParserPushContext(bool saveParamInfo=TRUE)
ctx->includeFileLength = g_includeFileLength;
ctx->includeFileLine = g_includeFileLine;
ctx->includeFileLineNo = g_includeFileShowLineNo;
-
+
ctx->token = g_token;
g_token = new TokenInfo;
@@ -291,7 +291,7 @@ static QCString findAndCopyImage(const char *fileName,DocImage::Type type, bool
text.sprintf("image file name %s is ambiguous.\n",qPrint(fileName));
text+="Possible candidates:\n";
text+=showFileDefMatches(Doxygen::imageNameDict,fileName);
- warn_doc_error(g_fileName,doctokenizerYYlineno,text);
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"%s", text.data());
}
QCString inputFile = fd->absFilePath();
@@ -364,7 +364,7 @@ static QCString findAndCopyImage(const char *fileName,DocImage::Type type, bool
"could not open image %s",qPrint(fileName));
}
- if (type==DocImage::Latex && Config_getBool(USE_PDFLATEX) &&
+ if (type==DocImage::Latex && Config_getBool(USE_PDFLATEX) &&
fd->name().right(4)==".eps"
)
{ // we have an .eps image in pdflatex mode => convert it to a pdf.
@@ -389,7 +389,7 @@ static QCString findAndCopyImage(const char *fileName,DocImage::Type type, bool
if (result.left(5)!="http:" && result.left(6)!="https:" && dowarn)
{
warn_doc_error(g_fileName,doctokenizerYYlineno,
- "image file %s is not found in IMAGE_PATH: "
+ "image file %s is not found in IMAGE_PATH: "
"assuming external image.",qPrint(fileName)
);
}
@@ -404,7 +404,7 @@ static QCString findAndCopyImage(const char *fileName,DocImage::Type type, bool
* are disabled altogether).
*/
static void checkArgumentName(const QCString &name)
-{
+{
if (!Config_getBool(WARN_IF_DOC_ERROR)) return;
if (g_memberDef==0) return; // not a member
const ArgumentList &al=g_memberDef->isDocsForDefinition() ?
@@ -474,9 +474,10 @@ static void checkRetvalName(const QCString &name)
{
warn_doc_error(g_memberDef->getDefFileName(),
g_memberDef->getDefLine(),
- "return value '" + name + "' of " +
+ "%s",
+ ("return value '" + name + "' of " +
QCString(g_memberDef->qualifiedName()) +
- " has multiple documentation sections");
+ " has multiple documentation sections").data());
}
g_retvalsFound.insert(name,(void *)(0x8));
}
@@ -510,7 +511,7 @@ static void checkUnOrMultipleDocumentedParams()
{
// allow undocumented self / cls parameter for Python
}
- else if (!argName.isEmpty() && g_paramsFound.find(argName)==0 && a.docs.isEmpty())
+ else if (!argName.isEmpty() && g_paramsFound.find(argName)==0 && a.docs.isEmpty())
{
notArgCnt++;
}
@@ -527,10 +528,11 @@ static void checkUnOrMultipleDocumentedParams()
{
warn_doc_error(g_memberDef->getDefFileName(),
g_memberDef->getDefLine(),
- "argument '" + aName +
+ "%s",
+ ("argument '" + aName +
"' from the argument list of " +
QCString(g_memberDef->qualifiedName()) +
- " has multiple @param documentation sections");
+ " has multiple @param documentation sections").data());
}
}
if (notArgCnt>0)
@@ -540,7 +542,7 @@ static void checkUnOrMultipleDocumentedParams()
"The following parameter";
errMsg+= (notArgCnt>1 ? "s" : "");
errMsg+=" of "+
- QCString(g_memberDef->qualifiedName()) +
+ QCString(g_memberDef->qualifiedName()) +
QCString(argListToString(al)) +
(notArgCnt>1 ? " are" : " is") + " not documented:\n";
for (const Argument &a : al)
@@ -567,7 +569,8 @@ static void checkUnOrMultipleDocumentedParams()
}
warn_doc_error(g_memberDef->getDefFileName(),
g_memberDef->getDefLine(),
- substitute(errMsg,"%","%%"));
+ "%s",
+ substitute(errMsg,"%","%%").data());
}
}
}
@@ -584,7 +587,7 @@ static QCString stripKnownExtensions(const char *text)
result=result.left(result.length()-4);
}
else if (result.right(Doxygen::htmlFileExtension.length())==
- QCString(Doxygen::htmlFileExtension))
+ QCString(Doxygen::htmlFileExtension))
{
result=result.left(result.length()-Doxygen::htmlFileExtension.length());
}
@@ -625,7 +628,7 @@ static bool insideUL(DocNode *n)
{
while (n)
{
- if (n->kind()==DocNode::Kind_HtmlList &&
+ if (n->kind()==DocNode::Kind_HtmlList &&
((DocHtmlList *)n)->type()==DocHtmlList::Unordered) return TRUE;
n=n->parent();
}
@@ -639,7 +642,7 @@ static bool insideOL(DocNode *n)
{
while (n)
{
- if (n->kind()==DocNode::Kind_HtmlList &&
+ if (n->kind()==DocNode::Kind_HtmlList &&
((DocHtmlList *)n)->type()==DocHtmlList::Ordered) return TRUE;
n=n->parent();
}
@@ -683,7 +686,7 @@ static bool findDocsForMemberOrCompound(const char *commandName,
if (l==0) return FALSE;
int funcStart=cmdArg.find('(');
- if (funcStart==-1)
+ if (funcStart==-1)
{
funcStart=l;
}
@@ -693,9 +696,9 @@ static bool findDocsForMemberOrCompound(const char *commandName,
// beware of scenarios like operator()((foo)bar)
int secondParen = cmdArg.find('(', funcStart+1);
int leftParen = cmdArg.find(')', funcStart+1);
- if (leftParen!=-1 && secondParen!=-1)
+ if (leftParen!=-1 && secondParen!=-1)
{
- if (leftParen<secondParen)
+ if (leftParen<secondParen)
{
funcStart=secondParen;
}
@@ -738,7 +741,7 @@ static bool findDocsForMemberOrCompound(const char *commandName,
// try class, namespace, group, page, file reference
cd = Doxygen::classSDict->find(fullName);
- if (cd) // class
+ if (cd) // class
{
*pDoc=cd->documentation();
*pBrief=cd->briefDescription();
@@ -790,7 +793,7 @@ static bool findDocsForMemberOrCompound(const char *commandName,
}
} while (scopeOffset>=0);
-
+
return FALSE;
}
//---------------------------------------------------------------------------
@@ -821,7 +824,7 @@ inline void errorHandleDefaultToken(DocNode *parent,int tok,
//---------------------------------------------------------------------------
// forward declaration
-static bool defaultHandleToken(DocNode *parent,int tok,
+static bool defaultHandleToken(DocNode *parent,int tok,
QList<DocNode> &children,bool
handleWord=TRUE);
@@ -837,15 +840,15 @@ static int handleStyleArgument(DocNode *parent,QList<DocNode> &children,
qPrint(saveCmdName));
return tok;
}
- while ((tok=doctokenizerYYlex()) &&
- tok!=TK_WHITESPACE &&
+ while ((tok=doctokenizerYYlex()) &&
+ tok!=TK_WHITESPACE &&
tok!=TK_NEWPARA &&
- tok!=TK_LISTITEM &&
+ tok!=TK_LISTITEM &&
tok!=TK_ENDLIST
)
{
static QRegExp specialChar("[.,|()\\[\\]:;\\?]");
- if (tok==TK_WORD && g_token->name.length()==1 &&
+ if (tok==TK_WORD && g_token->name.length()==1 &&
g_token->name.find(specialChar)!=-1)
{
// special character that ends the markup command
@@ -858,7 +861,7 @@ static int handleStyleArgument(DocNode *parent,QList<DocNode> &children,
case TK_HTMLTAG:
if (insideLI(parent) && Mappers::htmlTagMapper->map(g_token->name) && g_token->endTag)
{ // ignore </li> as the end of a style command
- continue;
+ continue;
}
return tok;
break;
@@ -871,7 +874,7 @@ static int handleStyleArgument(DocNode *parent,QList<DocNode> &children,
}
DBG(("handleStyleArgument(%s) end tok=%x\n",qPrint(saveCmdName),tok));
return (tok==TK_NEWPARA || tok==TK_LISTITEM || tok==TK_ENDLIST
- ) ? tok : RetVal_OK;
+ ) ? tok : RetVal_OK;
}
/*! Called when a style change starts. For instance a \<b\> command is
@@ -938,7 +941,7 @@ static void handlePendingStyleCommands(DocNode *parent,QList<DocNode> &children)
if (!g_styleStack.isEmpty())
{
DocStyleChange *sc = g_styleStack.top();
- while (sc && sc->position()>=g_nodeStack.count())
+ while (sc && sc->position()>=g_nodeStack.count())
{ // there are unclosed style modifiers in the paragraph
children.append(new DocStyleChange(parent,g_nodeStack.count(),sc->style(),sc->tagName(),FALSE));
g_initialStyleStack.push(sc);
@@ -1059,7 +1062,7 @@ static void handleLinkedWord(DocNode *parent,QList<DocNode> &children,bool ignor
bool ambig;
FileDef *fd = findFileDef(Doxygen::inputNameDict,g_fileName,ambig);
//printf("handleLinkedWord(%s) g_context=%s\n",g_token->name.data(),g_context.data());
- if (!g_insideHtmlLink &&
+ if (!g_insideHtmlLink &&
(resolveRef(g_context,g_token->name,g_inSeeBlock,&compound,&member,TRUE,fd,TRUE)
|| (!g_context.isEmpty() && // also try with global scope
resolveRef("",g_token->name,g_inSeeBlock,&compound,&member,FALSE,0,TRUE))
@@ -1069,12 +1072,12 @@ static void handleLinkedWord(DocNode *parent,QList<DocNode> &children,bool ignor
//printf("resolveRef %s = %p (linkable?=%d)\n",qPrint(g_token->name),member,member ? member->isLinkable() : FALSE);
if (member && member->isLinkable()) // member link
{
- if (member->isObjCMethod())
+ if (member->isObjCMethod())
{
bool localLink = g_memberDef ? member->getClassDef()==g_memberDef->getClassDef() : FALSE;
name = member->objCMethodName(localLink,g_inSeeBlock);
}
- children.append(new
+ children.append(new
DocLinkedWord(parent,name,
member->getReference(),
member->getOutputFileBase(),
@@ -1094,7 +1097,7 @@ static void handleLinkedWord(DocNode *parent,QList<DocNode> &children,bool ignor
{
name=(dynamic_cast<const GroupDef*>(compound))->groupTitle();
}
- children.append(new
+ children.append(new
DocLinkedWord(parent,name,
compound->getReference(),
compound->getOutputFileBase(),
@@ -1107,7 +1110,7 @@ static void handleLinkedWord(DocNode *parent,QList<DocNode> &children,bool ignor
(dynamic_cast<const FileDef*>(compound))->generateSourceFile()
) // undocumented file that has source code we can link to
{
- children.append(new
+ children.append(new
DocLinkedWord(parent,g_token->name,
compound->getReference(),
compound->getSourceFileBase(),
@@ -1123,7 +1126,7 @@ static void handleLinkedWord(DocNode *parent,QList<DocNode> &children,bool ignor
}
else if (!g_insideHtmlLink && len>1 && g_token->name.at(len-1)==':')
{
- // special case, where matching Foo: fails to be an Obj-C reference,
+ // special case, where matching Foo: fails to be an Obj-C reference,
// but Foo itself might be linkable.
g_token->name=g_token->name.left(len-1);
handleLinkedWord(parent,children,ignoreAutoLinkFlag);
@@ -1133,7 +1136,7 @@ static void handleLinkedWord(DocNode *parent,QList<DocNode> &children,bool ignor
{
// special case 2, where the token name is not a class, but could
// be a Obj-C protocol
- children.append(new
+ children.append(new
DocLinkedWord(parent,name,
cd->getReference(),
cd->getOutputFileBase(),
@@ -1145,7 +1148,7 @@ static void handleLinkedWord(DocNode *parent,QList<DocNode> &children,bool ignor
// {
// // special case 3, where the token name is not a class, but could
// // be a C# generic
-// children.append(new
+// children.append(new
// DocLinkedWord(parent,name,
// cd->getReference(),
// cd->getOutputFileBase(),
@@ -1397,7 +1400,7 @@ reparsetoken:
children.append(new DocStyleChange(parent,g_nodeStack.count(),DocStyleChange::Italic,tokenName,FALSE));
if (tok!=TK_WORD) children.append(new DocWhiteSpace(parent," "));
if (tok==TK_NEWPARA) goto handlepara;
- else if (tok==TK_WORD || tok==TK_HTMLTAG)
+ else if (tok==TK_WORD || tok==TK_HTMLTAG)
{
DBG(("CMD_EMPHASIS: reparsing command %s\n",qPrint(g_token->name)));
goto reparsetoken;
@@ -1411,7 +1414,7 @@ reparsetoken:
children.append(new DocStyleChange(parent,g_nodeStack.count(),DocStyleChange::Bold,tokenName,FALSE));
if (tok!=TK_WORD) children.append(new DocWhiteSpace(parent," "));
if (tok==TK_NEWPARA) goto handlepara;
- else if (tok==TK_WORD || tok==TK_HTMLTAG)
+ else if (tok==TK_WORD || tok==TK_HTMLTAG)
{
DBG(("CMD_BOLD: reparsing command %s\n",qPrint(g_token->name)));
goto reparsetoken;
@@ -1425,7 +1428,7 @@ reparsetoken:
children.append(new DocStyleChange(parent,g_nodeStack.count(),DocStyleChange::Code,tokenName,FALSE));
if (tok!=TK_WORD) children.append(new DocWhiteSpace(parent," "));
if (tok==TK_NEWPARA) goto handlepara;
- else if (tok==TK_WORD || tok==TK_HTMLTAG)
+ else if (tok==TK_WORD || tok==TK_HTMLTAG)
{
DBG(("CMD_CODE: reparsing command %s\n",qPrint(g_token->name)));
goto reparsetoken;
@@ -1464,7 +1467,7 @@ reparsetoken:
doctokenizerYYsetStateLatexOnly();
tok = doctokenizerYYlex();
children.append(new DocVerbatim(parent,g_context,g_token->verb,DocVerbatim::LatexOnly,g_isExample,g_exampleName));
- if (tok==0) warn_doc_error(g_fileName,doctokenizerYYlineno,"latexonly section ended without end marker",doctokenizerYYlineno);
+ if (tok==0) warn_doc_error(g_fileName,doctokenizerYYlineno,"latexonly section ended without end marker");
doctokenizerYYsetStatePara();
}
break;
@@ -1473,7 +1476,7 @@ reparsetoken:
doctokenizerYYsetStateXmlOnly();
tok = doctokenizerYYlex();
children.append(new DocVerbatim(parent,g_context,g_token->verb,DocVerbatim::XmlOnly,g_isExample,g_exampleName));
- if (tok==0) warn_doc_error(g_fileName,doctokenizerYYlineno,"xmlonly section ended without end marker",doctokenizerYYlineno);
+ if (tok==0) warn_doc_error(g_fileName,doctokenizerYYlineno,"xmlonly section ended without end marker");
doctokenizerYYsetStatePara();
}
break;
@@ -1482,7 +1485,7 @@ reparsetoken:
doctokenizerYYsetStateDbOnly();
tok = doctokenizerYYlex();
children.append(new DocVerbatim(parent,g_context,g_token->verb,DocVerbatim::DocbookOnly,g_isExample,g_exampleName));
- if (tok==0) warn_doc_error(g_fileName,doctokenizerYYlineno,"docbookonly section ended without end marker",doctokenizerYYlineno);
+ if (tok==0) warn_doc_error(g_fileName,doctokenizerYYlineno,"docbookonly section ended without end marker");
doctokenizerYYsetStatePara();
}
break;
@@ -1670,7 +1673,7 @@ reparsetoken:
}
}
break;
- case TK_SYMBOL:
+ case TK_SYMBOL:
{
DocSymbol::SymType s = DocSymbol::decodeSymbol(tokenName);
if (s!=DocSymbol::Sym_Unknown)
@@ -1683,15 +1686,15 @@ reparsetoken:
}
}
break;
- case TK_WHITESPACE:
- case TK_NEWPARA:
+ case TK_WHITESPACE:
+ case TK_NEWPARA:
handlepara:
if (insidePRE(parent) || !children.isEmpty())
{
children.append(new DocWhiteSpace(parent,g_token->chars));
}
break;
- case TK_LNKWORD:
+ case TK_LNKWORD:
if (handleWord)
{
handleLinkedWord(parent,children);
@@ -1699,7 +1702,7 @@ handlepara:
else
return FALSE;
break;
- case TK_WORD:
+ case TK_WORD:
if (handleWord)
{
children.append(new DocWord(parent,g_token->name));
@@ -1806,7 +1809,7 @@ static int internalValidatingParseDoc(DocNode *parent,QList<DocNode> &children,
DocPara *par = new DocPara(parent);
if (isFirst) { par->markFirst(); isFirst=FALSE; }
retval=par->parse();
- if (!par->isEmpty())
+ if (!par->isEmpty())
{
children.append(par);
if (lastPar) lastPar->markLast(FALSE);
@@ -1849,7 +1852,7 @@ static void readTextFileByName(const QCString &file,QCString &text)
text = fileToString(absFileName,Config_getBool(FILTER_SOURCE_FILES));
return;
}
- s=examplePathList.next();
+ s=examplePathList.next();
}
// as a fallback we also look in the exampleNameDict
@@ -1875,10 +1878,10 @@ static void readTextFileByName(const QCString &file,QCString &text)
//---------------------------------------------------------------------------
-DocWord::DocWord(DocNode *parent,const QCString &word) :
- m_word(word)
+DocWord::DocWord(DocNode *parent,const QCString &word) :
+ m_word(word)
{
- m_parent = parent;
+ m_parent = parent;
//printf("new word %s url=%s\n",word.data(),g_searchUrl.data());
if (Doxygen::searchIndex && !g_searchUrl.isEmpty())
{
@@ -1890,12 +1893,12 @@ DocWord::DocWord(DocNode *parent,const QCString &word) :
DocLinkedWord::DocLinkedWord(DocNode *parent,const QCString &word,
const QCString &ref,const QCString &file,
- const QCString &anchor,const QCString &tooltip) :
- m_word(word), m_ref(ref),
+ const QCString &anchor,const QCString &tooltip) :
+ m_word(word), m_ref(ref),
m_file(file), m_relPath(g_relPath), m_anchor(anchor),
m_tooltip(tooltip)
{
- m_parent = parent;
+ m_parent = parent;
//printf("DocLinkedWord: new word %s url=%s tooltip='%s'\n",
// word.data(),g_searchUrl.data(),tooltip.data());
if (Doxygen::searchIndex && !g_searchUrl.isEmpty())
@@ -1908,7 +1911,7 @@ DocLinkedWord::DocLinkedWord(DocNode *parent,const QCString &word,
DocAnchor::DocAnchor(DocNode *parent,const QCString &id,bool newAnchor)
{
- m_parent = parent;
+ m_parent = parent;
if (id.isEmpty())
{
warn_doc_error(g_fileName,doctokenizerYYlineno,"Empty anchor label");
@@ -1925,7 +1928,7 @@ DocAnchor::DocAnchor(DocNode *parent,const QCString &id,bool newAnchor)
m_file = convertNameToFile(ct.fileName(),FALSE,TRUE);
m_anchor = id;
}
- else
+ else
{
warn_doc_error(g_fileName,doctokenizerYYlineno,"Invalid cite anchor id '%s'",qPrint(id));
m_anchor = "invalid";
@@ -1990,7 +1993,7 @@ void DocInclude::parse()
g_includeFileShowLineNo = (m_type == DontIncWithLines || m_type == IncWithLines);
//printf("g_includeFile=<<%s>>\n",g_includeFileText.data());
break;
- case VerbInclude:
+ case VerbInclude:
// fall through
case HtmlInclude:
case LatexInclude:
@@ -2012,8 +2015,8 @@ void DocInclude::parse()
m_blockId.data(),m_file.data(),count);
}
break;
- case DocInclude::SnippetDoc:
- case DocInclude::IncludeDoc:
+ case DocInclude::SnippetDoc:
+ case DocInclude::IncludeDoc:
err("Internal inconsistency: found switch SnippetDoc / IncludeDoc in file: %s"
"Please create a bug report\n",__FILE__);
break;
@@ -2045,7 +2048,7 @@ void DocIncOperator::parse()
while (o<l)
{
char c = p[o];
- if (c=='\n')
+ if (c=='\n')
{
g_includeFileLine++;
if (nonEmpty) break; // we have a pattern to match
@@ -2162,10 +2165,10 @@ void DocIncOperator::parse()
//---------------------------------------------------------------------------
-DocXRefItem::DocXRefItem(DocNode *parent,int id,const char *key) :
+DocXRefItem::DocXRefItem(DocNode *parent,int id,const char *key) :
m_id(id), m_key(key), m_relPath(g_relPath)
{
- m_parent = parent;
+ m_parent = parent;
}
bool DocXRefItem::parse()
@@ -2370,10 +2373,10 @@ endsecreflist:
//---------------------------------------------------------------------------
-DocInternalRef::DocInternalRef(DocNode *parent,const QCString &ref)
+DocInternalRef::DocInternalRef(DocNode *parent,const QCString &ref)
: m_relPath(g_relPath)
{
- m_parent = parent;
+ m_parent = parent;
int i=ref.find('#');
if (i!=-1)
{
@@ -2408,10 +2411,10 @@ void DocInternalRef::parse()
//---------------------------------------------------------------------------
-DocRef::DocRef(DocNode *parent,const QCString &target,const QCString &context) :
+DocRef::DocRef(DocNode *parent,const QCString &target,const QCString &context) :
m_refType(Unknown), m_isSubPage(FALSE)
{
- m_parent = parent;
+ m_parent = parent;
const Definition *compound = 0;
QCString anchor;
//printf("DocRef::DocRef(target=%s,context=%s)\n",target.data(),context.data());
@@ -2455,9 +2458,9 @@ DocRef::DocRef(DocNode *parent,const QCString &target,const QCString &context) :
}
else if (resolveLink(context,target,TRUE,&compound,anchor))
{
- bool isFile = compound ?
+ bool isFile = compound ?
(compound->definitionType()==Definition::TypeFile ||
- compound->definitionType()==Definition::TypePage ? TRUE : FALSE) :
+ compound->definitionType()==Definition::TypePage ? TRUE : FALSE) :
FALSE;
m_text = linkToText(compound?compound->getLanguage():SrcLangExt_Unknown,target,isFile);
m_anchor = anchor;
@@ -2496,7 +2499,7 @@ DocRef::DocRef(DocNode *parent,const QCString &target,const QCString &context) :
}
m_text = target;
warn_doc_error(g_fileName,doctokenizerYYlineno,"unable to resolve reference to '%s' for \\ref command",
- qPrint(target));
+ qPrint(target));
}
static void flattenParagraphs(DocNode *root,QList<DocNode> &children)
@@ -2560,7 +2563,7 @@ void DocRef::parse()
}
handlePendingStyleCommands(this,m_children);
-
+
DocNode *n=g_nodeStack.pop();
ASSERT(n==this);
}
@@ -2606,7 +2609,7 @@ DocCite::DocCite(DocNode *parent,const QCString &target,const QCString &) //cont
//---------------------------------------------------------------------------
-DocLink::DocLink(DocNode *parent,const QCString &target)
+DocLink::DocLink(DocNode *parent,const QCString &target)
{
m_parent = parent;
const Definition *compound = 0;
@@ -2638,7 +2641,7 @@ DocLink::DocLink(DocNode *parent,const QCString &target)
// bogus link target
warn_doc_error(g_fileName,doctokenizerYYlineno,"unable to resolve link to '%s' for \\link command",
- qPrint(target));
+ qPrint(target));
}
@@ -2674,7 +2677,7 @@ QCString DocLink::parse(bool isJavaLink,bool isXmlLink)
break;
}
break;
- case TK_SYMBOL:
+ case TK_SYMBOL:
warn_doc_error(g_fileName,doctokenizerYYlineno,"Unsupported symbol %s found as part of a \\link",
qPrint(g_token->name));
break;
@@ -2685,8 +2688,8 @@ QCString DocLink::parse(bool isJavaLink,bool isXmlLink)
qPrint(g_token->name));
}
goto endlink;
- case TK_LNKWORD:
- case TK_WORD:
+ case TK_LNKWORD:
+ case TK_WORD:
if (isJavaLink) // special case to detect closing }
{
QCString w = g_token->name;
@@ -2718,7 +2721,7 @@ QCString DocLink::parse(bool isJavaLink,bool isXmlLink)
if (tok==0)
{
warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected end of comment while inside"
- " link command\n");
+ " link command\n");
}
endlink:
@@ -2737,10 +2740,10 @@ endlink:
//---------------------------------------------------------------------------
-DocDotFile::DocDotFile(DocNode *parent,const QCString &name,const QCString &context) :
+DocDotFile::DocDotFile(DocNode *parent,const QCString &name,const QCString &context) :
m_name(name), m_relPath(g_relPath), m_context(context)
{
- m_parent = parent;
+ m_parent = parent;
}
bool DocDotFile::parse()
@@ -2774,10 +2777,10 @@ bool DocDotFile::parse()
return ok;
}
-DocMscFile::DocMscFile(DocNode *parent,const QCString &name,const QCString &context) :
+DocMscFile::DocMscFile(DocNode *parent,const QCString &name,const QCString &context) :
m_name(name), m_relPath(g_relPath), m_context(context)
{
- m_parent = parent;
+ m_parent = parent;
}
bool DocMscFile::parse()
@@ -2932,7 +2935,7 @@ int DocHtmlHeader::parse()
if (m_level!=1)
{
warn_doc_error(g_fileName,doctokenizerYYlineno,"<h%d> ended with </h1>",
- m_level);
+ m_level);
}
goto endheader;
}
@@ -2941,7 +2944,7 @@ int DocHtmlHeader::parse()
if (m_level!=2)
{
warn_doc_error(g_fileName,doctokenizerYYlineno,"<h%d> ended with </h2>",
- m_level);
+ m_level);
}
goto endheader;
}
@@ -2950,7 +2953,7 @@ int DocHtmlHeader::parse()
if (m_level!=3)
{
warn_doc_error(g_fileName,doctokenizerYYlineno,"<h%d> ended with </h3>",
- m_level);
+ m_level);
}
goto endheader;
}
@@ -2959,7 +2962,7 @@ int DocHtmlHeader::parse()
if (m_level!=4)
{
warn_doc_error(g_fileName,doctokenizerYYlineno,"<h%d> ended with </h4>",
- m_level);
+ m_level);
}
goto endheader;
}
@@ -2968,7 +2971,7 @@ int DocHtmlHeader::parse()
if (m_level!=5)
{
warn_doc_error(g_fileName,doctokenizerYYlineno,"<h%d> ended with </h5>",
- m_level);
+ m_level);
}
goto endheader;
}
@@ -2977,7 +2980,7 @@ int DocHtmlHeader::parse()
if (m_level!=6)
{
warn_doc_error(g_fileName,doctokenizerYYlineno,"<h%d> ended with </h6>",
- m_level);
+ m_level);
}
goto endheader;
}
@@ -3010,7 +3013,7 @@ int DocHtmlHeader::parse()
if (tok==0)
{
warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected end of comment while inside"
- " <h%d> tag\n",m_level);
+ " <h%d> tag\n",m_level);
}
endheader:
handlePendingStyleCommands(this,m_children);
@@ -3045,7 +3048,7 @@ int DocHRef::parse()
else
{
warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected html tag <%s%s> found within <a href=...> context",
- g_token->endTag?"/":"",qPrint(g_token->name),doctokenizerYYlineno);
+ g_token->endTag?"/":"",qPrint(g_token->name));
}
}
break;
@@ -3058,7 +3061,7 @@ int DocHRef::parse()
if (tok==0)
{
warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected end of comment while inside"
- " <a href=...> tag",doctokenizerYYlineno);
+ " <a href=...> tag");
}
endhref:
handlePendingStyleCommands(this,m_children);
@@ -3084,7 +3087,7 @@ int DocInternal::parse(int level)
DocPara *par = new DocPara(this);
if (isFirst) { par->markFirst(); isFirst=FALSE; }
retval=par->parse();
- if (!par->isEmpty())
+ if (!par->isEmpty())
{
m_children.append(par);
lastPar=par;
@@ -3095,9 +3098,9 @@ int DocInternal::parse(int level)
}
if (retval==TK_LISTITEM)
{
- warn_doc_error(g_fileName,doctokenizerYYlineno,"Invalid list item found",doctokenizerYYlineno);
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Invalid list item found");
}
- } while (retval!=0 &&
+ } while (retval!=0 &&
retval!=RetVal_Section &&
retval!=RetVal_Subsection &&
retval!=RetVal_Subsubsection &&
@@ -3107,7 +3110,7 @@ int DocInternal::parse(int level)
if (lastPar) lastPar->markLast();
// then parse any number of level-n sections
- while ((level==1 && retval==RetVal_Section) ||
+ while ((level==1 && retval==RetVal_Section) ||
(level==2 && retval==RetVal_Subsection) ||
(level==3 && retval==RetVal_Subsubsection) ||
(level==4 && retval==RetVal_Paragraph)
@@ -3152,8 +3155,8 @@ int DocIndexEntry::parse()
case TK_WHITESPACE:
m_entry+=" ";
break;
- case TK_WORD:
- case TK_LNKWORD:
+ case TK_WORD:
+ case TK_LNKWORD:
m_entry+=g_token->name;
break;
case TK_SYMBOL:
@@ -3293,7 +3296,7 @@ int DocHtmlCaption::parse()
if (tok==0)
{
warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected end of comment while inside"
- " <caption> tag",doctokenizerYYlineno);
+ " <caption> tag");
}
endcaption:
handlePendingStyleCommands(this,m_children);
@@ -3384,7 +3387,7 @@ uint DocHtmlCell::rowSpan() const
uint retval = 0;
HtmlAttribList attrs = attribs();
uint i;
- for (i=0; i<attrs.count(); ++i)
+ for (i=0; i<attrs.count(); ++i)
{
if (attrs.at(i)->name.lower()=="rowspan")
{
@@ -3400,7 +3403,7 @@ uint DocHtmlCell::colSpan() const
uint retval = 1;
HtmlAttribList attrs = attribs();
uint i;
- for (i=0; i<attrs.count(); ++i)
+ for (i=0; i<attrs.count(); ++i)
{
if (attrs.at(i)->name.lower()=="colspan")
{
@@ -3587,7 +3590,7 @@ int DocHtmlTable::parse()
int retval=RetVal_OK;
g_nodeStack.push(this);
DBG(("DocHtmlTable::parse() start\n"));
-
+
getrow:
// get next token
int tok=doctokenizerYYlex();
@@ -3635,14 +3638,14 @@ getrow:
warn_doc_error(g_fileName,doctokenizerYYlineno,"expected <tr> tag but found %s token instead!",
tokToString(tok));
}
-
+
// parse one or more rows
while (retval==RetVal_TableRow)
{
DocHtmlRow *tr=new DocHtmlRow(this,g_token->attribs);
m_children.append(tr);
retval=tr->parse();
- }
+ }
computeTableGrid();
@@ -3657,7 +3660,7 @@ int DocHtmlTable::parseXml()
int retval=RetVal_OK;
g_nodeStack.push(this);
DBG(("DocHtmlTable::parseXml() start\n"));
-
+
// get next token
int tok=doctokenizerYYlex();
// skip whitespace
@@ -3686,7 +3689,7 @@ int DocHtmlTable::parseXml()
m_children.append(tr);
retval=tr->parseXml(isHeader);
isHeader=FALSE;
- }
+ }
computeTableGrid();
@@ -3702,7 +3705,7 @@ struct ActiveRowSpan
{
ActiveRowSpan(uint rows,uint col) : rowsLeft(rows), column(col) {}
uint rowsLeft;
- uint column;
+ uint column;
};
/** List of ActiveRowSpan classes. */
@@ -3741,8 +3744,8 @@ void DocHtmlTable::computeTableGrid()
for (i=0;i<rowSpans.count();i++)
{
- if (rowSpans.at(i)->rowsLeft>0 &&
- rowSpans.at(i)->column==colIdx)
+ if (rowSpans.at(i)->rowsLeft>0 &&
+ rowSpans.at(i)->column==colIdx)
{
colIdx=rowSpans.at(i)->column+1;
cells++;
@@ -3752,7 +3755,7 @@ void DocHtmlTable::computeTableGrid()
//printf("found cell at (%d,%d)\n",rowIdx,colIdx);
cell->setRowIndex(rowIdx);
cell->setColumnIndex(colIdx);
- colIdx+=cs;
+ colIdx+=cs;
cells++;
}
}
@@ -3769,9 +3772,9 @@ void DocHtmlTable::computeTableGrid()
m_numCols = maxCols;
}
-void DocHtmlTable::accept(DocVisitor *v)
-{
- v->visitPre(this);
+void DocHtmlTable::accept(DocVisitor *v)
+{
+ v->visitPre(this);
// for HTML output we put the caption first
//if (m_caption && v->id()==DocVisitor_Html) m_caption->accept(v);
// doxygen 1.8.11: always put the caption first
@@ -3781,7 +3784,7 @@ void DocHtmlTable::accept(DocVisitor *v)
for (cli.toFirst();(n=cli.current());++cli) n->accept(v);
// for other output formats we put the caption last
//if (m_caption && v->id()!=DocVisitor_Html) m_caption->accept(v);
- v->visitPost(this);
+ v->visitPost(this);
}
//---------------------------------------------------------------------------
@@ -3877,7 +3880,7 @@ int DocHtmlDescTitle::parse()
}
}
break;
- case TK_SYMBOL:
+ case TK_SYMBOL:
warn_doc_error(g_fileName,doctokenizerYYlineno,"Unsupported symbol \\%s found as part of a <dt> tag",
qPrint(g_token->name));
break;
@@ -3928,7 +3931,7 @@ int DocHtmlDescTitle::parse()
if (tok==0)
{
warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected end of comment while inside"
- " <dt> tag");
+ " <dt> tag");
}
endtitle:
handlePendingStyleCommands(this,m_children);
@@ -3958,7 +3961,7 @@ int DocHtmlDescData::parse()
}
while (retval==TK_NEWPARA);
if (par) par->markLast();
-
+
DBG(("DocHtmlDescData::parse() end\n"));
DocNode *n=g_nodeStack.pop();
ASSERT(n==this);
@@ -4163,7 +4166,7 @@ int DocHtmlList::parse()
m_children.append(li);
retval=li->parse();
} while (retval==RetVal_ListItem);
-
+
if (retval==0)
{
warn_doc_error(g_fileName,doctokenizerYYlineno,"unexpected end of comment while inside <%cl> block",
@@ -4226,7 +4229,7 @@ int DocHtmlList::parseXml()
if (retval==0) break;
//printf("retval=%x g_token->name=%s\n",retval,qPrint(g_token->name));
} while (retval==RetVal_ListItem);
-
+
if (retval==0)
{
warn_doc_error(g_fileName,doctokenizerYYlineno,"unexpected end of comment while inside <list type=\"%s\"> block",
@@ -4237,8 +4240,8 @@ endlist:
DBG(("DocHtmlList::parseXml() end retval=%x\n",retval));
DocNode *n=g_nodeStack.pop();
ASSERT(n==this);
- return retval==RetVal_EndList ||
- (retval==RetVal_CloseXml || g_token->name=="list") ?
+ return retval==RetVal_EndList ||
+ (retval==RetVal_CloseXml || g_token->name=="list") ?
RetVal_OK : retval;
}
@@ -4250,7 +4253,7 @@ int DocHtmlBlockQuote::parse()
int retval=0;
g_nodeStack.push(this);
- // parse one or more paragraphs
+ // parse one or more paragraphs
bool isFirst=TRUE;
DocPara *par=0;
do
@@ -4277,7 +4280,7 @@ int DocParBlock::parse()
int retval=0;
g_nodeStack.push(this);
- // parse one or more paragraphs
+ // parse one or more paragraphs
bool isFirst=TRUE;
DocPara *par=0;
do
@@ -4328,17 +4331,17 @@ int DocSimpleList::parse()
//--------------------------------------------------------------------------
-DocAutoListItem::DocAutoListItem(DocNode *parent,int indent,int num)
+DocAutoListItem::DocAutoListItem(DocNode *parent,int indent,int num)
: m_indent(indent), m_itemNum(num)
-{
- m_parent = parent;
+{
+ m_parent = parent;
}
int DocAutoListItem::parse()
{
int retval = RetVal_OK;
g_nodeStack.push(this);
-
+
// first parse any number of paragraphs
bool isFirst=TRUE;
DocPara *lastPar=0;
@@ -4347,7 +4350,7 @@ int DocAutoListItem::parse()
DocPara *par = new DocPara(this);
if (isFirst) { par->markFirst(); isFirst=FALSE; }
retval=par->parse();
- if (!par->isEmpty())
+ if (!par->isEmpty())
{
m_children.append(par);
if (lastPar) lastPar->markLast(FALSE);
@@ -4371,11 +4374,11 @@ int DocAutoListItem::parse()
//--------------------------------------------------------------------------
DocAutoList::DocAutoList(DocNode *parent,int indent,bool isEnumList,
- int depth) :
+ int depth) :
m_indent(indent), m_isEnumList(isEnumList),
m_depth(depth)
-{
- m_parent = parent;
+{
+ m_parent = parent;
}
int DocAutoList::parse()
@@ -4395,11 +4398,11 @@ int DocAutoList::parse()
m_children.append(li);
retval=li->parse();
//printf("DocAutoList::parse(): retval=0x%x g_token->indent=%d m_indent=%d "
- // "m_isEnumList=%d g_token->isEnumList=%d g_token->name=%s\n",
+ // "m_isEnumList=%d g_token->isEnumList=%d g_token->name=%s\n",
// retval,g_token->indent,m_indent,m_isEnumList,g_token->isEnumList,
// g_token->name.data());
//printf("num=%d g_token->id=%d\n",num,g_token->id);
- }
+ }
while (retval==TK_LISTITEM && // new list item
m_indent==g_token->indent && // at same indent level
m_isEnumList==g_token->isEnumList && // of the same kind
@@ -4441,16 +4444,16 @@ void DocTitle::parseFromString(const QCString &text)
//--------------------------------------------------------------------------
-DocSimpleSect::DocSimpleSect(DocNode *parent,Type t) :
+DocSimpleSect::DocSimpleSect(DocNode *parent,Type t) :
m_type(t)
-{
- m_parent = parent;
- m_title=0;
+{
+ m_parent = parent;
+ m_title=0;
}
DocSimpleSect::~DocSimpleSect()
-{
- delete m_title;
+{
+ delete m_title;
}
void DocSimpleSect::accept(DocVisitor *v)
@@ -4474,10 +4477,10 @@ int DocSimpleSect::parse(bool userTitle,bool needsSeparator)
m_title = new DocTitle(this);
m_title->parse();
}
-
+
// add new paragraph as child
DocPara *par = new DocPara(this);
- if (m_children.isEmpty())
+ if (m_children.isEmpty())
{
par->markFirst();
}
@@ -4489,7 +4492,7 @@ int DocSimpleSect::parse(bool userTitle,bool needsSeparator)
par->markLast();
if (needsSeparator) m_children.append(new DocSimpleSectSep(this));
m_children.append(par);
-
+
// parse the contents of the paragraph
int retval = par->parse();
@@ -4515,7 +4518,7 @@ int DocSimpleSect::parseRcs()
DBG(("DocSimpleSect::parseRcs()\n"));
DocNode *n=g_nodeStack.pop();
ASSERT(n==this);
- return RetVal_OK;
+ return RetVal_OK;
}
int DocSimpleSect::parseXml()
@@ -4524,11 +4527,11 @@ int DocSimpleSect::parseXml()
g_nodeStack.push(this);
int retval = RetVal_OK;
- for (;;)
+ for (;;)
{
// add new paragraph as child
DocPara *par = new DocPara(this);
- if (m_children.isEmpty())
+ if (m_children.isEmpty())
{
par->markFirst();
}
@@ -4543,17 +4546,17 @@ int DocSimpleSect::parseXml()
// parse the contents of the paragraph
retval = par->parse();
if (retval == 0) break;
- if (retval == RetVal_CloseXml)
+ if (retval == RetVal_CloseXml)
{
retval = RetVal_OK;
break;
}
}
-
+
DBG(("DocSimpleSect::parseXml() end retval=%d\n",retval));
DocNode *n=g_nodeStack.pop();
ASSERT(n==this);
- return retval;
+ return retval;
}
void DocSimpleSect::appendLinkWord(const QCString &word)
@@ -4567,12 +4570,12 @@ void DocSimpleSect::appendLinkWord(const QCString &word)
else
{
p = (DocPara *)m_children.getLast();
-
+
// Comma-separate <seealso> links.
p->injectToken(TK_WORD,",");
p->injectToken(TK_WHITESPACE," ");
}
-
+
g_inSeeBlock=TRUE;
p->injectToken(TK_LNKWORD,word);
g_inSeeBlock=FALSE;
@@ -4698,7 +4701,7 @@ int DocParamList::parseXml(const QCString &paramName)
g_hasReturnCommand=TRUE;
checkRetvalName(g_token->name);
}
-
+
handleLinkedWord(this,m_params);
do
@@ -4727,11 +4730,11 @@ int DocParamList::parseXml(const QCString &paramName)
if (retval == 0) break;
- } while (retval==RetVal_CloseXml &&
+ } while (retval==RetVal_CloseXml &&
Mappers::htmlTagMapper->map(g_token->name)!=XML_PARAM &&
Mappers::htmlTagMapper->map(g_token->name)!=XML_TYPEPARAM &&
Mappers::htmlTagMapper->map(g_token->name)!=XML_EXCEPTION);
-
+
if (retval==0) /* premature end of comment block */
{
@@ -4787,7 +4790,7 @@ int DocParamSect::parse(const QCString &cmdName,bool xmlContext, Direction d)
{
retval = RetVal_OK;
}
-
+
DBG(("DocParamSect::parse() end retval=%d\n",retval));
DocNode *n=g_nodeStack.pop();
ASSERT(n==this);
@@ -4922,7 +4925,7 @@ int DocPara::handleXRefItem()
{
m_children.append(ref);
}
- else
+ else
{
delete ref;
}
@@ -5316,7 +5319,7 @@ int DocPara::handleHtmlHeader(const HtmlAttribList &tagHtmlAttribs,int level)
// For XML tags whose content is stored in attributes rather than
// contained within the element, we need a way to inject the attribute
// text into the current paragraph.
-bool DocPara::injectToken(int tok,const QCString &tokText)
+bool DocPara::injectToken(int tok,const QCString &tokText)
{
g_token->name = tokText;
return defaultHandleToken(this,tok,m_children);
@@ -5389,19 +5392,19 @@ int DocPara::handleCommand(const QCString &cmdName, const int tok)
break;
case CMD_EMPHASIS:
m_children.append(new DocStyleChange(this,g_nodeStack.count(),DocStyleChange::Italic,cmdName,TRUE));
- retval=handleStyleArgument(this,m_children,cmdName);
+ retval=handleStyleArgument(this,m_children,cmdName);
m_children.append(new DocStyleChange(this,g_nodeStack.count(),DocStyleChange::Italic,cmdName,FALSE));
if (retval!=TK_WORD) m_children.append(new DocWhiteSpace(this," "));
break;
case CMD_BOLD:
m_children.append(new DocStyleChange(this,g_nodeStack.count(),DocStyleChange::Bold,cmdName,TRUE));
- retval=handleStyleArgument(this,m_children,cmdName);
+ retval=handleStyleArgument(this,m_children,cmdName);
m_children.append(new DocStyleChange(this,g_nodeStack.count(),DocStyleChange::Bold,cmdName,FALSE));
if (retval!=TK_WORD) m_children.append(new DocWhiteSpace(this," "));
break;
case CMD_CODE:
m_children.append(new DocStyleChange(this,g_nodeStack.count(),DocStyleChange::Code,cmdName,TRUE));
- retval=handleStyleArgument(this,m_children,cmdName);
+ retval=handleStyleArgument(this,m_children,cmdName);
m_children.append(new DocStyleChange(this,g_nodeStack.count(),DocStyleChange::Code,cmdName,FALSE));
if (retval!=TK_WORD) m_children.append(new DocWhiteSpace(this," "));
break;
@@ -5597,7 +5600,7 @@ int DocPara::handleCommand(const QCString &cmdName, const int tok)
doctokenizerYYsetStateDbOnly();
retval = doctokenizerYYlex();
m_children.append(new DocVerbatim(this,g_context,g_token->verb,DocVerbatim::DocbookOnly,g_isExample,g_exampleName));
- if (retval==0) warn_doc_error(g_fileName,doctokenizerYYlineno,"docbookonly section ended without end marker",doctokenizerYYlineno);
+ if (retval==0) warn_doc_error(g_fileName,doctokenizerYYlineno,"docbookonly section ended without end marker");
doctokenizerYYsetStatePara();
}
break;
@@ -5687,7 +5690,7 @@ int DocPara::handleCommand(const QCString &cmdName, const int tok)
case CMD_ENDMSC:
case CMD_ENDUML:
warn_doc_error(g_fileName,doctokenizerYYlineno,"unexpected command %s",qPrint(g_token->name));
- break;
+ break;
case CMD_PARAM:
retval = handleParamSection(cmdName,DocParamSect::Param,FALSE,g_token->paramDir);
break;
@@ -5873,26 +5876,26 @@ int DocPara::handleCommand(const QCString &cmdName, const int tok)
ASSERT(0);
break;
}
- INTERNAL_ASSERT(retval==0 || retval==RetVal_OK || retval==RetVal_SimpleSec ||
+ INTERNAL_ASSERT(retval==0 || retval==RetVal_OK || retval==RetVal_SimpleSec ||
retval==TK_LISTITEM || retval==TK_ENDLIST || retval==TK_NEWPARA ||
- retval==RetVal_Section || retval==RetVal_EndList ||
- retval==RetVal_Internal || retval==RetVal_SwitchLang ||
+ retval==RetVal_Section || retval==RetVal_EndList ||
+ retval==RetVal_Internal || retval==RetVal_SwitchLang ||
retval==RetVal_EndInternal
);
DBG(("handleCommand(%s) end retval=%x\n",qPrint(cmdName),retval));
return retval;
}
-static bool findAttribute(const HtmlAttribList &tagHtmlAttribs,
- const char *attrName,
- QCString *result)
+static bool findAttribute(const HtmlAttribList &tagHtmlAttribs,
+ const char *attrName,
+ QCString *result)
{
HtmlAttribListIterator li(tagHtmlAttribs);
HtmlAttrib *opt;
for (li.toFirst();(opt=li.current());++li)
{
- if (opt->name==attrName)
+ if (opt->name==attrName)
{
*result = opt->value;
return TRUE;
@@ -5906,7 +5909,7 @@ int DocPara::handleHtmlStartTag(const QCString &tagName,const HtmlAttribList &ta
DBG(("handleHtmlStartTag(%s,%d)\n",qPrint(tagName),tagHtmlAttribs.count()));
int retval=RetVal_OK;
int tagId = Mappers::htmlTagMapper->map(tagName);
- if (g_token->emptyTag && !(tagId&XML_CmdMask) &&
+ if (g_token->emptyTag && !(tagId&XML_CmdMask) &&
tagId!=HTML_UNKNOWN && tagId!=HTML_IMG && tagId!=HTML_BR && tagId!=HTML_HR && tagId!=HTML_P)
{
warn_doc_error(g_fileName,doctokenizerYYlineno,"HTML tag ('<%s/>') may not use the 'empty tag' XHTML syntax.",
@@ -5914,7 +5917,7 @@ int DocPara::handleHtmlStartTag(const QCString &tagName,const HtmlAttribList &ta
}
switch (tagId)
{
- case HTML_UL:
+ case HTML_UL:
if (!g_token->emptyTag)
{
DocHtmlList *list = new DocHtmlList(this,tagHtmlAttribs,DocHtmlList::Unordered);
@@ -5922,7 +5925,7 @@ int DocPara::handleHtmlStartTag(const QCString &tagName,const HtmlAttribList &ta
retval=list->parse();
}
break;
- case HTML_OL:
+ case HTML_OL:
if (!g_token->emptyTag)
{
DocHtmlList *list = new DocHtmlList(this,tagHtmlAttribs,DocHtmlList::Ordered);
@@ -5961,8 +5964,8 @@ int DocPara::handleHtmlStartTag(const QCString &tagName,const HtmlAttribList &ta
break;
case HTML_CODE:
if (g_token->emptyTag) break;
- if (/*getLanguageFromFileName(g_fileName)==SrcLangExt_CSharp ||*/ g_xmlComment)
- // for C# source or inside a <summary> or <remark> section we
+ if (/*getLanguageFromFileName(g_fileName)==SrcLangExt_CSharp ||*/ g_xmlComment)
+ // for C# source or inside a <summary> or <remark> section we
// treat <code> as an XML tag (so similar to @code)
{
doctokenizerYYsetStateXmlCode();
@@ -6140,7 +6143,7 @@ int DocPara::handleHtmlStartTag(const QCString &tagName,const HtmlAttribList &ta
{
//printf("paramName=%s\n",paramName.data());
m_children.append(new DocStyleChange(this,g_nodeStack.count(),DocStyleChange::Italic,tagName,TRUE));
- m_children.append(new DocWord(this,paramName));
+ m_children.append(new DocWord(this,paramName));
m_children.append(new DocStyleChange(this,g_nodeStack.count(),DocStyleChange::Italic,tagName,FALSE));
if (retval!=TK_WORD) m_children.append(new DocWhiteSpace(this," "));
}
@@ -6195,7 +6198,7 @@ int DocPara::handleHtmlStartTag(const QCString &tagName,const HtmlAttribList &ta
case XML_SEE:
// I'm not sure if <see> is the same as <seealso> or if it
// should you link a member without producing a section. The
- // C# specification is extremely vague about this (but what else
+ // C# specification is extremely vague about this (but what else
// can we expect from Microsoft...)
{
QCString cref;
@@ -6327,7 +6330,7 @@ int DocPara::handleHtmlEndTag(const QCString &tagName)
int retval=RetVal_OK;
switch (tagId)
{
- case HTML_UL:
+ case HTML_UL:
if (!insideUL(this))
{
warn_doc_error(g_fileName,doctokenizerYYlineno,"found </ul> tag without matching <ul>");
@@ -6337,7 +6340,7 @@ int DocPara::handleHtmlEndTag(const QCString &tagName)
retval=RetVal_EndList;
}
break;
- case HTML_OL:
+ case HTML_OL:
if (!insideOL(this))
{
warn_doc_error(g_fileName,doctokenizerYYlineno,"found </ol> tag without matching <ol>");
@@ -6555,8 +6558,8 @@ reparsetoken:
DocNode::Kind k;
if (insidePRE(this) || // all whitespace is relevant
(
- // remove leading whitespace
- !m_children.isEmpty() &&
+ // remove leading whitespace
+ !m_children.isEmpty() &&
// and whitespace after certain constructs
(k=m_children.getLast()->kind())!=DocNode::Kind_HtmlDescList &&
k!=DocNode::Kind_HtmlTable &&
@@ -6585,7 +6588,7 @@ reparsetoken:
{
DocAutoList *al = (DocAutoList *)n;
DBG(("previous list item at %d\n",al->indent()));
- if (al->indent()>=g_token->indent)
+ if (al->indent()>=g_token->indent)
// new item at the same or lower indent level
{
retval=TK_LISTITEM;
@@ -6596,9 +6599,9 @@ reparsetoken:
// determine list depth
int depth = 0;
n=parent();
- while(n)
+ while(n)
{
- if (n->kind() == DocNode::Kind_AutoList &&
+ if (n->kind() == DocNode::Kind_AutoList &&
((DocAutoList*)n)->isEnumList()) depth++;
n=n->parent();
}
@@ -6651,7 +6654,7 @@ reparsetoken:
}
}
break;
- case TK_ENDLIST:
+ case TK_ENDLIST:
DBG(("Found end of list inside of paragraph at line %d\n",doctokenizerYYlineno));
if (parent()->kind()==DocNode::Kind_AutoListItem)
{
@@ -6682,10 +6685,10 @@ reparsetoken:
// see if we have to start a simple section
int cmd = Mappers::cmdMapper->map(g_token->name);
DocNode *n=parent();
- while (n &&
- n->kind()!=DocNode::Kind_SimpleSect &&
+ while (n &&
+ n->kind()!=DocNode::Kind_SimpleSect &&
n->kind()!=DocNode::Kind_ParamSect
- )
+ )
{
n=n->parent();
}
@@ -6736,25 +6739,25 @@ reparsetoken:
DBG(("reparsing command %s\n",qPrint(g_token->name)));
goto reparsetoken;
}
- else if (retval==RetVal_OK)
+ else if (retval==RetVal_OK)
{
// the command ended normally, keep scanning for new tokens.
retval = 0;
}
else if (retval>0 && retval<RetVal_OK)
- {
+ {
// the command ended with a new command, reparse this token
tok = retval;
goto reparsetoken;
}
- else // end of file, end of paragraph, start or end of section
+ else // end of file, end of paragraph, start or end of section
// or some auto list marker
{
goto endparagraph;
}
}
break;
- case TK_HTMLTAG:
+ case TK_HTMLTAG:
{
if (!g_token->endTag) // found a start tag
{
@@ -6764,7 +6767,7 @@ reparsetoken:
{
retval = handleHtmlEndTag(g_token->name);
}
- if (retval==RetVal_OK)
+ if (retval==RetVal_OK)
{
// the command ended normally, keep scanner for new tokens.
retval = 0;
@@ -6775,7 +6778,7 @@ reparsetoken:
}
}
break;
- case TK_SYMBOL:
+ case TK_SYMBOL:
{
DocSymbol::SymType s = DocSymbol::decodeSymbol(g_token->name);
if (s!=DocSymbol::Sym_Unknown)
@@ -6789,16 +6792,16 @@ reparsetoken:
}
break;
}
- case TK_NEWPARA:
+ case TK_NEWPARA:
retval=TK_NEWPARA;
goto endparagraph;
case TK_RCSTAG:
{
DocNode *n=parent();
- while (n &&
- n->kind()!=DocNode::Kind_SimpleSect &&
+ while (n &&
+ n->kind()!=DocNode::Kind_SimpleSect &&
n->kind()!=DocNode::Kind_ParamSect
- )
+ )
{
n=n->parent();
}
@@ -6835,11 +6838,11 @@ endparagraph:
{
((DocPara *)n)->setAttribs(g_token->attribs);
}
- INTERNAL_ASSERT(retval==0 || retval==TK_NEWPARA || retval==TK_LISTITEM ||
- retval==TK_ENDLIST || retval>RetVal_OK
+ INTERNAL_ASSERT(retval==0 || retval==TK_NEWPARA || retval==TK_LISTITEM ||
+ retval==TK_ENDLIST || retval>RetVal_OK
);
- return retval;
+ return retval;
}
//--------------------------------------------------------------------------
@@ -6870,7 +6873,7 @@ int DocSection::parse()
DocPara *par = new DocPara(this);
if (isFirst) { par->markFirst(); isFirst=FALSE; }
retval=par->parse();
- if (!par->isEmpty())
+ if (!par->isEmpty())
{
m_children.append(par);
lastPar=par;
@@ -6893,7 +6896,7 @@ int DocSection::parse()
retval=RetVal_OK;
}
}
- } while (retval!=0 &&
+ } while (retval!=0 &&
retval!=RetVal_Section &&
retval!=RetVal_Subsection &&
retval!=RetVal_Subsubsection &&
@@ -6945,7 +6948,7 @@ int DocSection::parse()
m_children.append(s);
retval = s->parse();
}
- if (!(m_level<Doxygen::subpageNestingLevel+3 && (retval == RetVal_Subsection || retval == RetVal_Subsubsection))) break;
+ if (!(m_level<Doxygen::subpageNestingLevel+3 && (retval == RetVal_Subsection || retval == RetVal_Subsubsection))) break;
}
else
{
@@ -6953,11 +6956,11 @@ int DocSection::parse()
}
}
- INTERNAL_ASSERT(retval==0 ||
- retval==RetVal_Section ||
- retval==RetVal_Subsection ||
- retval==RetVal_Subsubsection ||
- retval==RetVal_Paragraph ||
+ INTERNAL_ASSERT(retval==0 ||
+ retval==RetVal_Section ||
+ retval==RetVal_Subsection ||
+ retval==RetVal_Subsubsection ||
+ retval==RetVal_Paragraph ||
retval==RetVal_Internal ||
retval==RetVal_EndInternal
);
@@ -6975,19 +6978,19 @@ void DocText::parse()
DBG(("DocText::parse() start\n"));
g_nodeStack.push(this);
doctokenizerYYsetStateText();
-
+
int tok;
while ((tok=doctokenizerYYlex())) // get the next token
{
switch(tok)
{
- case TK_WORD:
+ case TK_WORD:
m_children.append(new DocWord(this,g_token->name));
break;
- case TK_WHITESPACE:
+ case TK_WHITESPACE:
m_children.append(new DocWhiteSpace(this,g_token->chars));
break;
- case TK_SYMBOL:
+ case TK_SYMBOL:
{
DocSymbol::SymType s = DocSymbol::decodeSymbol(g_token->name);
if (s!=DocSymbol::Sym_Unknown)
@@ -7262,7 +7265,7 @@ static QCString extractCopyDocId(const char *data, uint &j, uint len)
case '\'': insideSQuote=TRUE; break;
case ' ': // fall through
case '\t': // fall through
- case '\n':
+ case '\n':
found=(round==0);
break;
}
@@ -7581,10 +7584,10 @@ DocRoot *validatingParseDoc(const char *fileName,int startLine,
docParserPushContext();
if (ctx && ctx!=Doxygen::globalScope &&
- (ctx->definitionType()==Definition::TypeClass ||
+ (ctx->definitionType()==Definition::TypeClass ||
ctx->definitionType()==Definition::TypeNamespace
- )
- )
+ )
+ )
{
g_context = ctx->name();
}
@@ -7622,7 +7625,7 @@ DocRoot *validatingParseDoc(const char *fileName,int startLine,
{
g_searchUrl=md->getOutputFileBase();
Doxygen::searchIndex->setCurrentDoc(
- (md->getLanguage()==SrcLangExt_Fortran ?
+ (md->getLanguage()==SrcLangExt_Fortran ?
theTranslator->trSubprogram(TRUE,TRUE):
theTranslator->trMember(TRUE,TRUE))+" "+md->qualifiedName(),
g_searchUrl,
@@ -7702,8 +7705,8 @@ DocRoot *validatingParseDoc(const char *fileName,int startLine,
}
g_fileName = fileName;
- g_relPath = (!linkFromIndex && ctx) ?
- QCString(relativePathToRoot(ctx->getOutputFileBase())) :
+ g_relPath = (!linkFromIndex && ctx) ?
+ QCString(relativePathToRoot(ctx->getOutputFileBase())) :
QCString("");
//printf("ctx->name=%s relPath=%s\n",ctx->name().data(),g_relPath.data());
g_memberDef = md;
@@ -7724,7 +7727,7 @@ DocRoot *validatingParseDoc(const char *fileName,int startLine,
g_retvalsFound.clear();
g_paramsFound.setAutoDelete(FALSE);
g_paramsFound.clear();
-
+
//printf("Starting comment block at %s:%d\n",g_fileName.data(),startLine);
doctokenizerYYlineno=startLine;
uint inpLen=qstrlen(input);
@@ -7762,7 +7765,7 @@ DocRoot *validatingParseDoc(const char *fileName,int startLine,
//printf(">>>>>> end validatingParseDoc(%s,%s)\n",ctx?ctx->name().data():"<none>",
// md?md->name().data():"<none>");
-
+
return root;
}
@@ -7827,4 +7830,3 @@ void docFindSections(const char *input,
{
doctokenizerYYFindSections(input,d,fileName);
}
-
diff --git a/src/dot.cpp b/src/dot.cpp
index f26bee4..acf4db9 100644
--- a/src/dot.cpp
+++ b/src/dot.cpp
@@ -83,10 +83,8 @@ DotManager *DotManager::instance()
return m_theInstance;
}
-DotManager::DotManager() : m_runners(1009), m_filePatchers(1009)
+DotManager::DotManager() : m_runners(), m_filePatchers()
{
- m_runners.setAutoDelete(TRUE);
- m_filePatchers.setAutoDelete(TRUE);
m_queue = new DotRunnerQueue;
int i;
int dotNumThreads = Config_getInt(DOT_NUM_THREADS);
@@ -114,40 +112,44 @@ DotManager::~DotManager()
delete m_queue;
}
-DotRunner* DotManager::createRunner(const QCString& absDotName, const QCString& md5Hash)
+DotRunner* DotManager::createRunner(const std::string &absDotName, const std::string& md5Hash)
{
- DotRunner * run = m_runners.find(absDotName);
- if (run == 0)
+ DotRunner* rv = nullptr;
+ auto const runit = m_runners.find(absDotName);
+ if (runit == m_runners.end())
{
- run = new DotRunner(absDotName, md5Hash);
- m_runners.insert(absDotName, run);
+ auto insobj = std::make_unique<DotRunner>(absDotName, md5Hash);
+ rv = insobj.get();
+ m_runners.emplace(absDotName, std::move(insobj));
}
else
{
// we have a match
- if (md5Hash != QCString(run->getMd5Hash().data()))
+ if (md5Hash != runit->second->getMd5Hash())
{
err("md5 hash does not match for two different runs of %s !\n", absDotName.data());
}
+ rv = runit->second.get();
}
- return run;
+ assert(rv);
+ return rv;
}
-DotFilePatcher *DotManager::createFilePatcher(const QCString &fileName)
+DotFilePatcher *DotManager::createFilePatcher(const std::string &fileName)
{
- DotFilePatcher *patcher = m_filePatchers.find(fileName);
- if (patcher==0)
- {
- patcher = new DotFilePatcher(fileName);
- m_filePatchers.append(fileName,patcher);
- }
- return patcher;
+ 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);
}
bool DotManager::run() const
{
- uint numDotRuns = m_runners.count();
- uint numFilePatchers = m_filePatchers.count();
+ uint numDotRuns = m_runners.size();
+ uint numFilePatchers = m_filePatchers.size();
if (numDotRuns+numFilePatchers>1)
{
if (m_workers.count()==0)
@@ -160,7 +162,6 @@ bool DotManager::run() const
}
}
int i=1;
- QDictIterator<DotRunner> li(m_runners);
bool setPath=FALSE;
if (Config_getBool(GENERATE_HTML))
@@ -185,22 +186,21 @@ bool DotManager::run() const
}
Portable::sysTimerStart();
// fill work queue with dot operations
- DotRunner *dr;
int prev=1;
if (m_workers.count()==0) // no threads to work with
{
- for (li.toFirst();(dr=li.current());++li)
+ for (auto & dr : m_runners)
{
msg("Running dot for graph %d/%d\n",prev,numDotRuns);
- dr->run();
+ dr.second->run();
prev++;
}
}
else // use multiple threads to run instances of dot in parallel
{
- for (li.toFirst();(dr=li.current());++li)
+ for (auto & dr: m_runners)
{
- m_queue->enqueue(dr);
+ m_queue->enqueue(dr.second.get());
}
// wait for the queue to become empty
while ((i=m_queue->count())>0)
@@ -237,27 +237,25 @@ bool DotManager::run() const
// patch the output file and insert the maps and figures
i=1;
- SDict<DotFilePatcher>::Iterator di(m_filePatchers);
- const DotFilePatcher *fp;
// 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.
- for (di.toFirst();(fp=di.current());++di)
+ for (auto & fp : m_filePatchers)
{
- if (fp->isSVGFile())
+ if (fp.second.isSVGFile())
{
msg("Patching output file %d/%d\n",i,numFilePatchers);
- if (!fp->run()) return FALSE;
+ if (!fp.second.run()) return FALSE;
i++;
}
}
- for (di.toFirst();(fp=di.current());++di)
+ for (auto& fp : m_filePatchers)
{
- if (!fp->isSVGFile())
+ if (!fp.second.isSVGFile())
{
msg("Patching output file %d/%d\n",i,numFilePatchers);
- if (!fp->run()) return FALSE;
+ if (!fp.second.run()) return FALSE;
i++;
}
}
@@ -280,7 +278,7 @@ void writeDotGraphFromFile(const char *inFile,const char *outDir,
QCString absImgName = d.absPath().utf8()+"/"+imgName;
QCString absOutFile = d.absPath().utf8()+"/"+outFile;
- DotRunner dotRun(inFile, QCString());
+ DotRunner dotRun(inFile);
if (format==GOF_BITMAP)
{
dotRun.addJob(Config_getEnum(DOT_IMAGE_FORMAT),absImgName);
@@ -333,7 +331,7 @@ void writeDotImageMapFromFile(FTextStream &t,
QCString imgName = baseName+"."+imgExt;
QCString absOutFile = d.absPath().utf8()+"/"+mapName;
- DotRunner dotRun(inFile, QCString());
+ DotRunner dotRun(inFile.data());
dotRun.addJob(MAP_CMD,absOutFile);
dotRun.preventCleanUp();
if (!dotRun.run())
diff --git a/src/dot.h b/src/dot.h
index 60f7f26..3c9af66 100644
--- a/src/dot.h
+++ b/src/dot.h
@@ -17,8 +17,8 @@
#define DOT_H
#include <qlist.h>
-#include <qdict.h>
#include <qcstring.h>
+#include <map>
#include "sortdict.h"
@@ -35,16 +35,16 @@ class DotManager
{
public:
static DotManager *instance();
- DotRunner* createRunner(const QCString& absDotName, const QCString& md5Hash);
- DotFilePatcher *createFilePatcher(const QCString &fileName);
+ DotRunner* createRunner(const std::string& absDotName, const std::string& md5Hash);
+ DotFilePatcher *createFilePatcher(const std::string &fileName);
bool run() const;
private:
DotManager();
virtual ~DotManager();
- QDict<DotRunner> m_runners;
- SDict<DotFilePatcher> m_filePatchers;
+ std::map<std::string, std::unique_ptr<DotRunner>> m_runners;
+ std::map<std::string, DotFilePatcher> m_filePatchers;
static DotManager *m_theInstance;
DotRunnerQueue *m_queue;
QList<DotWorkerThread> m_workers;
diff --git a/src/dotgraph.cpp b/src/dotgraph.cpp
index 0bfa712..e622dd4 100644
--- a/src/dotgraph.cpp
+++ b/src/dotgraph.cpp
@@ -186,14 +186,14 @@ bool DotGraph::prepareDotFile()
if (m_graphFormat == GOF_BITMAP)
{
// run dot to create a bitmap image
- DotRunner * dotRun = DotManager::instance()->createRunner(absDotName(), sigStr);
+ DotRunner * dotRun = DotManager::instance()->createRunner(absDotName().data(), sigStr.data());
dotRun->addJob(Config_getEnum(DOT_IMAGE_FORMAT), absImgName());
if (m_generateImageMap) dotRun->addJob(MAP_CMD, absMapName());
}
else if (m_graphFormat == GOF_EPS)
{
// run dot to create a .eps image
- DotRunner *dotRun = DotManager::instance()->createRunner(absDotName(), sigStr);
+ DotRunner *dotRun = DotManager::instance()->createRunner(absDotName().data(), sigStr.data());
if (Config_getBool(USE_PDFLATEX))
{
dotRun->addJob("pdf",absImgName());
@@ -233,11 +233,11 @@ void DotGraph::generateCode(FTextStream &t)
if (m_regenerate)
{
DotManager::instance()->
- createFilePatcher(absImgName())->
+ createFilePatcher(absImgName().data())->
addSVGConversion(m_relPath,FALSE,QCString(),m_zoomable,m_graphId);
}
int mapId = DotManager::instance()->
- createFilePatcher(m_fileName)->
+ createFilePatcher(m_fileName.data())->
addSVGObject(m_baseName,absImgName(),m_relPath);
t << "<!-- SVG " << mapId << " -->" << endl;
}
@@ -252,7 +252,7 @@ void DotGraph::generateCode(FTextStream &t)
if (m_regenerate || !insertMapFile(t, absMapName(), m_relPath, getMapLabel()))
{
int mapId = DotManager::instance()->
- createFilePatcher(m_fileName)->
+ createFilePatcher(m_fileName.data())->
addMap(absMapName(), m_relPath, m_urlOnly, QCString(), getMapLabel());
t << "<!-- MAP " << mapId << " -->" << endl;
}
@@ -263,7 +263,7 @@ void DotGraph::generateCode(FTextStream &t)
if (m_regenerate || !DotFilePatcher::writeVecGfxFigure(t,m_baseName,absBaseName()))
{
int figId = DotManager::instance()->
- createFilePatcher(m_fileName)->
+ createFilePatcher(m_fileName.data())->
addFigure(m_baseName,absBaseName(),FALSE /*TRUE*/);
t << endl << "% FIG " << figId << endl;
}
diff --git a/src/dotlegendgraph.cpp b/src/dotlegendgraph.cpp
index 98e1f88..b17a293 100644
--- a/src/dotlegendgraph.cpp
+++ b/src/dotlegendgraph.cpp
@@ -29,7 +29,7 @@ void DotLegendGraph::writeGraph(const char *path)
if (getDotImageExtension()=="svg")
{
DotManager::instance()->
- createFilePatcher(absBaseName()+Config_getString(HTML_FILE_EXTENSION))->
+ createFilePatcher((absBaseName()+Config_getString(HTML_FILE_EXTENSION)).data())->
addSVGObject("graph_legend", absImgName(),QCString());
}
}
diff --git a/src/dotrunner.cpp b/src/dotrunner.cpp
index fc9f85c..cb6bd73 100644
--- a/src/dotrunner.cpp
+++ b/src/dotrunner.cpp
@@ -15,6 +15,7 @@
#include "dotrunner.h"
+#include "qstring.h"
#include "util.h"
#include "portable.h"
#include "dot.h"
@@ -145,31 +146,31 @@ bool DotRunner::readBoundingBox(const char *fileName,int *width,int *height,bool
//---------------------------------------------------------------------------------
-DotRunner::DotRunner(const QCString& absDotName, const QCString& md5Hash)
- : m_file(absDotName)
- , m_md5Hash(md5Hash)
+DotRunner::DotRunner(const std::string& absDotName, const std::string& md5Hash)
+ : m_file(absDotName.data())
+ , m_md5Hash(md5Hash.data())
, m_dotExe(Config_getString(DOT_PATH)+"dot")
, m_cleanUp(Config_getBool(DOT_CLEANUP))
+ , m_jobs()
{
- m_jobs.setAutoDelete(TRUE);
}
-void DotRunner::addJob(const char *format,const char *output)
+
+void DotRunner::addJob(const char *format, const char *output)
{
- QListIterator<DotJob> li(m_jobs);
- DotJob *s;
- for (li.toFirst(); (s = li.current()); ++li)
+
+ for (auto& s: m_jobs)
{
- if (qstrcmp(s->format.data(), format) != 0) continue;
- if (qstrcmp(s->output.data(), output) != 0) continue;
+ if (s.format != format) continue;
+ if (s.output != output) continue;
// we have this job already
return;
}
- QCString args = QCString("-T")+format+" -o \""+output+"\"";
- m_jobs.append(new DotJob(format, output, args));
+ auto args = std::string ("-T") + format + " -o \"" + output + "\"";
+ m_jobs.emplace_back(format, output, args);
}
-QCString getBaseNameOfOutput(QCString const& output)
+QCString getBaseNameOfOutput(const QCString &output)
{
int index = output.findRev('.');
if (index < 0) return output;
@@ -181,48 +182,46 @@ bool DotRunner::run()
int exitCode=0;
QCString dotArgs;
- QListIterator<DotJob> li(m_jobs);
- DotJob *s;
// create output
if (Config_getBool(DOT_MULTI_TARGETS))
{
dotArgs=QCString("\"")+m_file.data()+"\"";
- for (li.toFirst();(s=li.current());++li)
+ for (auto& s: m_jobs)
{
dotArgs+=' ';
- dotArgs+=s->args.data();
+ dotArgs+=s.args.data();
}
if ((exitCode=Portable::system(m_dotExe.data(),dotArgs,FALSE))!=0) goto error;
}
else
{
- for (li.toFirst();(s=li.current());++li)
+ for (auto& s : m_jobs)
{
- dotArgs=QCString("\"")+m_file.data()+"\" "+s->args.data();
+ dotArgs=QCString("\"")+m_file.data()+"\" "+s.args.data();
if ((exitCode=Portable::system(m_dotExe.data(),dotArgs,FALSE))!=0) goto error;
}
}
// check output
// As there should be only one pdf file be generated, we don't need code for regenerating multiple pdf files in one call
- for (li.toFirst();(s=li.current());++li)
+ for (auto& s : m_jobs)
{
- if (qstrncmp(s->format.data(), "pdf", 3) == 0)
+ if (s.format.compare(0, 3, "pdf") == 0)
{
int width=0,height=0;
- if (!readBoundingBox(s->output.data(),&width,&height,FALSE)) goto error;
+ if (!readBoundingBox(s.output.data(),&width,&height,FALSE)) goto error;
if ((width > MAX_LATEX_GRAPH_SIZE) || (height > MAX_LATEX_GRAPH_SIZE))
{
- if (!resetPDFSize(width,height,getBaseNameOfOutput(s->output.data()))) goto error;
- dotArgs=QCString("\"")+m_file.data()+"\" "+s->args.data();
+ if (!resetPDFSize(width,height,getBaseNameOfOutput(s.output.data()))) goto error;
+ dotArgs=QCString("\"")+m_file.data()+"\" "+s.args.data();
if ((exitCode=Portable::system(m_dotExe.data(),dotArgs,FALSE))!=0) goto error;
}
}
- if (qstrncmp(s->format.data(), "png", 3) == 0)
+ if (s.format.compare(0, 3, "png") == 0)
{
- checkPngResult(s->output.data());
+ checkPngResult(s.output.data());
}
}
@@ -234,7 +233,7 @@ bool DotRunner::run()
}
// create checksum file
- if (!m_md5Hash.isEmpty())
+ if (!m_md5Hash.empty())
{
QCString md5Name = getBaseNameOfOutput(m_file.data()) + ".md5";
FILE *f = Portable::fopen(md5Name,"w");
@@ -256,27 +255,27 @@ error:
void DotRunnerQueue::enqueue(DotRunner *runner)
{
- QMutexLocker locker(&m_mutex);
- m_queue.enqueue(runner);
- m_bufferNotEmpty.wakeAll();
+ std::lock_guard<std::mutex> locker(m_mutex);
+ m_queue.push(runner);
+ m_bufferNotEmpty.notify_all();
}
DotRunner *DotRunnerQueue::dequeue()
{
- QMutexLocker locker(&m_mutex);
- while (m_queue.isEmpty())
- {
- // wait until something is added to the queue
- m_bufferNotEmpty.wait(&m_mutex);
- }
- DotRunner *result = m_queue.dequeue();
+ std::unique_lock<std::mutex> locker(m_mutex);
+
+ // wait until something is added to the queue
+ m_bufferNotEmpty.wait(locker, [this]() { return !m_queue.empty(); });
+
+ DotRunner *result = m_queue.front();
+ m_queue.pop();
return result;
}
uint DotRunnerQueue::count() const
{
- QMutexLocker locker(&m_mutex);
- return m_queue.count();
+ std::lock_guard<std::mutex> locker(m_mutex);
+ return m_queue.size();
}
//--------------------------------------------------------------------
@@ -294,3 +293,9 @@ void DotWorkerThread::run()
runner->run();
}
}
+
+void DotWorkerThread::start()
+{
+ assert(!m_thread);
+ m_thread = std::make_unique<std::thread>(&DotWorkerThread::run, this);
+}
diff --git a/src/dotrunner.h b/src/dotrunner.h
index 1b68c18..555ea78 100644
--- a/src/dotrunner.h
+++ b/src/dotrunner.h
@@ -16,70 +16,30 @@
#ifndef DOTRUNNER_H
#define DOTRUNNER_H
-#include "qcstring.h"
-#include "qlist.h"
-#include "qwaitcondition.h"
-#include "qthread.h"
-#include "qqueue.h"
-#include "qmutex.h"
-
-/** Minimal constant string class that is thread safe, once initialized. */
-class DotConstString
-{
- public:
- DotConstString() { m_str=0;}
- ~DotConstString() { delete[] m_str;}
- DotConstString(char const* s) : m_str(0) { set(s); }
- DotConstString(const QCString &s) : m_str(0) { set(s); }
- DotConstString(const DotConstString &s) : m_str(0) { set(s.data()); }
- const char *data() const { return m_str; }
- bool isEmpty() const { return m_str==0 || m_str[0]=='\0'; }
-
- private:
- void set(char const* s)
- {
- delete[] m_str;
- m_str=0;
- if (s)
- {
- m_str=new char[strlen(s) + 1];
- qstrcpy(m_str,s);
- }
- }
-
- void set(const QCString &s)
- {
- delete[] m_str;
- m_str=0;
- if (!s.isEmpty())
- {
- m_str=new char[s.length()+1];
- qstrcpy(m_str,s.data());
- }
- }
-
- DotConstString &operator=(const DotConstString &);
-
- char *m_str;
-};
+#include <qglobal.h> //uint
+#include <string>
+#include <thread>
+#include <list>
+#include <queue>
+#include <mutex>
+#include <condition_variable>
+#include <memory>
/** Helper class to run dot from doxygen from multiple threads. */
class DotRunner
{
- public:
struct DotJob
{
- DotJob(const DotConstString & format,
- const DotConstString & output,
- const DotConstString & args)
- : format(format), output(output), args(args) {}
- DotConstString format;
- DotConstString output;
- DotConstString args;
+ DotJob(std::string f, std::string o, std::string a)
+ : format(f), output(o), args(a) {}
+ std::string format;
+ std::string output;
+ std::string args;
};
+ public:
/** Creates a runner for a dot \a file. */
- DotRunner(const QCString& absDotName, const QCString& md5Hash);
+ DotRunner(const std::string& absDotName, const std::string& md5Hash = std::string());
/** Adds an additional job to the run.
* Performing multiple jobs one file can be faster.
@@ -87,22 +47,22 @@ class DotRunner
void addJob(const char *format,const char *output);
/** Prevent cleanup of the dot file (for user provided dot files) */
- void preventCleanUp() { m_cleanUp = FALSE; }
+ void preventCleanUp() { m_cleanUp = false; }
/** Runs dot for all jobs added. */
bool run();
// DotConstString const& getFileName() { return m_file; }
- DotConstString const& getMd5Hash() { return m_md5Hash; }
+ std::string const & getMd5Hash() { return m_md5Hash; }
static bool readBoundingBox(const char* fileName, int* width, int* height, bool isEps);
private:
- DotConstString m_file;
- DotConstString m_md5Hash;
- DotConstString m_dotExe;
- bool m_cleanUp;
- QList<DotJob> m_jobs;
+ std::string m_file;
+ std::string m_md5Hash;
+ std::string m_dotExe;
+ bool m_cleanUp;
+ std::vector<DotJob> m_jobs;
};
/** Queue of dot jobs to run. */
@@ -114,18 +74,22 @@ class DotRunnerQueue
DotRunner *dequeue();
uint count() const;
private:
- QWaitCondition m_bufferNotEmpty;
- QQueue<DotRunner> m_queue;
- mutable QMutex m_mutex;
+ std::condition_variable m_bufferNotEmpty;
+ std::queue<DotRunner *> m_queue;
+ mutable std::mutex m_mutex;
};
/** Worker thread to execute a dot run */
-class DotWorkerThread : public QThread
+class DotWorkerThread
{
public:
DotWorkerThread(DotRunnerQueue *queue);
void run();
+ void start();
+ bool isRunning() { return m_thread && m_thread->joinable(); }
+ void wait() { m_thread->join(); }
private:
+ std::unique_ptr<std::thread> m_thread;
DotRunnerQueue *m_queue;
};
diff --git a/src/doxygen.cpp b/src/doxygen.cpp
index 8bc65f5..f79509f 100644
--- a/src/doxygen.cpp
+++ b/src/doxygen.cpp
@@ -208,7 +208,7 @@ class Statistics
Statistics() { stats.setAutoDelete(TRUE); }
void begin(const char *name)
{
- msg(name);
+ msg("%s", name);
stat *entry= new stat(name,0);
stats.append(entry);
time.restart();
@@ -556,7 +556,7 @@ static void buildFileList(const Entry *root)
{
text+="is not an input file";
}
- warn(fn,root->startLine,text);
+ warn(fn,root->startLine,"%s", text.data());
}
}
for (const auto &e : root->children()) buildFileList(e.get());
@@ -610,7 +610,7 @@ static void addIncludeFile(ClassDef *cd,FileDef *ifd,const Entry *root)
{
text+="is not an input file";
}
- warn(root->fileName,root->startLine,text);
+ warn(root->fileName,root->startLine, "%s", text.data());
}
else if (includeFile.isEmpty() && ifd &&
// see if the file extension makes sense
@@ -996,7 +996,7 @@ static void addClassToContext(const Entry *root)
if (root->bodyLine!=-1 && cd->getStartBodyLine()==-1)
{
- cd->setBodySegment(root->bodyLine,root->endBodyLine);
+ cd->setBodySegment(root->startLine,root->bodyLine,root->endBodyLine);
cd->setBodyDef(fd);
}
//cd->setName(fullName); // change name to match docs
@@ -1073,7 +1073,7 @@ static void addClassToContext(const Entry *root)
cd->setIsStatic(root->stat);
// file definition containing the class cd
- cd->setBodySegment(root->bodyLine,root->endBodyLine);
+ cd->setBodySegment(root->startLine,root->bodyLine,root->endBodyLine);
cd->setBodyDef(fd);
cd->setMetaData(root->metaData);
@@ -1279,7 +1279,7 @@ static ClassDef *createTagLessInstance(ClassDef *rootCd,ClassDef *templ,const QC
cd->setDocumentation(templ->documentation(),templ->docFile(),templ->docLine()); // copy docs to definition
cd->setBriefDescription(templ->briefDescription(),templ->briefFile(),templ->briefLine());
cd->setLanguage(templ->getLanguage());
- cd->setBodySegment(templ->getStartBodyLine(),templ->getEndBodyLine());
+ cd->setBodySegment(templ->getDefLine(),templ->getStartBodyLine(),templ->getEndBodyLine());
cd->setBodyDef(templ->getBodyDef());
cd->setOuterScope(rootCd->getOuterScope());
@@ -1534,7 +1534,7 @@ static void buildNamespaceList(const Entry *root)
// the empty string test is needed for extract all case
nd->setBriefDescription(root->brief,root->briefFile,root->briefLine);
nd->insertUsedFile(fd);
- nd->setBodySegment(root->bodyLine,root->endBodyLine);
+ nd->setBodySegment(root->startLine,root->bodyLine,root->endBodyLine);
nd->setBodyDef(fd);
// add class to the list
Doxygen::namespaceSDict->inSort(fullName,nd);
@@ -1926,7 +1926,7 @@ static void findUsingDeclImports(const Entry *root)
newMd->enableReferencesRelation(root->referencesRelation);
newMd->setBitfields(md->bitfieldString());
newMd->addSectionsToDefinition(root->anchors);
- newMd->setBodySegment(md->getStartBodyLine(),md->getEndBodyLine());
+ newMd->setBodySegment(md->getDefLine(),md->getStartBodyLine(),md->getEndBodyLine());
newMd->setBodyDef(md->getBodyDef());
newMd->setInitializer(md->initializer());
newMd->setMaxInitLines(md->initializerLines());
@@ -2111,7 +2111,7 @@ static MemberDef *addVariableToClass(
md->setFromAnonymousScope(fromAnnScope);
md->setFromAnonymousMember(fromAnnMemb);
//md->setIndentDepth(indentDepth);
- md->setBodySegment(root->bodyLine,root->endBodyLine);
+ md->setBodySegment(root->startLine,root->bodyLine,root->endBodyLine);
md->setInitializer(root->initializer);
md->setMaxInitLines(root->initLines);
md->setMemberGroupId(root->mGrpId);
@@ -2380,7 +2380,7 @@ static MemberDef *addVariableToFile(
//md->setOuterScope(fd);
if (!root->explicitExternal)
{
- md->setBodySegment(root->bodyLine,root->endBodyLine);
+ md->setBodySegment(root->startLine,root->bodyLine,root->endBodyLine);
md->setBodyDef(fd);
}
addMemberToGroups(root,md);
@@ -2897,7 +2897,7 @@ static void addInterfaceOrServiceToServiceOrSingleton(
md->setDocsForDefinition(false);
md->setBriefDescription(root->brief,root->briefFile,root->briefLine);
md->setInbodyDocumentation(root->inbodyDocs,root->inbodyFile,root->inbodyLine);
- md->setBodySegment(root->bodyLine,root->endBodyLine);
+ md->setBodySegment(root->startLine,root->bodyLine,root->endBodyLine);
md->setMemberSpecifiers(root->spec);
md->setMemberGroupId(root->mGrpId);
md->setTypeConstraints(root->typeConstr);
@@ -3086,7 +3086,7 @@ static void addMethodToClass(const Entry *root,ClassDef *cd,
md->setDocsForDefinition(!root->proto);
md->setBriefDescription(root->brief,root->briefFile,root->briefLine);
md->setInbodyDocumentation(root->inbodyDocs,root->inbodyFile,root->inbodyLine);
- md->setBodySegment(root->bodyLine,root->endBodyLine);
+ md->setBodySegment(root->startLine,root->bodyLine,root->endBodyLine);
md->setMemberSpecifiers(spec);
md->setMemberGroupId(root->mGrpId);
md->setTypeConstraints(root->typeConstr);
@@ -3392,7 +3392,7 @@ static void buildFunctionList(const Entry *root)
md->setDocsForDefinition(!root->proto);
if (md->getStartBodyLine()==-1 && root->bodyLine!=-1)
{
- md->setBodySegment(root->bodyLine,root->endBodyLine);
+ md->setBodySegment(root->startLine,root->bodyLine,root->endBodyLine);
md->setBodyDef(rfd);
}
@@ -3468,7 +3468,7 @@ static void buildFunctionList(const Entry *root)
md->setDocsForDefinition(!root->proto);
md->setTypeConstraints(root->typeConstr);
//md->setBody(root->body);
- md->setBodySegment(root->bodyLine,root->endBodyLine);
+ md->setBodySegment(root->startLine,root->bodyLine,root->endBodyLine);
FileDef *fd=root->fileDef();
md->setBodyDef(fd);
md->addSectionsToDefinition(root->anchors);
@@ -3658,13 +3658,13 @@ static void findFriends()
//printf("body mmd %d fmd %d\n",mmd->getStartBodyLine(),fmd->getStartBodyLine());
if (mmd->getStartBodyLine()==-1 && fmd->getStartBodyLine()!=-1)
{
- mmd->setBodySegment(fmd->getStartBodyLine(),fmd->getEndBodyLine());
+ mmd->setBodySegment(fmd->getDefLine(),fmd->getStartBodyLine(),fmd->getEndBodyLine());
mmd->setBodyDef(fmd->getBodyDef());
//mmd->setBodyMember(fmd);
}
else if (mmd->getStartBodyLine()!=-1 && fmd->getStartBodyLine()==-1)
{
- fmd->setBodySegment(mmd->getStartBodyLine(),mmd->getEndBodyLine());
+ fmd->setBodySegment(mmd->getDefLine(),mmd->getStartBodyLine(),mmd->getEndBodyLine());
fmd->setBodyDef(mmd->getBodyDef());
//fmd->setBodyMember(mmd);
}
@@ -5092,7 +5092,7 @@ static void addMemberDocs(const Entry *root,
)
{
//printf("Setting new body segment [%d,%d]\n",root->bodyLine,root->endBodyLine);
- md->setBodySegment(root->bodyLine,root->endBodyLine);
+ md->setBodySegment(root->startLine,root->bodyLine,root->endBodyLine);
md->setBodyDef(rfd);
}
@@ -5284,7 +5284,7 @@ static bool findGlobalMember(const Entry *root,
" of file "+md->getDefFileName()+"\n";
}
}
- warn(root->fileName,root->startLine,warnMsg);
+ warn(root->fileName,root->startLine, "%s", warnMsg.data());
}
}
else // got docs for an undefined member!
@@ -6130,7 +6130,7 @@ static void findMember(const Entry *root,
md->setDocsForDefinition(!root->proto);
md->setPrototype(root->proto,root->fileName,root->startLine,root->startColumn);
md->addSectionsToDefinition(root->anchors);
- md->setBodySegment(root->bodyLine,root->endBodyLine);
+ md->setBodySegment(root->startLine,root->bodyLine,root->endBodyLine);
FileDef *fd=root->fileDef();
md->setBodyDef(fd);
md->setMemberSpecifiers(spec);
@@ -6199,7 +6199,7 @@ static void findMember(const Entry *root,
md->setDocsForDefinition(!root->proto);
md->setPrototype(root->proto,root->fileName,root->startLine,root->startColumn);
md->addSectionsToDefinition(root->anchors);
- md->setBodySegment(root->bodyLine,root->endBodyLine);
+ md->setBodySegment(root->startLine,root->bodyLine,root->endBodyLine);
FileDef *fd=root->fileDef();
md->setBodyDef(fd);
md->setMemberSpecifiers(spec);
@@ -6372,7 +6372,7 @@ static void findMember(const Entry *root,
}
if (rmd) // member found -> copy line number info
{
- md->setBodySegment(rmd->getStartBodyLine(),rmd->getEndBodyLine());
+ md->setBodySegment(rmd->getDefLine(),rmd->getStartBodyLine(),rmd->getEndBodyLine());
md->setBodyDef(rmd->getBodyDef());
//md->setBodyMember(rmd);
}
@@ -6381,7 +6381,7 @@ static void findMember(const Entry *root,
if (!found) // line number could not be found or is available in this
// entry
{
- md->setBodySegment(root->bodyLine,root->endBodyLine);
+ md->setBodySegment(root->startLine,root->bodyLine,root->endBodyLine);
md->setBodyDef(fd);
}
@@ -6475,7 +6475,7 @@ localObjCMethod:
md->setDocsForDefinition(!root->proto);
md->setPrototype(root->proto,root->fileName,root->startLine,root->startColumn);
md->addSectionsToDefinition(root->anchors);
- md->setBodySegment(root->bodyLine,root->endBodyLine);
+ md->setBodySegment(root->startLine,root->bodyLine,root->endBodyLine);
FileDef *fd=root->fileDef();
md->setBodyDef(fd);
md->setMemberSpecifiers(spec);
@@ -6818,7 +6818,7 @@ static void findEnums(const Entry *root)
md->setLanguage(root->lang);
md->setId(root->id);
if (!isGlobal) md->setMemberClass(cd); else md->setFileDef(fd);
- md->setBodySegment(root->bodyLine,root->endBodyLine);
+ md->setBodySegment(root->startLine,root->bodyLine,root->endBodyLine);
md->setBodyDef(root->fileDef());
md->setMemberSpecifiers(root->spec);
md->setEnumBaseType(root->args);
@@ -7721,9 +7721,9 @@ static void addSourceReferences()
for (cli.toFirst();(cd=cli.current());++cli)
{
FileDef *fd=cd->getBodyDef();
- if (fd && cd->isLinkableInProject() && cd->getDefLine()!=-1)
+ if (fd && cd->isLinkableInProject() && cd->getStartDefLine()!=-1)
{
- fd->addSourceRef(cd->getDefLine(),cd,0);
+ fd->addSourceRef(cd->getStartDefLine(),cd,0);
}
}
// add source references for namespace definitions
@@ -7732,9 +7732,9 @@ static void addSourceReferences()
for (nli.toFirst();(nd=nli.current());++nli)
{
FileDef *fd=nd->getBodyDef();
- if (fd && nd->isLinkableInProject() && nd->getDefLine()!=-1)
+ if (fd && nd->isLinkableInProject() && nd->getStartDefLine()!=-1)
{
- fd->addSourceRef(nd->getDefLine(),nd,0);
+ fd->addSourceRef(nd->getStartDefLine(),nd,0);
}
}
@@ -7753,14 +7753,14 @@ static void addSourceReferences()
// md->getStartBodyLine(),md->isLinkableInProject());
FileDef *fd=md->getBodyDef();
if (fd &&
- md->getDefLine()!=-1 &&
+ md->getStartDefLine()!=-1 &&
md->isLinkableInProject() &&
(fd->generateSourceFile() || Doxygen::parseSourcesNeeded)
)
{
//printf("Found member '%s' in file '%s' at line '%d' def=%s\n",
// md->name().data(),fd->name().data(),md->getStartBodyLine(),md->getOuterScope()->name().data());
- fd->addSourceRef(md->getDefLine(),md->getOuterScope(),md);
+ fd->addSourceRef(md->getStartDefLine(),md->getOuterScope(),md);
}
}
}
@@ -7778,14 +7778,14 @@ static void addSourceReferences()
// md->isLinkableInProject(),
// Doxygen::parseSourcesNeeded);
if (fd &&
- md->getDefLine()!=-1 &&
+ md->getStartDefLine()!=-1 &&
md->isLinkableInProject() &&
(fd->generateSourceFile() || Doxygen::parseSourcesNeeded)
)
{
//printf("Found member '%s' in file '%s' at line '%d' def=%s\n",
// md->name().data(),fd->name().data(),md->getStartBodyLine(),md->getOuterScope()->name().data());
- fd->addSourceRef(md->getDefLine(),md->getOuterScope(),md);
+ fd->addSourceRef(md->getStartDefLine(),md->getOuterScope(),md);
}
}
}
@@ -8305,7 +8305,7 @@ static void findDefineDocumentation(Entry *root)
{
md->setInbodyDocumentation(root->inbodyDocs,root->inbodyFile,root->inbodyLine);
}
- md->setBodySegment(root->bodyLine,root->endBodyLine);
+ md->setBodySegment(root->startLine,root->bodyLine,root->endBodyLine);
md->setBodyDef(root->fileDef());
md->addSectionsToDefinition(root->anchors);
md->setMaxInitLines(root->initLines);
@@ -8349,7 +8349,7 @@ static void findDefineDocumentation(Entry *root)
{
md->setInbodyDocumentation(root->inbodyDocs,root->inbodyFile,root->inbodyLine);
}
- md->setBodySegment(root->bodyLine,root->endBodyLine);
+ md->setBodySegment(root->startLine,root->bodyLine,root->endBodyLine);
md->setBodyDef(root->fileDef());
md->addSectionsToDefinition(root->anchors);
md->setRefItems(root->sli);
@@ -8378,7 +8378,7 @@ static void findDefineDocumentation(Entry *root)
else
{
warn(root->fileName,root->startLine,
- "found documented #define but ignoring it because "
+ "found documented #define %s but ignoring it because "
"ENABLE_PREPROCESSING is NO.\n",
root->name.data()
);
@@ -9946,15 +9946,7 @@ static int computeIdealCacheParam(uint v)
void readConfiguration(int argc, char **argv)
{
- QCString versionString;
- if (strlen(getGitVersion())>0)
- {
- versionString = QCString(getVersion())+" ("+getGitVersion()+")";
- }
- else
- {
- versionString = getVersion();
- }
+ QCString versionString = getFullVersion();
/**************************************************************************
* Handle arguments *
@@ -10771,15 +10763,7 @@ void parseInput()
// we would like to show the versionString earlier, but we first have to handle the configuration file
// to know the value of the QUIET setting.
- QCString versionString;
- if (strlen(getGitVersion())>0)
- {
- versionString = QCString(getVersion())+" ("+getGitVersion()+")";
- }
- else
- {
- versionString = getVersion();
- }
+ QCString versionString = getFullVersion();
msg("Doxygen version used: %s\n",versionString.data());
/**************************************************************************
@@ -11659,4 +11643,3 @@ void generateOutput()
// delete Doxygen::symbolStorage;
g_successfulRun=TRUE;
}
-
diff --git a/src/fortranscanner.l b/src/fortranscanner.l
index 95842f0..df4941d 100644
--- a/src/fortranscanner.l
+++ b/src/fortranscanner.l
@@ -2581,8 +2581,8 @@ static void subrHandleCommentBlock(yyscan_t yyscanner,const QCString &doc,bool b
else
{
// something different specified, give warning and leave error.
- warn(yyextra->fileName,yyextra->lineNr, "Routine: " + yyextra->current->name + yyextra->current->args +
- " inconsistency between intent attribute and documentation for parameter: " + yyextra->argName);
+ warn(yyextra->fileName,yyextra->lineNr, "%s", ("Routine: " + yyextra->current->name + yyextra->current->args +
+ " inconsistency between intent attribute and documentation for parameter: " + yyextra->argName).data());
handleCommentBlock(yyscanner,QCString("\n\n@param ") + directionParam[dir1] + " " +
yyextra->argName + " " + loc_doc,brief);
}
@@ -2605,8 +2605,8 @@ static void subrHandleCommentBlock(yyscan_t yyscanner,const QCString &doc,bool b
}
else
{
- warn(yyextra->fileName,yyextra->lineNr, "Routine: " + yyextra->current->name + yyextra->current->args +
- " inconsistency between intent attribute and documentation for parameter: " + yyextra->argName);
+ warn(yyextra->fileName,yyextra->lineNr, "%s", ("Routine: " + yyextra->current->name + yyextra->current->args +
+ " inconsistency between intent attribute and documentation for parameter: " + yyextra->argName).data());
handleCommentBlock(yyscanner,QCString("\n\n@param ") + directionParam[dir1] + " " +
yyextra->argName + " " + loc_doc,brief);
}
@@ -2627,8 +2627,8 @@ static void subrHandleCommentBlock(yyscan_t yyscanner,const QCString &doc,bool b
}
else
{
- warn(yyextra->fileName,yyextra->lineNr, "Routine: " + yyextra->current->name + yyextra->current->args +
- " inconsistency between intent attribute and documentation for parameter: " + yyextra->argName);
+ warn(yyextra->fileName,yyextra->lineNr, "%s", ("Routine: " + yyextra->current->name + yyextra->current->args +
+ " inconsistency between intent attribute and documentation for parameter: " + yyextra->argName).data());
handleCommentBlock(yyscanner,QCString("\n\n@param ") + directionParam[dir1] + " " +
yyextra->argName + " " + loc_doc,brief);
}
diff --git a/src/ftvhelp.cpp b/src/ftvhelp.cpp
index c556b43..d231dad 100644
--- a/src/ftvhelp.cpp
+++ b/src/ftvhelp.cpp
@@ -451,6 +451,10 @@ void FTVHelp::generateTree(FTextStream &t, const QList<FTVNode> &nl,int level,in
char icon=compoundIcon(dynamic_cast<const ClassDef*>(n->def));
t << "<span class=\"icona\"><span class=\"icon\">" << icon << "</span></span>";
}
+ else if (n->def && n->def->definitionType()==Definition::TypeDir)
+ {
+ t << "<span class=\"iconfclosed\"></span>";
+ }
else
{
t << "<span class=\"icondoc\"></span>";
diff --git a/src/htmlgen.cpp b/src/htmlgen.cpp
index 0e3b146..ac42a6a 100644
--- a/src/htmlgen.cpp
+++ b/src/htmlgen.cpp
@@ -1070,7 +1070,7 @@ void HtmlGenerator::writeSearchData(const char *dir)
{
searchCss = mgr.getAsString("search.css");
}
- searchCss = substitute(replaceColorMarkers(searchCss),"$doxygenversion",getVersion());
+ searchCss = substitute(replaceColorMarkers(searchCss),"$doxygenversion",getDoxygenVersion());
t << searchCss;
Doxygen::indexList->addStyleSheetFile("search/search.css");
}
@@ -1079,20 +1079,20 @@ void HtmlGenerator::writeSearchData(const char *dir)
void HtmlGenerator::writeStyleSheetFile(QFile &file)
{
FTextStream t(&file);
- t << replaceColorMarkers(substitute(ResourceMgr::instance().getAsString("doxygen.css"),"$doxygenversion",getVersion()));
+ t << replaceColorMarkers(substitute(ResourceMgr::instance().getAsString("doxygen.css"),"$doxygenversion",getDoxygenVersion()));
}
void HtmlGenerator::writeHeaderFile(QFile &file, const char * /*cssname*/)
{
FTextStream t(&file);
- t << "<!-- HTML header for doxygen " << getVersion() << "-->" << endl;
+ t << "<!-- HTML header for doxygen " << getDoxygenVersion() << "-->" << endl;
t << ResourceMgr::instance().getAsString("header.html");
}
void HtmlGenerator::writeFooterFile(QFile &file)
{
FTextStream t(&file);
- t << "<!-- HTML footer for doxygen " << getVersion() << "-->" << endl;
+ t << "<!-- HTML footer for doxygen " << getDoxygenVersion() << "-->" << endl;
t << ResourceMgr::instance().getAsString("footer.html");
}
@@ -1113,7 +1113,7 @@ void HtmlGenerator::startFile(const char *name,const char *,
t << substituteHtmlKeywords(g_header,convertToHtml(filterTitle(title)),m_relPath);
t << "<!-- " << theTranslator->trGeneratedBy() << " Doxygen "
- << getVersion() << " -->" << endl;
+ << getDoxygenVersion() << " -->" << endl;
//static bool generateTreeView = Config_getBool(GENERATE_TREEVIEW);
static bool searchEngine = Config_getBool(SEARCHENGINE);
if (searchEngine /*&& !generateTreeView*/)
@@ -1177,7 +1177,7 @@ QCString HtmlGenerator::writeLogoAsString(const char *path)
"<img class=\"footer\" src=\"";
result += path;
result += "doxygen.png\" alt=\"doxygen\"/></a> ";
- result += getVersion();
+ result += getDoxygenVersion();
result += " ";
return result;
}
@@ -1230,7 +1230,7 @@ void HtmlGenerator::writeStyleInfo(int part)
//t << "H1 { text-align: center; border-width: thin none thin none;" << endl;
//t << " border-style : double; border-color : blue; padding-left : 1em; padding-right : 1em }" << endl;
- t << replaceColorMarkers(substitute(ResourceMgr::instance().getAsString("doxygen.css"),"$doxygenversion",getVersion()));
+ t << replaceColorMarkers(substitute(ResourceMgr::instance().getAsString("doxygen.css"),"$doxygenversion",getDoxygenVersion()));
endPlainFile();
Doxygen::indexList->addStyleSheetFile("doxygen.css");
}
@@ -2648,7 +2648,7 @@ void HtmlGenerator::writeSearchPage()
t << substituteHtmlKeywords(g_header,"Search","");
t << "<!-- " << theTranslator->trGeneratedBy() << " Doxygen "
- << getVersion() << " -->" << endl;
+ << getDoxygenVersion() << " -->" << endl;
t << "<script type=\"text/javascript\">\n";
t << "/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */\n";
t << "var searchBox = new SearchBox(\"searchBox\", \""
@@ -2701,7 +2701,7 @@ void HtmlGenerator::writeExternalSearchPage()
t << substituteHtmlKeywords(g_header,"Search","");
t << "<!-- " << theTranslator->trGeneratedBy() << " Doxygen "
- << getVersion() << " -->" << endl;
+ << getDoxygenVersion() << " -->" << endl;
t << "<script type=\"text/javascript\">\n";
t << "/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */\n";
t << "var searchBox = new SearchBox(\"searchBox\", \""
diff --git a/src/language.cpp b/src/language.cpp
index 7457676..299c452 100644
--- a/src/language.cpp
+++ b/src/language.cpp
@@ -417,6 +417,6 @@ bool setTranslator(const char *langName)
}
QCString msg = theTranslator->updateNeededMessage();
- if (!msg.isEmpty()) warn_uncond(msg);
+ if (!msg.isEmpty()) warn_uncond("%s", msg.data());
return TRUE;
}
diff --git a/src/latexgen.cpp b/src/latexgen.cpp
index dc8d2fe..f00e6cf 100644
--- a/src/latexgen.cpp
+++ b/src/latexgen.cpp
@@ -791,7 +791,7 @@ static void writeDefaultHeaderPart3(FTextStream &t)
{
// part 3
// Finalize project number
- t << " Doxygen " << getVersion() << "}\\\\\n";
+ t << " Doxygen " << getDoxygenVersion() << "}\\\\\n";
if (Config_getBool(LATEX_TIMESTAMP))
t << "\\vspace*{0.5cm}\n"
"{\\small " << dateToString(TRUE) << "}\\\\\n";
@@ -860,7 +860,7 @@ static void writeDefaultFooter(FTextStream &t)
void LatexGenerator::writeHeaderFile(QFile &f)
{
FTextStream t(&f);
- t << "% Latex header for doxygen " << getVersion() << endl;
+ t << "% Latex header for doxygen " << getDoxygenVersion() << endl;
writeDefaultHeaderPart1(t);
t << "Your title here";
writeDefaultHeaderPart2(t);
@@ -871,14 +871,14 @@ void LatexGenerator::writeHeaderFile(QFile &f)
void LatexGenerator::writeFooterFile(QFile &f)
{
FTextStream t(&f);
- t << "% Latex footer for doxygen " << getVersion() << endl;
+ t << "% Latex footer for doxygen " << getDoxygenVersion() << endl;
writeDefaultFooter(t);
}
void LatexGenerator::writeStyleSheetFile(QFile &f)
{
FTextStream t(&f);
- t << "% stylesheet for doxygen " << getVersion() << endl;
+ t << "% stylesheet for doxygen " << getDoxygenVersion() << endl;
writeDefaultStyleSheet(t);
}
diff --git a/src/layout.cpp b/src/layout.cpp
index 0f47f2a..f84fec0 100644
--- a/src/layout.cpp
+++ b/src/layout.cpp
@@ -1562,7 +1562,7 @@ void writeDefaultLayoutFile(const char *fileName)
}
QTextStream t(&f);
t.setEncoding(QTextStream::UnicodeUTF8);
- t << substitute(layout_default,"$doxygenversion",getVersion());
+ t << substitute(layout_default,"$doxygenversion",getDoxygenVersion());
}
//----------------------------------------------------------------------------------
diff --git a/src/memberdef.cpp b/src/memberdef.cpp
index dcd1991..6d98311 100644
--- a/src/memberdef.cpp
+++ b/src/memberdef.cpp
@@ -4363,7 +4363,7 @@ MemberDef *MemberDefImpl::createTemplateInstanceMember(
imd->setArgumentList(actualArgList);
imd->setDefinition(substituteTemplateArgumentsInString(m_impl->def,formalArgs,actualArgs));
imd->setBodyDef(getBodyDef());
- imd->setBodySegment(getStartBodyLine(),getEndBodyLine());
+ imd->setBodySegment(getDefLine(),getStartBodyLine(),getEndBodyLine());
//imd->setBodyMember(this);
// TODO: init other member variables (if needed).
@@ -6017,14 +6017,14 @@ void combineDeclarationAndDefinition(MemberDef *mdec,MemberDef *mdef)
if (mdec->getStartBodyLine()!=-1 && mdef->getStartBodyLine()==-1)
{
//printf("body mdec->mdef %d-%d\n",mdec->getStartBodyLine(),mdef->getEndBodyLine());
- mdef->setBodySegment(mdec->getStartBodyLine(),mdec->getEndBodyLine());
+ mdef->setBodySegment(mdec->getDefLine(),mdec->getStartBodyLine(),mdec->getEndBodyLine());
mdef->setBodyDef(mdec->getBodyDef());
//mdef->setBodyMember(mdec);
}
else if (mdef->getStartBodyLine()!=-1 && mdec->getStartBodyLine()==-1)
{
//printf("body mdef->mdec %d-%d\n",mdef->getStartBodyLine(),mdec->getEndBodyLine());
- mdec->setBodySegment(mdef->getStartBodyLine(),mdef->getEndBodyLine());
+ mdec->setBodySegment(mdef->getDefLine(),mdef->getStartBodyLine(),mdef->getEndBodyLine());
mdec->setBodyDef(mdef->getBodyDef());
//mdec->setBodyMember(mdef);
}
diff --git a/src/message.h b/src/message.h
index 7b12ba8..5f8c9db 100644
--- a/src/message.h
+++ b/src/message.h
@@ -21,17 +21,26 @@
#include <stdio.h>
#include <stdarg.h>
-extern void msg(const char *fmt, ...);
-extern void warn(const char *file,int line,const char *fmt, ...);
-extern void va_warn(const char *file,int line,const char *fmt, va_list args);
+#ifdef __GNUC__
+#define PRINTFLIKE(FORMAT, PARAM ) __attribute__((format(printf, FORMAT, PARAM)))
+#else
+#define PRINTFLIKE(FORMAT, PARAM )
+#endif
+
+extern void msg(const char *fmt, ...) PRINTFLIKE(1,2);
+extern void warn(const char *file,int line,const char *fmt, ...) PRINTFLIKE(3, 4);
+extern void va_warn(const char* file, int line, const char* fmt, va_list args);
extern void warn_simple(const char *file,int line,const char *text);
-extern void warn_undoc(const char *file,int line,const char *fmt, ...);
-extern void warn_doc_error(const char *file,int line,const char *fmt, ...);
-extern void warn_uncond(const char *fmt, ...);
-extern void err(const char *fmt, ...);
-extern void err_full(const char *file,int line,const char *fmt, ...);
-extern void term(const char *fmt, ...);
+extern void warn_undoc(const char *file,int line,const char *fmt, ...) PRINTFLIKE(3, 4);
+extern void warn_doc_error(const char *file,int line,const char *fmt, ...) PRINTFLIKE(3, 4);
+extern void warn_uncond(const char *fmt, ...) PRINTFLIKE(1, 2);
+extern void err(const char *fmt, ...) PRINTFLIKE(1, 2);
+extern void err_full(const char *file,int line,const char *fmt, ...) PRINTFLIKE(3, 4);
+extern void term(const char *fmt, ...) PRINTFLIKE(1, 2);
void initWarningFormat();
extern void printlex(int dbg, bool enter, const char *lexName, const char *fileName);
+
+#undef PRINTFLIKE
+
#endif
diff --git a/src/resourcemgr.cpp b/src/resourcemgr.cpp
index 0f79c04..4ba3388 100644
--- a/src/resourcemgr.cpp
+++ b/src/resourcemgr.cpp
@@ -144,7 +144,7 @@ bool ResourceMgr::copyResourceAs(const char *name,const char *targetDir,const ch
}
else
{
- t << substitute(buf,"$doxygenversion",getVersion());
+ t << substitute(buf,"$doxygenversion",getDoxygenVersion());
}
return TRUE;
}
diff --git a/src/rtfdocvisitor.cpp b/src/rtfdocvisitor.cpp
index e1a9e31..f9b30f7 100644
--- a/src/rtfdocvisitor.cpp
+++ b/src/rtfdocvisitor.cpp
@@ -1107,14 +1107,30 @@ void RTFDocVisitor::visitPre(DocHRef *href)
DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocHRef)}\n");
if (Config_getBool(RTF_HYPERLINKS))
{
- m_t << "{\\field "
- "{\\*\\fldinst "
- "{ HYPERLINK \"" << href->url() << "\" "
- "}{}"
- "}"
- "{\\fldrslt "
- "{\\cs37\\ul\\cf2 ";
-
+ if (href->url().startsWith("#CITEREF"))
+ {
+ // when starting with #CITEREF it is a doxygen generated "url"a
+ // so a local link
+ QCString cite;
+ cite = "citelist_" + href->url().right(href->url().length()-1);
+ m_t << "{\\field "
+ "{\\*\\fldinst "
+ "{ HYPERLINK \\\\l \"" << rtfFormatBmkStr(cite) << "\" "
+ "}{}"
+ "}"
+ "{\\fldrslt "
+ "{\\cs37\\ul\\cf2 ";
+ }
+ else
+ {
+ m_t << "{\\field "
+ "{\\*\\fldinst "
+ "{ HYPERLINK \"" << href->url() << "\" "
+ "}{}"
+ "}"
+ "{\\fldrslt "
+ "{\\cs37\\ul\\cf2 ";
+ }
}
else
{
@@ -1621,7 +1637,7 @@ void RTFDocVisitor::visitPre(DocXRefItem *x)
m_t << "{\\field "
"{\\*\\fldinst "
- "{ HYPERLINK \\\\l \"" << refName << "\" "
+ "{ HYPERLINK \\\\l \"" << rtfFormatBmkStr(refName) << "\" "
"}{}"
"}"
"{\\fldrslt "
diff --git a/src/rtfgen.cpp b/src/rtfgen.cpp
index 221b44c..1a11989 100644
--- a/src/rtfgen.cpp
+++ b/src/rtfgen.cpp
@@ -79,10 +79,20 @@ RTFGenerator::~RTFGenerator()
{
}
+void RTFGenerator::setRelativePath(const QCString &path)
+{
+ m_relPath = path;
+}
+
+void RTFGenerator::setSourceFileName(const QCString &name)
+{
+ m_sourceFileName = name;
+}
+
void RTFGenerator::writeStyleSheetFile(QFile &file)
{
FTextStream t(&file);
- t << "# Generated by doxygen " << getVersion() << "\n\n";
+ t << "# Generated by doxygen " << getDoxygenVersion() << "\n\n";
t << "# This file describes styles used for generating RTF output.\n";
t << "# All text after a hash (#) is considered a comment and will be ignored.\n";
t << "# Remove a hash to activate a line.\n\n";
@@ -99,7 +109,7 @@ void RTFGenerator::writeStyleSheetFile(QFile &file)
void RTFGenerator::writeExtensionsFile(QFile &file)
{
FTextStream t(&file);
- t << "# Generated by doxygen " << getVersion() << "\n\n";
+ t << "# Generated by doxygen " << getDoxygenVersion() << "\n\n";
t << "# This file describes extensions used for generating RTF output.\n";
t << "# All text after a hash (#) is considered a comment and will be ignored.\n";
t << "# Remove a hash to activate a line.\n\n";
@@ -358,6 +368,8 @@ void RTFGenerator::startFile(const char *name,const char *,const char *)
if (fileName.right(4)!=".rtf" ) fileName+=".rtf";
startPlainFile(fileName);
+ setRelativePath(m_relPath);
+ setSourceFileName(stripPath(fileName));
beginRTFDocument();
}
@@ -367,6 +379,7 @@ void RTFGenerator::endFile()
t << "}";
endPlainFile();
+ setSourceFileName("");
}
void RTFGenerator::startProjectNumber()
@@ -575,7 +588,7 @@ void RTFGenerator::endIndexSection(IndexSections is)
break;
case isTitlePageAuthor:
{
- t << " doxygen.}\n";
+ t << " doxygen" << getDoxygenVersion() << ".}\n";
t << "{\\creatim " << dateToRTFDateString() << "}\n}";
DBG_RTF(t << "{\\comment end of infoblock}\n");
// setup for this section
@@ -3024,12 +3037,33 @@ void RTFGenerator::endInlineMemberDoc()
t << "\\cell }{\\row }" << endl;
}
-void RTFGenerator::writeLineNumber(const char *,const char *,const char *,int l)
+void RTFGenerator::writeLineNumber(const char *ref,const char *fileName,const char *anchor,int l)
{
+ static bool rtfHyperlinks = Config_getBool(RTF_HYPERLINKS);
+
DoxyCodeLineOpen = TRUE;
QCString lineNumber;
lineNumber.sprintf("%05d",l);
- t << lineNumber << " ";
+ if (m_prettyCode)
+ {
+ if (fileName && !m_sourceFileName.isEmpty() && rtfHyperlinks)
+ {
+ QCString lineAnchor;
+ lineAnchor.sprintf("_l%05d",l);
+ lineAnchor.prepend(stripExtensionGeneral(m_sourceFileName, ".rtf"));
+ t << "{\\bkmkstart ";
+ t << rtfFormatBmkStr(lineAnchor);
+ t << "}";
+ t << "{\\bkmkend ";
+ t << rtfFormatBmkStr(lineAnchor);
+ t << "}" << endl;
+ }
+ t << lineNumber << " ";
+ }
+ else
+ {
+ t << l << " ";
+ }
m_col=0;
}
void RTFGenerator::startCodeLine(bool)
diff --git a/src/rtfgen.h b/src/rtfgen.h
index 1750a7b..9330b13 100644
--- a/src/rtfgen.h
+++ b/src/rtfgen.h
@@ -32,6 +32,8 @@ class RTFGenerator : public OutputGenerator
static void writeStyleSheetFile(QFile &f);
static void writeExtensionsFile(QFile &file);
+ void setRelativePath(const QCString &path);
+ void setSourceFileName(const QCString &sourceFileName);
void enable()
{ if (m_genStack->top()) m_active=*m_genStack->top(); else m_active=TRUE; }
void disable() { m_active=FALSE; }
@@ -279,6 +281,7 @@ class RTFGenerator : public OutputGenerator
const char *rtf_Code_DepthStyle();
void incrementIndentLevel();
void decrementIndentLevel();
+ QCString m_sourceFileName;
int m_col;
bool m_prettyCode;
diff --git a/src/searchindex.cpp b/src/searchindex.cpp
index e090717..0e3ef44 100644
--- a/src/searchindex.cpp
+++ b/src/searchindex.cpp
@@ -982,7 +982,7 @@ void writeJavaScriptSearchIndex()
" \"https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">" << endl;
t << "<html><head><title></title>" << endl;
t << "<meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\"/>" << endl;
- t << "<meta name=\"generator\" content=\"Doxygen " << getVersion() << "\"/>" << endl;
+ t << "<meta name=\"generator\" content=\"Doxygen " << getDoxygenVersion() << "\"/>" << endl;
t << "<link rel=\"stylesheet\" type=\"text/css\" href=\"search.css\"/>" << endl;
t << "<script type=\"text/javascript\" src=\"" << baseName << ".js\"></script>" << endl;
t << "<script type=\"text/javascript\" src=\"search.js\"></script>" << endl;
@@ -1007,6 +1007,12 @@ void writeJavaScriptSearchIndex()
t << "document.getElementById(\"NoMatches\").style.display=\"none\";" << endl;
t << "var searchResults = new SearchResults(\"searchResults\");" << endl;
t << "searchResults.Search();" << endl;
+ t << "window.addEventListener(\"message\", function(event) {" << endl;
+ t << " if (event.data == \"take_focus\") {" << endl;
+ t << " var elem = searchResults.NavNext(0);" << endl;
+ t << " if (elem) elem.focus();" << endl;
+ t << " }" << endl;
+ t << "});" << endl;
t << "/* @license-end */\n";
t << "--></script>" << endl;
t << "</div>" << endl; // SRIndex
diff --git a/src/tagreader.cpp b/src/tagreader.cpp
index 3640f0e..275d66a 100644
--- a/src/tagreader.cpp
+++ b/src/tagreader.cpp
@@ -1,13 +1,13 @@
/******************************************************************************
*
- *
+ *
*
*
* Copyright (C) 1997-2015 by Dimitri van Heesch.
*
* Permission to use, copy, modify, and distribute this software and its
- * documentation under the terms of the GNU General Public License is hereby
- * granted. No representations are made about the suitability of this software
+ * documentation under the terms of the GNU General Public License is hereby
+ * granted. No representations are made about the suitability of this software
* for any purpose. It is provided "as is" without express or implied warranty.
* See the GNU General Public License for more details.
*
@@ -50,7 +50,7 @@ class TagAnchorInfo
public:
TagAnchorInfo(const QCString &f,
const QCString &l,
- const QCString &t=QCString())
+ const QCString &t=QCString())
: label(l), fileName(f), title(t) {}
QCString label;
QCString fileName;
@@ -60,7 +60,7 @@ class TagAnchorInfo
/** List of TagAnchorInfo objects. */
class TagAnchorInfoList : public QList<TagAnchorInfo>
{
- public:
+ public:
TagAnchorInfoList() : QList<TagAnchorInfo>() { setAutoDelete(TRUE); }
virtual ~TagAnchorInfoList() {}
};
@@ -79,7 +79,7 @@ class TagEnumValueInfo
class TagMemberInfo
{
public:
- TagMemberInfo() : prot(Public), virt(Normal), isStatic(FALSE)
+ TagMemberInfo() : prot(Public), virt(Normal), isStatic(FALSE)
{ enumValues.setAutoDelete(TRUE); }
QCString type;
QCString name;
@@ -91,7 +91,7 @@ class TagMemberInfo
TagAnchorInfoList docAnchors;
Protection prot;
Specifier virt;
- bool isStatic;
+ bool isStatic;
QList<TagEnumValueInfo> enumValues;
};
@@ -207,10 +207,10 @@ class TagDirInfo
TagAnchorInfoList docAnchors;
};
-/** Tag file parser.
+/** Tag file parser.
*
* Reads an XML-structured tagfile and builds up the structure in
- * memory. The method buildLists() is used to transfer/translate
+ * memory. The method buildLists() is used to transfer/translate
* the structures to the doxygen engine.
*/
class TagFileParser : public QXmlDefaultHandler
@@ -229,7 +229,7 @@ class TagFileParser : public QXmlDefaultHandler
};
class StartElementHandler
{
- typedef void (TagFileParser::*Handler)(const QXmlAttributes &attrib);
+ typedef void (TagFileParser::*Handler)(const QXmlAttributes &attrib);
public:
StartElementHandler(TagFileParser *parent, Handler h) : m_parent(parent), m_handler(h) {}
void operator()(const QXmlAttributes &attrib) { (m_parent->*m_handler)(attrib); }
@@ -240,7 +240,7 @@ class TagFileParser : public QXmlDefaultHandler
class EndElementHandler
{
- typedef void (TagFileParser::*Handler)();
+ typedef void (TagFileParser::*Handler)();
public:
EndElementHandler(TagFileParser *parent, Handler h) : m_parent(parent), m_handler(h) {}
void operator()() { (m_parent->*m_handler)(); }
@@ -282,7 +282,7 @@ class TagFileParser : public QXmlDefaultHandler
void warn(const char *fmt)
{
- ::warn(m_inputFileName,m_locator->lineNumber(),fmt);
+ ::warn(m_inputFileName,m_locator->lineNumber(),"%s", fmt);
}
void warn(const char *fmt,const char *s)
{
@@ -391,7 +391,7 @@ class TagFileParser : public QXmlDefaultHandler
}
if (isObjC=="yes" && m_curClass)
{
- m_curClass->isObjC = TRUE;
+ m_curClass->isObjC = TRUE;
}
}
@@ -399,20 +399,20 @@ class TagFileParser : public QXmlDefaultHandler
{
switch (m_state)
{
- case InClass: m_tagFileClasses.append(m_curClass);
- m_curClass=0; break;
- case InFile: m_tagFileFiles.append(m_curFile);
- m_curFile=0; break;
- case InNamespace: m_tagFileNamespaces.append(m_curNamespace);
- m_curNamespace=0; break;
- case InGroup: m_tagFileGroups.append(m_curGroup);
- m_curGroup=0; break;
- case InPage: m_tagFilePages.append(m_curPage);
- m_curPage=0; break;
+ case InClass: m_tagFileClasses.append(m_curClass);
+ m_curClass=0; break;
+ case InFile: m_tagFileFiles.append(m_curFile);
+ m_curFile=0; break;
+ case InNamespace: m_tagFileNamespaces.append(m_curNamespace);
+ m_curNamespace=0; break;
+ case InGroup: m_tagFileGroups.append(m_curGroup);
+ m_curGroup=0; break;
+ case InPage: m_tagFilePages.append(m_curPage);
+ m_curPage=0; break;
case InDir: m_tagFileDirs.append(m_curDir);
m_curDir=0; break;
- case InPackage: m_tagFilePackages.append(m_curPackage);
- m_curPackage=0; break;
+ case InPackage: m_tagFilePackages.append(m_curPackage);
+ m_curPackage=0; break;
default:
warn("tag 'compound' was not expected!");
}
@@ -460,7 +460,7 @@ class TagFileParser : public QXmlDefaultHandler
case InNamespace: m_curNamespace->members.append(m_curMember); break;
case InGroup: m_curGroup->members.append(m_curMember); break;
case InPackage: m_curPackage->members.append(m_curMember); break;
- default: warn("Unexpected tag 'member' found"); break;
+ default: warn("Unexpected tag 'member' found"); break;
}
}
@@ -484,7 +484,7 @@ class TagFileParser : public QXmlDefaultHandler
void endEnumValue()
{
- m_curEnumValue->name = m_curString.stripWhiteSpace();
+ m_curEnumValue->name = m_curString.stripWhiteSpace();
m_state = *m_stateStack.top();
m_stateStack.remove();
if (m_state==InMember)
@@ -536,7 +536,7 @@ class TagFileParser : public QXmlDefaultHandler
case InNamespace: m_curNamespace->classList.append(m_curString); break;
case InGroup: m_curGroup->classList.append(m_curString); break;
case InPackage: m_curPackage->classList.append(m_curString); break;
- default: warn("Unexpected tag 'class' found"); break;
+ default: warn("Unexpected tag 'class' found"); break;
}
}
@@ -547,7 +547,7 @@ class TagFileParser : public QXmlDefaultHandler
case InNamespace: m_curNamespace->classList.append(m_curString); break;
case InFile: m_curFile->namespaceList.append(m_curString); break;
case InGroup: m_curGroup->namespaceList.append(m_curString); break;
- default: warn("Unexpected tag 'namespace' found"); break;
+ default: warn("Unexpected tag 'namespace' found"); break;
}
}
@@ -557,7 +557,7 @@ class TagFileParser : public QXmlDefaultHandler
{
case InGroup: m_curGroup->fileList.append(m_curString); break;
case InDir: m_curDir->fileList.append(m_curString); break;
- default: warn("Unexpected tag 'file' found"); break;
+ default: warn("Unexpected tag 'file' found"); break;
}
}
@@ -566,7 +566,7 @@ class TagFileParser : public QXmlDefaultHandler
switch(m_state)
{
case InGroup: m_curGroup->fileList.append(m_curString); break;
- default: warn("Unexpected tag 'page' found"); break;
+ default: warn("Unexpected tag 'page' found"); break;
}
}
@@ -575,7 +575,7 @@ class TagFileParser : public QXmlDefaultHandler
switch(m_state)
{
case InDir: m_curDir->subdirList.append(m_curString); break;
- default: warn("Unexpected tag 'dir' found"); break;
+ default: warn("Unexpected tag 'dir' found"); break;
}
}
@@ -595,7 +595,7 @@ class TagFileParser : public QXmlDefaultHandler
{
if (m_state==InMember)
{
- m_curMember->type = m_curString;
+ m_curMember->type = m_curString;
}
else
{
@@ -615,7 +615,7 @@ class TagFileParser : public QXmlDefaultHandler
case InDir: m_curDir->name = m_curString; break;
case InMember: m_curMember->name = m_curString; break;
case InPackage: m_curPackage->name = m_curString; break;
- default: warn("Unexpected tag 'name' found"); break;
+ default: warn("Unexpected tag 'name' found"); break;
}
}
@@ -687,7 +687,7 @@ class TagFileParser : public QXmlDefaultHandler
{
if (m_state==InClass && m_curClass)
{
- if (m_curClass->templateArguments==0)
+ if (m_curClass->templateArguments==0)
{
m_curClass->templateArguments = new QList<QCString>;
m_curClass->templateArguments->setAutoDelete(TRUE);
@@ -711,7 +711,7 @@ class TagFileParser : public QXmlDefaultHandler
case InPage: m_curPage->filename = m_curString; break;
case InPackage: m_curPackage->filename = m_curString; break;
case InDir: m_curDir->filename = m_curString; break;
- default: warn("Unexpected tag 'filename' found"); break;
+ default: warn("Unexpected tag 'filename' found"); break;
}
}
@@ -721,19 +721,19 @@ class TagFileParser : public QXmlDefaultHandler
{
case InFile: m_curFile->path = m_curString; break;
case InDir: m_curDir->path = m_curString; break;
- default: warn("Unexpected tag 'path' found"); break;
+ default: warn("Unexpected tag 'path' found"); break;
}
}
-
+
void endAnchor()
{
if (m_state==InMember)
{
- m_curMember->anchor = m_curString;
+ m_curMember->anchor = m_curString;
}
else if (m_state==InClass)
{
- m_curClass->anchor = m_curString;
+ m_curClass->anchor = m_curString;
}
else
{
@@ -745,7 +745,7 @@ class TagFileParser : public QXmlDefaultHandler
{
if (m_state==InMember)
{
- m_curMember->clangId = m_curString;
+ m_curMember->clangId = m_curString;
}
else if (m_state==InClass)
{
@@ -762,24 +762,24 @@ class TagFileParser : public QXmlDefaultHandler
}
-
+
void endAnchorFile()
{
if (m_state==InMember)
{
- m_curMember->anchorFile = m_curString;
+ m_curMember->anchorFile = m_curString;
}
else
{
warn("Unexpected tag 'anchorfile' found");
}
}
-
+
void endArglist()
{
if (m_state==InMember)
{
- m_curMember->arglist = m_curString;
+ m_curMember->arglist = m_curString;
}
else
{
@@ -792,7 +792,7 @@ class TagFileParser : public QXmlDefaultHandler
{
case InGroup: m_curGroup->title = m_curString; break;
case InPage: m_curPage->title = m_curString; break;
- default: warn("Unexpected tag 'title' found"); break;
+ default: warn("Unexpected tag 'title' found"); break;
}
}
@@ -888,7 +888,7 @@ class TagFileParser : public QXmlDefaultHandler
return TRUE;
}
- bool startElement( const QString&, const QString&,
+ bool startElement( const QString&, const QString&,
const QString&name, const QXmlAttributes& attrib )
{
//printf("startElement '%s'\n",name.data());
@@ -897,7 +897,7 @@ class TagFileParser : public QXmlDefaultHandler
{
(*handler)(attrib);
}
- else
+ else
{
warn("Unknown tag '%s' found!",name.data());
}
@@ -912,14 +912,14 @@ class TagFileParser : public QXmlDefaultHandler
{
(*handler)();
}
- else
+ else
{
warn("Unknown tag '%s' found!",name.data());
}
return TRUE;
}
- bool characters ( const QString & ch )
+ bool characters ( const QString & ch )
{
m_curString+=ch.utf8();
return TRUE;
@@ -928,7 +928,7 @@ class TagFileParser : public QXmlDefaultHandler
void dump();
void buildLists(const std::shared_ptr<Entry> &root);
void addIncludes();
-
+
private:
void buildMemberList(const std::shared_ptr<Entry> &ce,QList<TagMemberInfo> &members);
void addDocAnchors(const std::shared_ptr<Entry> &e,const TagAnchorInfoList &l);
@@ -961,7 +961,7 @@ class TagFileParser : public QXmlDefaultHandler
QCString m_inputFileName;
};
-/** Error handler for the XML tag file parser.
+/** Error handler for the XML tag file parser.
*
* Basically dumps all fatal error to stderr using err().
*/
@@ -1026,8 +1026,8 @@ void TagFileParser::dump()
msg("namespace '%s'\n",nd->name.data());
msg(" filename '%s'\n",nd->filename.data());
QCStringList::Iterator it;
- for ( it = nd->classList.begin();
- it != nd->classList.end(); ++it )
+ for ( it = nd->classList.begin();
+ it != nd->classList.end(); ++it )
{
msg( " class: %s \n", (*it).data() );
}
@@ -1051,13 +1051,13 @@ void TagFileParser::dump()
msg("file '%s'\n",fd->name.data());
msg(" filename '%s'\n",fd->filename.data());
QCStringList::Iterator it;
- for ( it = fd->namespaceList.begin();
- it != fd->namespaceList.end(); ++it )
+ for ( it = fd->namespaceList.begin();
+ it != fd->namespaceList.end(); ++it )
{
msg( " namespace: %s \n", (*it).data() );
}
- for ( it = fd->classList.begin();
- it != fd->classList.end(); ++it )
+ for ( it = fd->classList.begin();
+ it != fd->classList.end(); ++it )
{
msg( " class: %s \n", (*it).data() );
}
@@ -1089,28 +1089,28 @@ void TagFileParser::dump()
msg("group '%s'\n",gd->name.data());
msg(" filename '%s'\n",gd->filename.data());
QCStringList::Iterator it;
- for ( it = gd->namespaceList.begin();
- it != gd->namespaceList.end(); ++it )
+ for ( it = gd->namespaceList.begin();
+ it != gd->namespaceList.end(); ++it )
{
msg( " namespace: %s \n", (*it).data() );
}
- for ( it = gd->classList.begin();
- it != gd->classList.end(); ++it )
+ for ( it = gd->classList.begin();
+ it != gd->classList.end(); ++it )
{
msg( " class: %s \n", (*it).data() );
}
- for ( it = gd->fileList.begin();
- it != gd->fileList.end(); ++it )
+ for ( it = gd->fileList.begin();
+ it != gd->fileList.end(); ++it )
{
msg( " file: %s \n", (*it).data() );
}
- for ( it = gd->subgroupList.begin();
- it != gd->subgroupList.end(); ++it )
+ for ( it = gd->subgroupList.begin();
+ it != gd->subgroupList.end(); ++it )
{
msg( " subgroup: %s \n", (*it).data() );
}
- for ( it = gd->pageList.begin();
- it != gd->pageList.end(); ++it )
+ for ( it = gd->pageList.begin();
+ it != gd->pageList.end(); ++it )
{
msg( " page: %s \n", (*it).data() );
}
@@ -1143,13 +1143,13 @@ void TagFileParser::dump()
msg("dir '%s'\n",dd->name.data());
msg(" path '%s'\n",dd->path.data());
QCStringList::Iterator it;
- for ( it = dd->fileList.begin();
- it != dd->fileList.end(); ++it )
+ for ( it = dd->fileList.begin();
+ it != dd->fileList.end(); ++it )
{
msg( " file: %s \n", (*it).data() );
}
- for ( it = dd->subdirList.begin();
- it != dd->subdirList.end(); ++it )
+ for ( it = dd->subdirList.begin();
+ it != dd->subdirList.end(); ++it )
{
msg( " subdir: %s \n", (*it).data() );
}
@@ -1310,7 +1310,7 @@ static QCString stripPath(const QCString &s)
}
/*! Injects the info gathered by the XML parser into the Entry tree.
- * This tree contains the information extracted from the input in a
+ * This tree contains the information extracted from the input in a
* "unrelated" form.
*/
void TagFileParser::buildLists(const std::shared_ptr<Entry> &root)
@@ -1561,5 +1561,3 @@ void parseTagFile(const std::shared_ptr<Entry> &root,const char *fullName)
handler.addIncludes();
//handler.dump();
}
-
-
diff --git a/src/util.cpp b/src/util.cpp
index ad0d735..bcc32f3 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -1,11 +1,11 @@
/*****************************************************************************
- *
+ *
*
* Copyright (C) 1997-2015 by Dimitri van Heesch.
*
* Permission to use, copy, modify, and distribute this software and its
- * documentation under the terms of the GNU General Public License is hereby
- * granted. No representations are made about the suitability of this software
+ * documentation under the terms of the GNU General Public License is hereby
+ * granted. No representations are made about the suitability of this software
* for any purpose. It is provided "as is" without express or implied warranty.
* See the GNU General Public License for more details.
*
@@ -19,6 +19,8 @@
#include <errno.h>
#include <math.h>
#include <limits.h>
+#include <cinttypes>
+
#include "md5.h"
@@ -84,7 +86,7 @@
#define ALGO_COUNT 1
#define ALGO_CRC16 2
#define ALGO_MD5 3
-
+
//#define MAP_ALGO ALGO_COUNT
//#define MAP_ALGO ALGO_CRC16
#define MAP_ALGO ALGO_MD5
@@ -95,12 +97,12 @@
// TextGeneratorOLImpl implementation
//------------------------------------------------------------------------
-TextGeneratorOLImpl::TextGeneratorOLImpl(OutputDocInterface &od) : m_od(od)
+TextGeneratorOLImpl::TextGeneratorOLImpl(OutputDocInterface &od) : m_od(od)
{
}
void TextGeneratorOLImpl::writeString(const char *s,bool keepSpaces) const
-{
+{
if (s==0) return;
//printf("TextGeneratorOlImpl::writeString('%s',%d)\n",s,keepSpaces);
if (keepSpaces)
@@ -113,19 +115,19 @@ void TextGeneratorOLImpl::writeString(const char *s,bool keepSpaces) const
cs[1]='\0';
while ((c=*p++))
{
- if (c==' ') m_od.writeNonBreakableSpace(1);
+ if (c==' ') m_od.writeNonBreakableSpace(1);
else cs[0]=c,m_od.docify(cs);
}
}
}
else
{
- m_od.docify(s);
+ m_od.docify(s);
}
}
void TextGeneratorOLImpl::writeBreak(int indent) const
-{
+{
m_od.lineBreak("typebreak");
int i;
for (i=0;i<indent;i++)
@@ -146,9 +148,9 @@ void TextGeneratorOLImpl::writeLink(const char *extRef,const char *file,
//------------------------------------------------------------------------
// an inheritance tree of depth of 100000 should be enough for everyone :-)
-const int maxInheritanceDepth = 100000;
+const int maxInheritanceDepth = 100000;
-/*!
+/*!
Removes all anonymous scopes from string s
Possible examples:
\verbatim
@@ -177,9 +179,9 @@ QCString removeAnonymousScopes(const QCString &s)
while (c<i+l && s.at(c)!='@') if (s.at(c++)==':') b1=TRUE;
c=i+l-1;
while (c>=i && s.at(c)!='@') if (s.at(c--)==':') b2=TRUE;
- if (b1 && b2)
- {
- result+="::";
+ if (b1 && b2)
+ {
+ result+="::";
}
p=i+l;
}
@@ -248,7 +250,7 @@ done:
void writePageRef(OutputDocInterface &od,const char *cn,const char *mn)
{
od.pushGeneratorState();
-
+
od.disable(OutputGenerator::Html);
od.disable(OutputGenerator::Man);
od.disable(OutputGenerator::Docbook);
@@ -275,7 +277,7 @@ QCString generateMarker(int id)
static QCString stripFromPath(const QCString &path,QStrList &l)
{
- // look at all the strings in the list and strip the longest match
+ // look at all the strings in the list and strip the longest match
const char *s=l.first();
QCString potential;
unsigned int length = 0;
@@ -311,7 +313,7 @@ QCString stripFromIncludePath(const QCString &path)
}
/*! try to determine if \a name is a source or a header file name by looking
- * at the extension. A number of variations is allowed in both upper and
+ * at the extension. A number of variations is allowed in both upper and
* lower case) If anyone knows or uses another extension please let me know :-)
*/
int guessSection(const char *name)
@@ -331,7 +333,7 @@ int guessSection(const char *name)
n.right(4)==".i++" ||
n.right(4)==".inl" ||
n.right(4)==".xml" ||
- n.right(4)==".sql"
+ n.right(4)==".sql"
) return Entry::SOURCE_SEC;
if (n.right(2)==".h" || // header
n.right(3)==".hh" ||
@@ -352,7 +354,7 @@ QCString resolveTypeDef(const Definition *context,const QCString &qualifiedName,
//printf("<<resolveTypeDef(%s,%s)\n",
// context ? context->name().data() : "<none>",qualifiedName.data());
QCString result;
- if (qualifiedName.isEmpty())
+ if (qualifiedName.isEmpty())
{
//printf(" qualified name empty!\n");
return result;
@@ -379,7 +381,7 @@ QCString resolveTypeDef(const Definition *context,const QCString &qualifiedName,
{
// step 1: get the right scope
const Definition *resScope=mContext;
- if (scopeIndex!=-1)
+ if (scopeIndex!=-1)
{
// split-off scope part
QCString resScopeName = qualifiedName.left(scopeIndex);
@@ -400,9 +402,9 @@ QCString resolveTypeDef(const Definition *context,const QCString &qualifiedName,
}
}
//printf("resScope=%s\n",resScope?resScope->name().data():"<none>");
-
+
// step 2: get the member
- if (resScope) // no scope or scope found in the current context
+ if (resScope) // no scope or scope found in the current context
{
//printf("scope found: %s, look for typedef %s\n",
// resScope->qualifiedName().data(),resName.data());
@@ -424,7 +426,7 @@ QCString resolveTypeDef(const Definition *context,const QCString &qualifiedName,
for (;(tmd=mni.current());++mni)
{
//printf("Found member %s resScope=%s outerScope=%s mContext=%p\n",
- // tmd->name().data(), resScope->name().data(),
+ // tmd->name().data(), resScope->name().data(),
// tmd->getOuterScope()->name().data(), mContext);
if (tmd->isTypedef() /*&& tmd->getOuterScope()==resScope*/)
{
@@ -465,11 +467,11 @@ QCString resolveTypeDef(const Definition *context,const QCString &qualifiedName,
// qualifiedName.data(),context ? context->name().data() : "<global>");
}
return result;
-
+
}
-/*! Get a class definition given its name.
+/*! Get a class definition given its name.
* Returns 0 if the class is not found.
*/
ClassDef *getClass(const char *n)
@@ -532,7 +534,7 @@ int isAccessibleFromWithExpScope(const Definition *scope,const FileDef *fileScop
* within file \a fileScope.
*
* Example: typedef A T; will return the class representing A if it is a class.
- *
+ *
* Example: typedef int T; will return 0, since "int" is not a class.
*/
const ClassDef *newResolveTypedef(const FileDef *fileScope,
@@ -560,7 +562,7 @@ const ClassDef *newResolveTypedef(const FileDef *fileScope,
if (g_resolvedTypedefs.find(qname)) return 0; // typedef already done
g_resolvedTypedefs.insert(qname,md); // put on the trace list
-
+
const ClassDef *typeClass = md->getClassDef();
QCString type = md->typeString(); // get the "value" of the typedef
if (typeClass && typeClass->isTemplate() &&
@@ -572,7 +574,7 @@ const ClassDef *newResolveTypedef(const FileDef *fileScope,
QCString typedefValue = type;
int tl=type.length();
int ip=tl-1; // remove * and & at the end
- while (ip>=0 && (type.at(ip)=='*' || type.at(ip)=='&' || type.at(ip)==' '))
+ while (ip>=0 && (type.at(ip)=='*' || type.at(ip)=='&' || type.at(ip)==' '))
{
ip--;
}
@@ -587,7 +589,7 @@ const ClassDef *newResolveTypedef(const FileDef *fileScope,
const ClassDef *result = getResolvedClassRec(md->getOuterScope(),
fileScope,type,&memTypeDef,0,pResolvedType);
// if type is a typedef then return what it resolves to.
- if (memTypeDef && memTypeDef->isTypedef())
+ if (memTypeDef && memTypeDef->isTypedef())
{
result=newResolveTypedef(fileScope,memTypeDef,pMemType,pTemplSpec);
goto done;
@@ -647,8 +649,8 @@ done:
}
// remember computed value for next time
- if (result && result->getDefFileName()!="<code>")
- // this check is needed to prevent that temporary classes that are
+ if (result && result->getDefFileName()!="<code>")
+ // this check is needed to prevent that temporary classes that are
// introduced while parsing code fragments are being cached here.
{
//printf("setting cached typedef %p in result %p\n",md,result);
@@ -659,9 +661,9 @@ done:
pResolvedType ? *pResolvedType : QCString()
);
}
-
+
g_resolvedTypedefs.remove(qname); // remove from the trace list
-
+
return result;
}
@@ -696,11 +698,11 @@ static QCString substTypedef(const Definition *scope,const FileDef *fileScope,co
{
// test accessibility of typedef within scope.
int distance = isAccessibleFromWithExpScope(scope,fileScope,d,"");
- if (distance!=-1 && distance<minDistance)
+ if (distance!=-1 && distance<minDistance)
// definition is accessible and a better match
{
minDistance=distance;
- bestMatch = md;
+ bestMatch = md;
}
}
}
@@ -715,18 +717,18 @@ static QCString substTypedef(const Definition *scope,const FileDef *fileScope,co
{
// test accessibility of typedef within scope.
int distance = isAccessibleFromWithExpScope(scope,fileScope,d,"");
- if (distance!=-1) // definition is accessible
+ if (distance!=-1) // definition is accessible
{
- bestMatch = md;
+ bestMatch = md;
}
}
}
- if (bestMatch)
+ if (bestMatch)
{
result = bestMatch->typeString();
if (pTypeDef) *pTypeDef=bestMatch;
}
-
+
//printf("substTypedef(%s,%s)=%s\n",scope?scope->name().data():"<global>",
// name.data(),result.data());
return result;
@@ -750,8 +752,8 @@ static const Definition *endOfPathIsUsedClass(const SDict<Definition> *cl,const
}
/*! Starting with scope \a start, the string \a path is interpreted as
- * a part of a qualified scope name (e.g. A::B::C), and the scope is
- * searched. If found the scope definition is returned, otherwise 0
+ * a part of a qualified scope name (e.g. A::B::C), and the scope is
+ * searched. If found the scope definition is returned, otherwise 0
* is returned.
*/
static const Definition *followPath(const Definition *start,const FileDef *fileScope,const QCString &path)
@@ -782,7 +784,7 @@ static const Definition *followPath(const Definition *start,const FileDef *fileS
// qualScopePart.data(),
// current->name().data(),
// next?next->name().data():"<null>");
- if (next==0) // failed to follow the path
+ if (next==0) // failed to follow the path
{
//printf("==> next==0!\n");
if (current->definitionType()==Definition::TypeNamespace)
@@ -817,7 +819,7 @@ bool accessibleViaUsingClass(const SDict<Definition> *cl,
)
{
//printf("accessibleViaUsingClass(%p)\n",cl);
- if (cl) // see if the class was imported via a using statement
+ if (cl) // see if the class was imported via a using statement
{
SDict<Definition>::Iterator cli(*cl);
Definition *ucd;
@@ -826,7 +828,7 @@ bool accessibleViaUsingClass(const SDict<Definition> *cl,
{
//printf("Trying via used class %s\n",ucd->name().data());
const Definition *sc = explicitScopePartEmpty ? ucd : followPath(ucd,fileScope,explicitScopePart);
- if (sc && sc==item) return TRUE;
+ if (sc && sc==item) return TRUE;
//printf("Try via used class done\n");
}
}
@@ -849,10 +851,10 @@ bool accessibleViaUsingNamespace(const NamespaceSDict *nl,
//printf("[Trying via used namespace %s: count=%d/%d\n",und->name().data(),
// count,nl->count());
const Definition *sc = explicitScopePart.isEmpty() ? und : followPath(und,fileScope,explicitScopePart);
- if (sc && item->getOuterScope()==sc)
+ if (sc && item->getOuterScope()==sc)
{
//printf("] found it\n");
- return TRUE;
+ return TRUE;
}
if (item->getLanguage()==SrcLangExt_Cpp)
{
@@ -916,7 +918,7 @@ class AccessStack
for (i=0;i<m_index;i++)
{
AccessElem *e = &m_elements[i];
- if (e->scope==scope && e->fileScope==fileScope && e->item==item)
+ if (e->scope==scope && e->fileScope==fileScope && e->item==item)
{
return TRUE;
}
@@ -929,7 +931,7 @@ class AccessStack
for (i=0;i<m_index;i++)
{
AccessElem *e = &m_elements[i];
- if (e->scope==scope && e->fileScope==fileScope && e->item==item && e->expScope==expScope)
+ if (e->scope==scope && e->fileScope==fileScope && e->item==item && e->expScope==expScope)
{
return TRUE;
}
@@ -951,7 +953,7 @@ class AccessStack
};
/* Returns the "distance" (=number of levels up) from item to scope, or -1
- * if item in not inside scope.
+ * if item in not inside scope.
*/
int isAccessibleFrom(const Definition *scope,const FileDef *fileScope,const Definition *item)
{
@@ -969,20 +971,20 @@ int isAccessibleFrom(const Definition *scope,const FileDef *fileScope,const Defi
int i;
Definition *itemScope=item->getOuterScope();
- bool memberAccessibleFromScope =
+ bool memberAccessibleFromScope =
(item->definitionType()==Definition::TypeMember && // a member
itemScope && itemScope->definitionType()==Definition::TypeClass && // of a class
scope->definitionType()==Definition::TypeClass && // accessible
(dynamic_cast<const ClassDef*>(scope))->isAccessibleMember(dynamic_cast<const MemberDef *>(item)) // from scope
);
- bool nestedClassInsideBaseClass =
+ bool nestedClassInsideBaseClass =
(item->definitionType()==Definition::TypeClass && // a nested class
- itemScope && itemScope->definitionType()==Definition::TypeClass && // inside a base
+ itemScope && itemScope->definitionType()==Definition::TypeClass && // inside a base
scope->definitionType()==Definition::TypeClass && // class of scope
- (dynamic_cast<const ClassDef*>(scope))->isBaseClass(dynamic_cast<ClassDef*>(itemScope),TRUE)
+ (dynamic_cast<const ClassDef*>(scope))->isBaseClass(dynamic_cast<ClassDef*>(itemScope),TRUE)
);
- if (itemScope==scope || memberAccessibleFromScope || nestedClassInsideBaseClass)
+ if (itemScope==scope || memberAccessibleFromScope || nestedClassInsideBaseClass)
{
//printf("> found it\n");
if (nestedClassInsideBaseClass) result++; // penalty for base class to prevent
@@ -994,13 +996,13 @@ int isAccessibleFrom(const Definition *scope,const FileDef *fileScope,const Defi
if (fileScope)
{
SDict<Definition> *cl = fileScope->getUsedClasses();
- if (accessibleViaUsingClass(cl,fileScope,item))
+ if (accessibleViaUsingClass(cl,fileScope,item))
{
//printf("> found via used class\n");
goto done;
}
NamespaceSDict *nl = fileScope->getUsedNamespaces();
- if (accessibleViaUsingNamespace(nl,fileScope,item))
+ if (accessibleViaUsingNamespace(nl,fileScope,item))
{
//printf("> found via used namespace\n");
goto done;
@@ -1017,13 +1019,13 @@ int isAccessibleFrom(const Definition *scope,const FileDef *fileScope,const Defi
const NamespaceDef *nscope = dynamic_cast<const NamespaceDef*>(scope);
//printf(" %s is namespace with %d used classes\n",nscope->name().data(),nscope->getUsedClasses());
const SDict<Definition> *cl = nscope->getUsedClasses();
- if (accessibleViaUsingClass(cl,fileScope,item))
+ if (accessibleViaUsingClass(cl,fileScope,item))
{
//printf("> found via used class\n");
goto done;
}
const NamespaceSDict *nl = nscope->getUsedNamespaces();
- if (accessibleViaUsingNamespace(nl,fileScope,item))
+ if (accessibleViaUsingNamespace(nl,fileScope,item))
{
//printf("> found via used namespace\n");
goto done;
@@ -1050,10 +1052,10 @@ done:
* class B { public: class J {}; };
*
* - Looking for item=='J' inside scope=='B' will return 0.
- * - Looking for item=='I' inside scope=='B' will return -1
+ * - Looking for item=='I' inside scope=='B' will return -1
* (as it is not found in B nor in the global scope).
- * - Looking for item=='A::I' inside scope=='B', first the match B::A::I is tried but
- * not found and then A::I is searched in the global scope, which matches and
+ * - Looking for item=='A::I' inside scope=='B', first the match B::A::I is tried but
+ * not found and then A::I is searched in the global scope, which matches and
* thus the result is 1.
*/
int isAccessibleFromWithExpScope(const Definition *scope,const FileDef *fileScope,
@@ -1097,7 +1099,7 @@ int isAccessibleFromWithExpScope(const Definition *scope,const FileDef *fileScop
(dynamic_cast<const ClassDef*>(newScope))->isBaseClass(dynamic_cast<const ClassDef*>(itemScope),TRUE,0)
)
{
- // inheritance is also ok. Example: looking for B::I, where
+ // inheritance is also ok. Example: looking for B::I, where
// class A { public: class I {} };
// class B : public A {}
// but looking for B::I, where
@@ -1172,7 +1174,7 @@ int isAccessibleFromWithExpScope(const Definition *scope,const FileDef *fileScop
{
const NamespaceDef *nscope = dynamic_cast<const NamespaceDef*>(scope);
const NamespaceSDict *nl = nscope->getUsedNamespaces();
- if (accessibleViaUsingNamespace(nl,fileScope,item,explicitScopePart))
+ if (accessibleViaUsingNamespace(nl,fileScope,item,explicitScopePart))
{
//printf("> found in used namespace\n");
goto done;
@@ -1183,7 +1185,7 @@ int isAccessibleFromWithExpScope(const Definition *scope,const FileDef *fileScop
if (fileScope)
{
const NamespaceSDict *nl = fileScope->getUsedNamespaces();
- if (accessibleViaUsingNamespace(nl,fileScope,item,explicitScopePart))
+ if (accessibleViaUsingNamespace(nl,fileScope,item,explicitScopePart))
{
//printf("> found in used namespace\n");
goto done;
@@ -1216,7 +1218,7 @@ int computeQualifiedIndex(const QCString &name)
static void getResolvedSymbol(const Definition *scope,
const FileDef *fileScope,
- Definition *d,
+ Definition *d,
const QCString &explicitScopePart,
ArgumentList *actTemplParams,
int &minDistance,
@@ -1231,8 +1233,8 @@ static void getResolvedSymbol(const Definition *scope,
// only look at classes and members that are enums or typedefs
if (d->definitionType()==Definition::TypeClass ||
- (d->definitionType()==Definition::TypeMember &&
- ((dynamic_cast<MemberDef*>(d))->isTypedef() || (dynamic_cast<MemberDef*>(d))->isEnumerate())
+ (d->definitionType()==Definition::TypeMember &&
+ ((dynamic_cast<MemberDef*>(d))->isTypedef() || (dynamic_cast<MemberDef*>(d))->isEnumerate())
)
)
{
@@ -1248,23 +1250,23 @@ static void getResolvedSymbol(const Definition *scope,
ClassDef *cd = dynamic_cast<ClassDef *>(d);
//printf("cd=%s\n",cd->name().data());
if (!cd->isTemplateArgument()) // skip classes that
- // are only there to
- // represent a template
+ // are only there to
+ // represent a template
// argument
{
//printf("is not a templ arg\n");
if (distance<minDistance) // found a definition that is "closer"
{
minDistance=distance;
- bestMatch = cd;
+ bestMatch = cd;
bestTypedef = 0;
bestTemplSpec.resize(0);
bestResolvedType = cd->qualifiedName();
}
else if (distance==minDistance &&
fileScope && bestMatch &&
- fileScope->getUsedNamespaces() &&
- d->getOuterScope()->definitionType()==Definition::TypeNamespace &&
+ fileScope->getUsedNamespaces() &&
+ d->getOuterScope()->definitionType()==Definition::TypeNamespace &&
bestMatch->getOuterScope()==Doxygen::globalScope
)
{
@@ -1277,7 +1279,7 @@ static void getResolvedSymbol(const Definition *scope,
// Just a non-perfect heuristic but it could help in some situations
// (kdecore code is an example).
minDistance=distance;
- bestMatch = cd;
+ bestMatch = cd;
bestTypedef = 0;
bestTemplSpec.resize(0);
bestResolvedType = cd->qualifiedName();
@@ -1376,7 +1378,7 @@ static void getResolvedSymbol(const Definition *scope,
/* Find the fully qualified class name referred to by the input class
* or typedef name against the input scope.
* Loops through scope and each of its parent scopes looking for a
- * match against the input name. Can recursively call itself when
+ * match against the input name. Can recursively call itself when
* resolving typedefs.
*/
static const ClassDef *getResolvedClassRec(const Definition *scope,
@@ -1411,7 +1413,7 @@ static const ClassDef *getResolvedClassRec(const Definition *scope,
name=name.mid(qualifierIndex+2);
}
- if (name.isEmpty())
+ if (name.isEmpty())
{
//printf("] empty name\n");
return 0; // empty name
@@ -1419,9 +1421,9 @@ static const ClassDef *getResolvedClassRec(const Definition *scope,
//printf("Looking for symbol %s\n",name.data());
DefinitionIntf *di = Doxygen::symbolMap->find(name);
- // the -g (for C# generics) and -p (for ObjC protocols) are now already
+ // the -g (for C# generics) and -p (for ObjC protocols) are now already
// stripped from the key used in the symbolMap, so that is not needed here.
- if (di==0)
+ if (di==0)
{
//di = Doxygen::symbolMap->find(name+"-g");
//if (di==0)
@@ -1436,11 +1438,11 @@ static const ClassDef *getResolvedClassRec(const Definition *scope,
}
//printf("found symbol!\n");
- bool hasUsingStatements =
- (fileScope && ((fileScope->getUsedNamespaces() &&
+ bool hasUsingStatements =
+ (fileScope && ((fileScope->getUsedNamespaces() &&
fileScope->getUsedNamespaces()->count()>0) ||
- (fileScope->getUsedClasses() &&
- fileScope->getUsedClasses()->count()>0))
+ (fileScope->getUsedClasses() &&
+ fileScope->getUsedClasses()->count()>0))
);
//printf("hasUsingStatements=%d\n",hasUsingStatements);
// Since it is often the case that the same name is searched in the same
@@ -1467,7 +1469,7 @@ static const ClassDef *getResolvedClassRec(const Definition *scope,
// if a file scope is given and it contains using statements we should
// also use the file part in the key (as a class name can be in
- // two different namespaces and a using statement in a file can select
+ // two different namespaces and a using statement in a file can select
// one of them).
if (hasUsingStatements)
{
@@ -1483,19 +1485,19 @@ static const ClassDef *getResolvedClassRec(const Definition *scope,
//printf("Searching for %s result=%p\n",key.data(),pval);
if (pval)
{
- //printf("LookupInfo %p %p '%s' %p\n",
- // pval->classDef, pval->typeDef, pval->templSpec.data(),
- // pval->resolvedType.data());
+ //printf("LookupInfo %p %p '%s' %p\n",
+ // pval->classDef, pval->typeDef, pval->templSpec.data(),
+ // pval->resolvedType.data());
if (pTemplSpec) *pTemplSpec=pval->templSpec;
if (pTypeDef) *pTypeDef=pval->typeDef;
if (pResolvedType) *pResolvedType=pval->resolvedType;
//printf("] cachedMatch=%s\n",
// pval->classDef?pval->classDef->name().data():"<none>");
- //if (pTemplSpec)
+ //if (pTemplSpec)
// printf("templSpec=%s\n",pTemplSpec->data());
- return pval->classDef;
+ return pval->classDef;
}
- else // not found yet; we already add a 0 to avoid the possibility of
+ else // not found yet; we already add a 0 to avoid the possibility of
// endless recursion.
{
Doxygen::lookupCache->insert(key,new LookupInfo);
@@ -1529,7 +1531,7 @@ static const ClassDef *getResolvedClassRec(const Definition *scope,
bestResolvedType);
}
- if (pTypeDef)
+ if (pTypeDef)
{
*pTypeDef = bestTypedef;
}
@@ -1558,7 +1560,7 @@ static const ClassDef *getResolvedClassRec(const Definition *scope,
}
//printf("] bestMatch=%s distance=%d\n",
// bestMatch?bestMatch->name().data():"<none>",minDistance);
- //if (pTemplSpec)
+ //if (pTemplSpec)
// printf("templSpec=%s\n",pTemplSpec->data());
return bestMatch;
}
@@ -1566,7 +1568,7 @@ static const ClassDef *getResolvedClassRec(const Definition *scope,
/* Find the fully qualified class name referred to by the input class
* or typedef name against the input scope.
* Loops through scope and each of its parent scopes looking for a
- * match against the input name.
+ * match against the input name.
*/
const ClassDef *getResolvedClass(const Definition *scope,
const FileDef *fileScope,
@@ -1581,7 +1583,7 @@ const ClassDef *getResolvedClass(const Definition *scope,
static bool optimizeOutputVhdl = Config_getBool(OPTIMIZE_OUTPUT_VHDL);
g_resolvedTypedefs.clear();
if (scope==0 ||
- (scope->definitionType()!=Definition::TypeClass &&
+ (scope->definitionType()!=Definition::TypeClass &&
scope->definitionType()!=Definition::TypeNamespace
) ||
(scope->getLanguage()==SrcLangExt_Java && QCString(n).find("::")!=-1)
@@ -1610,7 +1612,7 @@ const ClassDef *getResolvedClass(const Definition *scope,
{
result = getClass(n);
}
- if (!mayBeUnlinkable && result && !result->isLinkable())
+ if (!mayBeUnlinkable && result && !result->isLinkable())
{
if (!mayBeHidden || !result->isHidden())
{
@@ -1966,10 +1968,10 @@ bool rightScopeMatch(const QCString &scope, const QCString &name)
{
int sl=scope.length();
int nl=name.length();
- return (name==scope || // equal
- (scope.right(nl)==name && // substring
+ return (name==scope || // equal
+ (scope.right(nl)==name && // substring
sl-nl>1 && scope.at(sl-nl-1)==':' && scope.at(sl-nl-2)==':' // scope
- )
+ )
);
}
@@ -1977,10 +1979,10 @@ bool leftScopeMatch(const QCString &scope, const QCString &name)
{
int sl=scope.length();
int nl=name.length();
- return (name==scope || // equal
- (scope.left(nl)==name && // substring
+ return (name==scope || // equal
+ (scope.left(nl)==name && // substring
sl>nl+1 && scope.at(nl)==':' && scope.at(nl+1)==':' // scope
- )
+ )
);
}
@@ -2017,11 +2019,11 @@ void linkifyText(const TextGeneratorIntf &out, const Definition *scope,
}
// add non-word part to the result
- bool insideString=FALSE;
+ bool insideString=FALSE;
int i;
- for (i=index;i<newIndex;i++)
- {
- if (txtStr.at(i)=='"') insideString=!insideString;
+ for (i=index;i<newIndex;i++)
+ {
+ if (txtStr.at(i)=='"') insideString=!insideString;
}
//printf("floatingIndex=%d strlen=%d autoBreak=%d\n",floatingIndex,strLen,autoBreak);
@@ -2041,16 +2043,16 @@ void linkifyText(const TextGeneratorIntf &out, const Definition *scope,
out.writeBreak(indentLevel==0 ? 0 : indentLevel+1);
out.writeString(splitText.right(splitLength-i-offset),keepSpaces);
floatingIndex=splitLength-i-offset+matchLen;
- }
+ }
else
{
- out.writeString(splitText,keepSpaces);
+ out.writeString(splitText,keepSpaces);
}
}
else
{
- //ol.docify(txtStr.mid(skipIndex,newIndex-skipIndex));
- out.writeString(txtStr.mid(skipIndex,newIndex-skipIndex),keepSpaces);
+ //ol.docify(txtStr.mid(skipIndex,newIndex-skipIndex));
+ out.writeString(txtStr.mid(skipIndex,newIndex-skipIndex),keepSpaces);
}
// get word from string
QCString word=txtStr.mid(newIndex,matchLen);
@@ -2084,7 +2086,7 @@ void linkifyText(const TextGeneratorIntf &out, const Definition *scope,
}
}
}
- if (!found && (cd || (cd=getClass(matchWord))))
+ if (!found && (cd || (cd=getClass(matchWord))))
{
//printf("Found class %s\n",cd->name().data());
// add link to the result
@@ -2128,10 +2130,10 @@ void linkifyText(const TextGeneratorIntf &out, const Definition *scope,
int m = matchWord.findRev("::");
QCString scopeName;
- if (scope &&
- (scope->definitionType()==Definition::TypeClass ||
+ if (scope &&
+ (scope->definitionType()==Definition::TypeClass ||
scope->definitionType()==Definition::TypeNamespace
- )
+ )
)
{
scopeName=scope->name();
@@ -2143,19 +2145,19 @@ void linkifyText(const TextGeneratorIntf &out, const Definition *scope,
}
//printf("ScopeName=%s\n",scopeName.data());
- //if (!found) printf("Trying to link %s in %s\n",word.data(),scopeName.data());
- if (!found &&
- getDefs(scopeName,matchWord,0,md,cd,fd,nd,gd) &&
- //(md->isTypedef() || md->isEnumerate() ||
+ //if (!found) printf("Trying to link %s in %s\n",word.data(),scopeName.data());
+ if (!found &&
+ getDefs(scopeName,matchWord,0,md,cd,fd,nd,gd) &&
+ //(md->isTypedef() || md->isEnumerate() ||
// md->isReference() || md->isVariable()
- //) &&
- (external ? md->isLinkable() : md->isLinkableInProject())
+ //) &&
+ (external ? md->isLinkable() : md->isLinkableInProject())
)
{
//printf("Found ref scope=%s\n",d?d->name().data():"<global>");
//ol.writeObjectLink(d->getReference(),d->getOutputFileBase(),
// md->anchor(),word);
- if (md!=self && (self==0 || md->name()!=self->name()))
+ if (md!=self && (self==0 || md->name()!=self->name()))
// name check is needed for overloaded members, where getDefs just returns one
{
/* in case of Fortran scop and the variable is a non Fortran variable: don't link,
@@ -2202,7 +2204,7 @@ void writeExample(OutputList &ol,ExampleSDict *ed)
ol.parseText(exampleLine.mid(index,newIndex-index));
uint entryIndex = exampleLine.mid(newIndex+1,matchLen-1).toUInt(&ok);
Example *e=ed->at(entryIndex);
- if (ok && e)
+ if (ok && e)
{
ol.pushGeneratorState();
//if (latexEnabled) ol.disable(OutputGenerator::Latex);
@@ -2226,7 +2228,7 @@ void writeExample(OutputList &ol,ExampleSDict *ed)
ol.popGeneratorState();
}
index=newIndex+matchLen;
- }
+ }
ol.parseText(exampleLine.right(exampleLine.length()-index));
ol.writeString(".");
}
@@ -2376,7 +2378,7 @@ int filterCRLF(char *buf,int len)
{
c = '\n'; // each CR to LF
if (src<len && buf[src] == '\n')
- ++src; // skip LF just after CR (DOS)
+ ++src; // skip LF just after CR (DOS)
}
else if ( c == '\0' && src<len-1) // filter out internal \0 characters, as it will confuse the parser
{
@@ -2400,8 +2402,8 @@ static QCString getFilterFromList(const char *name,const QStrList &filterList,bo
if (i_equals!=-1)
{
QCString filterPattern = fs.left(i_equals);
- QRegExp fpat(filterPattern,Portable::fileSystemIsCaseSensitive(),TRUE);
- if (fpat.match(name)!=-1)
+ QRegExp fpat(filterPattern,Portable::fileSystemIsCaseSensitive(),TRUE);
+ if (fpat.match(name)!=-1)
{
// found a match!
QCString filterName = fs.mid(i_equals+1);
@@ -2469,7 +2471,7 @@ QCString transcodeCharacterStringToUTF8(const QCString &input)
int outputSize=inputSize*4+1;
QCString output(outputSize);
void *cd = portable_iconv_open(outputEncoding,inputEncoding);
- if (cd==(void *)(-1))
+ if (cd==(void *)(-1))
{
err("unsupported character conversion: '%s'->'%s'\n",
inputEncoding.data(),outputEncoding);
@@ -2501,7 +2503,7 @@ QCString transcodeCharacterStringToUTF8(const QCString &input)
/*! reads a file with name \a name and returns it as a string. If \a filter
* is TRUE the file will be filtered by any user specified input filter.
- * If \a name is "-" the string will be read from standard input.
+ * If \a name is "-" the string will be read from standard input.
*/
QCString fileToString(const char *name,bool filter,bool isSourceCode)
{
@@ -2551,7 +2553,7 @@ QCString fileToString(const char *name,bool filter,bool isSourceCode)
return buf.data();
}
}
- if (!fileOpened)
+ if (!fileOpened)
{
err("cannot open file '%s' for reading\n",name);
}
@@ -2581,7 +2583,7 @@ static QDateTime getCurrentDateTime()
static bool warnedOnce=FALSE;
if (!warnedOnce)
{
- warn_uncond("Environment variable SOURCE_DATE_EPOCH must have a value smaller than or equal to %llu; actual value %llu\n",UINT_MAX,epoch);
+ warn_uncond("Environment variable SOURCE_DATE_EPOCH must have a value smaller than or equal to %d; actual value %" PRIu64 "\n",UINT_MAX, (uint64_t)epoch);
warnedOnce=TRUE;
}
}
@@ -2615,24 +2617,24 @@ QCString yearToString()
}
//----------------------------------------------------------------------
-// recursive function that returns the number of branches in the
+// recursive function that returns the number of branches in the
// inheritance tree that the base class 'bcd' is below the class 'cd'
int minClassDistance(const ClassDef *cd,const ClassDef *bcd,int level)
{
- if (bcd->categoryOf()) // use class that is being extended in case of
+ if (bcd->categoryOf()) // use class that is being extended in case of
// an Objective-C category
{
bcd=bcd->categoryOf();
}
- if (cd==bcd) return level;
+ if (cd==bcd) return level;
if (level==256)
{
warn_uncond("class %s seem to have a recursive "
"inheritance relation!\n",cd->name().data());
return -1;
}
- int m=maxInheritanceDepth;
+ int m=maxInheritanceDepth;
if (cd->baseClasses())
{
BaseClassListIterator bcli(*cd->baseClasses());
@@ -2649,12 +2651,12 @@ int minClassDistance(const ClassDef *cd,const ClassDef *bcd,int level)
Protection classInheritedProtectionLevel(const ClassDef *cd,const ClassDef *bcd,Protection prot,int level)
{
- if (bcd->categoryOf()) // use class that is being extended in case of
+ if (bcd->categoryOf()) // use class that is being extended in case of
// an Objective-C category
{
bcd=bcd->categoryOf();
}
- if (cd==bcd)
+ if (cd==bcd)
{
goto exit;
}
@@ -2697,7 +2699,7 @@ void trimBaseClassScope(BaseClassList *bcl,QCString &s,int level=0)
}
//printf("base class '%s'\n",cd->name().data());
if (cd->baseClasses())
- trimBaseClassScope(cd->baseClasses(),s,level+1);
+ trimBaseClassScope(cd->baseClasses(),s,level+1);
}
}
@@ -2795,7 +2797,7 @@ static void stripIrrelevantString(QCString &target,const QCString &str)
if (i1==-1 && i2==-1)
{
// strip str from target at index i
- target=target.left(i)+target.right(target.length()-i-l);
+ target=target.left(i)+target.right(target.length()-i-l);
changed=TRUE;
i-=l;
}
@@ -2824,8 +2826,8 @@ static void stripIrrelevantString(QCString &target,const QCString &str)
\code
const T param -> T param // not relevant
- const T& param -> const T& param // const needed
- T* const param -> T* param // not relevant
+ const T& param -> const T& param // const needed
+ T* const param -> T* param // not relevant
const T* param -> const T* param // const needed
\endcode
*/
@@ -2863,11 +2865,11 @@ static QCString extractCanonicalType(const Definition *d,const FileDef *fs,QCStr
QCString getCanonicalTemplateSpec(const Definition *d,const FileDef *fs,const QCString& spec)
{
-
+
QCString templSpec = spec.stripWhiteSpace();
// this part had been commented out before... but it is needed to match for instance
// std::list<std::string> against list<string> so it is now back again!
- if (!templSpec.isEmpty() && templSpec.at(0) == '<')
+ if (!templSpec.isEmpty() && templSpec.at(0) == '<')
{
templSpec = "< " + extractCanonicalType(d,fs,templSpec.right(templSpec.length()-1).stripWhiteSpace());
}
@@ -2889,7 +2891,7 @@ static QCString getCanonicalTypeForIdentifier(
QCString symName,result,templSpec,tmpName;
//DefinitionList *defList=0;
- if (tSpec && !tSpec->isEmpty())
+ if (tSpec && !tSpec->isEmpty())
templSpec = stripDeclKeywords(getCanonicalTemplateSpec(d,fs,*tSpec));
if (word.findRev("::")!=-1 && !(tmpName=stripScope(word)).isEmpty())
@@ -3051,7 +3053,7 @@ static QCString extractCanonicalType(const Definition *d,const FileDef *fs,QCStr
QCString ct = getCanonicalTypeForIdentifier(d,fs,word,&templSpec);
// in case the ct is empty it means that "word" represents scope "d"
- // and this does not need to be added to the canonical
+ // and this does not need to be added to the canonical
// type (it is redundant), so/ we skip it. This solves problem 589616.
if (ct.isEmpty() && type.mid(p,2)=="::")
{
@@ -3065,7 +3067,7 @@ static QCString extractCanonicalType(const Definition *d,const FileDef *fs,QCStr
// word.data(),templSpec.data(),canType.data(),ct.data());
if (!templSpec.isEmpty()) // if we didn't use up the templSpec already
// (i.e. type is not a template specialization)
- // then resolve any identifiers inside.
+ // then resolve any identifiers inside.
{
static QRegExp re("[a-z_A-Z\\x80-\\xFF][a-z_A-Z0-9\\x80-\\xFF]*");
int tp=0,tl,ti;
@@ -3093,11 +3095,11 @@ static QCString extractCanonicalArgType(const Definition *d,const FileDef *fs,co
QCString type = arg.type.stripWhiteSpace();
QCString name = arg.name;
//printf("----- extractCanonicalArgType(type=%s,name=%s)\n",type.data(),name.data());
- if ((type=="const" || type=="volatile") && !name.isEmpty())
+ if ((type=="const" || type=="volatile") && !name.isEmpty())
{ // name is part of type => correct
type+=" ";
type+=name;
- }
+ }
if (name=="const" || name=="volatile")
{ // name is part of type => correct
if (!type.isEmpty()) type+=" ";
@@ -3208,7 +3210,7 @@ bool matchArguments2(const Definition *srcScope,const FileDef *srcFileScope,cons
if (checkCV)
{
- if (srcAl.constSpecifier != dstAl.constSpecifier)
+ if (srcAl.constSpecifier != dstAl.constSpecifier)
{
NOMATCH
return FALSE; // one member is const, the other not -> no match
@@ -3243,7 +3245,7 @@ bool matchArguments2(const Definition *srcScope,const FileDef *srcFileScope,cons
}
}
MATCH
- return TRUE; // all arguments match
+ return TRUE; // all arguments match
}
@@ -3405,11 +3407,11 @@ static void findMembersWithSpecificName(MemberName *mn,
//printf(" md->name()='%s' md->args='%s' fd=%p gd=%p current=%p ref=%s\n",
// md->name().data(),args,fd,gd,currentFile,md->getReference().data());
if (
- ((gd && gd->isLinkable()) || (fd && fd->isLinkable()) || md->isReference()) &&
+ ((gd && gd->isLinkable()) || (fd && fd->isLinkable()) || md->isReference()) &&
md->getNamespaceDef()==0 && md->isLinkable() &&
- (!checkStatics || (!md->isStatic() && !md->isDefine()) ||
+ (!checkStatics || (!md->isStatic() && !md->isDefine()) ||
currentFile==0 || fd==currentFile) // statics must appear in the same file
- )
+ )
{
bool match=TRUE;
if (args && !md->isDefine() && qstrcmp(args,"()")!=0)
@@ -3422,7 +3424,7 @@ static void findMembersWithSpecificName(MemberName *mn,
Doxygen::globalScope,fd,argList,
checkCV);
}
- if (match && (forceTagFile==0 || md->getReference()==forceTagFile))
+ if (match && (forceTagFile==0 || md->getReference()==forceTagFile))
{
//printf("Found match!\n");
members.append(md);
@@ -3436,17 +3438,17 @@ static void findMembersWithSpecificName(MemberName *mn,
* memberName may also include a (partial) scope to indicate the scope
* in which the member is located.
*
- * The parameter 'scName' is a string representing the name of the scope in
+ * The parameter 'scName' is a string representing the name of the scope in
* which the link was found.
*
- * In case of a function args contains a string representation of the
- * argument list. Passing 0 means the member has no arguments.
+ * In case of a function args contains a string representation of the
+ * argument list. Passing 0 means the member has no arguments.
* Passing "()" means any argument list will do, but "()" is preferred.
*
* The function returns TRUE if the member is known and documented or
* FALSE if it is not.
- * If TRUE is returned parameter 'md' contains a pointer to the member
- * definition. Furthermore exactly one of the parameter 'cd', 'nd', or 'fd'
+ * If TRUE is returned parameter 'md' contains a pointer to the member
+ * definition. Furthermore exactly one of the parameter 'cd', 'nd', or 'fd'
* will be non-zero:
* - if 'cd' is non zero, the member was found in a class pointed to by cd.
* - if 'nd' is non zero, the member was found in a namespace pointed to by nd.
@@ -3454,12 +3456,12 @@ static void findMembersWithSpecificName(MemberName *mn,
* file fd.
*/
bool getDefs(const QCString &scName,
- const QCString &mbName,
+ const QCString &mbName,
const char *args,
- const MemberDef *&md,
- const ClassDef *&cd,
- const FileDef *&fd,
- const NamespaceDef *&nd,
+ const MemberDef *&md,
+ const ClassDef *&cd,
+ const FileDef *&fd,
+ const NamespaceDef *&nd,
const GroupDef *&gd,
bool forceEmptyScope,
const FileDef *currentFile,
@@ -3479,12 +3481,12 @@ bool getDefs(const QCString &scName,
int is,im=0,pm=0;
// strip common part of the scope from the scopeName
- while ((is=scopeName.findRev("::"))!=-1 &&
+ while ((is=scopeName.findRev("::"))!=-1 &&
(im=memberName.find("::",pm))!=-1 &&
(scopeName.right(scopeName.length()-is-2)==memberName.mid(pm,im-pm))
)
{
- scopeName=scopeName.left(is);
+ scopeName=scopeName.left(is);
pm=im+2;
}
//printf("result after scope corrections scope=%s name=%s\n",
@@ -3494,11 +3496,11 @@ bool getDefs(const QCString &scName,
QCString mScope;
if (memberName.left(9)!="operator " && // treat operator conversion methods
// as a special case
- (im=memberName.findRev("::"))!=-1 &&
+ (im=memberName.findRev("::"))!=-1 &&
im<(int)memberName.length()-2 // not A::
)
{
- mScope=memberName.left(im);
+ mScope=memberName.left(im);
mName=memberName.right(memberName.length()-im-2);
}
@@ -3537,13 +3539,13 @@ bool getDefs(const QCString &scName,
//printf("Trying class scope %s: fcd=%p tmd=%p\n",className.data(),fcd,tmd);
// todo: fill in correct fileScope!
if (fcd && // is it a documented class
- fcd->isLinkable()
+ fcd->isLinkable()
)
{
//printf(" Found fcd=%p\n",fcd);
MemberNameIterator mmli(*mn);
MemberDef *mmd;
- int mdist=maxInheritanceDepth;
+ int mdist=maxInheritanceDepth;
ArgumentList argList;
if (args)
{
@@ -3600,9 +3602,9 @@ bool getDefs(const QCString &scName,
}
}
//printf(" >Success=%d\n",mdist<maxInheritanceDepth);
- if (mdist<maxInheritanceDepth)
+ if (mdist<maxInheritanceDepth)
{
- if (!md->isLinkable() || md->isStrongEnumValue())
+ if (!md->isLinkable() || md->isStrongEnumValue())
{
md=0; // avoid returning things we cannot link to
cd=0;
@@ -3615,7 +3617,7 @@ bool getDefs(const QCString &scName,
return TRUE; /* found match */
}
}
- }
+ }
if (tmd && tmd->isEnumerate() && tmd->isStrong()) // scoped enum
{
//printf("Found scoped enum!\n");
@@ -3729,7 +3731,7 @@ bool getDefs(const QCString &scName,
namespaceName=mScope.copy();
}
//printf("Trying namespace %s\n",namespaceName.data());
- if (!namespaceName.isEmpty() &&
+ if (!namespaceName.isEmpty() &&
(fnd=Doxygen::namespaceSDict->find(namespaceName)) &&
fnd->isLinkable()
)
@@ -3747,7 +3749,7 @@ bool getDefs(const QCString &scName,
if (emd && emd->isStrong())
{
//printf("yes match %s<->%s!\n",mScope.data(),emd->localName().data());
- if (emd->getNamespaceDef()==fnd &&
+ if (emd->getNamespaceDef()==fnd &&
rightScopeMatch(mScope,emd->localName()))
{
//printf("found it!\n");
@@ -3783,8 +3785,8 @@ bool getDefs(const QCString &scName,
}
}
}
- if (!found && args && !qstrcmp(args,"()"))
- // no exact match found, but if args="()" an arbitrary
+ if (!found && args && !qstrcmp(args,"()"))
+ // no exact match found, but if args="()" an arbitrary
// member will do
{
for (mmli.toFirst();((mmd=mmli.current()) && !found);++mmli)
@@ -3799,7 +3801,7 @@ bool getDefs(const QCString &scName,
}
if (found)
{
- if (!md->isLinkable())
+ if (!md->isLinkable())
{
md=0; // avoid returning things we cannot link to
nd=0;
@@ -3893,7 +3895,7 @@ bool getDefs(const QCString &scName,
QListIterator<MemberDef> mit(members);
for (mit.toFirst();(md=mit.current());++mit)
{
- if (md->getFileDef() && md->getFileDef()->name() == currentFile->name())
+ if (md->getFileDef() && md->getFileDef()->name() == currentFile->name())
{
break; // found match in the current file
}
@@ -3908,7 +3910,7 @@ bool getDefs(const QCString &scName,
md=members.getLast();
}
}
- if (md && (md->getEnumScope()==0 || !md->getEnumScope()->isStrong()))
+ if (md && (md->getEnumScope()==0 || !md->getEnumScope()->isStrong()))
// found a matching global member, that is not a scoped enum value (or uniquely matches)
{
fd=md->getFileDef();
@@ -3926,14 +3928,14 @@ bool getDefs(const QCString &scName,
/*!
* Searches for a scope definition given its name as a string via parameter
- * `scope`.
+ * `scope`.
*
- * The parameter `docScope` is a string representing the name of the scope in
+ * The parameter `docScope` is a string representing the name of the scope in
* which the `scope` string was found.
*
* The function returns TRUE if the scope is known and documented or
* FALSE if it is not.
- * If TRUE is returned exactly one of the parameter `cd`, `nd`
+ * If TRUE is returned exactly one of the parameter `cd`, `nd`
* will be non-zero:
* - if `cd` is non zero, the scope was a class pointed to by cd.
* - if `nd` is non zero, the scope was a namespace pointed to by nd.
@@ -3950,7 +3952,7 @@ static bool getScopeDefs(const char *docScope,const char *scope,
bool explicitGlobalScope=FALSE;
if (scopeName.at(0)==':' && scopeName.at(1)==':')
{
- scopeName=scopeName.right(scopeName.length()-2);
+ scopeName=scopeName.right(scopeName.length()-2);
explicitGlobalScope=TRUE;
}
if (scopeName.isEmpty())
@@ -3971,11 +3973,11 @@ static bool getScopeDefs(const char *docScope,const char *scope,
//(cd=getClass(fullName+"-g")) // C# generic
) && cd->isLinkable())
{
- return TRUE; // class link written => quit
+ return TRUE; // class link written => quit
}
else if ((nd=Doxygen::namespaceSDict->find(fullName)) && nd->isLinkable())
{
- return TRUE; // namespace link written => quit
+ return TRUE; // namespace link written => quit
}
if (scopeOffset==0)
{
@@ -3996,10 +3998,10 @@ static bool isLowerCase(QCString &s)
if (p==0) return TRUE;
int c;
while ((c=*p++)) if (!islower(c)) return FALSE;
- return TRUE;
+ return TRUE;
}
-/*! Returns an object to reference to given its name and context
+/*! Returns an object to reference to given its name and context
* @post return value TRUE implies *resContext!=0 or *resMember!=0
*/
bool resolveRef(/* in */ const char *scName,
@@ -4043,10 +4045,10 @@ bool resolveRef(/* in */ const char *scName,
ClassDef *cd=0;
NamespaceDef *nd=0;
- // the following if() was commented out for releases in the range
+ // the following if() was commented out for releases in the range
// 1.5.2 to 1.6.1, but has been restored as a result of bug report 594787.
if (!inSeeBlock && scopePos==-1 && isLowerCase(tsName))
- { // link to lower case only name => do not try to autolink
+ { // link to lower case only name => do not try to autolink
return FALSE;
}
@@ -4066,7 +4068,7 @@ bool resolveRef(/* in */ const char *scName,
}
return TRUE;
}
- else if (scName==fullName || (!inSeeBlock && scopePos==-1))
+ else if (scName==fullName || (!inSeeBlock && scopePos==-1))
// nothing to link => output plain text
{
//printf("found scName=%s fullName=%s scName==fullName=%d "
@@ -4086,7 +4088,7 @@ bool resolveRef(/* in */ const char *scName,
if (bracePos!=-1) argsStr=fullName.right(fullName.length()-bracePos);
// strip template specifier
- // TODO: match against the correct partial template instantiation
+ // TODO: match against the correct partial template instantiation
int templPos=nameStr.find('<');
bool tryUnspecializedVersion = FALSE;
if (templPos!=-1 && nameStr.find("operator")==-1)
@@ -4126,11 +4128,11 @@ bool resolveRef(/* in */ const char *scName,
)
{
//printf("after getDefs checkScope=%d nameStr=%s cd=%p nd=%p\n",checkScope,nameStr.data(),cd,nd);
- if (checkScope && md && md->getOuterScope()==Doxygen::globalScope &&
+ if (checkScope && md && md->getOuterScope()==Doxygen::globalScope &&
!md->isStrongEnumValue() &&
(!scopeStr.isEmpty() || nameStr.find("::")>0))
{
- // we did find a member, but it is a global one while we were explicitly
+ // we did find a member, but it is a global one while we were explicitly
// looking for a scoped variable. See bug 616387 for an example why this check is needed.
// note we do need to support autolinking to "::symbol" hence the >0
//printf("not global member!\n");
@@ -4209,20 +4211,20 @@ QCString linkToText(SrcLangExt lang,const char *link,bool isFileName)
#if 0
/*
* generate a reference to a class, namespace or member.
- * 'scName' is the name of the scope that contains the documentation
+ * 'scName' is the name of the scope that contains the documentation
* string that is returned.
* 'name' is the name that we want to link to.
* 'name' may have the following formats:
* 1) "ScopeName"
- * 2) "memberName()" one of the (overloaded) function or define
+ * 2) "memberName()" one of the (overloaded) function or define
* with name memberName.
- * 3) "memberName(...)" a specific (overloaded) function or define
+ * 3) "memberName(...)" a specific (overloaded) function or define
* with name memberName
* 4) "::name a global variable or define
* 4) "\#memberName member variable, global variable or define
- * 5) ("ScopeName::")+"memberName()"
- * 6) ("ScopeName::")+"memberName(...)"
- * 7) ("ScopeName::")+"memberName"
+ * 5) ("ScopeName::")+"memberName()"
+ * 6) ("ScopeName::")+"memberName(...)"
+ * 7) ("ScopeName::")+"memberName"
* instead of :: the \# symbol may also be used.
*/
@@ -4384,7 +4386,7 @@ bool resolveLink(/* in */ const char *scName,
//----------------------------------------------------------------------
// General function that generates the HTML code for a reference to some
-// file, class or member from text 'lr' within the context of class 'clName'.
+// file, class or member from text 'lr' within the context of class 'clName'.
// This link has the text 'lt' (if not 0), otherwise 'lr' is used as a
// basis for the link's text.
// returns TRUE if a link could be generated.
@@ -4402,14 +4404,14 @@ bool generateLink(OutputDocInterface &od,const char *clName,
if (compound) // link to compound
{
if (lt==0 && anchor.isEmpty() && /* compound link */
- compound->definitionType()==Definition::TypeGroup /* is group */
+ compound->definitionType()==Definition::TypeGroup /* is group */
)
{
linkText=(dynamic_cast<const GroupDef *>(compound))->groupTitle(); // use group's title as link
}
else if (compound->definitionType()==Definition::TypeFile)
{
- linkText=linkToText(compound->getLanguage(),lt,TRUE);
+ linkText=linkToText(compound->getLanguage(),lt,TRUE);
}
od.writeObjectLink(compound->getReference(),
compound->getOutputFileBase(),anchor,linkText);
@@ -4438,12 +4440,12 @@ void generateFileRef(OutputDocInterface &od,const char *name,const char *text)
//FileInfo *fi;
FileDef *fd;
bool ambig;
- if ((fd=findFileDef(Doxygen::inputNameDict,name,ambig)) &&
- fd->isLinkable())
+ if ((fd=findFileDef(Doxygen::inputNameDict,name,ambig)) &&
+ fd->isLinkable())
// link to documented input file
od.writeObjectLink(fd->getReference(),fd->getOutputFileBase(),0,linkText);
else
- od.docify(linkText);
+ od.docify(linkText);
}
//----------------------------------------------------------------------
@@ -4520,7 +4522,7 @@ FileDef *findFileDef(const FileNameDict *fnDict,const char *n,bool &ambig)
if (slashPos!=-1)
{
path=name.left(slashPos+1);
- name=name.right(name.length()-slashPos-1);
+ name=name.right(name.length()-slashPos-1);
//printf("path=%s name=%s\n",path.data(),name.data());
}
if (name.isEmpty()) goto exit;
@@ -4553,10 +4555,10 @@ FileDef *findFileDef(const FileNameDict *fnDict,const char *n,bool &ambig)
for (fni.toFirst();(fd=fni.current());++fni)
{
QCString fdStripPath = stripFromIncludePath(fd->getPath());
- if (path.isEmpty() || fdStripPath.right(pathStripped.length())==pathStripped)
- {
- count++;
- lastMatch=fd;
+ if (path.isEmpty() || fdStripPath.right(pathStripped.length())==pathStripped)
+ {
+ count++;
+ lastMatch=fd;
}
}
//printf(">1 ===> add to cache %p\n",fd);
@@ -4590,7 +4592,7 @@ QCString showFileDefMatches(const FileNameDict *fnDict,const char *n)
if (slashPos!=-1)
{
path=name.left(slashPos+1);
- name=name.right(name.length()-slashPos-1);
+ name=name.right(name.length()-slashPos-1);
}
FileName *fn;
if ((fn=(*fnDict)[name]))
@@ -4730,7 +4732,7 @@ QCString substituteKeywords(const QCString &s,const char *title,
result = substitute(result,"$datetime",dateToString(TRUE));
result = substitute(result,"$date",dateToString(FALSE));
result = substitute(result,"$year",yearToString());
- result = substitute(result,"$doxygenversion",getVersion());
+ result = substitute(result,"$doxygenversion",getDoxygenVersion());
result = substitute(result,"$projectname",projName);
result = substitute(result,"$projectnumber",projNum);
result = substitute(result,"$projectbrief",projBrief);
@@ -4743,7 +4745,7 @@ QCString substituteKeywords(const QCString &s,const char *title,
/*! Returns the character index within \a name of the first prefix
* in Config_getList(IGNORE_PREFIX) that matches \a name at the left hand side,
* or zero if no match was found
- */
+ */
int getPrefixIndex(const QCString &name)
{
if (name.isEmpty()) return 0;
@@ -4791,7 +4793,7 @@ bool classHasVisibleChildren(const ClassDef *cd)
if (cd->baseClasses()==0) return FALSE;
bcl=cd->baseClasses();
}
- else
+ else
{
if (cd->subClasses()==0) return FALSE;
bcl=cd->subClasses();
@@ -4882,7 +4884,7 @@ QCString escapeCharsInString(const char *name,bool allowDots,bool allowUnderscor
case '@': growBuf.addStr("_0d"); break;
case ']': growBuf.addStr("_0e"); break;
case '[': growBuf.addStr("_0f"); break;
- default:
+ default:
if (c<0)
{
char ids[5];
@@ -4944,7 +4946,7 @@ QCString escapeCharsInString(const char *name,bool allowDots,bool allowUnderscor
else
{
growBuf.addChar('_');
- growBuf.addChar((char)tolower(c));
+ growBuf.addChar((char)tolower(c));
}
break;
}
@@ -5024,7 +5026,7 @@ QCString unescapeCharsInString(const char *s)
}
/*! This function determines the file name on disk of an item
- * given its name, which could be a class name with template
+ * given its name, which could be a class name with template
* arguments, so special characters need to be escaped.
*/
QCString convertNameToFile(const char *name,bool allowDots,bool allowUnderscore)
@@ -5050,7 +5052,7 @@ QCString convertNameToFile(const char *name,bool allowDots,bool allowUnderscore)
{
num = *value;
}
- result.sprintf("a%05d",num);
+ result.sprintf("a%05d",num);
}
else // long names
{
@@ -5063,17 +5065,17 @@ QCString convertNameToFile(const char *name,bool allowDots,bool allowUnderscore)
QCString sigStr(33);
MD5Buffer((const unsigned char *)result.data(),resultLen,md5_sig);
MD5SigToString(md5_sig,sigStr.rawData(),33);
- result=result.left(128-32)+sigStr;
+ result=result.left(128-32)+sigStr;
}
}
if (createSubdirs)
{
int l1Dir=0,l2Dir=0;
-#if MAP_ALGO==ALGO_COUNT
+#if MAP_ALGO==ALGO_COUNT
// old algorithm, has the problem that after regeneration the
// output can be located in a different dir.
- if (Doxygen::htmlDirMap==0)
+ if (Doxygen::htmlDirMap==0)
{
Doxygen::htmlDirMap=new QDict<int>(100003);
Doxygen::htmlDirMap->setAutoDelete(TRUE);
@@ -5082,7 +5084,7 @@ QCString convertNameToFile(const char *name,bool allowDots,bool allowUnderscore)
int *dirNum = Doxygen::htmlDirMap->find(result);
if (dirNum==0) // new name
{
- Doxygen::htmlDirMap->insert(result,new int(curDirNum));
+ Doxygen::htmlDirMap->insert(result,new int(curDirNum));
l1Dir = (curDirNum)&0xf; // bits 0-3
l2Dir = (curDirNum>>4)&0xff; // bits 4-11
curDirNum++;
@@ -5166,7 +5168,7 @@ void extractNamespaceName(const QCString &scopeName,
goto done;
}
p=clName.length()-2;
- while (p>=0 && (i=clName.findRev("::",p))!=-1)
+ while (p>=0 && (i=clName.findRev("::",p))!=-1)
// see if the first part is a namespace (and not a class)
{
//printf("Trying %s\n",clName.left(i).data());
@@ -5176,7 +5178,7 @@ void extractNamespaceName(const QCString &scopeName,
namespaceName=nd->name().copy();
className=clName.right(clName.length()-i-2);
goto done;
- }
+ }
p=i-2; // try a smaller piece of the scope
}
//printf("not found!\n");
@@ -5213,12 +5215,12 @@ QCString insertTemplateSpecifierInScope(const QCString &scope,const QCString &te
((cd=getClass(scope.left(si)))==0 || cd->templateArguments().empty())
)
{
- //printf("Tried '%s'\n",(scope.left(si)+templ).data());
- pi=si+2;
+ //printf("Tried '%s'\n",(scope.left(si)+templ).data());
+ pi=si+2;
}
if (si==-1) // not nested => append template specifier
{
- result+=templ;
+ result+=templ;
}
else // nested => insert template specifier before after first class name
{
@@ -5247,7 +5249,7 @@ QCString stripScope(const char *name)
char c=result.at(p);
switch (c)
{
- case ':':
+ case ':':
//printf("stripScope(%s)=%s\n",name,result.right(l-p-1).data());
return result.right(l-p-1);
case '>':
@@ -5262,7 +5264,7 @@ QCString stripScope(const char *name)
{
case '>': count++; break;
case '<': count--; if (count<=0) done=TRUE; break;
- default:
+ default:
//printf("c=%c count=%d\n",c,count);
break;
}
@@ -5296,7 +5298,7 @@ QCString stripScope(const char *name)
char c=result.at(p);
switch (c)
{
- case ':':
+ case ':':
// only exit in the case of ::
//printf("stripScope(%s)=%s\n",name,result.right(l-p-1).data());
if (p>0 && result.at(p-1)==':') return result.right(l-p-1);
@@ -5323,10 +5325,10 @@ QCString stripScope(const char *name)
c=result.at(p--);
switch (c)
{
- case '>':
- count++;
+ case '>':
+ count++;
break;
- case '<':
+ case '<':
if (p>0)
{
if (result.at(p-1) == '<') // skip << operator
@@ -5335,10 +5337,10 @@ QCString stripScope(const char *name)
break;
}
}
- count--;
+ count--;
foundMatch = count==0;
break;
- default:
+ default:
//printf("c=%c count=%d\n",c,count);
break;
}
@@ -5428,7 +5430,7 @@ QCString convertToXML(const char *s, bool keepEntities)
growBuf.addStr("&amp;");
}
break;
- case '\'': growBuf.addStr("&apos;"); break;
+ case '\'': growBuf.addStr("&apos;"); break;
case '"': growBuf.addStr("&quot;"); break;
case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8:
case 11: case 12: case 13: case 14: case 15: case 16: case 17: case 18:
@@ -5538,10 +5540,10 @@ QCString convertToHtml(const char *s,bool keepEntities)
}
else
{
- growBuf.addStr("&amp;");
+ growBuf.addStr("&amp;");
}
break;
- case '\'': growBuf.addStr("&#39;"); break;
+ case '\'': growBuf.addStr("&#39;"); break;
case '"': growBuf.addStr("&quot;"); break;
default: growBuf.addChar(c); break;
}
@@ -5783,11 +5785,11 @@ int extractClassNameFromType(const QCString &type,int &pos,QCString &name,QCStri
int brCount=1;
while (te<typeLen && brCount!=0)
{
- if (type.at(te)=='<')
+ if (type.at(te)=='<')
{
if (te<typeLen-1 && type.at(te+1)=='<') te++; else brCount++;
}
- if (type.at(te)=='>')
+ if (type.at(te)=='>')
{
if (te<typeLen-1 && type.at(te+1)=='>') te++; else brCount--;
}
@@ -5795,7 +5797,7 @@ int extractClassNameFromType(const QCString &type,int &pos,QCString &name,QCStri
}
}
name = type.mid(i,l);
- if (te>ts)
+ if (te>ts)
{
templSpec = type.mid(ts,te-ts),tl+=te-ts;
pos=i+l+tl;
@@ -5925,23 +5927,23 @@ QCString substituteTemplateArgumentsInString(
if (formArg.name==n && actIt!=actualArgs.end() && !actArg.type.isEmpty()) // base class is a template argument
{
// replace formal argument with the actual argument of the instance
- if (!leftScopeMatch(actArg.type,n))
- // the scope guard is to prevent recursive lockup for
- // template<class A> class C : public<A::T>,
- // where A::T would become A::T::T here,
+ if (!leftScopeMatch(actArg.type,n))
+ // the scope guard is to prevent recursive lockup for
+ // template<class A> class C : public<A::T>,
+ // where A::T would become A::T::T here,
// since n==A and actArg->type==A::T
// see bug595833 for an example
{
if (actArg.name.isEmpty())
{
- result += actArg.type+" ";
+ result += actArg.type+" ";
found=TRUE;
}
- else
+ else
// for case where the actual arg is something like "unsigned int"
// the "int" part is in actArg->name.
{
- result += actArg.type+" "+actArg.name+" ";
+ result += actArg.type+" "+actArg.name+" ";
found=TRUE;
}
}
@@ -5983,12 +5985,12 @@ QCString substituteTemplateArgumentsInString(
}
-/*! Strips template specifiers from scope \a fullName, except those
- * that make up specialized classes. The switch \a parentOnly
- * determines whether or not a template "at the end" of a scope
- * should be considered, e.g. with \a parentOnly is \c TRUE, \c A<T>::B<S> will
- * try to strip `<T>` and not `<S>`, while \a parentOnly is \c FALSE will
- * strip both unless `A<T>` or `B<S>` are specialized template classes.
+/*! Strips template specifiers from scope \a fullName, except those
+ * that make up specialized classes. The switch \a parentOnly
+ * determines whether or not a template "at the end" of a scope
+ * should be considered, e.g. with \a parentOnly is \c TRUE, \c A<T>::B<S> will
+ * try to strip `<T>` and not `<S>`, while \a parentOnly is \c FALSE will
+ * strip both unless `A<T>` or `B<S>` are specialized template classes.
*/
QCString stripTemplateSpecifiersFromScope(const QCString &fullName,
bool parentOnly,
@@ -6007,11 +6009,11 @@ QCString stripTemplateSpecifiersFromScope(const QCString &fullName,
while (e<l && !done)
{
char c=fullName.at(e++);
- if (c=='<')
+ if (c=='<')
{
count++;
}
- else if (c=='>')
+ else if (c=='>')
{
count--;
done = count==0;
@@ -6019,7 +6021,7 @@ QCString stripTemplateSpecifiersFromScope(const QCString &fullName,
}
int si= fullName.find("::",e);
- if (parentOnly && si==-1) break;
+ if (parentOnly && si==-1) break;
// we only do the parent scope, so we stop here if needed
result+=fullName.mid(p,i-p);
@@ -6046,10 +6048,10 @@ QCString stripTemplateSpecifiersFromScope(const QCString &fullName,
* Example1: \c A::B and \c B::C will result in \c A::B::C <br>
* Example2: \c A and \c B will be \c A::B <br>
* Example3: \c A::B and B will be \c A::B
- *
+ *
* @param leftScope the left hand part of the scope.
* @param rightScope the right hand part of the scope.
- * @returns the merged scope.
+ * @returns the merged scope.
*/
QCString mergeScopes(const QCString &leftScope,const QCString &rightScope)
{
@@ -6158,7 +6160,7 @@ PageDef *addRelatedPage(const char *name,const QCString &ptitle,
else // new page
{
QCString baseName=name;
- if (baseName.right(4)==".tex")
+ if (baseName.right(4)==".tex")
baseName=baseName.left(baseName.length()-4);
else if (baseName.right(Doxygen::htmlFileExtension.length())==Doxygen::htmlFileExtension)
baseName=baseName.left(baseName.length()-Doxygen::htmlFileExtension.length());
@@ -6190,7 +6192,7 @@ PageDef *addRelatedPage(const char *name,const QCString &ptitle,
{
file=gd->getOutputFileBase();
}
- else
+ else
{
file=pd->getOutputFileBase();
}
@@ -6224,7 +6226,7 @@ PageDef *addRelatedPage(const char *name,const QCString &ptitle,
//----------------------------------------------------------------------------
void addRefItem(const std::vector<RefItem*> &sli,
- const char *key,
+ const char *key,
const char *prefix, const char *name,const char *title,const char *args,const Definition *scope)
{
//printf("addRefItem(sli=%d,key=%s,prefix=%s,name=%s,title=%s,args=%s)\n",(int)sli.size(),key,prefix,name,title,args);
@@ -6374,9 +6376,9 @@ void filterLatexString(FTextStream &t,const char *str,
}
break;
case '*': t << "$\\ast$"; break;
- case '_': if (!insideTabbing) t << "\\+";
- t << "\\_";
- if (!insideTabbing) t << "\\+";
+ case '_': if (!insideTabbing) t << "\\+";
+ t << "\\_";
+ if (!insideTabbing) t << "\\+";
break;
case '{': t << "\\{"; break;
case '}': t << "\\}"; break;
@@ -6384,8 +6386,8 @@ void filterLatexString(FTextStream &t,const char *str,
case '>': t << "$>$"; break;
case '|': t << "$\\vert$"; break;
case '~': t << "$\\sim$"; break;
- case '[': if (Config_getBool(PDF_HYPERLINKS) || insideItem)
- t << "\\mbox{[}";
+ case '[': if (Config_getBool(PDF_HYPERLINKS) || insideItem)
+ t << "\\mbox{[}";
else
t << "[";
break;
@@ -6393,12 +6395,12 @@ void filterLatexString(FTextStream &t,const char *str,
if (Config_getBool(PDF_HYPERLINKS) || insideItem)
t << "\\mbox{]}";
else
- t << "]";
+ t << "]";
break;
case '-': t << "-\\/";
break;
case '\\': t << "\\textbackslash{}";
- break;
+ break;
case '"': t << "\\char`\\\"{}";
break;
case '`': t << "\\`{}";
@@ -6408,9 +6410,9 @@ void filterLatexString(FTextStream &t,const char *str,
case ' ': if (keepSpaces) { if (insideTabbing) t << "\\>"; else t << '~'; } else t << ' ';
break;
- default:
+ default:
//if (!insideTabbing && forceBreaks && c!=' ' && *p!=' ')
- if (!insideTabbing &&
+ if (!insideTabbing &&
((c>='A' && c<='Z' && pc!=' ' && pc!='\0' && *p) || (c==':' && pc!=':') || (pc=='.' && isId(c)))
)
{
@@ -6444,7 +6446,7 @@ QCString latexEscapeLabelName(const char *s)
case '}': t << "\\rcurly{}"; break;
case '~': t << "````~"; break; // to get it a bit better in index together with other special characters
// NOTE: adding a case here, means adding it to while below as well!
- default:
+ default:
i=0;
// collect as long string as possible, before handing it to docify
tmp[i++]=c;
@@ -6483,7 +6485,7 @@ QCString latexEscapeIndexChars(const char *s)
case '{': t << "\\lcurly{}"; break;
case '}': t << "\\rcurly{}"; break;
// NOTE: adding a case here, means adding it to while below as well!
- default:
+ default:
i=0;
// collect as long string as possible, before handing it to docify
tmp[i++]=c;
@@ -6585,6 +6587,7 @@ QCString rtfFormatBmkStr(const char *name)
}
}
+ //printf("Name = %s RTF_tag = %s\n",name,(*tag).data());
return *tag;
}
@@ -6667,9 +6670,9 @@ bool findAndRemoveWord(QCString &s,const QCString &word)
int p=0,i,l;
while ((i=wordExp.match(s,p,&l))!=-1)
{
- if (s.mid(i,l)==word)
+ if (s.mid(i,l)==word)
{
- if (i>0 && isspace((uchar)s.at(i-1)))
+ if (i>0 && isspace((uchar)s.at(i-1)))
i--,l++;
else if (i+l<(int)s.length() && isspace((uchar)s.at(i+l)))
l++;
@@ -6753,7 +6756,7 @@ static struct Lang2ExtMap
const char *langName;
const char *parserName;
SrcLangExt parserId;
-}
+}
g_lang2extMap[] =
{
// language parser parser option
@@ -6907,7 +6910,7 @@ QCString getFileNameExtension(QCString fn)
//--------------------------------------------------------------------------
-MemberDef *getMemberFromSymbol(const Definition *scope,const FileDef *fileScope,
+MemberDef *getMemberFromSymbol(const Definition *scope,const FileDef *fileScope,
const char *n)
{
if (scope==0 ||
@@ -7120,8 +7123,8 @@ struct Marker
int size; // size of the marker
};
-/** For a string \a s that starts with a command name, returns the character
- * offset within that string representing the first character after the
+/** For a string \a s that starts with a command name, returns the character
+ * offset within that string representing the first character after the
* command. For an alias with argument, this is the offset to the
* character just after the argument list.
*
@@ -7148,8 +7151,8 @@ static int findEndOfCommand(const char *s)
return i;
}
-/** Replaces the markers in an alias definition \a aliasValue
- * with the corresponding values found in the comma separated argument
+/** Replaces the markers in an alias definition \a aliasValue
+ * with the corresponding values found in the comma separated argument
* list \a argList and the returns the result after recursive alias expansion.
*/
static QCString replaceAliasArguments(const QCString &aliasValue,const QCString &argList)
@@ -7164,7 +7167,7 @@ static QCString replaceAliasArguments(const QCString &aliasValue,const QCString
for (i=0;i<l;i++)
{
char c = argList.at(i);
- if (c==',' && (i==0 || argList.at(i-1)!='\\'))
+ if (c==',' && (i==0 || argList.at(i-1)!='\\'))
{
args.append(new QCString(argList.mid(s,i-s)));
s=i+1; // start of next argument
@@ -7292,8 +7295,8 @@ static QCString expandAliasRec(const QCString s,bool allowRecursion)
cmd += QCString().sprintf("{%d}",numArgs); // alias name + {n}
}
QCString *aliasText=Doxygen::aliasDict.find(cmd);
- if (numArgs>1 && aliasText==0)
- { // in case there is no command with numArgs parameters, but there is a command with 1 parameter,
+ if (numArgs>1 && aliasText==0)
+ { // in case there is no command with numArgs parameters, but there is a command with 1 parameter,
// we also accept all text as the argument of that command (so you don't have to escape commas)
aliasText=Doxygen::aliasDict.find(cmdNoArgs+"{1}");
if (aliasText)
@@ -7339,7 +7342,7 @@ int countAliasArguments(const QCString argList)
int count=1;
int l = argList.length();
int i;
- for (i=0;i<l;i++)
+ for (i=0;i<l;i++)
{
char c = argList.at(i);
if (c==',' && (i==0 || argList.at(i-1)!='\\')) count++;
@@ -7373,7 +7376,7 @@ QCString extractAliasArgs(const QCString &args,int pos)
prevChar=0;
}
- if (bc==0)
+ if (bc==0)
{
//printf("extractAliasArgs('%s')->'%s'\n",args.data(),args.mid(pos+1,i-pos-1).data());
return args.mid(pos+1,i-pos-1);
@@ -7409,7 +7412,7 @@ QCString expandAlias(const QCString &aliasName,const QCString &aliasValue)
void writeTypeConstraints(OutputList &ol,const Definition *d,const ArgumentList &al)
{
if (al.empty()) return;
- ol.startConstraintList(theTranslator->trTypeConstraints());
+ ol.startConstraintList(theTranslator->trTypeConstraints());
for (const Argument &a : al)
{
ol.startConstraintParam();
@@ -7435,7 +7438,7 @@ void stackTrace()
static char cmd[40960];
char *p = cmd;
p += sprintf(p,"/usr/bin/atos -p %d ", (int)getpid());
- for (int x = 0; x < frameCount; x++)
+ for (int x = 0; x < frameCount; x++)
{
p += sprintf(p,"%p ", backtraceFrames[x]);
}
@@ -7468,7 +7471,7 @@ static int transcodeCharacterBuffer(const char *fileName,BufStr &srcBuf,int size
if (inputEncoding==0 || outputEncoding==0) return size;
if (qstricmp(inputEncoding,outputEncoding)==0) return size;
void *cd = portable_iconv_open(outputEncoding,inputEncoding);
- if (cd==(void *)(-1))
+ if (cd==(void *)(-1))
{
term("unsupported character conversion: '%s'->'%s': %s\n"
"Check the INPUT_ENCODING setting in the config file!\n",
@@ -7721,7 +7724,7 @@ QCString externalRef(const QCString &relPath,const QCString &ref,bool href)
return result;
}
-/** Writes the intensity only bitmap represented by \a data as an image to
+/** Writes the intensity only bitmap represented by \a data as an image to
* directory \a dir using the colors defined by HTML_COLORSTYLE_*.
*/
void writeColoredImgData(const char *dir,ColoredImgDataItem data[])
@@ -7750,8 +7753,8 @@ void writeColoredImgData(const char *dir,ColoredImgDataItem data[])
}
/** Replaces any markers of the form \#\#AA in input string \a str
- * by new markers of the form \#AABBCC, where \#AABBCC represents a
- * valid color, based on the intensity represented by hex number AA
+ * by new markers of the form \#AABBCC, where \#AABBCC represents a
+ * valid color, based on the intensity represented by hex number AA
* and the current HTML_COLORSTYLE_* settings.
*/
QCString replaceColorMarkers(const char *str)
@@ -7772,7 +7775,7 @@ QCString replaceColorMarkers(const char *str)
#define HEXTONUM(x) (((x)>='0' && (x)<='9') ? ((x)-'0') : \
((x)>='a' && (x)<='f') ? ((x)-'a'+10) : \
((x)>='A' && (x)<='F') ? ((x)-'A'+10) : 0)
-
+
double r,g,b;
int red,green,blue;
int level = HEXTONUM(lumStr[0])*16+HEXTONUM(lumStr[1]);
@@ -7798,7 +7801,7 @@ QCString replaceColorMarkers(const char *str)
return result;
}
-/** Copies the contents of file with name \a src to the newly created
+/** Copies the contents of file with name \a src to the newly created
* file with name \a dest. Returns TRUE if successful.
*/
bool copyFile(const QCString &src,const QCString &dest)
@@ -7830,7 +7833,7 @@ bool copyFile(const QCString &src,const QCString &dest)
return TRUE;
}
-/** Returns the section of text, in between a pair of markers.
+/** Returns the section of text, in between a pair of markers.
* Full lines are returned, excluding the lines on which the markers appear.
* \sa routine lineBlock
*/
@@ -7949,7 +7952,7 @@ QCString replaceScopeSeparator(QCString str)
bool isURL(const QCString &url)
{
QCString loc_url = url.stripWhiteSpace();
- return loc_url.left(5)=="http:" || loc_url.left(6)=="https:" ||
+ return loc_url.left(5)=="http:" || loc_url.left(6)=="https:" ||
loc_url.left(4)=="ftp:" || loc_url.left(5)=="file:";
}
/** Corrects URL \a url according to the relative path \a relPath.
@@ -7972,8 +7975,8 @@ bool protectionLevelVisible(Protection prot)
static bool extractPrivate = Config_getBool(EXTRACT_PRIVATE);
static bool extractPackage = Config_getBool(EXTRACT_PACKAGE);
- return (prot!=Private && prot!=Package) ||
- (prot==Private && extractPrivate) ||
+ return (prot!=Private && prot!=Package) ||
+ (prot==Private && extractPrivate) ||
(prot==Package && extractPackage);
}
@@ -7996,7 +7999,7 @@ QCString stripIndentation(const QCString &s)
if (c=='\t') indent+=tabSize - (indent%tabSize);
else if (c=='\n') indent=0,searchIndent=TRUE;
else if (c==' ') indent++;
- else if (searchIndent)
+ else if (searchIndent)
{
searchIndent=FALSE;
if (indent<minIndent) minIndent=indent;
@@ -8053,7 +8056,7 @@ bool fileVisibleInIndex(const FileDef *fd,bool &genSourceFile)
genSourceFile = !isDocFile && fd->generateSourceFile();
return ( ((allExternals && fd->isLinkable()) ||
fd->isLinkableInProject()
- ) &&
+ ) &&
!isDocFile
);
}
@@ -8062,7 +8065,7 @@ void addDocCrossReference(MemberDef *src,MemberDef *dst)
{
//printf("--> addDocCrossReference src=%s,dst=%s\n",src->name().data(),dst->name().data());
if (dst->isTypedef() || dst->isEnumerate()) return; // don't add types
- if ((dst->hasReferencedByRelation() || dst->hasCallerGraph()) &&
+ if ((dst->hasReferencedByRelation() || dst->hasCallerGraph()) &&
src->showInCallGraph()
)
{
@@ -8078,7 +8081,7 @@ void addDocCrossReference(MemberDef *src,MemberDef *dst)
mdDecl->addSourceReferencedBy(src);
}
}
- if ((src->hasReferencesRelation() || src->hasCallGraph()) &&
+ if ((src->hasReferencesRelation() || src->hasCallGraph()) &&
src->showInCallGraph()
)
{
@@ -8134,7 +8137,7 @@ uint getUtf8Code( const QCString& s, int idx )
}
-/*! @brief Returns one unicode character as an unsigned integer
+/*! @brief Returns one unicode character as an unsigned integer
* from utf-8 string, making the character lower case if it was upper case.
*
* @param s utf-8 encoded string
@@ -8149,7 +8152,7 @@ uint getUtf8CodeToLower( const QCString& s, int idx )
}
-/*! @brief Returns one unicode character as an unsigned integer
+/*! @brief Returns one unicode character as an unsigned integer
* from utf-8 string, making the character upper case if it was lower case.
*
* @param s utf-8 encoded string
@@ -8470,7 +8473,7 @@ bool openOutputFile(const char *outFile,QFile &f)
if (backup.exists()) // remove existing backup
dir.remove(backup.fileName());
dir.rename(fi.fileName(),fi.fileName()+".bak");
- }
+ }
f.setName(outFile);
fileOpened = f.open(IO_WriteOnly|IO_Translate);
}
@@ -8481,7 +8484,7 @@ void writeExtraLatexPackages(FTextStream &t)
{
// User-specified packages
QStrList &extraPackages = Config_getList(EXTRA_PACKAGES);
- if (!extraPackages.isEmpty())
+ if (!extraPackages.isEmpty())
{
t << "% Packages requested by user\n";
const char *pkgName=extraPackages.first();
@@ -8523,6 +8526,20 @@ void writeLatexSpecialFormulaChars(FTextStream &t)
"\n";
}
+QCString getFullVersion()
+{
+ QCString versionString;
+ if (strlen(getGitVersion())>0)
+ {
+ versionString = QCString(getDoxygenVersion())+" ("+getGitVersion()+")";
+ }
+ else
+ {
+ versionString = getDoxygenVersion();
+ }
+ return versionString;
+}
+
//------------------------------------------------------
static int g_usedTableLevels = 0;
@@ -8541,5 +8558,3 @@ int usedTableLevels()
}
//------------------------------------------------------
-
-
diff --git a/src/util.h b/src/util.h
index fc5eee4..07fc375 100644
--- a/src/util.h
+++ b/src/util.h
@@ -501,4 +501,5 @@ int usedTableLevels();
void incUsedTableLevels();
void decUsedTableLevels();
+QCString getFullVersion();
#endif
diff --git a/src/vhdldocgen.cpp b/src/vhdldocgen.cpp
index db4f658..3528627 100644
--- a/src/vhdldocgen.cpp
+++ b/src/vhdldocgen.cpp
@@ -1957,7 +1957,7 @@ void VhdlDocGen::writeVHDLDeclaration(const MemberDef* mdef,OutputList &ol,
QCString ltype(mdef->typeString());
QCString largs(mdef->argsString());
-
+
ClassDef *kl=0;
const ArgumentList &al = mdef->argumentList();
QCString nn;
@@ -2136,7 +2136,7 @@ void VhdlDocGen::writeVHDLDeclaration(const MemberDef* mdef,OutputList &ol,
case VhdlDocGen::UNITS:
writeRecordUnit(largs,ltype,ol,mdef);
break;
-
+
default: break;
}
@@ -2795,7 +2795,7 @@ ferr:
md->setLanguage(SrcLangExt_VHDL);
md->setMemberSpecifiers(VhdlDocGen::INSTANTIATION);
md->setBriefDescription(cur->brief,cur->briefFile,cur->briefLine);
- md->setBodySegment(cur->startLine,-1) ;
+ md->setBodySegment(cur->startLine,cur->startLine,-1) ;
md->setDocumentation(cur->doc.data(),cur->docFile.data(),cur->docLine);
FileDef *fd=ar->getFileDef();
md->setBodyDef(fd);
@@ -2814,20 +2814,20 @@ ferr:
void VhdlDocGen::writeRecordUnit(QCString & largs,QCString & ltype,OutputList& ol ,const MemberDef *mdef)
{
- int i=mdef->name().find('~');
+ int i=mdef->name().find('~');
if(i>0){
//sets the real record member name
const_cast<MemberDef*>(mdef)->setName(mdef->name().left(i).data());
}
-
+
writeLink(mdef,ol);
ol.startBold();
ol.insertMemberAlign();
if (!ltype.isEmpty()){
VhdlDocGen::formatString(ltype,ol,mdef);
- }
+ }
ol.endBold();
-
+
}
@@ -3933,7 +3933,7 @@ int FlowChart::findLabel(int index,QCString &label)
return j;
}
}
- err("could not find label: ",label.data());
+ err("could not find label: %s",label.data());
return 0;
}
@@ -4148,5 +4148,3 @@ void FlowChart::writeFlowLinks(FTextStream &t)
}
} //for
} //writeFlowLinks
-
-
diff --git a/src/xmlgen.cpp b/src/xmlgen.cpp
index bca5f7b..284332e 100644
--- a/src/xmlgen.cpp
+++ b/src/xmlgen.cpp
@@ -154,7 +154,7 @@ static void writeXMLHeader(FTextStream &t)
t << "<?xml version='1.0' encoding='UTF-8' standalone='no'?>" << endl;;
t << "<doxygen xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ";
t << "xsi:noNamespaceSchemaLocation=\"compound.xsd\" ";
- t << "version=\"" << getVersion() << "\">" << endl;
+ t << "version=\"" << getDoxygenVersion() << "\">" << endl;
}
static void writeCombineScript()
@@ -1968,7 +1968,7 @@ void generateXML()
t << "<?xml version='1.0' encoding='UTF-8' standalone='no'?>" << endl;;
t << "<doxygenindex xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ";
t << "xsi:noNamespaceSchemaLocation=\"index.xsd\" ";
- t << "version=\"" << getVersion() << "\">" << endl;
+ t << "version=\"" << getDoxygenVersion() << "\">" << endl;
{
ClassSDict::Iterator cli(*Doxygen::classSDict);
diff --git a/templates/html/htmlsearchresult.tpl b/templates/html/htmlsearchresult.tpl
index db37a5d..4e15414 100644
--- a/templates/html/htmlsearchresult.tpl
+++ b/templates/html/htmlsearchresult.tpl
@@ -24,6 +24,12 @@ document.getElementById("Loading").style.display="none";
document.getElementById("NoMatches").style.display="none";
var searchResults = new SearchResults("searchResults");
searchResults.Search();
+window.addEventListener("message", function(event) {
+ if (event.data == "take_focus") {
+ var elem = searchResults.NavNext(0);
+ if (elem) elem.focus();
+ }
+});
/* @license-end */
--></script>
</div>
diff --git a/templates/html/search.js b/templates/html/search.js
index a554ab9..86fbb9c 100644
--- a/templates/html/search.js
+++ b/templates/html/search.js
@@ -200,10 +200,9 @@ function SearchBox(name, resultsPath, inFrame, label)
}
return;
}
- else if (window.frames.MSearchResults.searchResults)
+ else
{
- var elem = window.frames.MSearchResults.searchResults.NavNext(0);
- if (elem) elem.focus();
+ window.frames.MSearchResults.postMessage("take_focus", "*");
}
}
else if (e.keyCode==27) // Escape out of the search field