Travis: Update clang from 4.0 to 5.0 (#6467)
authorLoïc Blot <nerzhul@users.noreply.github.com>
Mon, 9 Oct 2017 09:32:06 +0000 (11:32 +0200)
committerGitHub <noreply@github.com>
Mon, 9 Oct 2017 09:32:06 +0000 (11:32 +0200)
* Update clang from 4.0 to 5.0

12 files changed:
.clang-format
.travis.yml
src/chatmessage.h
src/client/renderingengine.cpp
src/environment.h
src/httpfetch.h
src/network/peerhandler.h
src/profiler.cpp
src/sound.h
src/wieldmesh.h
util/travis/common.sh
util/travis/lint.sh

index f1d51a04fa78146c2790e3c613d73bf53477eeeb..455dc60383087e2ba6b9a41de17d68d751661012 100644 (file)
@@ -17,7 +17,7 @@ AllowShortIfStatementsOnASingleLine: false
 IndentCaseLabels: false
 AccessModifierOffset: -8
 ColumnLimit: 90
-AllowShortFunctionsOnASingleLine: Inline
+AllowShortFunctionsOnASingleLine: InlineOnly
 SortIncludes: false
 IncludeCategories:
   - Regex:           '^".*'
@@ -26,3 +26,5 @@ IncludeCategories:
     Priority:        1
 AlignAfterOpenBracket: DontAlign
 ContinuationIndentWidth: 16
+ConstructorInitializerIndentWidth: 16
+BreakConstructorInitializers: AfterColon
index eaa8fd1ac3e686a7f17ac3fd643f86e8de0f6503..77c405b69c42fd630038afbfb5a850881f5e5b36 100644 (file)
@@ -61,32 +61,32 @@ matrix:
           sources: &sources
             - llvm-toolchain-trusty-3.6
 
-    - env: PLATFORM=Unix COMPILER=clang-4.0
+    - env: PLATFORM=Unix COMPILER=clang-5.0
       compiler: clang
       os: linux
       addons:
         apt:
-          packages: ['clang-4.0', 'clang++-4.0']
+          packages: ['clang-5.0', 'clang++-5.0']
           sources: &sources
-            - llvm-toolchain-trusty-4.0
+            - llvm-toolchain-trusty-5.0
 
-    - env: PLATFORM=Unix COMPILER=clang-4.0 VALGRIND=1
+    - env: PLATFORM=Unix COMPILER=clang-5.0 VALGRIND=1
       compiler: clang
       os: linux
       addons:
         apt:
-          packages: ['valgrind', 'clang-4.0', 'clang++-4.0']
+          packages: ['valgrind', 'clang-5.0', 'clang++-5.0']
           sources: &sources
-            - llvm-toolchain-trusty-4.0
+            - llvm-toolchain-trusty-5.0
 
     - env: LINT=1
       compiler: clang
       os: linux
       addons:
         apt:
-          packages: ['clang-format-4.0']
+          packages: ['clang-format-5.0']
           sources: &sources
-            - llvm-toolchain-trusty-4.0
+            - llvm-toolchain-trusty-5.0
 
 
 
index 06c5ea6647e1f16f690384bb4db424d0d944c63a..f4ecd631d62f448a1891fd0fd1a43d281adb201a 100644 (file)
@@ -36,8 +36,9 @@ struct ChatMessage
        ChatMessage(const std::wstring &m = L"") : message(m) {}
 
        ChatMessage(ChatMessageType t, const std::wstring &m, const std::wstring &s = L"",
-                       std::time_t ts = std::time(0))
-           : type(t), message(m), sender(s), timestamp(ts)
+                       std::time_t ts = std::time(0)) :
+                       type(t),
+                       message(m), sender(s), timestamp(ts)
        {
        }
 
index 7058711600f29e4b6db2f9d7d55aae73b6b337e3..b3abd824d079447c293f1a34a96891a9aacdb3d1 100644 (file)
@@ -93,10 +93,11 @@ RenderingEngine::RenderingEngine(IEventReceiver *receiver)
        params.HighPrecisionFPU = g_settings->getBool("high_precision_fpu");
        params.ZBufferBits = 24;
 #ifdef __ANDROID__
+       // clang-format off
        params.PrivateData = porting::app_global;
-       params.OGLES2ShaderPath = std::string(
-                       porting::path_user + DIR_DELIM + "media" + DIR_DELIM + "Shaders" +
-                       DIR_DELIM).c_str();
+       params.OGLES2ShaderPath = std::string(porting::path_user + DIR_DELIM + "media" +
+               DIR_DELIM + "Shaders" + DIR_DELIM).c_str();
+       // clang-format on
 #endif
 
        m_device = createDeviceEx(params);
@@ -233,7 +234,7 @@ bool RenderingEngine::setWindowIcon()
        const HICON hicon = LoadIcon(GetModuleHandle(NULL),
                        MAKEINTRESOURCE(130) // The ID of the ICON defined in
                                             // winresource.rc
-                       );
+       );
 
        if (hicon) {
                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,
 const char *RenderingEngine::getVideoDriverName(irr::video::E_DRIVER_TYPE type)
 {
        static const char *driver_ids[] = {
-                       "null", "software", "burningsvideo", "direct3d8", "direct3d9",
-                       "opengl", "ogles1", "ogles2",
+                       "null",
+                       "software",
+                       "burningsvideo",
+                       "direct3d8",
+                       "direct3d9",
+                       "opengl",
+                       "ogles1",
+                       "ogles2",
        };
 
        return driver_ids[type];
@@ -1007,8 +1014,14 @@ const char *RenderingEngine::getVideoDriverName(irr::video::E_DRIVER_TYPE type)
 const char *RenderingEngine::getVideoDriverFriendlyName(irr::video::E_DRIVER_TYPE type)
 {
        static const char *driver_names[] = {
-                       "NULL Driver", "Software Renderer", "Burning's Video",
-                       "Direct3D 8", "Direct3D 9", "OpenGL", "OpenGL ES1", "OpenGL ES2",
+                       "NULL Driver",
+                       "Software Renderer",
+                       "Burning's Video",
+                       "Direct3D 8",
+                       "Direct3D 9",
+                       "OpenGL",
+                       "OpenGL ES1",
+                       "OpenGL ES2",
        };
 
        return driver_names[type];
index 1a1debcb9dab5824bbe3ea4ed050e1450cf71d5f..f568ba2287e42370e988eda05317ef25619bdebc 100644 (file)
@@ -106,7 +106,7 @@ protected:
 
        /*
         * Below: values managed by m_time_lock
-       */
+        */
        // Time of day in milli-hours (0-23999), determines day and night
        u32 m_time_of_day;
        // Time of day in 0...1
@@ -122,7 +122,7 @@ protected:
        std::atomic<u32> m_day_count;
        /*
         * Above: values managed by m_time_lock
-       */
+        */
 
        /* TODO: Add a callback function so these can be updated when a setting
         *       changes.  At this point in time it doesn't matter (e.g. /set
index db43e3a4b8d400eaf6ffe81611ad69b07588a2eb..ae8b5afb5b733332b8b55dae03ccbf7b5d7d617d 100644 (file)
@@ -78,8 +78,8 @@ struct HTTPFetchResult
 
        HTTPFetchResult() = default;
 
-       HTTPFetchResult(const HTTPFetchRequest &fetch_request)
-           : caller(fetch_request.caller), request_id(fetch_request.request_id)
+       HTTPFetchResult(const HTTPFetchRequest &fetch_request) :
+                       caller(fetch_request.caller), request_id(fetch_request.request_id)
        {
        }
 };
index 70e416e90903b99350bc2152b925d76b7ff0c998..208ab801e66805b42d6354d02a4d672fdb08401f 100644 (file)
@@ -63,8 +63,8 @@ enum PeerChangeType : u8
 
 struct PeerChange
 {
-       PeerChange(PeerChangeType t, session_t _peer_id, bool _timeout)
-           : type(t), peer_id(_peer_id), timeout(_timeout)
+       PeerChange(PeerChangeType t, session_t _peer_id, bool _timeout) :
+                       type(t), peer_id(_peer_id), timeout(_timeout)
        {
        }
        PeerChange() = delete;
index 738a5b7e3957e9f3e3215ebc8f6fb8c1d0b972b7..f8d4fc181989fff755c758367af49cb0c431cdc2 100644 (file)
@@ -22,8 +22,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 static Profiler main_profiler;
 Profiler *g_profiler = &main_profiler;
 ScopeProfiler::ScopeProfiler(
-               Profiler *profiler, const std::string &name, ScopeProfilerType type)
-    : m_profiler(profiler), m_name(name), m_type(type)
+               Profiler *profiler, const std::string &name, ScopeProfilerType type) :
+               m_profiler(profiler),
+               m_name(name), m_type(type)
 {
        if (m_profiler)
                m_timer = new TimeTaker(m_name);
index f52746369d09934369f0fb5c1b8c7ad851f07556..0ad34e5cdfb68e9f477c7305ce1f0baf0f92272f 100644 (file)
@@ -34,8 +34,9 @@ public:
 struct SimpleSoundSpec
 {
        SimpleSoundSpec(const std::string &name = "", float gain = 1.0f,
-                       float fade = 0.0f, float pitch = 1.0f)
-           : name(name), gain(gain), fade(fade), pitch(pitch)
+                       float fade = 0.0f, float pitch = 1.0f) :
+                       name(name),
+                       gain(gain), fade(fade), pitch(pitch)
        {
        }
 
index 23e3abf2984f2f87d16d8a69feef48642d420e3f..87b8a8efe047452796f0cebf4cf66572b6ccc224 100644 (file)
@@ -46,8 +46,8 @@ struct ItemPartColor
 
        ItemPartColor() = default;
 
-       ItemPartColor(bool override, video::SColor color)
-           : override_base(override), color(color)
+       ItemPartColor(bool override, video::SColor color) :
+                       override_base(override), color(color)
        {
        }
 };
index d040f639f2a67cbec24e6ffe4a61cf379b2fd959..9495409672d89455b37075218323f390f9754dc1 100644 (file)
@@ -13,9 +13,9 @@ set_linux_compiler_env() {
        elif [[ "${COMPILER}" == "clang-3.6" ]]; then
                export CC=clang-3.6
                export CXX=clang++-3.6
-       elif [[ "${COMPILER}" == "clang-4.0" ]]; then
-               export CC=clang-4.0
-               export CXX=clang++-4.0
+       elif [[ "${COMPILER}" == "clang-5.0" ]]; then
+               export CC=clang-5.0
+               export CXX=clang++-5.0
        fi
 }
 
@@ -45,7 +45,7 @@ TRIGGER_COMPILE_PATHS="src/.*\.(c|cpp|h)|CMakeLists.txt|cmake/Modules/|util/trav
 
 needs_compile() {
        RANGE="$TRAVIS_COMMIT_RANGE"
-       if [[ "$(git diff --name-only $RANGE -- 2>/dev/null)" == "" ]]; then 
+       if [[ "$(git diff --name-only $RANGE -- 2>/dev/null)" == "" ]]; then
                RANGE="$TRAVIS_COMMIT^...$TRAVIS_COMMIT"
                echo "Fixed range: $RANGE"
        fi
index 555cf3ebe0a36a6bf74dc7e9a7b600877407aa5b..1174ed2575177476d6ce7e3ff5b093459da24a1d 100644 (file)
@@ -1,8 +1,8 @@
 #! /bin/bash
 function perform_lint() {
        echo "Performing LINT..."
-       if hash clang-format-4.0 2>/dev/null; then
-               CLANG_FORMAT=clang-format-4.0
+       if hash clang-format-5.0 2>/dev/null; then
+               CLANG_FORMAT=clang-format-5.0
        else
                CLANG_FORMAT=clang-format
        fi