]> git.lizzy.rs Git - minetest.git/commitdiff
Update our tooling (Clang 5 -> 7, GCC 7 -> 8)
authorLoïc Blot <loic.blot@unix-experience.fr>
Fri, 23 Mar 2018 10:07:19 +0000 (11:07 +0100)
committerLoïc Blot <nerzhul@users.noreply.github.com>
Thu, 14 Mar 2019 11:30:13 +0000 (12:30 +0100)
This change permits to use up-to-date compilers, clang-tidy and
clang-format

It also refactor the tidy/format step to drop the binary selection from
scripts and perform it directly in travis

.clang-format
.travis.yml
src/irrlicht_changes/irrUString.h
util/travis/before_install.sh
util/travis/clangtidy.sh
util/travis/common.sh
util/travis/lint.sh
util/travis/script.sh

index 455dc60383087e2ba6b9a41de17d68d751661012..dc7380ffd8684caf6e550b221898ef944d47820a 100644 (file)
@@ -13,6 +13,7 @@ BraceWrapping:
   AfterUnion: true
   BeforeCatch: false
   BeforeElse: false
+FixNamespaceComments: false
 AllowShortIfStatementsOnASingleLine: false
 IndentCaseLabels: false
 AccessModifierOffset: -8
index 2409a51cd5c661c460b167f5629666bf11fc3875..23f6d5ebb15c665ce6e174a19aebdf9ac12bc2af 100644 (file)
@@ -10,24 +10,26 @@ matrix:
   fast_finish: true
   include:
 
-    - env: LINT=1
+    - env: CLANG_FORMAT=clang-format-7
       compiler: clang
       os: linux
       addons:
         apt:
-          packages: ['clang-format-5.0']
+          packages: ['clang-format-7']
           sources: &sources
-            - llvm-toolchain-trusty-5.0
+            - ubuntu-toolchain-r-test
+            - llvm-toolchain-trusty-7
 
-    - env: CLANG_TIDY=1
+    - env: CLANG_TIDY=clang-tidy-7
       compiler: clang
       os: linux
       script: ./util/travis/clangtidy.sh
       addons:
         apt:
-          packages: ['clang-tidy-5.0']
+          packages: ['clang-7', 'clang++-7', 'clang-tools-7', 'clang-tidy-7']
           sources: &sources
-            - llvm-toolchain-trusty-5.0
+            - ubuntu-toolchain-r-test
+            - llvm-toolchain-trusty-7
 
     - env: PLATFORM=Win32
       compiler: gcc
@@ -63,12 +65,12 @@ matrix:
           sources: &sources
             - ubuntu-toolchain-r-test
 
-    - env: PLATFORM=Unix COMPILER=gcc-7
+    - env: PLATFORM=Unix COMPILER=gcc-8
       compiler: gcc
       os: linux
       addons:
         apt:
-          packages: ['gcc-7', 'g++-7']
+          packages: ['gcc-8', 'g++-8']
           sources: &sources
             - ubuntu-toolchain-r-test
 
@@ -81,29 +83,33 @@ matrix:
           sources: &sources
             - llvm-toolchain-trusty-3.6
 
-    - env: PLATFORM=Unix COMPILER=clang-5.0
+    - env: PLATFORM=Unix COMPILER=clang-7
       compiler: clang
       os: linux
       addons:
         apt:
-          packages: ['clang-5.0', 'clang++-5.0']
+          packages: ['clang-7', 'clang++-7']
           sources: &sources
-            - llvm-toolchain-trusty-5.0
+            - ubuntu-toolchain-r-test
+            - llvm-toolchain-trusty-7
 
-    - env: PLATFORM=Unix COMPILER=clang-5.0 FREETYPE=0
+    - env: PLATFORM=Unix COMPILER=clang-7 FREETYPE=0
       compiler: clang
       os: linux
       addons:
         apt:
-          packages: ['clang-5.0', 'clang++-5.0']
+          packages: ['clang-7', 'clang++-7']
           sources: &sources
-            - llvm-toolchain-trusty-5.0
+            - ubuntu-toolchain-r-test
+            - llvm-toolchain-trusty-7
 
-    - env: PLATFORM=Unix COMPILER=clang-5.0 VALGRIND=1
+    - env: PLATFORM=Unix COMPILER=clang-7 VALGRIND=1
       compiler: clang
       os: linux
       addons:
         apt:
-          packages: ['valgrind', 'clang-5.0', 'clang++-5.0']
+          packages: ['valgrind', 'clang-7', 'clang++-7']
           sources: &sources
-            - llvm-toolchain-trusty-5.0
+            - ubuntu-toolchain-r-test
+            - llvm-toolchain-trusty-7
+
index b628c092c28b5a2371d65910ec81f126a498626a..fce49e7177d3397c1c47dbaaeb65e54a3cb05bbb 100644 (file)
@@ -2916,13 +2916,13 @@ class ustring16
                                ret[0] = unicode::BOM;
                        else if (endian == unicode::EUTFEE_LITTLE)
                        {
-                               uchar8_t* ptr8 = reinterpret_cast<uchar8_t*>(&ret[0]);
+                               uchar8_t* ptr8 = reinterpret_cast<uchar8_t*>(ret.c_str());
                                *ptr8++ = unicode::BOM_ENCODE_UTF16_LE[0];
                                *ptr8 = unicode::BOM_ENCODE_UTF16_LE[1];
                        }
                        else
                        {
-                               uchar8_t* ptr8 = reinterpret_cast<uchar8_t*>(&ret[0]);
+                               uchar8_t* ptr8 = reinterpret_cast<uchar8_t*>(ret.c_str());
                                *ptr8++ = unicode::BOM_ENCODE_UTF16_BE[0];
                                *ptr8 = unicode::BOM_ENCODE_UTF16_BE[1];
                        }
index 19c40ef90704514b54e44974de77db7d4f013e24..fef054130dd1f49f6c9451444503d37f94b541f7 100755 (executable)
@@ -4,14 +4,14 @@ echo "Preparing for $TRAVIS_COMMIT_RANGE"
 
 . util/travis/common.sh
 
-if [[ "${LINT}" == "1" ]]; then
+if [[ ! -z "${CLANG_FORMAT}" ]]; then
        exit 0
 fi
 
 needs_compile || exit 0
 
-if [[ $PLATFORM == "Unix" ]] || [[ $CLANG_TIDY == "1" ]]; then
-       if [[ $TRAVIS_OS_NAME == "linux" ]] || [[ $CLANG_TIDY == "1" ]]; then
+if [[ $PLATFORM == "Unix" ]] || [[ ! -z "${CLANG_TIDY}" ]]; then
+       if [[ $TRAVIS_OS_NAME == "linux" ]] || [[ ! -z "${CLANG_TIDY}" ]]; then
                install_linux_deps
        else
                install_macosx_deps
index 7ed555693b01eb9a3e37fd7abfacf6744d1d6b82..5b00115c8f0a1504e5cd80c67405670af02acffd 100755 (executable)
@@ -3,9 +3,7 @@
 
 needs_compile || exit 0
 
-if hash clang-tidy-5.0 2>/dev/null; then
-       CLANG_TIDY=clang-tidy-5.0
-else
+if [ -z "${CLANG_TIDY}" ]; then
        CLANG_TIDY=clang-tidy
 fi
 
index 9495409672d89455b37075218323f390f9754dc1..b4406866e01701daa7d36ffd847895f35376baed 100644 (file)
@@ -7,15 +7,15 @@ set_linux_compiler_env() {
        elif [[ "${COMPILER}" == "gcc-6" ]]; then
                export CC=gcc-6
                export CXX=g++-6
-       elif [[ "${COMPILER}" == "gcc-7" ]]; then
-               export CC=gcc-7
-               export CXX=g++-7
+       elif [[ "${COMPILER}" == "gcc-8" ]]; then
+               export CC=gcc-8
+               export CXX=g++-8
        elif [[ "${COMPILER}" == "clang-3.6" ]]; then
                export CC=clang-3.6
                export CXX=clang++-3.6
-       elif [[ "${COMPILER}" == "clang-5.0" ]]; then
-               export CC=clang-5.0
-               export CXX=clang++-5.0
+       elif [[ "${COMPILER}" == "clang-7" ]]; then
+               export CC=clang-7
+               export CXX=clang++-7
        fi
 }
 
index 887e621f58e90710b5e4a19e5ad5bcc5d246ad3d..b3027c689efca3d66e9235d4a6a061a4e15cbdd9 100644 (file)
@@ -1,9 +1,7 @@
 #! /bin/bash
 function perform_lint() {
        echo "Performing LINT..."
-       if hash clang-format-5.0 2>/dev/null; then
-               CLANG_FORMAT=clang-format-5.0
-       else
+       if [ -z "${CLANG_FORMAT}" ]; then
                CLANG_FORMAT=clang-format
        fi
        echo "LINT: Using binary $CLANG_FORMAT"
index 32e8d2e36f690f99e9e63a12f8e2928887d8ab2b..19aa2fdf79867b597446116f197982650243e798 100755 (executable)
@@ -4,7 +4,7 @@
 
 needs_compile || exit 0
 
-if [[ "$LINT" == "1" ]]; then
+if [[ ! -z "${CLANG_FORMAT}" ]]; then
        # Lint and exit CI
        perform_lint
        exit 0