Skip to content

Commit 91a9382

Browse files
authoredApr 23, 2017
Pass clang-format on various cpp/header files (#5559)
1 parent 0c34fe2 commit 91a9382

30 files changed

+138
-183
lines changed
 

‎src/ban.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ class BanManager
4141
void add(const std::string &ip, const std::string &name);
4242
void remove(const std::string &ip_or_name);
4343
bool isModified();
44+
4445
private:
4546
Mutex m_mutex;
4647
std::string m_banfilepath;
4748
StringMap m_ips;
4849
bool m_modified;
49-
5050
};
5151

5252
#endif

‎src/cavegen.h

+23-22
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,12 @@ class GenerateNotifier;
3737
TODO(hmmmm): Remove dependency on biomes
3838
TODO(hmmmm): Find alternative to overgeneration as solution for sunlight issue
3939
*/
40-
class CavesNoiseIntersection {
40+
class CavesNoiseIntersection
41+
{
4142
public:
4243
CavesNoiseIntersection(INodeDefManager *nodedef, BiomeManager *biomemgr,
43-
v3s16 chunksize, NoiseParams *np_cave1, NoiseParams *np_cave2,
44-
s32 seed, float cave_width);
44+
v3s16 chunksize, NoiseParams *np_cave1, NoiseParams *np_cave2,
45+
s32 seed, float cave_width);
4546
~CavesNoiseIntersection();
4647

4748
void generateCaves(MMVManip *vm, v3s16 nmin, v3s16 nmax, u8 *biomemap);
@@ -65,10 +66,12 @@ class CavesNoiseIntersection {
6566
/*
6667
CavernsNoise is a cave digging algorithm
6768
*/
68-
class CavernsNoise {
69+
class CavernsNoise
70+
{
6971
public:
7072
CavernsNoise(INodeDefManager *nodedef, v3s16 chunksize, NoiseParams *np_cavern,
71-
s32 seed, float cavern_limit, float cavern_taper, float cavern_threshold);
73+
s32 seed, float cavern_limit, float cavern_taper,
74+
float cavern_threshold);
7275
~CavernsNoise();
7376

7477
bool generateCaverns(MMVManip *vm, v3s16 nmin, v3s16 nmax);
@@ -105,7 +108,8 @@ class CavernsNoise {
105108
This algorithm is very fast, executing in less than 1ms on average for an
106109
80x80x80 chunk of map on a modern processor.
107110
*/
108-
class CavesRandomWalk {
111+
class CavesRandomWalk
112+
{
109113
public:
110114
MMVManip *vm;
111115
INodeDefManager *ndef;
@@ -150,18 +154,16 @@ class CavesRandomWalk {
150154

151155
// ndef is a mandatory parameter.
152156
// If gennotify is NULL, generation events are not logged.
153-
CavesRandomWalk(INodeDefManager *ndef,
154-
GenerateNotifier *gennotify = NULL,
155-
s32 seed = 0,
156-
int water_level = 1,
157-
content_t water_source = CONTENT_IGNORE,
158-
content_t lava_source = CONTENT_IGNORE);
157+
CavesRandomWalk(INodeDefManager *ndef, GenerateNotifier *gennotify = NULL,
158+
s32 seed = 0, int water_level = 1,
159+
content_t water_source = CONTENT_IGNORE,
160+
content_t lava_source = CONTENT_IGNORE);
159161

160162
// vm and ps are mandatory parameters.
161163
// If heightmap is NULL, the surface level at all points is assumed to
162164
// be water_level.
163165
void makeCave(MMVManip *vm, v3s16 nmin, v3s16 nmax, PseudoRandom *ps,
164-
bool is_large_cave, int max_stone_height, s16 *heightmap);
166+
bool is_large_cave, int max_stone_height, s16 *heightmap);
165167

166168
private:
167169
void makeTunnel(bool dirswitch);
@@ -183,7 +185,8 @@ class CavesRandomWalk {
183185
tl;dr,
184186
*** DO NOT TOUCH THIS CLASS UNLESS YOU KNOW WHAT YOU ARE DOING ***
185187
*/
186-
class CavesV6 {
188+
class CavesV6
189+
{
187190
public:
188191
MMVManip *vm;
189192
INodeDefManager *ndef;
@@ -222,18 +225,16 @@ class CavesV6 {
222225

223226
// ndef is a mandatory parameter.
224227
// If gennotify is NULL, generation events are not logged.
225-
CavesV6(INodeDefManager *ndef,
226-
GenerateNotifier *gennotify = NULL,
227-
int water_level = 1,
228-
content_t water_source = CONTENT_IGNORE,
229-
content_t lava_source = CONTENT_IGNORE);
228+
CavesV6(INodeDefManager *ndef, GenerateNotifier *gennotify = NULL,
229+
int water_level = 1, content_t water_source = CONTENT_IGNORE,
230+
content_t lava_source = CONTENT_IGNORE);
230231

231232
// vm, ps, and ps2 are mandatory parameters.
232233
// If heightmap is NULL, the surface level at all points is assumed to
233234
// be water_level.
234-
void makeCave(MMVManip *vm, v3s16 nmin, v3s16 nmax,
235-
PseudoRandom *ps, PseudoRandom *ps2,
236-
bool is_large_cave, int max_stone_height, s16 *heightmap = NULL);
235+
void makeCave(MMVManip *vm, v3s16 nmin, v3s16 nmax, PseudoRandom *ps,
236+
PseudoRandom *ps2, bool is_large_cave, int max_stone_height,
237+
s16 *heightmap = NULL);
237238

238239
private:
239240
void makeTunnel(bool dirswitch);

‎src/constants.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
8585
*/
8686

8787
// Size of player's main inventory
88-
#define PLAYER_INVENTORY_SIZE (8*4)
88+
#define PLAYER_INVENTORY_SIZE (8 * 4)
8989

9090
// Maximum hit points of a player
9191
#define PLAYER_MAX_HP 20
@@ -110,10 +110,10 @@ with this program; if not, write to the Free Software Foundation, Inc.,
110110

111111
// TODO: implement dpi-based scaling for windows and remove this hack
112112
#if defined(_WIN32)
113-
#define TTF_DEFAULT_FONT_SIZE (18)
113+
#define TTF_DEFAULT_FONT_SIZE (18)
114114
#else
115-
#define TTF_DEFAULT_FONT_SIZE (16)
115+
#define TTF_DEFAULT_FONT_SIZE (16)
116116
#endif
117-
#define DEFAULT_FONT_SIZE (10)
117+
#define DEFAULT_FONT_SIZE (10)
118118

119119
#endif

‎src/content_abm.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
2929
#include "serverscripting.h"
3030
#include "log.h"
3131

32-
void add_legacy_abms(ServerEnvironment *env, INodeDefManager *nodedef) {
33-
32+
void add_legacy_abms(ServerEnvironment *env, INodeDefManager *nodedef)
33+
{
3434
}

‎src/database-dummy.h

-1
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,3 @@ class Database_Dummy : public Database
3838
};
3939

4040
#endif
41-

‎src/defaultsettings.h

-1
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,3 @@ void set_default_settings(Settings *settings);
3636
void override_default_settings(Settings *settings, Settings *from);
3737

3838
#endif
39-

‎src/environment.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class Environment
5858
*/
5959
virtual void step(f32 dtime) = 0;
6060

61-
virtual Map & getMap() = 0;
61+
virtual Map &getMap() = 0;
6262

6363
u32 getDayNightRatio();
6464

@@ -78,7 +78,7 @@ class Environment
7878
// counter used internally when triggering ABMs
7979
u32 m_added_objects;
8080

81-
IGameDef* getGameDef() { return m_gamedef; }
81+
IGameDef *getGameDef() { return m_gamedef; }
8282
protected:
8383
GenericAtomic<float> m_time_of_day_speed;
8484

@@ -117,11 +117,11 @@ class Environment
117117
float m_cache_nodetimer_interval;
118118

119119
IGameDef *m_gamedef;
120+
120121
private:
121122
Mutex m_time_lock;
122123

123124
DISABLE_CLASS_COPY(Environment);
124125
};
125126

126127
#endif
127-

‎src/guiKeyChangeMenu.h

+8-10
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,20 @@
3030
#include <string>
3131
#include <vector>
3232

33-
struct key_setting {
33+
struct key_setting
34+
{
3435
int id;
3536
const wchar_t *button_name;
3637
KeyPress key;
3738
std::string setting_name;
3839
gui::IGUIButton *button;
3940
};
4041

41-
42-
class GUIKeyChangeMenu: public GUIModalMenu
42+
class GUIKeyChangeMenu : public GUIModalMenu
4343
{
4444
public:
45-
GUIKeyChangeMenu(gui::IGUIEnvironment* env, gui::IGUIElement* parent,
46-
s32 id, IMenuManager *menumgr);
45+
GUIKeyChangeMenu(gui::IGUIEnvironment *env, gui::IGUIElement *parent, s32 id,
46+
IMenuManager *menumgr);
4747
~GUIKeyChangeMenu();
4848

4949
void removeChildren();
@@ -56,24 +56,22 @@ class GUIKeyChangeMenu: public GUIModalMenu
5656

5757
bool acceptInput();
5858

59-
bool OnEvent(const SEvent& event);
59+
bool OnEvent(const SEvent &event);
6060

6161
private:
62-
6362
void init_keys();
6463

6564
bool resetMenu();
6665

6766
void add_key(int id, const wchar_t *button_name, const std::string &setting_name);
6867

6968
bool shift_down;
70-
69+
7170
s32 activeKey;
72-
71+
7372
std::vector<KeyPress> key_used;
7473
gui::IGUIStaticText *key_used_text;
7574
std::vector<key_setting *> key_settings;
7675
};
7776

7877
#endif
79-

‎src/guiPasswordChange.h

+6-10
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,10 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
2727
class GUIPasswordChange : public GUIModalMenu
2828
{
2929
public:
30-
GUIPasswordChange(gui::IGUIEnvironment* env,
31-
gui::IGUIElement* parent, s32 id,
32-
IMenuManager *menumgr,
33-
Client* client);
30+
GUIPasswordChange(gui::IGUIEnvironment *env, gui::IGUIElement *parent, s32 id,
31+
IMenuManager *menumgr, Client *client);
3432
~GUIPasswordChange();
35-
33+
3634
void removeChildren();
3735
/*
3836
Remove and re-add (or reposition) stuff
@@ -43,12 +41,10 @@ class GUIPasswordChange : public GUIModalMenu
4341

4442
bool acceptInput();
4543

46-
bool OnEvent(const SEvent& event);
47-
48-
private:
49-
Client* m_client;
44+
bool OnEvent(const SEvent &event);
5045

46+
private:
47+
Client *m_client;
5148
};
5249

5350
#endif
54-

‎src/irrlichttypes_bloated.h

-1
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,3 @@ with this program; if not, write to the Free Software Foundation, Inc.,
2929
#include <SColor.h>
3030

3131
#endif
32-

‎src/irrlichttypes_extrabloated.h

-1
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,3 @@ with this program; if not, write to the Free Software Foundation, Inc.,
3636
#endif
3737

3838
#endif
39-

‎src/itemgroup.h

+2-4
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,12 @@ with this program; if not, write to the Free Software Foundation, Inc.,
2525

2626
typedef UNORDERED_MAP<std::string, int> ItemGroupList;
2727

28-
static inline int itemgroup_get(const ItemGroupList &groups,
29-
const std::string &name)
28+
static inline int itemgroup_get(const ItemGroupList &groups, const std::string &name)
3029
{
3130
ItemGroupList::const_iterator i = groups.find(name);
32-
if(i == groups.end())
31+
if (i == groups.end())
3332
return 0;
3433
return i->second;
3534
}
3635

3736
#endif
38-

‎src/keycode.h

+3-4
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,16 @@ class KeyPress
3434
KeyPress();
3535
KeyPress(const char *name);
3636

37-
KeyPress(const irr::SEvent::SKeyInput &in, bool prefer_character=false);
37+
KeyPress(const irr::SEvent::SKeyInput &in, bool prefer_character = false);
3838

3939
bool operator==(const KeyPress &o) const
4040
{
41-
return (Char > 0 && Char == o.Char) ||
42-
(valid_kcode(Key) && Key == o.Key);
41+
return (Char > 0 && Char == o.Char) || (valid_kcode(Key) && Key == o.Key);
4342
}
4443

4544
const char *sym() const;
4645
const char *name() const;
46+
4747
protected:
4848
static bool valid_kcode(irr::EKEY_CODE k)
4949
{
@@ -68,4 +68,3 @@ void clearKeyCache();
6868
irr::EKEY_CODE keyname_to_keycode(const char *name);
6969

7070
#endif
71-

0 commit comments

Comments
 (0)
Please sign in to comment.