The change to XesamSearch::operator==() is required for the port to build with libc++ r224926. See https://bugs.freebsd.org/196603. commit 2667f0bf37bc52c3375d0bc3727d2474568508a7 Author: Jos van den Oever Date: Fri Jul 12 15:55:07 2013 +0200 Fix Krazy issues. --- /dev/null +++ strigidaemon/.krazy @@ -0,0 +1,2 @@ +# see http://techbase.kde.org/Development/Tutorials/Code_Checking#Controlling_Krazy_on_the_EBN for an explanation of this file +EXCLUDE syscalls,typedefs --- strigidaemon/bin/daemon/dbus/dbuscpp/dbusbytearray.h +++ strigidaemon/bin/daemon/dbus/dbuscpp/dbusbytearray.h @@ -30,7 +30,7 @@ private: const char* array; int32_t length; public: - DBusByteArray(DBusMessage* msg); + explicit DBusByteArray(DBusMessage* msg); ~DBusByteArray() { if (msg) { dbus_message_unref(msg); --- strigidaemon/bin/daemon/dbus/dbuscpp/dbusobjectcallhandler.h +++ strigidaemon/bin/daemon/dbus/dbuscpp/dbusobjectcallhandler.h @@ -37,7 +37,7 @@ private: std::map interfaces; public: static const DBusObjectPathVTable vtable; - DBusObjectCallHandler(const std::string& path); + explicit DBusObjectCallHandler(const std::string& path); ~DBusObjectCallHandler(); void addInterface(DBusObjectInterface* interface); void registerOnConnection(DBusConnection* c); --- strigidaemon/bin/daemon/dbus/dbuscpp/dbusobjectinterface.h +++ strigidaemon/bin/daemon/dbus/dbuscpp/dbusobjectinterface.h @@ -27,7 +27,7 @@ class DBusObjectInterface { private: const std::string interfacename; public: - DBusObjectInterface(const std::string& i) :interfacename(i) {} + explicit DBusObjectInterface(const std::string& i) :interfacename(i) {} virtual ~DBusObjectInterface() {}; virtual DBusHandlerResult handleCall(DBusConnection* connection, DBusMessage* msg) = 0; --- strigidaemon/bin/daemon/dbus/testinterface.cpp +++ strigidaemon/bin/daemon/dbus/testinterface.cpp @@ -38,6 +38,6 @@ TestInterface::upload(const std::vector& upload) { map TestInterface::giveMap() { map m; - m["a"] = "b"; + m["a"] = 'b'; return m; } --- strigidaemon/bin/daemon/eventlistener/pollinglistener.h +++ strigidaemon/bin/daemon/eventlistener/pollinglistener.h @@ -47,7 +47,7 @@ class Event; class PollingListener : public EventListener, Strigi::AnalysisCaller { public: PollingListener(); - PollingListener(std::set& dirs); + explicit PollingListener(std::set& dirs); ~PollingListener(); --- strigidaemon/bin/daemon/indexscheduler.cpp +++ strigidaemon/bin/daemon/indexscheduler.cpp @@ -126,7 +126,7 @@ IndexScheduler::processListenerEvents(vector& events) { Event* event = *iter; STRIGI_LOG_DEBUG ("strigi.IndexScheduler", - "event infos: " + event->toString()); + "event information: " + event->toString()); switch (event->getType()) { --- strigidaemon/bin/daemon/queue/jobqueue.h +++ strigidaemon/bin/daemon/queue/jobqueue.h @@ -27,7 +27,7 @@ public: private: Private* p; public: - JobQueue(unsigned int n=20); + explicit JobQueue(unsigned int n=20); ~JobQueue(); void stop(); bool addJob(Job* job); --- strigidaemon/bin/daemon/xesam/xesamlivesearchinterface.h +++ strigidaemon/bin/daemon/xesam/xesamlivesearchinterface.h @@ -29,7 +29,7 @@ private: XesamLiveSearchInterface(const XesamLiveSearchInterface&); void operator=(const XesamLiveSearchInterface&); public: - XesamLiveSearchInterface(XesamLiveSearchInterface* x) :iface(x) {} + explicit XesamLiveSearchInterface(XesamLiveSearchInterface* x) :iface(x) {} virtual ~XesamLiveSearchInterface() {} virtual std::string /*session*/ NewSession() { return iface->NewSession(); --- strigidaemon/bin/daemon/xesam/xesamsearch.h +++ strigidaemon/bin/daemon/xesam/xesamsearch.h @@ -40,10 +40,10 @@ public: XesamSearch(XesamSession& s, const std::string& n, const std::string& query); XesamSearch(const XesamSearch&); - XesamSearch(Private* p); + explicit XesamSearch(Private* p); ~XesamSearch(); void operator=(const XesamSearch& xs); - bool operator==(const XesamSearch& xs) { return p == xs.p; } + bool operator==(const XesamSearch& xs) const { return p == xs.p; } void startSearch(); void getHitCount(void* msg); void getHits(void* msg, uint32_t num); --- strigidaemon/bin/daemon/xesam/xesamsession.h +++ strigidaemon/bin/daemon/xesam/xesamsession.h @@ -33,11 +33,11 @@ private: XesamSession(); public: - XesamSession(XesamLiveSearch& x); + explicit XesamSession(XesamLiveSearch& x); XesamSession(const XesamSession& xs); ~XesamSession(); void operator=(const XesamSession& xs); - bool operator==(const XesamSession& xs) { return p == xs.p; } + bool operator==(const XesamSession& xs) const { return p == xs.p; } /** * Attempt to set a parameter to the given value. * A runtime_error will be thrown if this function was called after a --- strigidaemon/bin/daemon/xsd/xsdparser/xmlstream.h +++ strigidaemon/bin/daemon/xsd/xsdparser/xmlstream.h @@ -35,7 +35,7 @@ private: class Private; Private* p; public: - XMLStream(const std::string& xml); + explicit XMLStream(const std::string& xml); ~XMLStream(); void setFromAttribute(bool&, const char*); void setFromAttribute(int&, const char*); @@ -82,7 +82,7 @@ public: std::list nodes; std::string text; - SimpleNode(const std::string& xml); + explicit SimpleNode(const std::string& xml); }; --- strigidaemon/include/strigi/clientinterface.h +++ strigidaemon/include/strigi/clientinterface.h @@ -37,7 +37,7 @@ public: std::string error; }; - ClientInterface(ClientInterface* i) :iface(i) {} + explicit ClientInterface(ClientInterface* i) :iface(i) {} virtual ~ClientInterface() {} virtual int32_t countHits(const std::string& query) { return iface->countHits(query); --- strigidaemon/tests/daemon/daemonconfiguratortest.cpp +++ strigidaemon/tests/daemon/daemonconfiguratortest.cpp @@ -68,7 +68,7 @@ CPPUNIT_TEST_SUITE_REGISTRATION( DaemonConfiguratorTest ); bool DaemonConfiguratorTest::checkEq(set& ori, set& last, string& errMsg) { - for (set::iterator itOri = ori.begin(); itOri != ori.end(); itOri++) + for (set::iterator itOri = ori.begin(); itOri != ori.end(); ++itOri) { set::iterator itLast = last.find(*itOri); if (itLast == last.end()) @@ -105,7 +105,7 @@ bool DaemonConfiguratorTest::checkEq(Strigi::AnalyzerConfiguration& oriConf, // check retrieved values for (vector >::iterator itOri = filtersOri.begin(); - itOri != filtersOri.end(); itOri++) + itOri != filtersOri.end(); ++itOri) { FindFilterRule findRule (itOri->first, itOri->second); @@ -213,8 +213,7 @@ void DaemonConfiguratorTest::testIndexedDirs() dirsLast = dirsSet; for (set::iterator it = dirsDelta.begin(); it != dirsDelta.end(); - it++) - { + ++it) { dirsLast.insert(*it); } @@ -244,7 +243,7 @@ void DaemonConfiguratorTest::testFilters() // check retrieved values bool check = true; for (vector >::iterator itSet = filtersSet.begin(); - itSet != filtersSet.end(); itSet++) + itSet != filtersSet.end(); ++itSet) { FindFilterRule findRule (itSet->first, itSet->second); --- strigidaemon/tests/daemon/dbus/strigidaemonunittestsession.cpp +++ strigidaemon/tests/daemon/dbus/strigidaemonunittestsession.cpp @@ -1,3 +1,22 @@ +/* This file is part of Strigi Desktop Search + * + * Copyright (C) 2008 Jos van den Oever + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ #include "config.h" #include "strigidaemonunittestsession.h" #include @@ -11,7 +30,6 @@ #include #include #include -#include "config.h" #include "strigilogging.h" using namespace std; --- strigidaemon/tests/daemon/dbus/strigidaemonunittestsession.h +++ strigidaemon/tests/daemon/dbus/strigidaemonunittestsession.h @@ -1,3 +1,22 @@ +/* This file is part of Strigi Desktop Search + * + * Copyright (C) 2008 Jos van den Oever + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ #ifndef STRIGIDAEMONUNITTESTSESSION_H #define STRIGIDAEMONUNITTESTSESSION_H --- strigidaemon/tests/daemon/dbus/test.cpp +++ strigidaemon/tests/daemon/dbus/test.cpp @@ -1,3 +1,22 @@ +/* This file is part of Strigi Desktop Search + * + * Copyright (C) 2008 Jos van den Oever + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ #include "config.h" #include "strigiclient.h" #include @@ -101,7 +120,7 @@ setupTestDir() { ofstream out(file.c_str()); out << "" << endl; out << " " << endl; + + '/' + backend + "' type='" + backend + "'>" << endl; out << " " << endl; out << " " << endl; out << "" << endl; --- strigidaemon/tests/daemon/dbus/xesamlistener.cpp +++ strigidaemon/tests/daemon/dbus/xesamlistener.cpp @@ -25,14 +25,14 @@ XesamListener::XesamListener(OrgFreedesktopXesamSearchInterface* xesam) :eventloop(this) { - connect(xesam, SIGNAL(HitsAdded(const QString&, uint)), - this, SLOT(slotHitsAdded(const QString&, uint))); - connect(xesam, SIGNAL(HitsRemoved(const QString &, const QList &)), - this, SLOT(slotHitsRemoved(const QString &, const QList &))); - connect(xesam, SIGNAL(SearchDone(const QString&)), - this, SLOT(slotSearchDone(const QString&))); - connect(xesam, SIGNAL(StateChanged(const QStringList&)), - this, SLOT(slotStateChanged(const QStringList&))); + connect(xesam, SIGNAL(HitsAdded(QString, uint)), + this, SLOT(slotHitsAdded(QString, uint))); + connect(xesam, SIGNAL(HitsRemoved(QString, QList)), + this, SLOT(slotHitsRemoved(QString, QList))); + connect(xesam, SIGNAL(SearchDone(QString)), + this, SLOT(slotSearchDone(QString))); + connect(xesam, SIGNAL(StateChanged(QStringList)), + this, SLOT(slotStateChanged(QStringList))); } bool XesamListener::waitForSearchToFinish(const QString& searchid, --- strigidaemon/tests/indextesters/indexmanagertester.cpp +++ strigidaemon/tests/indextesters/indexmanagertester.cpp @@ -42,7 +42,7 @@ void IndexManagerTest::tearDown() { Strigi::IndexPluginLoader::deleteIndexManager(m_manager); // clean up data (if any) - string cmd("rm -rf '" + m_indexpath + "'"); + string cmd("rm -rf '" + m_indexpath + '\''); int r = system(cmd.c_str()); CPPUNIT_ASSERT_MESSAGE("cleanup failed", r == 0); } --- strigidaemon/tests/indextesters/indexsearchtester.cpp +++ strigidaemon/tests/indextesters/indexsearchtester.cpp @@ -60,9 +60,9 @@ IndexSearchTest::setUp() { } #ifdef _WIN32 - separator = "\\"; + separator = '\\'; #else - separator = "/"; + separator = '/'; #endif // prepare files to be indexed @@ -79,7 +79,7 @@ IndexSearchTest::setUp() { // create files on file system for (map::iterator iter = indexedFiles.begin(); - iter != indexedFiles.end(); iter++) { + iter != indexedFiles.end(); ++iter) { ofstream file; string fullpath = filedir + separator + iter->first; file.open( fullpath.c_str()); @@ -96,7 +96,7 @@ IndexSearchTest::setUp() { streamindexer->setIndexWriter(*m_writer); for (map::iterator iter = indexedFiles.begin(); - iter != indexedFiles.end(); iter++) { + iter != indexedFiles.end(); ++iter) { string temp = filedir + separator + iter->first; fprintf (stderr, "going to index %s\n", temp.c_str()); streamindexer->indexFile(temp); @@ -110,7 +110,7 @@ IndexSearchTest::setUp() { void IndexSearchTest::tearDown() { // clean up data (does not work on windows) - string cmd = "rm -r '" + filedir + "'"; + string cmd = "rm -r '" + filedir + '\''; int r = system(cmd.c_str()); CPPUNIT_ASSERT_MESSAGE ("command failed", r == 0); --- strigidaemon/tests/indextesters/indextest.cpp +++ strigidaemon/tests/indextesters/indextest.cpp @@ -18,11 +18,10 @@ * Boston, MA 02110-1301, USA. */ -#include - #include "indextest.h" #include #include +#include using namespace std; using namespace Strigi; @@ -50,7 +49,7 @@ void IndexTest::tearDown() { IndexPluginLoader::deleteIndexManager(m_manager); // clean up data (if any) - string cmd("rm -rf '" + m_indexpath + "'"); + string cmd("rm -rf '" + m_indexpath + '\''); int r = system(cmd.c_str()); CPPUNIT_ASSERT_MESSAGE("cleanup failed", r == 0); } --- strigidaemon/tests/streamanalyzer/diranalyzertester.cpp +++ strigidaemon/tests/streamanalyzer/diranalyzertester.cpp @@ -38,9 +38,9 @@ using namespace std; using namespace strigiunittest; #ifdef _WIN32 - const string DirAnalyzerTester::separator = "\\"; + const string DirAnalyzerTester::separator = '\\'; #else - const string DirAnalyzerTester::separator = "/"; + const string DirAnalyzerTester::separator = '/'; #endif void DirAnalyzerTester::setUp() { @@ -87,7 +87,7 @@ void DirAnalyzerTester::setUp() { // create files on file system for (map::iterator iter = indexedFiles.begin(); - iter != indexedFiles.end(); iter++) + iter != indexedFiles.end(); ++iter) { string fullpath = filedir + separator + iter->first; @@ -114,7 +114,7 @@ void DirAnalyzerTester::tearDown() // clean up data string cmd = "rm -r "; cmd += indexdir; - cmd += " "; + cmd += ' '; cmd += filedir; int r = system(cmd.c_str()); CPPUNIT_ASSERT_MESSAGE("cleanup failed", r == 0); @@ -144,7 +144,7 @@ void DirAnalyzerTester::testCreateIndex() Strigi::DirAnalyzer* analyzer = new Strigi::DirAnalyzer(*manager, config); for (map::iterator iter = indexedFiles.begin(); - iter != indexedFiles.end(); iter++) + iter != indexedFiles.end(); ++iter) { string path = filedir + separator + iter->first; // cerr << "going to index " << path << endl; --- strigidaemon/tests/streamanalyzer/diranalyzertester.h +++ strigidaemon/tests/streamanalyzer/diranalyzertester.h @@ -17,8 +17,8 @@ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ -#ifndef UNIT_TEST_DIRANALYZER_TEST_H -#define UNIT_TEST_DIRANALYZER_TEST_H +#ifndef UNIT_TEST_DIRANALYZER_TESTER_H +#define UNIT_TEST_DIRANALYZER_TESTER_H #include #include --- strigidaemon/tests/streamanalyzer/xesam/xesam2strigitest.cpp +++ strigidaemon/tests/streamanalyzer/xesam/xesam2strigitest.cpp @@ -67,7 +67,7 @@ void Xesam2StrigiTest::tearDown() void Xesam2StrigiTest::parseUlFromString() { for (set::iterator iter = m_ulQueries.begin(); - iter != m_ulQueries.end(); iter++) + iter != m_ulQueries.end(); ++iter) { if (!xesam2strigi->parse (*iter, Xesam2Strigi::UserLanguage)) { string msg = "Failed to parse xesam userlanguage query: |"; @@ -96,7 +96,7 @@ void Xesam2StrigiTest::parseUlFromFile() printf ("created temporary file: %s\n", filename); for (set::iterator iter = m_ulQueries.begin(); - iter != m_ulQueries.end(); iter++) + iter != m_ulQueries.end(); ++iter) { out.open(filename); out << *iter; --- strigidaemon/tests/utils/unittestfunctions.h +++ strigidaemon/tests/utils/unittestfunctions.h @@ -18,8 +18,8 @@ * Boston, MA 02110-1301, USA. */ -#ifndef UNIT_TEST_FUNTIONS_H -#define UNIT_TEST_FUNTIONS_H +#ifndef UNIT_TEST_FUNCTIONS_H +#define UNIT_TEST_FUNCTIONS_H #include