Skip to content

Commit

Permalink
fix warnings
Browse files Browse the repository at this point in the history
add const modifiers
  • Loading branch information
Altren committed Apr 10, 2010
1 parent 2b418ec commit 68cef09
Show file tree
Hide file tree
Showing 17 changed files with 34 additions and 39 deletions.
2 changes: 1 addition & 1 deletion Demos/Demo_Gui/ColourWindowCellData.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace demo
}

const std::string& getName() const { return m_name; }
const MyGUI::Colour& getColour() { return m_colour; }
const MyGUI::Colour& getColour() const { return m_colour; }


private:
Expand Down
4 changes: 2 additions & 2 deletions Demos/Demo_ItemBox/ItemData.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ namespace demo
}

size_t getCount() const { return count; }
demo::ResourceItemInfoPtr getInfo() { return mResourceInfo; }
MyGUI::ResourceImageSetPtr getImage() { return mResourceImage; }
demo::ResourceItemInfoPtr getInfo() const { return mResourceInfo; }
MyGUI::ResourceImageSetPtr getImage() const { return mResourceImage; }

private:
size_t count;
Expand Down
2 changes: 1 addition & 1 deletion MyGUIEngine/include/MyGUI_DynLib.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ namespace MyGUI

protected:
//! Gets the last loading error
std::string dynlibError(void);
std::string dynlibError() const;


protected:
Expand Down
2 changes: 1 addition & 1 deletion MyGUIEngine/include/MyGUI_RenderFormat.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ namespace MyGUI
friend TextureUsage operator | (Enum const& a, Enum const& b) { return TextureUsage(Enum(int(a) | int(b))); }
friend TextureUsage operator | (TextureUsage const& a, TextureUsage const& b) { return TextureUsage(Enum(int(a.value) | int(b.value))); }

bool isValue(Enum _value) { return 0 != (value & _value); }
bool isValue(Enum _value) const { return 0 != (value & _value); }

private:
Enum value;
Expand Down
4 changes: 2 additions & 2 deletions MyGUIEngine/include/MyGUI_TextView.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ namespace MyGUI
int getLenght() const { MYGUI_DEBUG_ASSERT(rollback, "rollback point not valid"); return lenght; }
size_t getCount() const { MYGUI_DEBUG_ASSERT(rollback, "rollback point not valid"); return count; }
size_t getPosition() const { MYGUI_DEBUG_ASSERT(rollback, "rollback point not valid"); return position; }
UString::const_iterator getTextIter() { MYGUI_DEBUG_ASSERT(rollback, "rollback point not valid"); return space_point; }
UString::const_iterator getTextIter() const { MYGUI_DEBUG_ASSERT(rollback, "rollback point not valid"); return space_point; }

private:
size_t position;
Expand Down Expand Up @@ -348,7 +348,7 @@ namespace MyGUI

const IntSize& getViewSize() const { return mViewSize; }
size_t getTextLength() const { return mLength; }
const VectorLineInfo& getData() { return mLineInfo; }
const VectorLineInfo& getData() const { return mLineInfo; }

private:
IntSize mViewSize;
Expand Down
2 changes: 1 addition & 1 deletion MyGUIEngine/src/MyGUI_DynLib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ namespace MyGUI
#endif
}

std::string DynLib::dynlibError( void )
std::string DynLib::dynlibError() const
{
#if MYGUI_PLATFORM == MYGUI_PLATFORM_WIN32
LPVOID lpMsgBuf;
Expand Down
4 changes: 0 additions & 4 deletions Scripts/vera++/profiles/default
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,3 @@ set rules {
T018
NoLeadingSpaces
}

set ruleExclusions(L006) {
MyGUI_UString.h
}
2 changes: 1 addition & 1 deletion Tools/LayoutEditor/CodeGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ std::string CodeGenerator::stringToUpperCase(std::string _str)
{
for(size_t i=0;i<_str.length();i++)
{
_str[i] = toupper(_str[i]);
_str[i] = (char)toupper(_str[i]);
}
return _str;
}
Expand Down
1 change: 0 additions & 1 deletion Tools/LayoutEditor/CodeGenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ class CodeGenerator :
void printWidgetDeclaration(WidgetContainer* _container, std::ofstream& _stream);
void notifyGeneratePressed(MyGUI::Widget* _sender);
private:
typedef std::pair<std::string, std::string> PairString;
typedef std::map<std::string, std::string> StringPairs;

ATTRIBUTE_FIELD_WIDGET_NAME(CodeGenerator, mPanelNameEdit, "PanelName");
Expand Down
16 changes: 8 additions & 8 deletions Tools/LayoutEditor/EditorWidgets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ EditorWidgets::~EditorWidgets()
{
}

void MapSet(StringPairs & _map, const std::string &_key, const std::string &_value)
void MapSet(VectorStringPairs & _map, const std::string &_key, const std::string &_value)
{
bool find = false;
for (StringPairs::iterator iter=_map.begin(); iter!=_map.end(); ++iter)
for (VectorStringPairs::iterator iter=_map.begin(); iter!=_map.end(); ++iter)
{
if (iter->first == _key)
{
Expand All @@ -37,19 +37,19 @@ void MapSet(StringPairs & _map, const std::string &_key, const std::string &_val
}
}

StringPairs::iterator MapFind(StringPairs & _map, const std::string &_key)
VectorStringPairs::iterator MapFind(VectorStringPairs & _map, const std::string &_key)
{
StringPairs::iterator iter = _map.begin();
VectorStringPairs::iterator iter = _map.begin();
for (; iter!=_map.end(); ++iter)
{
if (iter->first == _key) break;
}
return iter;
}

void MapErase(StringPairs & _map, const std::string &_key)
void MapErase(VectorStringPairs & _map, const std::string &_key)
{
for (StringPairs::iterator iter = _map.begin(); iter != _map.end(); ++iter)
for (VectorStringPairs::iterator iter = _map.begin(); iter != _map.end(); ++iter)
{
if (iter->first == _key)
{
Expand Down Expand Up @@ -460,14 +460,14 @@ void EditorWidgets::serialiseWidget(WidgetContainer * _container, MyGUI::xml::El
if ("" != _container->layer) node->addAttribute("layer", _container->layer);
if ("" != _container->name) node->addAttribute("name", _container->name);

for (StringPairs::iterator iter = _container->mProperty.begin(); iter != _container->mProperty.end(); ++iter)
for (VectorStringPairs::iterator iter = _container->mProperty.begin(); iter != _container->mProperty.end(); ++iter)
{
MyGUI::xml::ElementPtr nodeProp = node->createChild("Property");
nodeProp->addAttribute("key", iter->first);
nodeProp->addAttribute("value", iter->second);
}

for (StringPairs::iterator iter = _container->mUserString.begin(); iter != _container->mUserString.end(); ++iter)
for (VectorStringPairs::iterator iter = _container->mUserString.begin(); iter != _container->mUserString.end(); ++iter)
{
MyGUI::xml::ElementPtr nodeProp = node->createChild("UserString");
nodeProp->addAttribute("key", iter->first);
Expand Down
6 changes: 3 additions & 3 deletions Tools/LayoutEditor/EditorWidgets.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
#include <sstream>
#include "WidgetContainer.h"

void MapSet(StringPairs & _map, const std::string &_key, const std::string &_value);
StringPairs::iterator MapFind(StringPairs & _map, const std::string &_key);
void MapErase(StringPairs & _map, const std::string &_key);
void MapSet(VectorStringPairs & _map, const std::string &_key, const std::string &_value);
VectorStringPairs::iterator MapFind(VectorStringPairs & _map, const std::string &_key);
void MapErase(VectorStringPairs & _map, const std::string &_key);

// ýòî ìîæíî â ìåòîäû ãóè çàíåñòè
MyGUI::IntCoord convertCoordToParentCoord(const MyGUI::IntCoord& _coord, MyGUI::Widget* _widget);
Expand Down
6 changes: 3 additions & 3 deletions Tools/LayoutEditor/PanelItems.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ void PanelItems::syncItems(bool _apply, bool _add, std::string _value)
else
{
int index = 0;
for (StringPairs::iterator iterProperty = widgetContainer->mProperty.begin(); iterProperty != widgetContainer->mProperty.end(); ++iterProperty)
for (VectorStringPairs::iterator iterProperty = widgetContainer->mProperty.begin(); iterProperty != widgetContainer->mProperty.end(); ++iterProperty)
{
if (iterProperty->first == action)
{
Expand Down Expand Up @@ -196,7 +196,7 @@ void PanelItems::syncItems(bool _apply, bool _add, std::string _value)
}
else
{
for (StringPairs::iterator iterProperty = widgetContainer->mProperty.begin(); iterProperty != widgetContainer->mProperty.end(); ++iterProperty)
for (VectorStringPairs::iterator iterProperty = widgetContainer->mProperty.begin(); iterProperty != widgetContainer->mProperty.end(); ++iterProperty)
{
if (iterProperty->first == action)
{
Expand Down Expand Up @@ -280,7 +280,7 @@ void PanelItems::notifyUpdateItem(MyGUI::Edit* _widget)

WidgetContainer * widgetContainer = EditorWidgets::getInstance().find(current_widget);
int index = 0;
for (StringPairs::iterator iterProperty = widgetContainer->mProperty.begin(); iterProperty != widgetContainer->mProperty.end(); ++iterProperty)
for (VectorStringPairs::iterator iterProperty = widgetContainer->mProperty.begin(); iterProperty != widgetContainer->mProperty.end(); ++iterProperty)
{
if (iterProperty->first == action)
{
Expand Down
8 changes: 4 additions & 4 deletions Tools/LayoutEditor/PanelProperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ size_t PanelProperties::AddParametrs(WidgetStyle * widgetType, WidgetContainer *
{
size_t count = widgetType->parameter.size();

for (StringPairs::iterator iter = widgetType->parameter.begin(); iter != widgetType->parameter.end(); ++iter)
for (VectorStringPairs::iterator iter = widgetType->parameter.begin(); iter != widgetType->parameter.end(); ++iter)
{
std::string value = "";
for (StringPairs::iterator iterProperty = widgetContainer->mProperty.begin(); iterProperty != widgetContainer->mProperty.end(); ++iterProperty)
for (VectorStringPairs::iterator iterProperty = widgetContainer->mProperty.begin(); iterProperty != widgetContainer->mProperty.end(); ++iterProperty)
{
if (iterProperty->first == iter->first)
{
Expand Down Expand Up @@ -91,10 +91,10 @@ void PanelProperties::update(MyGUI::Widget* _current_widget, PropertiesGroup _gr
setVisible(true);
//base properties (from Widget)
WidgetStyle * baseType = WidgetTypes::getInstance().find("Widget");
for (StringPairs::iterator iter = baseType->parameter.begin(); iter != baseType->parameter.end(); ++iter)
for (VectorStringPairs::iterator iter = baseType->parameter.begin(); iter != baseType->parameter.end(); ++iter)
{
std::string value = "";
for (StringPairs::iterator iterProperty = widgetContainer->mProperty.begin(); iterProperty != widgetContainer->mProperty.end(); ++iterProperty)
for (VectorStringPairs::iterator iterProperty = widgetContainer->mProperty.begin(); iterProperty != widgetContainer->mProperty.end(); ++iterProperty)
{
if (iterProperty->first == iter->first)
{
Expand Down
2 changes: 1 addition & 1 deletion Tools/LayoutEditor/PanelUserData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ void PanelUserData::update(MyGUI::Widget* _current_widget)
WidgetContainer * widgetContainer = EditorWidgets::getInstance().find(_current_widget);

mMultilist->removeAllItems();
for (StringPairs::iterator iterProperty = widgetContainer->mUserString.begin(); iterProperty != widgetContainer->mUserString.end(); ++iterProperty)
for (VectorStringPairs::iterator iterProperty = widgetContainer->mUserString.begin(); iterProperty != widgetContainer->mUserString.end(); ++iterProperty)
{
mMultilist->addItem(iterProperty->first);
mMultilist->setSubItemNameAt(1, mMultilist->getItemCount() - 1, iterProperty->second);
Expand Down
2 changes: 1 addition & 1 deletion Tools/LayoutEditor/PropertiesPanelView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ void PropertiesPanelView::notifyApplyProperties(MyGUI::Widget* _sender, bool _fo
}

// åñëè òàêîå ñâ-âî áûëî, òî çàìåíèì (èëè óäàëèì åñëè ñòåðëè) çíà÷åíèå
for (StringPairs::iterator iterProperty = widgetContainer->mProperty.begin(); iterProperty != widgetContainer->mProperty.end(); ++iterProperty)
for (VectorStringPairs::iterator iterProperty = widgetContainer->mProperty.begin(); iterProperty != widgetContainer->mProperty.end(); ++iterProperty)
{
if (iterProperty->first == action)
{
Expand Down
6 changes: 3 additions & 3 deletions Tools/LayoutEditor/WidgetContainer.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
//#include <Ogre.h>

typedef std::pair<std::string, std::string> PairString;
typedef std::vector<PairString> StringPairs;
typedef std::vector<PairString> VectorStringPairs;

const std::string DEFAULT_EDITOR_LAYER = "LayoutEditor_Widgets";
const std::string DEFAULT_LAYER = "Back";
Expand All @@ -32,8 +32,8 @@ struct WidgetContainer

MyGUI::Widget* widget;
std::vector<WidgetContainer*> childContainers;
StringPairs mProperty;
StringPairs mUserString;
VectorStringPairs mProperty;
VectorStringPairs mUserString;
std::vector<ControllerInfo*> mController;
std::string type;
std::string skin;
Expand Down
4 changes: 2 additions & 2 deletions Tools/LayoutEditor/WidgetTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ typedef std::vector<SkinInfo> VectorSkinInfo;
typedef std::map<std::string, VectorSkinInfo> SkinGroups;

typedef std::pair<std::string, std::string> PairString;
typedef std::vector<PairString> StringPairs;
typedef std::vector<PairString> VectorStringPairs;

const std::string DEFAULT_GOROUP_NAME = "Default";

Expand All @@ -24,7 +24,7 @@ struct WidgetStyle
std::string base;
std::vector<std::string> skin;
std::string default_skin;
StringPairs parameter;
VectorStringPairs parameter;
// can have child widgets
bool parent;
// can have farent
Expand Down

0 comments on commit 68cef09

Please sign in to comment.