From b3f70d8d46199524edc590269a73c262899763c7 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 8 Sep 2011 00:07:56 +0300 Subject: Replace most iterator to const_iterator. Some other minor changes. --- src/guichan/focushandler.cpp | 6 ++++-- src/guichan/gui.cpp | 8 ++++---- src/guichan/widget.cpp | 2 +- src/guichan/widgets/window.cpp | 2 +- 4 files changed, 10 insertions(+), 8 deletions(-) (limited to 'src/guichan') diff --git a/src/guichan/focushandler.cpp b/src/guichan/focushandler.cpp index bb0378f59..367eed6b1 100644 --- a/src/guichan/focushandler.cpp +++ b/src/guichan/focushandler.cpp @@ -479,7 +479,8 @@ namespace gcn = sourceWidget->_getFocusListeners(); // Send the event to all focus listeners of the widget. - for (std::list::iterator it = focusListeners.begin(); + for (std::list::const_iterator + it = focusListeners.begin(); it != focusListeners.end(); ++ it) { @@ -495,7 +496,8 @@ namespace gcn = sourceWidget->_getFocusListeners(); // Send the event to all focus listeners of the widget. - for (std::list::iterator it = focusListeners.begin(); + for (std::list::const_iterator + it = focusListeners.begin(); it != focusListeners.end(); ++ it) { diff --git a/src/guichan/gui.cpp b/src/guichan/gui.cpp index bec4c875f..0c81182ea 100644 --- a/src/guichan/gui.cpp +++ b/src/guichan/gui.cpp @@ -421,7 +421,7 @@ namespace gcn // Check if the widget is present in the "widget with mouse" queue. bool widgetIsPresentInQueue = false; - std::deque::iterator iter; + std::deque::const_iterator iter; for (iter = mWidgetWithMouseQueue.begin(); iter != mWidgetWithMouseQueue.end(); ++ iter) @@ -697,7 +697,7 @@ namespace gcn = widget->_getMouseListeners(); // Send the event to all mouse listeners of the widget. - for (std::list::iterator + for (std::list::const_iterator it = mouseListeners.begin(); it != mouseListeners.end(); ++it) @@ -796,7 +796,7 @@ namespace gcn = widget->_getKeyListeners(); // Send the event to all key listeners of the source widget. - for (std::list::iterator + for (std::list::const_iterator it = keyListeners.begin(); it != keyListeners.end(); ++it) @@ -936,7 +936,7 @@ namespace gcn // Check if the widget is present in the "widget with mouse" queue. bool widgetIsPresentInQueue = false; - std::deque::iterator iter; + std::deque::const_iterator iter; for (iter = mWidgetWithMouseQueue.begin(); iter != mWidgetWithMouseQueue.end(); ++ iter) diff --git a/src/guichan/widget.cpp b/src/guichan/widget.cpp index e2ed26508..1b2b3295b 100644 --- a/src/guichan/widget.cpp +++ b/src/guichan/widget.cpp @@ -470,7 +470,7 @@ namespace gcn { mGlobalFont = font; - std::list::iterator iter; + std::list::const_iterator iter; for (iter = mWidgets.begin(); iter != mWidgets.end(); ++iter) { if ((*iter)->mCurrentFont == NULL) diff --git a/src/guichan/widgets/window.cpp b/src/guichan/widgets/window.cpp index 7b04981c2..d0ba32f47 100644 --- a/src/guichan/widgets/window.cpp +++ b/src/guichan/widgets/window.cpp @@ -282,7 +282,7 @@ namespace gcn WidgetListConstIterator it; int w = 0, h = 0; - for (it = mWidgets.begin(); it != mWidgets.end(); it++) + for (it = mWidgets.begin(); it != mWidgets.end(); ++ it) { if ((*it)->getX() + (*it)->getWidth() > w) w = (*it)->getX() + (*it)->getWidth(); -- cgit v1.2.3-70-g09d2