Skip to content

Commit 1701609

Browse files
authoredOct 9, 2017
Travis: Update clang from 4.0 to 5.0 (#6467)
* Update clang from 4.0 to 5.0
1 parent e6e5fa3 commit 1701609

12 files changed

+55
-37
lines changed
 

‎.clang-format

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ AllowShortIfStatementsOnASingleLine: false
1717
IndentCaseLabels: false
1818
AccessModifierOffset: -8
1919
ColumnLimit: 90
20-
AllowShortFunctionsOnASingleLine: Inline
20+
AllowShortFunctionsOnASingleLine: InlineOnly
2121
SortIncludes: false
2222
IncludeCategories:
2323
- Regex: '^".*'
@@ -26,3 +26,5 @@ IncludeCategories:
2626
Priority: 1
2727
AlignAfterOpenBracket: DontAlign
2828
ContinuationIndentWidth: 16
29+
ConstructorInitializerIndentWidth: 16
30+
BreakConstructorInitializers: AfterColon

‎.travis.yml

+8-8
Original file line numberDiff line numberDiff line change
@@ -61,32 +61,32 @@ matrix:
6161
sources: &sources
6262
- llvm-toolchain-trusty-3.6
6363

64-
- env: PLATFORM=Unix COMPILER=clang-4.0
64+
- env: PLATFORM=Unix COMPILER=clang-5.0
6565
compiler: clang
6666
os: linux
6767
addons:
6868
apt:
69-
packages: ['clang-4.0', 'clang++-4.0']
69+
packages: ['clang-5.0', 'clang++-5.0']
7070
sources: &sources
71-
- llvm-toolchain-trusty-4.0
71+
- llvm-toolchain-trusty-5.0
7272

73-
- env: PLATFORM=Unix COMPILER=clang-4.0 VALGRIND=1
73+
- env: PLATFORM=Unix COMPILER=clang-5.0 VALGRIND=1
7474
compiler: clang
7575
os: linux
7676
addons:
7777
apt:
78-
packages: ['valgrind', 'clang-4.0', 'clang++-4.0']
78+
packages: ['valgrind', 'clang-5.0', 'clang++-5.0']
7979
sources: &sources
80-
- llvm-toolchain-trusty-4.0
80+
- llvm-toolchain-trusty-5.0
8181

8282
- env: LINT=1
8383
compiler: clang
8484
os: linux
8585
addons:
8686
apt:
87-
packages: ['clang-format-4.0']
87+
packages: ['clang-format-5.0']
8888
sources: &sources
89-
- llvm-toolchain-trusty-4.0
89+
- llvm-toolchain-trusty-5.0
9090

9191

9292

‎src/chatmessage.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ struct ChatMessage
3636
ChatMessage(const std::wstring &m = L"") : message(m) {}
3737

3838
ChatMessage(ChatMessageType t, const std::wstring &m, const std::wstring &s = L"",
39-
std::time_t ts = std::time(0))
40-
: type(t), message(m), sender(s), timestamp(ts)
39+
std::time_t ts = std::time(0)) :
40+
type(t),
41+
message(m), sender(s), timestamp(ts)
4142
{
4243
}
4344

‎src/client/renderingengine.cpp

+21-8
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,11 @@ RenderingEngine::RenderingEngine(IEventReceiver *receiver)
9393
params.HighPrecisionFPU = g_settings->getBool("high_precision_fpu");
9494
params.ZBufferBits = 24;
9595
#ifdef __ANDROID__
96+
// clang-format off
9697
params.PrivateData = porting::app_global;
97-
params.OGLES2ShaderPath = std::string(
98-
porting::path_user + DIR_DELIM + "media" + DIR_DELIM + "Shaders" +
99-
DIR_DELIM).c_str();
98+
params.OGLES2ShaderPath = std::string(porting::path_user + DIR_DELIM + "media" +
99+
DIR_DELIM + "Shaders" + DIR_DELIM).c_str();
100+
// clang-format on
100101
#endif
101102

102103
m_device = createDeviceEx(params);
@@ -233,7 +234,7 @@ bool RenderingEngine::setWindowIcon()
233234
const HICON hicon = LoadIcon(GetModuleHandle(NULL),
234235
MAKEINTRESOURCE(130) // The ID of the ICON defined in
235236
// winresource.rc
236-
);
237+
);
237238

238239
if (hicon) {
239240
SendMessage(hWnd, WM_SETICON, ICON_BIG, reinterpret_cast<LPARAM>(hicon));
@@ -997,8 +998,14 @@ void RenderingEngine::draw_plain(Camera *camera, bool show_hud, Hud *hud,
997998
const char *RenderingEngine::getVideoDriverName(irr::video::E_DRIVER_TYPE type)
998999
{
9991000
static const char *driver_ids[] = {
1000-
"null", "software", "burningsvideo", "direct3d8", "direct3d9",
1001-
"opengl", "ogles1", "ogles2",
1001+
"null",
1002+
"software",
1003+
"burningsvideo",
1004+
"direct3d8",
1005+
"direct3d9",
1006+
"opengl",
1007+
"ogles1",
1008+
"ogles2",
10021009
};
10031010

10041011
return driver_ids[type];
@@ -1007,8 +1014,14 @@ const char *RenderingEngine::getVideoDriverName(irr::video::E_DRIVER_TYPE type)
10071014
const char *RenderingEngine::getVideoDriverFriendlyName(irr::video::E_DRIVER_TYPE type)
10081015
{
10091016
static const char *driver_names[] = {
1010-
"NULL Driver", "Software Renderer", "Burning's Video",
1011-
"Direct3D 8", "Direct3D 9", "OpenGL", "OpenGL ES1", "OpenGL ES2",
1017+
"NULL Driver",
1018+
"Software Renderer",
1019+
"Burning's Video",
1020+
"Direct3D 8",
1021+
"Direct3D 9",
1022+
"OpenGL",
1023+
"OpenGL ES1",
1024+
"OpenGL ES2",
10121025
};
10131026

10141027
return driver_names[type];

‎src/environment.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ class Environment
106106

107107
/*
108108
* Below: values managed by m_time_lock
109-
*/
109+
*/
110110
// Time of day in milli-hours (0-23999), determines day and night
111111
u32 m_time_of_day;
112112
// Time of day in 0...1
@@ -122,7 +122,7 @@ class Environment
122122
std::atomic<u32> m_day_count;
123123
/*
124124
* Above: values managed by m_time_lock
125-
*/
125+
*/
126126

127127
/* TODO: Add a callback function so these can be updated when a setting
128128
* changes. At this point in time it doesn't matter (e.g. /set

‎src/httpfetch.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ struct HTTPFetchResult
7878

7979
HTTPFetchResult() = default;
8080

81-
HTTPFetchResult(const HTTPFetchRequest &fetch_request)
82-
: caller(fetch_request.caller), request_id(fetch_request.request_id)
81+
HTTPFetchResult(const HTTPFetchRequest &fetch_request) :
82+
caller(fetch_request.caller), request_id(fetch_request.request_id)
8383
{
8484
}
8585
};

‎src/network/peerhandler.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ enum PeerChangeType : u8
6363

6464
struct PeerChange
6565
{
66-
PeerChange(PeerChangeType t, session_t _peer_id, bool _timeout)
67-
: type(t), peer_id(_peer_id), timeout(_timeout)
66+
PeerChange(PeerChangeType t, session_t _peer_id, bool _timeout) :
67+
type(t), peer_id(_peer_id), timeout(_timeout)
6868
{
6969
}
7070
PeerChange() = delete;

‎src/profiler.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
2222
static Profiler main_profiler;
2323
Profiler *g_profiler = &main_profiler;
2424
ScopeProfiler::ScopeProfiler(
25-
Profiler *profiler, const std::string &name, ScopeProfilerType type)
26-
: m_profiler(profiler), m_name(name), m_type(type)
25+
Profiler *profiler, const std::string &name, ScopeProfilerType type) :
26+
m_profiler(profiler),
27+
m_name(name), m_type(type)
2728
{
2829
if (m_profiler)
2930
m_timer = new TimeTaker(m_name);

‎src/sound.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@ class OnDemandSoundFetcher
3434
struct SimpleSoundSpec
3535
{
3636
SimpleSoundSpec(const std::string &name = "", float gain = 1.0f,
37-
float fade = 0.0f, float pitch = 1.0f)
38-
: name(name), gain(gain), fade(fade), pitch(pitch)
37+
float fade = 0.0f, float pitch = 1.0f) :
38+
name(name),
39+
gain(gain), fade(fade), pitch(pitch)
3940
{
4041
}
4142

‎src/wieldmesh.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ struct ItemPartColor
4646

4747
ItemPartColor() = default;
4848

49-
ItemPartColor(bool override, video::SColor color)
50-
: override_base(override), color(color)
49+
ItemPartColor(bool override, video::SColor color) :
50+
override_base(override), color(color)
5151
{
5252
}
5353
};

‎util/travis/common.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ set_linux_compiler_env() {
1313
elif [[ "${COMPILER}" == "clang-3.6" ]]; then
1414
export CC=clang-3.6
1515
export CXX=clang++-3.6
16-
elif [[ "${COMPILER}" == "clang-4.0" ]]; then
17-
export CC=clang-4.0
18-
export CXX=clang++-4.0
16+
elif [[ "${COMPILER}" == "clang-5.0" ]]; then
17+
export CC=clang-5.0
18+
export CXX=clang++-5.0
1919
fi
2020
}
2121

@@ -45,7 +45,7 @@ TRIGGER_COMPILE_PATHS="src/.*\.(c|cpp|h)|CMakeLists.txt|cmake/Modules/|util/trav
4545

4646
needs_compile() {
4747
RANGE="$TRAVIS_COMMIT_RANGE"
48-
if [[ "$(git diff --name-only $RANGE -- 2>/dev/null)" == "" ]]; then
48+
if [[ "$(git diff --name-only $RANGE -- 2>/dev/null)" == "" ]]; then
4949
RANGE="$TRAVIS_COMMIT^...$TRAVIS_COMMIT"
5050
echo "Fixed range: $RANGE"
5151
fi

‎util/travis/lint.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#! /bin/bash
22
function perform_lint() {
33
echo "Performing LINT..."
4-
if hash clang-format-4.0 2>/dev/null; then
5-
CLANG_FORMAT=clang-format-4.0
4+
if hash clang-format-5.0 2>/dev/null; then
5+
CLANG_FORMAT=clang-format-5.0
66
else
77
CLANG_FORMAT=clang-format
88
fi

0 commit comments

Comments
 (0)
Please sign in to comment.