From 7ca6bb4072a9f99ffa17e991c6dc9f3dde0a9730 Mon Sep 17 00:00:00 2001 From: wmayer Date: Wed, 7 Oct 2015 14:29:49 +0200 Subject: [PATCH] + Prefer prefix ++/-- operators for non-primitive types --- src/App/Application.cpp | 2 +- src/App/ApplicationPy.cpp | 24 ++++++++++++------------ src/Base/BoundBox.h | 2 +- src/Base/Observer.h | 4 ++-- src/Gui/DlgUndoRedo.cpp | 10 +++++----- 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/App/Application.cpp b/src/App/Application.cpp index 92ffa3fc1..868235fc0 100644 --- a/src/App/Application.cpp +++ b/src/App/Application.cpp @@ -1406,7 +1406,7 @@ void Application::logStatus() time(&now); Console().Log("Time = %s", ctime(&now)); - for (std::map::iterator It = mConfig.begin();It!= mConfig.end();It++) { + for (std::map::iterator It = mConfig.begin();It!= mConfig.end();++It) { Console().Log("%s = %s\n",It->first.c_str(),It->second.c_str()); } } diff --git a/src/App/ApplicationPy.cpp b/src/App/ApplicationPy.cpp index 8d13296c5..b6d477d0d 100644 --- a/src/App/ApplicationPy.cpp +++ b/src/App/ApplicationPy.cpp @@ -80,8 +80,8 @@ PyMethodDef Application::Methods[] = { "Get the name of the module that can export the filetype"}, {"getResourceDir", (PyCFunction) Application::sGetResourceDir ,1, "Get the root directory of all resources"}, - {"getUserAppDataDir", (PyCFunction) Application::sGetUserAppDataDir ,1, - "Get the root directory of user settings"}, + {"getUserAppDataDir", (PyCFunction) Application::sGetUserAppDataDir ,1, + "Get the root directory of user settings"}, {"getHomePath", (PyCFunction) Application::sGetHomePath ,1, "Get the home path, i.e. the parent directory of the executable"}, @@ -360,7 +360,7 @@ PyObject* Application::sDumpConfig(PyObject * /*self*/, PyObject *args,PyObject PyObject *dict = PyDict_New(); for (std::map::iterator It= GetApplication()._mConfig.begin(); - It!=GetApplication()._mConfig.end();It++) { + It!=GetApplication()._mConfig.end();++It) { PyDict_SetItemString(dict,It->first.c_str(), PyString_FromString(It->second.c_str())); } return dict; @@ -527,15 +527,15 @@ PyObject* Application::sGetResourceDir(PyObject * /*self*/, PyObject *args,PyObj return Py::new_reference_to(datadir); } -PyObject* Application::sGetUserAppDataDir(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) -{ - if (!PyArg_ParseTuple(args, "")) // convert args: Python->C - return NULL; // NULL triggers exception - - Py::String user_data_dir(Application::getUserAppDataDir(),"utf-8"); - return Py::new_reference_to(user_data_dir); -} - +PyObject* Application::sGetUserAppDataDir(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) +{ + if (!PyArg_ParseTuple(args, "")) // convert args: Python->C + return NULL; // NULL triggers exception + + Py::String user_data_dir(Application::getUserAppDataDir(),"utf-8"); + return Py::new_reference_to(user_data_dir); +} + PyObject* Application::sGetHomePath(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) { if (!PyArg_ParseTuple(args, "")) // convert args: Python->C diff --git a/src/Base/BoundBox.h b/src/Base/BoundBox.h index f9d686d33..1e6d24d64 100644 --- a/src/Base/BoundBox.h +++ b/src/Base/BoundBox.h @@ -765,7 +765,7 @@ inline BoundBox3<_Precision>::BoundBox3 (const Vector3<_Precision> *pclVect, uns MaxX(-FLOAT_MAX), MaxY(-FLOAT_MAX), MaxZ(-FLOAT_MAX) { const Vector3<_Precision> *pI, *pEnd = pclVect + ulCt; - for (pI = pclVect; pI < pEnd; pI++) + for (pI = pclVect; pI < pEnd; ++pI) { MinX = std::min<_Precision>(MinX, pI->x); MinY = std::min<_Precision>(MinY, pI->y); diff --git a/src/Base/Observer.h b/src/Base/Observer.h index 4c827d71d..1797267c5 100644 --- a/src/Base/Observer.h +++ b/src/Base/Observer.h @@ -169,7 +169,7 @@ public: */ void Notify(_MessageType rcReason) { - for(typename std::set * >::iterator Iter=_ObserverSet.begin();Iter!=_ObserverSet.end();Iter++) + for(typename std::set * >::iterator Iter=_ObserverSet.begin();Iter!=_ObserverSet.end();++Iter) (*Iter)->OnChange(*this,rcReason); // send OnChange-signal } @@ -180,7 +180,7 @@ public: Observer<_MessageType> * Get(const char *Name) { const char* OName; - for(typename std::set * >::iterator Iter=_ObserverSet.begin();Iter!=_ObserverSet.end();Iter++) + for(typename std::set * >::iterator Iter=_ObserverSet.begin();Iter!=_ObserverSet.end();++Iter) { OName = (*Iter)->Name(); // get the name if(OName && strcmp(OName,Name) == 0) diff --git a/src/Gui/DlgUndoRedo.cpp b/src/Gui/DlgUndoRedo.cpp index d282d57f3..f746c8afe 100644 --- a/src/Gui/DlgUndoRedo.cpp +++ b/src/Gui/DlgUndoRedo.cpp @@ -62,7 +62,7 @@ void UndoDialog::onFetchInfo() if (pcDoc) { std::vector vecUndos = pcDoc->getUndoVector(); - for (std::vector::iterator i=vecUndos.begin(); i!=vecUndos.end(); i++) + for (std::vector::iterator i=vecUndos.begin(); i!=vecUndos.end(); ++i) addAction(QString::fromUtf8((*i).c_str()), this, SLOT(onSelected())); } else @@ -70,7 +70,7 @@ void UndoDialog::onFetchInfo() EditorView* view = qobject_cast(getMainWindow()->activeWindow()); if (view) { QStringList vecUndos = view->undoActions(); - for (QStringList::Iterator i=vecUndos.begin(); i!=vecUndos.end(); i++) + for (QStringList::Iterator i=vecUndos.begin(); i!=vecUndos.end(); ++i) addAction(*i, this, SLOT(onSelected())); } } @@ -116,10 +116,10 @@ void RedoDialog::onFetchInfo() { clear(); // Remove first all items Gui::Document* pcDoc = Application::Instance->activeDocument(); - if ( pcDoc ) + if (pcDoc) { std::vector vecRedos = pcDoc->getRedoVector(); - for (std::vector::iterator i=vecRedos.begin(); i!=vecRedos.end(); i++) + for (std::vector::iterator i=vecRedos.begin(); i!=vecRedos.end(); ++i) addAction(QString::fromUtf8((*i).c_str()), this, SLOT(onSelected())); } else @@ -127,7 +127,7 @@ void RedoDialog::onFetchInfo() EditorView* view = qobject_cast(getMainWindow()->activeWindow()); if (view) { QStringList vecRedos = view->redoActions(); - for (QStringList::Iterator i=vecRedos.begin(); i!=vecRedos.end(); i++) + for (QStringList::Iterator i=vecRedos.begin(); i!=vecRedos.end(); ++i) addAction(*i, this, SLOT(onSelected())); } }