Skip to content

Commit 987eb2b

Browse files
authoredApr 1, 2017
Clang-format: trivial fix on some headers (#5495)
Fix some headers style and remove them from whitelist
1 parent 63ac62e commit 987eb2b

13 files changed

+18
-42
lines changed
 

Diff for: ‎src/client/keys.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@ with this program; if not, write to the Free Software Foundation, Inc.,
2020
#ifndef KEYS_HEADER
2121
#define KEYS_HEADER
2222

23-
#include<list>
23+
#include <list>
2424

25-
class KeyType {
25+
class KeyType
26+
{
2627
public:
2728
enum T {
2829
// Player movement
@@ -83,5 +84,4 @@ class KeyType {
8384

8485
typedef KeyType::T GameKeyType;
8586

86-
8787
#endif

Diff for: ‎src/clientsimpleobject.h

+3-4
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,9 @@ class ClientSimpleObject
2929
public:
3030
bool m_to_be_removed;
3131

32-
ClientSimpleObject(): m_to_be_removed(false) {}
33-
virtual ~ClientSimpleObject(){}
34-
virtual void step(float dtime){}
32+
ClientSimpleObject() : m_to_be_removed(false) {}
33+
virtual ~ClientSimpleObject() {}
34+
virtual void step(float dtime) {}
3535
};
3636

3737
#endif
38-

Diff for: ‎src/content_abm.h

-1
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,3 @@ class INodeDefManager;
3030
void add_legacy_abms(ServerEnvironment *env, INodeDefManager *nodedef);
3131

3232
#endif
33-

Diff for: ‎src/database-leveldb.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
2424

2525
#if USE_LEVELDB
2626

27+
#include <string>
2728
#include "database.h"
2829
#include "leveldb/db.h"
29-
#include <string>
3030

3131
class Database_LevelDB : public Database
3232
{
@@ -46,4 +46,3 @@ class Database_LevelDB : public Database
4646
#endif // USE_LEVELDB
4747

4848
#endif
49-

Diff for: ‎src/database-redis.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
2424

2525
#if USE_REDIS
2626

27-
#include "database.h"
2827
#include <hiredis.h>
2928
#include <string>
29+
#include "database.h"
3030

3131
class Settings;
3232

@@ -52,4 +52,3 @@ class Database_Redis : public Database
5252
#endif // USE_REDIS
5353

5454
#endif
55-

Diff for: ‎src/database-sqlite3.h

+3-4
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
2020
#ifndef DATABASE_SQLITE3_HEADER
2121
#define DATABASE_SQLITE3_HEADER
2222

23-
#include "database.h"
2423
#include <string>
24+
#include "database.h"
2525

2626
extern "C" {
27-
#include "sqlite3.h"
27+
#include "sqlite3.h"
2828
}
2929

3030
class Database_SQLite3 : public Database
@@ -50,7 +50,7 @@ class Database_SQLite3 : public Database
5050
// Open and initialize the database if needed
5151
void verifyDatabase();
5252

53-
void bindPos(sqlite3_stmt *stmt, const v3s16 &pos, int index=1);
53+
void bindPos(sqlite3_stmt *stmt, const v3s16 &pos, int index = 1);
5454

5555
bool m_initialized;
5656

@@ -70,4 +70,3 @@ class Database_SQLite3 : public Database
7070
};
7171

7272
#endif
73-

Diff for: ‎src/database.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
2020
#ifndef DATABASE_HEADER
2121
#define DATABASE_HEADER
2222

23-
#include <vector>
2423
#include <string>
24+
#include <vector>
2525
#include "irr_v3d.h"
2626
#include "irrlichttypes.h"
2727
#include "util/basic_macros.h"
@@ -47,4 +47,3 @@ class Database
4747
};
4848

4949
#endif
50-

Diff for: ‎src/filecache.h

+4-6
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,20 @@ with this program; if not, write to the Free Software Foundation, Inc.,
2121
#ifndef FILECACHE_HEADER
2222
#define FILECACHE_HEADER
2323

24-
#include <string>
2524
#include <iostream>
25+
#include <string>
2626

2727
class FileCache
2828
{
2929
public:
3030
/*
3131
'dir' is the file cache directory to use.
3232
*/
33-
FileCache(std::string dir):
34-
m_dir(dir)
35-
{
36-
}
37-
33+
FileCache(std::string dir) : m_dir(dir) {}
34+
3835
bool update(const std::string &name, const std::string &data);
3936
bool load(const std::string &name, std::ostream &os);
37+
4038
private:
4139
std::string m_dir;
4240

Diff for: ‎src/gettime.h

+2-3
Original file line numberDiff line numberDiff line change
@@ -45,19 +45,18 @@ extern u32 getTime(TimePrecision prec);
4545
Timestamp stuff
4646
*/
4747

48-
#include <time.h>
4948
#include <string>
49+
#include <time.h>
5050

5151
inline std::string getTimestamp()
5252
{
5353
time_t t = time(NULL);
5454
// This is not really thread-safe but it won't break anything
5555
// except its own output, so just go with it.
5656
struct tm *tm = localtime(&t);
57-
char cs[20]; //YYYY-MM-DD HH:MM:SS + '\0'
57+
char cs[20]; // YYYY-MM-DD HH:MM:SS + '\0'
5858
strftime(cs, 20, "%Y-%m-%d %H:%M:%S", tm);
5959
return cs;
6060
}
6161

62-
6362
#endif

Diff for: ‎src/irr_aabb3d.h

-1
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,3 @@ with this program; if not, write to the Free Software Foundation, Inc.,
2727
typedef core::aabbox3d<f32> aabb3f;
2828

2929
#endif
30-

Diff for: ‎src/irr_v2d.h

-1
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,3 @@ typedef core::vector2d<u32> v2u32;
3131
typedef core::vector2d<f32> v2f32;
3232

3333
#endif
34-

Diff for: ‎src/irr_v3d.h

-1
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,3 @@ typedef core::vector3d<u16> v3u16;
3030
typedef core::vector3d<s32> v3s32;
3131

3232
#endif
33-

Diff for: ‎util/travis/clang-format-whitelist.txt

-12
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,12 @@ src/clientiface.h
2323
src/client/inputhandler.h
2424
src/client/joystick_controller.cpp
2525
src/client/joystick_controller.h
26-
src/client/keys.h
2726
src/clientmap.cpp
2827
src/clientmap.h
2928
src/clientmedia.cpp
3029
src/clientmedia.h
3130
src/clientobject.cpp
3231
src/clientobject.h
33-
src/clientsimpleobject.h
3432
src/client/tile.cpp
3533
src/client/tile.h
3634
src/clouds.cpp
@@ -40,7 +38,6 @@ src/collision.h
4038
src/config.h
4139
src/constants.h
4240
src/content_abm.cpp
43-
src/content_abm.h
4441
src/content_cao.cpp
4542
src/content_cao.h
4643
src/content_cso.cpp
@@ -59,15 +56,11 @@ src/craftdef.h
5956
src/database.cpp
6057
src/database-dummy.cpp
6158
src/database-dummy.h
62-
src/database.h
6359
src/database-leveldb.cpp
64-
src/database-leveldb.h
6560
src/database-postgresql.cpp
6661
src/database-postgresql.h
6762
src/database-redis.cpp
68-
src/database-redis.h
6963
src/database-sqlite3.cpp
70-
src/database-sqlite3.h
7164
src/daynightratio.h
7265
src/debug.cpp
7366
src/debug.h
@@ -85,7 +78,6 @@ src/event.h
8578
src/event_manager.h
8679
src/exceptions.h
8780
src/filecache.cpp
88-
src/filecache.h
8981
src/filesys.cpp
9082
src/filesys.h
9183
src/fontengine.cpp
@@ -97,7 +89,6 @@ src/genericobject.cpp
9789
src/genericobject.h
9890
src/gettext.cpp
9991
src/gettext.h
100-
src/gettime.h
10192
src/guiChatConsole.cpp
10293
src/guiChatConsole.h
10394
src/guiEngine.cpp
@@ -129,14 +120,11 @@ src/inventory.cpp
129120
src/inventory.h
130121
src/inventorymanager.cpp
131122
src/inventorymanager.h
132-
src/irr_aabb3d.h
133123
src/irrlicht_changes/static_text.cpp
134124
src/irrlicht_changes/static_text.h
135125
src/irrlichttypes_bloated.h
136126
src/irrlichttypes_extrabloated.h
137127
src/irrlichttypes.h
138-
src/irr_v2d.h
139-
src/irr_v3d.h
140128
src/itemdef.cpp
141129
src/itemdef.h
142130
src/itemgroup.h

0 commit comments

Comments
 (0)
Please sign in to comment.