summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-02-08 00:49:41 +0300
committerAndrei Karas <akaras@inbox.ru>2012-02-08 00:49:41 +0300
commitff5e17ff14a78af31d9d23cd1dfdb5404f9a8fa9 (patch)
tree51a99a43eba0b09ca9e5f554b3676d0308685797
parent538261b13990ee02bbc62d9704233885b15cee04 (diff)
downloadManaVerse-ff5e17ff14a78af31d9d23cd1dfdb5404f9a8fa9.tar.gz
ManaVerse-ff5e17ff14a78af31d9d23cd1dfdb5404f9a8fa9.tar.bz2
ManaVerse-ff5e17ff14a78af31d9d23cd1dfdb5404f9a8fa9.tar.xz
ManaVerse-ff5e17ff14a78af31d9d23cd1dfdb5404f9a8fa9.zip
Fix code style with new tool.
-rw-r--r--src/avatar.cpp2
-rw-r--r--src/being.cpp7
-rw-r--r--src/client.cpp2
-rw-r--r--src/configuration.cpp2
-rw-r--r--src/debug/debug_new.cpp16
-rw-r--r--src/defaults.h20
-rw-r--r--src/graphics.cpp6
-rw-r--r--src/gui/botcheckerwindow.cpp3
-rw-r--r--src/gui/chatwindow.cpp4
-rw-r--r--src/gui/confirmdialog.cpp1
-rw-r--r--src/gui/debugwindow.cpp2
-rw-r--r--src/gui/itempopup.cpp2
-rw-r--r--src/gui/npcpostdialog.cpp2
-rw-r--r--src/gui/palette.cpp4
-rw-r--r--src/gui/setup_relations.cpp3
-rw-r--r--src/gui/setup_video.cpp2
-rw-r--r--src/gui/statuswindow.cpp2
-rw-r--r--src/gui/textdialog.cpp2
-rw-r--r--src/gui/viewport.h4
-rw-r--r--src/gui/whoisonline.cpp2
-rw-r--r--src/gui/widgets/avatarlistbox.cpp2
-rw-r--r--src/gui/widgets/battletab.h3
-rw-r--r--src/gui/widgets/chattab.cpp2
-rw-r--r--src/gui/widgets/container.cpp2
-rw-r--r--src/gui/widgets/dropdown.h1
-rw-r--r--src/gui/widgets/inventoryfilter.cpp2
-rw-r--r--src/gui/widgets/layout.h4
-rw-r--r--src/gui/widgets/setupitem.cpp1
-rw-r--r--src/gui/widgets/setuptab.cpp2
-rw-r--r--src/gui/widgets/shoplistbox.cpp2
-rw-r--r--src/gui/widgets/slider.cpp1
-rw-r--r--src/gui/widgets/tablemodel.cpp1
-rw-r--r--src/gui/widgets/textfield.cpp22
-rw-r--r--src/gui/widgets/tradetab.h3
-rw-r--r--src/guichan/actionevent.cpp1
-rw-r--r--src/guichan/event.cpp1
-rw-r--r--src/guichan/include/guichan/actionevent.hpp1
-rw-r--r--src/guichan/include/guichan/color.hpp2
-rw-r--r--src/guichan/include/guichan/gui.hpp9
-rw-r--r--src/guichan/include/guichan/sdl/sdlpixel.hpp6
-rw-r--r--src/guichan/keyinput.cpp1
-rw-r--r--src/guichan/sdl/sdlgraphics.cpp4
-rw-r--r--src/guichan/selectionevent.cpp1
-rw-r--r--src/guichan/widgets/checkbox.cpp1
-rw-r--r--src/guichan/widgets/dropdown.cpp1
-rw-r--r--src/guichan/widgets/icon.cpp18
-rw-r--r--src/guichan/widgets/tab.cpp1
-rw-r--r--src/localconsts.h2
-rw-r--r--src/localplayer.cpp16
-rw-r--r--src/logger.cpp2
-rw-r--r--src/map.cpp6
-rw-r--r--src/maplayer.cpp6
-rw-r--r--src/mumblemanager.cpp4
-rw-r--r--src/net/ea/beinghandler.cpp6
-rw-r--r--src/net/ea/gui/partytab.cpp1
-rw-r--r--src/net/ea/inventoryhandler.cpp2
-rw-r--r--src/net/manaserv/chathandler.cpp2
-rw-r--r--src/net/manaserv/guildhandler.cpp2
-rw-r--r--src/net/manaserv/playerhandler.cpp3
-rw-r--r--src/net/net.cpp1
-rw-r--r--src/net/tmwa/gui/guildtab.cpp1
-rw-r--r--src/net/tmwa/gui/partytab.cpp1
-rw-r--r--src/net/tmwa/network.cpp4
-rw-r--r--src/openglgraphics.cpp6
-rw-r--r--src/playerrelations.cpp5
-rw-r--r--src/resources/image.cpp10
-rw-r--r--src/resources/mapreader.cpp4
-rw-r--r--src/resources/resourcemanager.cpp54
-rw-r--r--src/resources/specialdb.cpp3
-rw-r--r--src/spellmanager.cpp3
-rw-r--r--src/textcommand.h2
-rw-r--r--src/units.cpp10
-rw-r--r--src/utils/base64.cpp4
-rw-r--r--src/utils/physfsrwops.h1
-rw-r--r--src/utils/stringutils.cpp8
-rw-r--r--src/vector.h4
76 files changed, 172 insertions, 184 deletions
diff --git a/src/avatar.cpp b/src/avatar.cpp
index 9a4831f18..54d7c6e79 100644
--- a/src/avatar.cpp
+++ b/src/avatar.cpp
@@ -61,4 +61,4 @@ std::string Avatar::getAdditionString() const
return " - " + getIp();
else
return "";
-} \ No newline at end of file
+}
diff --git a/src/being.cpp b/src/being.cpp
index 9edfaad7b..92d01097b 100644
--- a/src/being.cpp
+++ b/src/being.cpp
@@ -295,9 +295,9 @@ Being::~Being()
{
config.removeListener("visiblenames", this);
- delete[] mSpriteRemap;
+ delete [] mSpriteRemap;
mSpriteRemap = nullptr;
- delete[] mSpriteHide;
+ delete [] mSpriteHide;
mSpriteHide = nullptr;
delete mSpeechBubble;
@@ -993,7 +993,6 @@ void Being::setAction(Action action, int attackType A_UNUSED)
case DIRECTION_RIGHT: rotation = 270; break;
default: break;
}
- ;
if (particleEngine)
{
Particle *p = particleEngine->addEffect(
@@ -2404,7 +2403,7 @@ void Being::searchSlotValueItr(std::vector<int>::iterator &it, int &idx,
// logger->log("searching %d", val);
it = slotRemap.begin();
idx = 0;
- while(it != slotRemap.end())
+ while (it != slotRemap.end())
{
// logger->log("testing %d", *it);
if (*it == val)
diff --git a/src/client.cpp b/src/client.cpp
index 3e8eef6ed..54a0b6224 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -502,7 +502,7 @@ void Client::gameInit()
GraphicsVertexes::setLoadAsOpenGL(useOpenGL);
// Create the graphics context
- switch(useOpenGL)
+ switch (useOpenGL)
{
case 0:
mainGraphics = new Graphics;
diff --git a/src/configuration.cpp b/src/configuration.cpp
index 39e0c75d4..254a3fea8 100644
--- a/src/configuration.cpp
+++ b/src/configuration.cpp
@@ -161,7 +161,7 @@ void Configuration::cleanDefaults()
for (DefaultsData::const_iterator iter = mDefaultsData->begin();
iter != mDefaultsData->end(); ++iter)
{
- delete(iter->second);
+ delete (iter->second);
}
mDefaultsData->clear();
delete mDefaultsData;
diff --git a/src/debug/debug_new.cpp b/src/debug/debug_new.cpp
index 3bc02b3e5..9e30d30d9 100644
--- a/src/debug/debug_new.cpp
+++ b/src/debug/debug_new.cpp
@@ -533,7 +533,7 @@ static void* alloc_mem(size_t size, const char* file, int line, bool is_array)
* @param pointer pointer to delete
* @param addr pointer to the caller
* @param is_array flag indicating whether it is invoked by a
- * <code>delete[]</code> call
+ * <code>delete []</code> call
*/
static void free_pointer(void* pointer, void* addr, bool is_array)
{
@@ -558,9 +558,9 @@ static void free_pointer(void* pointer, void* addr, bool is_array)
{
const char* msg;
if (is_array)
- msg = "delete[] after new";
+ msg = "delete [] after new";
else
- msg = "delete after new[]";
+ msg = "delete after new []";
fast_mutex_autolock lock(new_output_lock);
fprintf(new_output_fp,
"%s: pointer %p (size %u)\n\tat ",
@@ -800,7 +800,7 @@ void operator delete(void* pointer) throw()
free_pointer(pointer, _DEBUG_NEW_CALLER_ADDRESS, false);
}
-void operator delete[](void* pointer) throw()
+void operator delete [](void* pointer) throw()
{
free_pointer(pointer, _DEBUG_NEW_CALLER_ADDRESS, true);
}
@@ -820,7 +820,7 @@ void operator delete(void* pointer, const char* file, int line) throw()
operator delete(pointer);
}
-void operator delete[](void* pointer, const char* file, int line) throw()
+void operator delete [](void* pointer, const char* file, int line) throw()
{
if (new_verbose_flag)
{
@@ -831,7 +831,7 @@ void operator delete[](void* pointer, const char* file, int line) throw()
print_position(file, line);
fprintf(new_output_fp, ")\n");
}
- operator delete[](pointer);
+ operator delete [](pointer);
}
void operator delete(void* pointer, const std::nothrow_t&) throw()
@@ -839,9 +839,9 @@ void operator delete(void* pointer, const std::nothrow_t&) throw()
operator delete(pointer, (char*)_DEBUG_NEW_CALLER_ADDRESS, 0);
}
-void operator delete[](void* pointer, const std::nothrow_t&) throw()
+void operator delete [](void* pointer, const std::nothrow_t&) throw()
{
- operator delete[](pointer, (char*)_DEBUG_NEW_CALLER_ADDRESS, 0);
+ operator delete [](pointer, (char*)_DEBUG_NEW_CALLER_ADDRESS, 0);
}
#endif // HAVE_PLACEMENT_DELETE
diff --git a/src/defaults.h b/src/defaults.h
index 1d979e928..850e15d37 100644
--- a/src/defaults.h
+++ b/src/defaults.h
@@ -26,18 +26,16 @@
#include <string>
#include "variabledata.h"
-using namespace Mana;
-
typedef std::map<std::string, Mana::VariableData*> DefaultsData;
-VariableData* createData(int defData);
-VariableData* createData(double defData);
-VariableData* createData(float defData);
-VariableData* createData(const std::string &defData);
-VariableData* createData(const char* defData);
-VariableData* createData(bool defData);
-DefaultsData* getConfigDefaults();
-DefaultsData* getBrandingDefaults();
-DefaultsData* getPathsDefaults();
+Mana::VariableData* createData(int defData);
+Mana::VariableData* createData(double defData);
+Mana::VariableData* createData(float defData);
+Mana::VariableData* createData(const std::string &defData);
+Mana::VariableData* createData(const char* defData);
+Mana::VariableData* createData(bool defData);
+Mana::DefaultsData* getConfigDefaults();
+Mana::DefaultsData* getBrandingDefaults();
+Mana::DefaultsData* getPathsDefaults();
#endif
diff --git a/src/graphics.cpp b/src/graphics.cpp
index 5848d8c14..635cc6ab9 100644
--- a/src/graphics.cpp
+++ b/src/graphics.cpp
@@ -719,10 +719,10 @@ int Graphics::SDL_FakeUpperBlit(SDL_Surface *src, SDL_Rect *srcrect,
/* Make sure the surfaces aren't locked */
if (!src || !dst)
- return(-1);
+ return -1;
if (src->locked || dst->locked)
- return(-1);
+ return -1;
/* If the destination rectangle is nullptr, use the entire dest surface */
if (!dstrect)
@@ -841,7 +841,7 @@ void Graphics::fillRectangle(const gcn::Rectangle& rectangle)
Uint32 pixel = SDL_MapRGB(mTarget->format,
mColor.r, mColor.g, mColor.b);
- switch(bpp)
+ switch (bpp)
{
case 1:
for (y = y1; y < y2; y++)
diff --git a/src/gui/botcheckerwindow.cpp b/src/gui/botcheckerwindow.cpp
index 2043b4fe3..4a092ab55 100644
--- a/src/gui/botcheckerwindow.cpp
+++ b/src/gui/botcheckerwindow.cpp
@@ -53,7 +53,8 @@
#define TIME_COLUMN 1
#define ROW_HEIGHT 12
-// The following column widths really shouldn't be hardcoded but should scale with the size of the widget... excep
+// The following column widths really shouldn't be hardcoded but should
+// scale with the size of the widget... excep
// that, right now, the widget doesn't exactly scale either.
#define NAME_COLUMN_WIDTH 185
#define TIME_COLUMN_WIDTH 70
diff --git a/src/gui/chatwindow.cpp b/src/gui/chatwindow.cpp
index 6831ad5b6..452d2420e 100644
--- a/src/gui/chatwindow.cpp
+++ b/src/gui/chatwindow.cpp
@@ -594,7 +594,7 @@ void ChatWindow::ignoreAllWhispers()
PlayerRelation::IGNORED);
}
- delete(iter->second);
+ delete (iter->second);
iter->second = nullptr;
}
}
@@ -1122,7 +1122,7 @@ std::string ChatWindow::addColors(std::string &msg)
int cMap[] = {1, 4, 5, 2, 3, 6, 7, 9, 0, 8};
// rainbow
- switch(mChatColor)
+ switch (mChatColor)
{
case 11:
msg = removeColors(msg);
diff --git a/src/gui/confirmdialog.cpp b/src/gui/confirmdialog.cpp
index cf9d541ad..22acf5116 100644
--- a/src/gui/confirmdialog.cpp
+++ b/src/gui/confirmdialog.cpp
@@ -112,4 +112,3 @@ void ConfirmDialog::action(const gcn::ActionEvent &event)
scheduleDelete();
}
}
-
diff --git a/src/gui/debugwindow.cpp b/src/gui/debugwindow.cpp
index d13545bea..19db5540a 100644
--- a/src/gui/debugwindow.cpp
+++ b/src/gui/debugwindow.cpp
@@ -396,4 +396,4 @@ void NetDebugTab::logic()
PacketCounters::getInBytes()));
mOutPackets1Label->setCaption(strprintf(_("Out: %d bytes/s"),
PacketCounters::getOutBytes()));
-} \ No newline at end of file
+}
diff --git a/src/gui/itempopup.cpp b/src/gui/itempopup.cpp
index 9a9e5f50d..d96aa564f 100644
--- a/src/gui/itempopup.cpp
+++ b/src/gui/itempopup.cpp
@@ -282,4 +282,4 @@ void ItemPopup::mouseMoved(gcn::MouseEvent &event)
setVisible(false);
mLastName = "";
mLastColor = 1;
-} \ No newline at end of file
+}
diff --git a/src/gui/npcpostdialog.cpp b/src/gui/npcpostdialog.cpp
index 6bcb62baf..b2ffb312c 100644
--- a/src/gui/npcpostdialog.cpp
+++ b/src/gui/npcpostdialog.cpp
@@ -128,4 +128,4 @@ void NpcPostDialog::closeAll()
for (; it != it_end; ++it)
(*it)->close();
-} \ No newline at end of file
+}
diff --git a/src/gui/palette.cpp b/src/gui/palette.cpp
index fe14cd2d4..3b36fa6ce 100644
--- a/src/gui/palette.cpp
+++ b/src/gui/palette.cpp
@@ -39,7 +39,8 @@
const gcn::Color Palette::BLACK = gcn::Color(0, 0, 0);
Palette::Palettes Palette::mInstances;
-const gcn::Color Palette::RAINBOW_COLORS[7] = {
+const gcn::Color Palette::RAINBOW_COLORS[7] =
+{
gcn::Color(255, 0, 0),
gcn::Color(255, 153, 0),
gcn::Color(255, 255, 0),
@@ -48,6 +49,7 @@ const gcn::Color Palette::RAINBOW_COLORS[7] = {
gcn::Color(51, 0, 153),
gcn::Color(153, 0, 153)
};
+
/** Number of Elemets of RAINBOW_COLORS */
const int Palette::RAINBOW_COLOR_COUNT = 7;
diff --git a/src/gui/setup_relations.cpp b/src/gui/setup_relations.cpp
index 571856a14..47d53620c 100644
--- a/src/gui/setup_relations.cpp
+++ b/src/gui/setup_relations.cpp
@@ -50,7 +50,8 @@
#define RELATION_CHOICE_COLUMN 1
#define ROW_HEIGHT 12
-// The following column widths really shouldn't be hardcoded but should scale with the size of the widget... except
+// The following column widths really shouldn't be hardcoded
+// but should scale with the size of the widget... except
// that, right now, the widget doesn't exactly scale either.
#define NAME_COLUMN_WIDTH 230
#define RELATION_CHOICE_COLUMN_WIDTH 80
diff --git a/src/gui/setup_video.cpp b/src/gui/setup_video.cpp
index 9a5b30ea7..6b3d6d4d3 100644
--- a/src/gui/setup_video.cpp
+++ b/src/gui/setup_video.cpp
@@ -743,4 +743,4 @@ void Setup_Video::action(const gcn::ActionEvent &event)
void Setup_Video::externalUpdated()
{
-} \ No newline at end of file
+}
diff --git a/src/gui/statuswindow.cpp b/src/gui/statuswindow.cpp
index 86964383a..3fbec4f35 100644
--- a/src/gui/statuswindow.cpp
+++ b/src/gui/statuswindow.cpp
@@ -286,7 +286,7 @@ void StatusWindow::processEvent(Mana::Channels channel A_UNUSED,
if (event.getName() == Mana::EVENT_UPDATEATTRIBUTE)
{
- switch(event.getInt("id"))
+ switch (event.getInt("id"))
{
case HP: case MAX_HP:
updateHPBar(mHpBar, true);
diff --git a/src/gui/textdialog.cpp b/src/gui/textdialog.cpp
index b30c9eb82..d7d3d5eeb 100644
--- a/src/gui/textdialog.cpp
+++ b/src/gui/textdialog.cpp
@@ -126,4 +126,4 @@ void TextDialog::close()
{
keyboard.setEnabled(mEnabledKeyboard);
scheduleDelete();
-} \ No newline at end of file
+}
diff --git a/src/gui/viewport.h b/src/gui/viewport.h
index f3035b5df..ccb8124ba 100644
--- a/src/gui/viewport.h
+++ b/src/gui/viewport.h
@@ -90,7 +90,9 @@ class Viewport : public WindowContainer, public gcn::MouseListener,
void logic();
/**
- * Toggles whether the path debug graphics are shown. normal, debug with all images and grid, debug with out big images and with out grid.
+ * Toggles whether the path debug graphics are shown. normal,
+ * debug with all images and grid, debug with out big images
+ * and with out grid.
*/
void toggleDebugPath();
diff --git a/src/gui/whoisonline.cpp b/src/gui/whoisonline.cpp
index 205a1aae1..104e4d7f1 100644
--- a/src/gui/whoisonline.cpp
+++ b/src/gui/whoisonline.cpp
@@ -138,7 +138,7 @@ WhoIsOnline::~WhoIsOnline()
mMemoryBuffer = nullptr;
// Remove possibly leftover temporary download
- delete[] mCurlError;
+ delete []mCurlError;
std::set<OnlinePlayer*>::iterator itd = mOnlinePlayers.begin();
std::set<OnlinePlayer*>::iterator itd_end = mOnlinePlayers.end();
diff --git a/src/gui/widgets/avatarlistbox.cpp b/src/gui/widgets/avatarlistbox.cpp
index 2e3472515..822e71805 100644
--- a/src/gui/widgets/avatarlistbox.cpp
+++ b/src/gui/widgets/avatarlistbox.cpp
@@ -403,4 +403,4 @@ void AvatarListBox::optionChanged(const std::string &value)
mShowGender = config.getBoolValue("showgender");
else if (value == "showlevel")
mShowLevel = config.getBoolValue("showlevel");
-} \ No newline at end of file
+}
diff --git a/src/gui/widgets/battletab.h b/src/gui/widgets/battletab.h
index 8d85e739e..2a034a166 100644
--- a/src/gui/widgets/battletab.h
+++ b/src/gui/widgets/battletab.h
@@ -43,6 +43,3 @@ class BattleTab : public ChatTab
extern BattleTab *battleChatTab;
#endif
-
-
-
diff --git a/src/gui/widgets/chattab.cpp b/src/gui/widgets/chattab.cpp
index 6d5dfc9dd..018e35030 100644
--- a/src/gui/widgets/chattab.cpp
+++ b/src/gui/widgets/chattab.cpp
@@ -467,4 +467,4 @@ void ChatTab::addNewRow(std::string &line)
addRow(line);
}
mScrollArea->logic();
-} \ No newline at end of file
+}
diff --git a/src/gui/widgets/container.cpp b/src/gui/widgets/container.cpp
index 80028a62f..106112956 100644
--- a/src/gui/widgets/container.cpp
+++ b/src/gui/widgets/container.cpp
@@ -47,4 +47,4 @@ bool Container::safeRemove(gcn::Widget* widget)
}
}
return false;
-} \ No newline at end of file
+}
diff --git a/src/gui/widgets/dropdown.h b/src/gui/widgets/dropdown.h
index a769678ca..5896042fa 100644
--- a/src/gui/widgets/dropdown.h
+++ b/src/gui/widgets/dropdown.h
@@ -102,4 +102,3 @@ class DropDown : public gcn::DropDown
};
#endif // end DROPDOWN_H
-
diff --git a/src/gui/widgets/inventoryfilter.cpp b/src/gui/widgets/inventoryfilter.cpp
index 216c2bea0..515682cb6 100644
--- a/src/gui/widgets/inventoryfilter.cpp
+++ b/src/gui/widgets/inventoryfilter.cpp
@@ -58,4 +58,4 @@ void InventoryFilter::action(const gcn::ActionEvent &event)
{
(*iter)->action(event);
}
-} \ No newline at end of file
+}
diff --git a/src/gui/widgets/layout.h b/src/gui/widgets/layout.h
index 046d09b59..3c42554b6 100644
--- a/src/gui/widgets/layout.h
+++ b/src/gui/widgets/layout.h
@@ -37,8 +37,8 @@ class LayoutCell;
class ContainerPlacer
{
public:
- ContainerPlacer(gcn::Container *c = nullptr, LayoutCell *l = nullptr):
- mContainer(c), mCell(l)
+ ContainerPlacer(gcn::Container *c = nullptr, LayoutCell *lc = nullptr):
+ mContainer(c), mCell(lc)
{}
/**
diff --git a/src/gui/widgets/setupitem.cpp b/src/gui/widgets/setupitem.cpp
index 059b05ba2..56ce0a25a 100644
--- a/src/gui/widgets/setupitem.cpp
+++ b/src/gui/widgets/setupitem.cpp
@@ -455,7 +455,6 @@ void SetupItemIntTextField::apply(std::string eventName)
}
-
SetupItemLabel::SetupItemLabel(std::string text, std::string description,
SetupTabScroll *parent, bool separator) :
SetupItem(text, description, "", parent, "", "", true),
diff --git a/src/gui/widgets/setuptab.cpp b/src/gui/widgets/setuptab.cpp
index b3863c134..d4ae46eb8 100644
--- a/src/gui/widgets/setuptab.cpp
+++ b/src/gui/widgets/setuptab.cpp
@@ -31,4 +31,4 @@ SetupTab::SetupTab()
void SetupTab::externalUpdated()
{
-} \ No newline at end of file
+}
diff --git a/src/gui/widgets/shoplistbox.cpp b/src/gui/widgets/shoplistbox.cpp
index 71e373d70..ab6400149 100644
--- a/src/gui/widgets/shoplistbox.cpp
+++ b/src/gui/widgets/shoplistbox.cpp
@@ -191,4 +191,4 @@ void ShopListBox::mouseExited(gcn::MouseEvent& mouseEvent A_UNUSED)
return;
mItemPopup->hide();
-} \ No newline at end of file
+}
diff --git a/src/gui/widgets/slider.cpp b/src/gui/widgets/slider.cpp
index ed667e194..c6b57858c 100644
--- a/src/gui/widgets/slider.cpp
+++ b/src/gui/widgets/slider.cpp
@@ -298,4 +298,3 @@ void Slider::mouseExited(gcn::MouseEvent& event A_UNUSED)
{
mHasMouse = false;
}
-
diff --git a/src/gui/widgets/tablemodel.cpp b/src/gui/widgets/tablemodel.cpp
index 5216fb89c..bc5d2ead6 100644
--- a/src/gui/widgets/tablemodel.cpp
+++ b/src/gui/widgets/tablemodel.cpp
@@ -173,4 +173,3 @@ int StaticTableModel::getHeight() const
{
return mColumns * mHeight;
}
-
diff --git a/src/gui/widgets/textfield.cpp b/src/gui/widgets/textfield.cpp
index 4dba2eb57..e207b0613 100644
--- a/src/gui/widgets/textfield.cpp
+++ b/src/gui/widgets/textfield.cpp
@@ -208,29 +208,29 @@ void TextField::keyPressed(gcn::KeyEvent &keyEvent)
}
else if (!mMaximum || mText.size() < mMaximum)
{
- int l;
+ int len;
if (val < 128)
- l = 1; // 0xxxxxxx
+ len = 1; // 0xxxxxxx
else if (val < 0x800)
- l = 2; // 110xxxxx 10xxxxxx
+ len = 2; // 110xxxxx 10xxxxxx
else if (val < 0x10000)
- l = 3; // 1110xxxx 10xxxxxx 10xxxxxx
+ len = 3; // 1110xxxx 10xxxxxx 10xxxxxx
else
- l = 4; // 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
+ len = 4; // 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
char buf[4];
- for (int i = 0; i < l; ++i)
+ for (int i = 0; i < len; ++ i)
{
- buf[i] = static_cast<char>(val >> (6 * (l - i - 1)));
+ buf[i] = static_cast<char>(val >> (6 * (len - i - 1)));
if (i > 0)
buf[i] = static_cast<char>((buf[i] & 63) | 128);
}
- if (l > 1)
- buf[0] |= static_cast<char>(255 << (8 - l));
+ if (len > 1)
+ buf[0] |= static_cast<char>(255 << (8 - len));
- mText.insert(mCaretPosition, std::string(buf, buf + l));
- mCaretPosition += l;
+ mText.insert(mCaretPosition, std::string(buf, buf + len));
+ mCaretPosition += len;
}
}
diff --git a/src/gui/widgets/tradetab.h b/src/gui/widgets/tradetab.h
index 06add3ee0..44922c31a 100644
--- a/src/gui/widgets/tradetab.h
+++ b/src/gui/widgets/tradetab.h
@@ -46,6 +46,3 @@ class TradeTab : public ChatTab
extern TradeTab *tradeChatTab;
#endif
-
-
-
diff --git a/src/guichan/actionevent.cpp b/src/guichan/actionevent.cpp
index a91c6dec0..7348587d7 100644
--- a/src/guichan/actionevent.cpp
+++ b/src/guichan/actionevent.cpp
@@ -69,4 +69,3 @@ namespace gcn
return mId;
}
}
-
diff --git a/src/guichan/event.cpp b/src/guichan/event.cpp
index 691240d11..5983af7e7 100644
--- a/src/guichan/event.cpp
+++ b/src/guichan/event.cpp
@@ -68,4 +68,3 @@ namespace gcn
return mSource;
}
}
-
diff --git a/src/guichan/include/guichan/actionevent.hpp b/src/guichan/include/guichan/actionevent.hpp
index 96a2d1364..a6c54f516 100644
--- a/src/guichan/include/guichan/actionevent.hpp
+++ b/src/guichan/include/guichan/actionevent.hpp
@@ -112,4 +112,3 @@ namespace gcn
}
#endif // GCN_ACTIONEVENT_HPP
-
diff --git a/src/guichan/include/guichan/color.hpp b/src/guichan/include/guichan/color.hpp
index a051c3569..6f0cfc1ff 100644
--- a/src/guichan/include/guichan/color.hpp
+++ b/src/guichan/include/guichan/color.hpp
@@ -139,7 +139,7 @@ namespace gcn
*/
bool operator!=(const Color& color) const;
- /**
+ /**
* Output operator for output.
*
* @param out The stream to output to.
diff --git a/src/guichan/include/guichan/gui.hpp b/src/guichan/include/guichan/gui.hpp
index d8c9c7555..b2be75141 100644
--- a/src/guichan/include/guichan/gui.hpp
+++ b/src/guichan/include/guichan/gui.hpp
@@ -65,10 +65,15 @@ namespace gcn
/**
* @mainpage
* @section Introduction
- * This documentation is mostly intended as a reference to the API. If you want to get started with Guichan, we suggest you check out the programs in the examples directory of the Guichan release.
+ * This documentation is mostly intended as a reference to the API.
+ * If you want to get started with Guichan, we suggest you check out
+ * the programs in the examples directory of the Guichan release.
* @n
* @n
- * This documentation is, and will always be, work in progress. If you find any errors, typos or inconsistencies, or if you feel something needs to be explained in more detail - don't hesitate to tell us.
+ * This documentation is, and will always be, work in progress.
+ * If you find any errors, typos or inconsistencies, or if you feel
+ * something needs to be explained in more detail - don't hesitate to
+ * tell us.
*/
/**
diff --git a/src/guichan/include/guichan/sdl/sdlpixel.hpp b/src/guichan/include/guichan/sdl/sdlpixel.hpp
index 663c2059d..a0221ca7c 100644
--- a/src/guichan/include/guichan/sdl/sdlpixel.hpp
+++ b/src/guichan/include/guichan/sdl/sdlpixel.hpp
@@ -72,7 +72,7 @@ namespace gcn
unsigned int color = 0;
- switch(bpp)
+ switch (bpp)
{
case 1:
color = *p;
@@ -127,7 +127,7 @@ namespace gcn
Uint32 pixel = SDL_MapRGB(surface->format, color.r, color.g, color.b);
- switch(bpp)
+ switch (bpp)
{
case 1:
*p = pixel;
@@ -234,7 +234,7 @@ namespace gcn
Uint32 pixel = SDL_MapRGB(surface->format, color.r, color.g, color.b);
- switch(bpp)
+ switch (bpp)
{
case 1:
*p = pixel;
diff --git a/src/guichan/keyinput.cpp b/src/guichan/keyinput.cpp
index 3f5ebc124..35e8b6168 100644
--- a/src/guichan/keyinput.cpp
+++ b/src/guichan/keyinput.cpp
@@ -134,4 +134,3 @@ namespace gcn
mNumericPad = numpad;
}
}
-
diff --git a/src/guichan/sdl/sdlgraphics.cpp b/src/guichan/sdl/sdlgraphics.cpp
index 79c65da9f..c8cec6370 100644
--- a/src/guichan/sdl/sdlgraphics.cpp
+++ b/src/guichan/sdl/sdlgraphics.cpp
@@ -289,7 +289,7 @@ namespace gcn
mColor.r,
mColor.g,
mColor.b);
- switch(bpp)
+ switch (bpp)
{
case 1:
for (; x1 <= x2; ++x1)
@@ -400,7 +400,7 @@ namespace gcn
Uint32 pixel = SDL_MapRGB(mTarget->format, mColor.r,
mColor.g, mColor.b);
- switch(bpp)
+ switch (bpp)
{
case 1:
for (; y1 <= y2; ++y1)
diff --git a/src/guichan/selectionevent.cpp b/src/guichan/selectionevent.cpp
index 784252230..8c8a3f28f 100644
--- a/src/guichan/selectionevent.cpp
+++ b/src/guichan/selectionevent.cpp
@@ -63,4 +63,3 @@ namespace gcn
}
}
-
diff --git a/src/guichan/widgets/checkbox.cpp b/src/guichan/widgets/checkbox.cpp
index ab0b19e00..c7ec3e1e0 100644
--- a/src/guichan/widgets/checkbox.cpp
+++ b/src/guichan/widgets/checkbox.cpp
@@ -138,4 +138,3 @@ namespace gcn
distributeActionEvent();
}
}
-
diff --git a/src/guichan/widgets/dropdown.cpp b/src/guichan/widgets/dropdown.cpp
index 40abaf41f..ead4e7815 100644
--- a/src/guichan/widgets/dropdown.cpp
+++ b/src/guichan/widgets/dropdown.cpp
@@ -422,4 +422,3 @@ namespace gcn
}
}
}
-
diff --git a/src/guichan/widgets/icon.cpp b/src/guichan/widgets/icon.cpp
index c85ada7c3..dca3400ba 100644
--- a/src/guichan/widgets/icon.cpp
+++ b/src/guichan/widgets/icon.cpp
@@ -56,16 +56,16 @@
namespace gcn
{
- Icon::Icon()
- : mImage(nullptr)
- , mInternalImage(false)
+ Icon::Icon() :
+ mImage(nullptr),
+ mInternalImage(false)
{
setSize(0, 0);
}
- Icon::Icon(const std::string& filename)
- : mImage(nullptr),
- mInternalImage(false)
+ Icon::Icon(const std::string& filename) :
+ mImage(nullptr),
+ mInternalImage(false)
{
mImage = Image::load(filename);
mInternalImage = true;
@@ -73,9 +73,9 @@ namespace gcn
mImage->getHeight());
}
- Icon::Icon(const Image* image)
- : mImage(image),
- mInternalImage(false)
+ Icon::Icon(const Image* image) :
+ mImage(image),
+ mInternalImage(false)
{
setSize(mImage->getWidth(),
mImage->getHeight());
diff --git a/src/guichan/widgets/tab.cpp b/src/guichan/widgets/tab.cpp
index 96a347607..8afc248c5 100644
--- a/src/guichan/widgets/tab.cpp
+++ b/src/guichan/widgets/tab.cpp
@@ -116,4 +116,3 @@ namespace gcn
mHasMouse = false;
}
}
-
diff --git a/src/localconsts.h b/src/localconsts.h
index 2d0eb5dea..de67c3850 100644
--- a/src/localconsts.h
+++ b/src/localconsts.h
@@ -30,4 +30,4 @@
#define A_UNUSED __attribute__ ((unused))
#else
#define A_UNUSED
-#endif \ No newline at end of file
+#endif
diff --git a/src/localplayer.cpp b/src/localplayer.cpp
index 81c988d53..bb0c087d5 100644
--- a/src/localplayer.cpp
+++ b/src/localplayer.cpp
@@ -2338,7 +2338,7 @@ void LocalPlayer::crazyMove()
{
bool oldDisableCrazyMove = mDisableCrazyMove;
mDisableCrazyMove = true;
- switch(mCrazyMoveType)
+ switch (mCrazyMoveType)
{
case 1:
crazyMove1();
@@ -2449,7 +2449,7 @@ void LocalPlayer::crazyMove3()
if (mAction == MOVE)
return;
- switch(mCrazyMoveState)
+ switch (mCrazyMoveState)
{
case 0:
move(1, 1);
@@ -2483,7 +2483,7 @@ void LocalPlayer::crazyMove4()
if (mAction == MOVE)
return;
- switch(mCrazyMoveState)
+ switch (mCrazyMoveState)
{
case 0:
move(7, 0);
@@ -2503,7 +2503,7 @@ void LocalPlayer::crazyMove5()
if (mAction == MOVE)
return;
- switch(mCrazyMoveState)
+ switch (mCrazyMoveState)
{
case 0:
move(0, 7);
@@ -2523,7 +2523,7 @@ void LocalPlayer::crazyMove6()
if (mAction == MOVE)
return;
- switch(mCrazyMoveState)
+ switch (mCrazyMoveState)
{
case 0:
move(3, 0);
@@ -2567,7 +2567,7 @@ void LocalPlayer::crazyMove7()
if (mAction == MOVE)
return;
- switch(mCrazyMoveState)
+ switch (mCrazyMoveState)
{
case 0:
move(1, 1);
@@ -3045,7 +3045,7 @@ bool LocalPlayer::pickUpItems(int pickUpType)
return status;
int x1, y1, x2, y2;
- switch(pickUpType)
+ switch (pickUpType)
{
case 1:
switch (mDirection)
@@ -3206,7 +3206,7 @@ void LocalPlayer::magicAttack()
if (!Client::limitPackets(PACKET_CHAT))
return;
- switch(mMagicAttackType)
+ switch (mMagicAttackType)
{
//flar W00
case 0:
diff --git a/src/logger.cpp b/src/logger.cpp
index a2df9a911..1541616f2 100644
--- a/src/logger.cpp
+++ b/src/logger.cpp
@@ -186,7 +186,7 @@ void Logger::log(const char *log_text, ...)
debugChatTab->chatLog(buf, BY_LOGGER);
// Delete temporary buffer
- delete[] buf;
+ delete [] buf;
}
void Logger::error(const std::string &error_text)
diff --git a/src/map.cpp b/src/map.cpp
index a9aed4531..3ea9989a4 100644
--- a/src/map.cpp
+++ b/src/map.cpp
@@ -181,9 +181,9 @@ Map::~Map()
config.removeListener("beingopacity", this);
// delete metadata, layers, tilesets and overlays
- delete[] mMetaTiles;
+ delete [] mMetaTiles;
for (int i = 0; i < NB_BLOCKTYPES; i++)
- delete[] mOccupation[i];
+ delete [] mOccupation[i];
mFringeLayer = nullptr;
delete_all(mLayers);
@@ -1435,7 +1435,7 @@ void Map::clearIndexedTilesets()
return;
mTilesetsIndexed = false;
- delete[] mIndexedTilesets;
+ delete [] mIndexedTilesets;
mIndexedTilesetsSize = 0;
}
diff --git a/src/maplayer.cpp b/src/maplayer.cpp
index 3e9c47968..514a35858 100644
--- a/src/maplayer.cpp
+++ b/src/maplayer.cpp
@@ -56,7 +56,7 @@ MapLayer::MapLayer(int x, int y, int width, int height, bool fringeLayer):
MapLayer::~MapLayer()
{
config.removeListener("highlightAttackRange", this);
- delete[] mTiles;
+ delete [] mTiles;
delete_all(mTempRows);
mTempRows.clear();
}
@@ -534,7 +534,7 @@ SpecialLayer::~SpecialLayer()
delete mTiles[f];
mTiles[f] = nullptr;
}
- delete[] mTiles;
+ delete [] mTiles;
}
MapItem* SpecialLayer::getTile(int x, int y) const
@@ -722,7 +722,7 @@ void MapItem::draw(Graphics *graphics, int x, int y, int dx, int dy)
if (mImage)
graphics->drawImage(mImage, x, y);
- switch(mType)
+ switch (mType)
{
case ROAD:
case CROSS:
diff --git a/src/mumblemanager.cpp b/src/mumblemanager.cpp
index 100b600b4..7e857a52b 100644
--- a/src/mumblemanager.cpp
+++ b/src/mumblemanager.cpp
@@ -182,7 +182,7 @@ void MumbleManager::setAction(int action)
if (!mLinkedMem)
return;
- switch(action)
+ switch (action)
{
case 0: /* STAND */
case 1: /* WALK */
@@ -228,7 +228,7 @@ void MumbleManager::setPos(int tileX, int tileY, int direction)
// Unit vector pointing out of the avatars eyes
// (here Front looks into scene).
- switch(direction)
+ switch (direction)
{
case 4: /* UP */
mLinkedMemCache.fAvatarFront[0] = 0.0f;
diff --git a/src/net/ea/beinghandler.cpp b/src/net/ea/beinghandler.cpp
index 84bd03bb1..d9e7e7506 100644
--- a/src/net/ea/beinghandler.cpp
+++ b/src/net/ea/beinghandler.cpp
@@ -511,6 +511,12 @@ void BeingHandler::processBeingAction(Net::MessageIn &msg)
}
break;
+ case 0x01: // dead
+ break;
+ // tmw server can send here garbage?
+// if (srcBeing)
+// srcBeing->setAction(Being::DEAD);
+
case 0x02: // Sit
if (srcBeing)
{
diff --git a/src/net/ea/gui/partytab.cpp b/src/net/ea/gui/partytab.cpp
index cf62af459..d5e344ac2 100644
--- a/src/net/ea/gui/partytab.cpp
+++ b/src/net/ea/gui/partytab.cpp
@@ -242,4 +242,3 @@ void PartyTab::saveToLogFile(std::string &msg)
}
} // namespace Ea
-
diff --git a/src/net/ea/inventoryhandler.cpp b/src/net/ea/inventoryhandler.cpp
index 4c4fb760c..d870eff38 100644
--- a/src/net/ea/inventoryhandler.cpp
+++ b/src/net/ea/inventoryhandler.cpp
@@ -330,7 +330,7 @@ void InventoryHandler::processPlayerInventoryAdd(Net::MessageIn &msg)
{
Item *item = inventory->getItem(index);
- if (item && item->getId() == itemId)
+ if (item && item->getId() == itemId)
amount += item->getQuantity();
if (serverVersion < 1 && identified > 1)
diff --git a/src/net/manaserv/chathandler.cpp b/src/net/manaserv/chathandler.cpp
index f0a23127c..12451e6f6 100644
--- a/src/net/manaserv/chathandler.cpp
+++ b/src/net/manaserv/chathandler.cpp
@@ -293,7 +293,7 @@ void ChatHandler::handleChannelEvent(Net::MessageIn &msg)
if (channel)
{
- switch(eventId)
+ switch (eventId)
{
case CHAT_EVENT_NEW_PLAYER:
channel->getTab()->chatLog(strprintf(_("%s entered the "
diff --git a/src/net/manaserv/guildhandler.cpp b/src/net/manaserv/guildhandler.cpp
index dfd2ed3cf..aa82d6dcd 100644
--- a/src/net/manaserv/guildhandler.cpp
+++ b/src/net/manaserv/guildhandler.cpp
@@ -153,7 +153,7 @@ void GuildHandler::handleMessage(Net::MessageIn &msg)
Guild *guild = player_node->getGuild(guildId);
if (guild)
{
- switch(eventId)
+ switch (eventId)
{
case GUILD_EVENT_NEW_PLAYER:
member = guild->addMember(name);
diff --git a/src/net/manaserv/playerhandler.cpp b/src/net/manaserv/playerhandler.cpp
index aa79d4d41..b2609cf02 100644
--- a/src/net/manaserv/playerhandler.cpp
+++ b/src/net/manaserv/playerhandler.cpp
@@ -151,8 +151,7 @@ void PlayerHandler::handleMessage(Net::MessageIn &msg)
PlayerInfo::setAttribute(CORR_POINTS, msg.readInt16());
Particle* effect = particleEngine->addEffect(
paths.getStringValue("particles")
- + paths.getStringValue("levelUpEffectFile")
- , 0, 0);
+ + paths.getStringValue("levelUpEffectFile"), 0, 0);
player_node->controlParticle(effect);
} break;
diff --git a/src/net/net.cpp b/src/net/net.cpp
index 713b6aa7e..75bc35b72 100644
--- a/src/net/net.cpp
+++ b/src/net/net.cpp
@@ -202,4 +202,3 @@ ServerInfo::Type getNetworkType()
}
} // namespace Net
-
diff --git a/src/net/tmwa/gui/guildtab.cpp b/src/net/tmwa/gui/guildtab.cpp
index af90f5c6b..496ba64f5 100644
--- a/src/net/tmwa/gui/guildtab.cpp
+++ b/src/net/tmwa/gui/guildtab.cpp
@@ -53,4 +53,3 @@ GuildTab::~GuildTab()
}
} // namespace TmwAthena
-
diff --git a/src/net/tmwa/gui/partytab.cpp b/src/net/tmwa/gui/partytab.cpp
index d0738e79c..02bcfd54f 100644
--- a/src/net/tmwa/gui/partytab.cpp
+++ b/src/net/tmwa/gui/partytab.cpp
@@ -56,4 +56,3 @@ PartyTab::~PartyTab()
}
} // namespace TmwAthena
-
diff --git a/src/net/tmwa/network.cpp b/src/net/tmwa/network.cpp
index 31329eafb..6e9e367c0 100644
--- a/src/net/tmwa/network.cpp
+++ b/src/net/tmwa/network.cpp
@@ -133,8 +133,8 @@ Network::~Network()
mMutex = nullptr;
mInstance = nullptr;
- delete[] mInBuffer;
- delete[] mOutBuffer;
+ delete []mInBuffer;
+ delete []mOutBuffer;
SDLNet_Quit();
}
diff --git a/src/openglgraphics.cpp b/src/openglgraphics.cpp
index 2c3d914b0..bcf46e18b 100644
--- a/src/openglgraphics.cpp
+++ b/src/openglgraphics.cpp
@@ -61,9 +61,9 @@ OpenGLGraphics::OpenGLGraphics():
OpenGLGraphics::~OpenGLGraphics()
{
- delete[] mFloatTexArray;
- delete[] mIntTexArray;
- delete[] mIntVertArray;
+ delete [] mFloatTexArray;
+ delete [] mIntTexArray;
+ delete [] mIntVertArray;
}
void OpenGLGraphics::setSync(bool sync)
diff --git a/src/playerrelations.cpp b/src/playerrelations.cpp
index 6b5cb0199..38062c352 100644
--- a/src/playerrelations.cpp
+++ b/src/playerrelations.cpp
@@ -103,7 +103,8 @@ class PlayerConfSerialiser :
static PlayerConfSerialiser player_conf_serialiser; // stateless singleton
-const unsigned int PlayerRelation::RELATION_PERMISSIONS[RELATIONS_NR] = {
+const unsigned int PlayerRelation::RELATION_PERMISSIONS[RELATIONS_NR] =
+{
/* NEUTRAL */ 0, // we always fall back to the defaults anyway
/* FRIEND */ EMOTE | SPEECH_FLOAT | SPEECH_LOG | WHISPER | TRADE,
/* DISREGARDED*/ EMOTE | SPEECH_FLOAT,
@@ -531,8 +532,6 @@ public:
Uint8 mEmotion;
};
-
-
std::vector<PlayerIgnoreStrategy *> *
PlayerRelationsManager::getPlayerIgnoreStrategies()
{
diff --git a/src/resources/image.cpp b/src/resources/image.cpp
index 6f9042029..0ac11f114 100644
--- a/src/resources/image.cpp
+++ b/src/resources/image.cpp
@@ -250,14 +250,14 @@ Image *Image::createTextSurface(SDL_Surface *tmpImage, float alpha)
// We also delete the alpha channel since
// it's not used.
- delete[] alphaChannel;
+ delete [] alphaChannel;
alphaChannel = nullptr;
}
if (!image)
{
logger->log1("Error: Image convert failed.");
- delete[] alphaChannel;
+ delete [] alphaChannel;
return nullptr;
}
@@ -295,7 +295,7 @@ void Image::unload()
SDL_FreeSurface(mSDLSurface);
mSDLSurface = nullptr;
- delete[] mAlphaChannel;
+ delete [] mAlphaChannel;
mAlphaChannel = nullptr;
}
@@ -689,14 +689,14 @@ Image *Image::_SDLload(SDL_Surface *tmpImage)
// We also delete the alpha channel since
// it's not used.
- delete[] alphaChannel;
+ delete [] alphaChannel;
alphaChannel = nullptr;
}
if (!image)
{
logger->log1("Error: Image convert failed.");
- delete[] alphaChannel;
+ delete [] alphaChannel;
return nullptr;
}
diff --git a/src/resources/mapreader.cpp b/src/resources/mapreader.cpp
index 1ddb74f20..eec14685d 100644
--- a/src/resources/mapreader.cpp
+++ b/src/resources/mapreader.cpp
@@ -503,7 +503,7 @@ void MapReader::readLayer(XmlNodePtr node, Map *map)
const char *charStart = reinterpret_cast<const char*>(xmlChars);
if (!charStart)
{
- delete[] charData;
+ delete [] charData;
return;
}
@@ -526,7 +526,7 @@ void MapReader::readLayer(XmlNodePtr node, Map *map)
static_cast<int>(strlen(reinterpret_cast<char*>(
charData))), &binLen);
- delete[] charData;
+ delete [] charData;
xmlFree(xmlChars);
if (binData)
diff --git a/src/resources/resourcemanager.cpp b/src/resources/resourcemanager.cpp
index c26526b97..7adeaa268 100644
--- a/src/resources/resourcemanager.cpp
+++ b/src/resources/resourcemanager.cpp
@@ -404,19 +404,19 @@ struct ResourceLoader
{
if (!v)
return nullptr;
- ResourceLoader *l = static_cast< ResourceLoader * >(v);
- SDL_RWops *rw = PHYSFSRWOPS_openRead(l->path.c_str());
+ ResourceLoader *rl = static_cast< ResourceLoader * >(v);
+ SDL_RWops *rw = PHYSFSRWOPS_openRead(rl->path.c_str());
if (!rw)
return nullptr;
- Resource *res = l->fun(rw);
+ Resource *res = rl->fun(rw);
return res;
}
};
Resource *ResourceManager::load(const std::string &path, loader fun)
{
- ResourceLoader l = { this, path, fun };
- return get(path, ResourceLoader::load, &l);
+ ResourceLoader rl = { this, path, fun };
+ return get(path, ResourceLoader::load, &rl);
}
Music *ResourceManager::getMusic(const std::string &idPath)
@@ -438,11 +438,11 @@ struct DyedImageLoader
if (!v)
return nullptr;
- DyedImageLoader *l = static_cast< DyedImageLoader * >(v);
- if (!l->manager)
+ DyedImageLoader *rl = static_cast< DyedImageLoader * >(v);
+ if (!rl->manager)
return nullptr;
- std::string path = l->path;
+ std::string path = rl->path;
std::string::size_type p = path.find('|');
Dye *d = nullptr;
if (p != std::string::npos)
@@ -465,8 +465,8 @@ struct DyedImageLoader
Image *ResourceManager::getImage(const std::string &idPath)
{
- DyedImageLoader l = { this, idPath };
- return static_cast<Image*>(get(idPath, DyedImageLoader::load, &l));
+ DyedImageLoader rl = { this, idPath };
+ return static_cast<Image*>(get(idPath, DyedImageLoader::load, &rl));
}
/*
@@ -475,8 +475,8 @@ Image *ResourceManager::getSkinImage(const std::string &idPath)
if (mSelectedSkin.empty())
return getImage(idPath);
- DyedImageLoader l = { this, mSelectedSkin + idPath };
- void *ptr = get(idPath, DyedImageLoader::load, &l);
+ DyedImageLoader rl = { this, mSelectedSkin + idPath };
+ void *ptr = get(idPath, DyedImageLoader::load, &rl);
if (ptr)
return static_cast<Image*>(ptr);
else
@@ -494,14 +494,14 @@ struct ImageSetLoader
if (!v)
return nullptr;
- ImageSetLoader *l = static_cast< ImageSetLoader * >(v);
- if (!l->manager)
+ ImageSetLoader *rl = static_cast< ImageSetLoader * >(v);
+ if (!rl->manager)
return nullptr;
- Image *img = l->manager->getImage(l->path);
+ Image *img = rl->manager->getImage(rl->path);
if (!img)
return nullptr;
- ImageSet *res = new ImageSet(img, l->w, l->h);
+ ImageSet *res = new ImageSet(img, rl->w, rl->h);
img->decRef();
return res;
}
@@ -510,10 +510,10 @@ struct ImageSetLoader
ImageSet *ResourceManager::getImageSet(const std::string &imagePath,
int w, int h)
{
- ImageSetLoader l = { this, imagePath, w, h };
+ ImageSetLoader rl = { this, imagePath, w, h };
std::stringstream ss;
ss << imagePath << "[" << w << "x" << h << "]";
- return static_cast<ImageSet*>(get(ss.str(), ImageSetLoader::load, &l));
+ return static_cast<ImageSet*>(get(ss.str(), ImageSetLoader::load, &rl));
}
struct SpriteDefLoader
@@ -525,17 +525,17 @@ struct SpriteDefLoader
if (!v)
return nullptr;
- SpriteDefLoader *l = static_cast< SpriteDefLoader * >(v);
- return SpriteDef::load(l->path, l->variant);
+ SpriteDefLoader *rl = static_cast< SpriteDefLoader * >(v);
+ return SpriteDef::load(rl->path, rl->variant);
}
};
SpriteDef *ResourceManager::getSprite(const std::string &path, int variant)
{
- SpriteDefLoader l = { path, variant };
+ SpriteDefLoader rl = { path, variant };
std::stringstream ss;
ss << path << "[" << variant << "]";
- return static_cast<SpriteDef*>(get(ss.str(), SpriteDefLoader::load, &l));
+ return static_cast<SpriteDef*>(get(ss.str(), SpriteDefLoader::load, &rl));
}
void ResourceManager::release(Resource *res)
@@ -723,10 +723,10 @@ struct RescaledLoader
{
if (!v)
return nullptr;
- RescaledLoader *l = static_cast< RescaledLoader * >(v);
- if (!l->manager)
+ RescaledLoader *rl = static_cast< RescaledLoader * >(v);
+ if (!rl->manager || !rl->image)
return nullptr;
- Image *rescaled = l->image->SDLgetScaledImage(l->width, l->height);
+ Image *rescaled = rl->image->SDLgetScaledImage(rl->width, rl->height);
if (!rescaled)
return nullptr;
return rescaled;
@@ -740,7 +740,7 @@ Image *ResourceManager::getRescaled(Image *image, int width, int height)
std::string idPath = image->getIdPath() + strprintf(
"_rescaled%dx%d", width, height);
- RescaledLoader l = { this, image, width, height };
- Image *img = static_cast<Image*>(get(idPath, RescaledLoader::load, &l));
+ RescaledLoader rl = { this, image, width, height };
+ Image *img = static_cast<Image*>(get(idPath, RescaledLoader::load, &rl));
return img;
}
diff --git a/src/resources/specialdb.cpp b/src/resources/specialdb.cpp
index b1a3a9c4d..664d2c73d 100644
--- a/src/resources/specialdb.cpp
+++ b/src/resources/specialdb.cpp
@@ -36,7 +36,7 @@ namespace
SpecialInfo::TargetMode SpecialDB::targetModeFromString(const std::string& str)
{
- if (str == "self") return SpecialInfo::TARGET_SELF;
+ if (str == "self") return SpecialInfo::TARGET_SELF;
else if (str == "friend") return SpecialInfo::TARGET_FRIEND;
else if (str == "enemy") return SpecialInfo::TARGET_ENEMY;
else if (str == "being") return SpecialInfo::TARGET_BEING;
@@ -131,4 +131,3 @@ SpecialInfo *SpecialDB::get(int id)
return i->second;
return nullptr;
}
-
diff --git a/src/spellmanager.cpp b/src/spellmanager.cpp
index 7c4c444f0..ebdff6382 100644
--- a/src/spellmanager.cpp
+++ b/src/spellmanager.cpp
@@ -66,7 +66,8 @@ TextCommand* SpellManager::getSpellByItem(int itemId)
void SpellManager::fillSpells()
{
-//id, std::string name, std::string symbol, ST type, int basicLvl, MagicSchool school, int schoolLvl, int mana)
+//id, std::string name, std::string symbol, ST type, int basicLvl,
+// MagicSchool school, int schoolLvl, int mana)
addSpell(new TextCommand(0, "lum", "#lum", "heal with lifestones",
ALLOWTARGET, "", 1, SKILL_MAGIC_LIFE, 0, 6));
diff --git a/src/textcommand.h b/src/textcommand.h
index 27b44cc7a..6677b97e9 100644
--- a/src/textcommand.h
+++ b/src/textcommand.h
@@ -153,7 +153,7 @@ class TextCommand
{ mCommandType = commandType; }
bool isEmpty() const
- { return mCommand == "" && mSymbol == "" ; }
+ { return mCommand == "" && mSymbol == ""; }
Image *getImage() const
{ return mImage; }
diff --git a/src/units.cpp b/src/units.cpp
index 804512dbd..1440cff9f 100644
--- a/src/units.cpp
+++ b/src/units.cpp
@@ -150,12 +150,12 @@ void Units::loadUnits()
}
// Add one more level for saftey
- struct UnitLevel ll;
- ll.symbol = "";
- ll.count = INT_MAX;
- ll.round = 0;
+ struct UnitLevel lev;
+ lev.symbol = "";
+ lev.count = INT_MAX;
+ lev.round = 0;
- ud.levels.push_back(ll);
+ ud.levels.push_back(lev);
if (type == "weight")
units[UNIT_WEIGHT] = ud;
diff --git a/src/utils/base64.cpp b/src/utils/base64.cpp
index 24a3a58e3..cd7d59cdb 100644
--- a/src/utils/base64.cpp
+++ b/src/utils/base64.cpp
@@ -125,7 +125,7 @@ unsigned char *php3_base64_decode(const unsigned char *string,
continue;
ch = static_cast<int>(chp - base64_table);
- switch(i % 4)
+ switch (i % 4)
{
case 0:
result[j] = ch << 2;
@@ -151,7 +151,7 @@ unsigned char *php3_base64_decode(const unsigned char *string,
/* mop things up if we ended on a boundary */
if (ch == base64_pad)
{
- switch(i % 4)
+ switch (i % 4)
{
case 0:
case 1:
diff --git a/src/utils/physfsrwops.h b/src/utils/physfsrwops.h
index efa004ac6..1f52f40aa 100644
--- a/src/utils/physfsrwops.h
+++ b/src/utils/physfsrwops.h
@@ -79,4 +79,3 @@ SDL_RWops *PHYSFSRWOPS_makeRWops(PHYSFS_file *handle);
#endif /* include-once blocker */
/* end of physfsrwops.h ... */
-
diff --git a/src/utils/stringutils.cpp b/src/utils/stringutils.cpp
index becb2124d..5e7bf19a0 100644
--- a/src/utils/stringutils.cpp
+++ b/src/utils/stringutils.cpp
@@ -405,7 +405,7 @@ std::set<int> splitToIntSet(const std::string &text, char separator)
std::set<int> tokens;
std::stringstream ss(text);
std::string item;
- while(std::getline(ss, item, separator))
+ while (std::getline(ss, item, separator))
tokens.insert(atoi(item.c_str()));
return tokens;
@@ -416,7 +416,7 @@ std::list<int> splitToIntList(const std::string &text, char separator)
std::list<int> tokens;
std::stringstream ss(text);
std::string item;
- while(std::getline(ss, item, separator))
+ while (std::getline(ss, item, separator))
tokens.push_back(atoi(item.c_str()));
return tokens;
@@ -429,7 +429,7 @@ std::list<std::string> splitToStringList(const std::string &text,
std::list<std::string> tokens;
std::stringstream ss(text);
std::string item;
- while(std::getline(ss, item, separator))
+ while (std::getline(ss, item, separator))
tokens.push_back(item);
return tokens;
@@ -440,7 +440,7 @@ void splitToStringVector(std::vector<std::string> &tokens,
{
std::stringstream ss(text);
std::string item;
- while(std::getline(ss, item, separator))
+ while (std::getline(ss, item, separator))
{
item = trim(item);
if (!item.empty())
diff --git a/src/vector.h b/src/vector.h
index 744b235c0..2caf48418 100644
--- a/src/vector.h
+++ b/src/vector.h
@@ -185,8 +185,8 @@ class Vector
*/
Vector normalized() const
{
- const float l = length();
- return Vector(x / l, y / l, z / l);
+ const float len = length();
+ return Vector(x / len, y / len, z / len);
}
float x, y, z;