From bad1fbb918f221af72c6c165fb4c47f80cd65371 Mon Sep 17 00:00:00 2001 From: Fred Dushin Date: Sat, 4 Nov 2023 20:41:01 -0400 Subject: [PATCH] Update clang format to version 16 Also updated files with format violations. Signed-off-by: Fred Dushin --- .github/workflows/check-formatting.yaml | 8 ++++---- src/libAtomVM/memory.c | 2 +- src/libAtomVM/refc_binary.c | 2 +- src/platforms/emscripten/src/lib/platform_nifs.c | 2 +- src/platforms/rp2040/src/lib/platform_nifs.c | 2 +- tests/test.c | 8 ++++---- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/check-formatting.yaml b/.github/workflows/check-formatting.yaml index 6706c99ae..347cae21e 100644 --- a/.github/workflows/check-formatting.yaml +++ b/.github/workflows/check-formatting.yaml @@ -40,16 +40,16 @@ jobs: - name: "Install run-clang-format" run: | wget -q -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add - - echo "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-13 main" | sudo tee -a /etc/apt/sources.list - echo "deb-src http://apt.llvm.org/focal/ llvm-toolchain-focal-13 main" | sudo tee -a /etc/apt/sources.list + echo "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-16 main" | sudo tee -a /etc/apt/sources.list + echo "deb-src http://apt.llvm.org/focal/ llvm-toolchain-focal-16 main" | sudo tee -a /etc/apt/sources.list sudo apt-get update - sudo apt-get install -y clang-format-13 + sudo apt-get install -y clang-format-16 curl -sSfL https://raw.githubusercontent.com/Sarcasm/run-clang-format/master/run-clang-format.py -o run-clang-format chmod +x run-clang-format - name: "Check formatting with clang-format" run: | - ./run-clang-format --style=file --clang-format-executable=clang-format-13 -r src/ tests/ + ./run-clang-format --style=file --clang-format-executable=clang-format-16 -r src/ tests/ - name: "Check formatting with Erlang fmt" if: success() || failure() diff --git a/src/libAtomVM/memory.c b/src/libAtomVM/memory.c index e21557ab5..c118e497e 100644 --- a/src/libAtomVM/memory.c +++ b/src/libAtomVM/memory.c @@ -31,7 +31,7 @@ #include "tempstack.h" #include "term.h" -//#define ENABLE_TRACE +// #define ENABLE_TRACE #include "trace.h" #include "utils.h" diff --git a/src/libAtomVM/refc_binary.c b/src/libAtomVM/refc_binary.c index e2752db19..53dc355f0 100644 --- a/src/libAtomVM/refc_binary.c +++ b/src/libAtomVM/refc_binary.c @@ -29,7 +29,7 @@ #include "tempstack.h" #include "utils.h" -//#define ENABLE_TRACE +// #define ENABLE_TRACE #include "trace.h" diff --git a/src/platforms/emscripten/src/lib/platform_nifs.c b/src/platforms/emscripten/src/lib/platform_nifs.c index ebff78e33..2bd1cc35e 100644 --- a/src/platforms/emscripten/src/lib/platform_nifs.c +++ b/src/platforms/emscripten/src/lib/platform_nifs.c @@ -36,7 +36,7 @@ #include -//#define ENABLE_TRACE +// #define ENABLE_TRACE #include #include "emscripten_sys.h" diff --git a/src/platforms/rp2040/src/lib/platform_nifs.c b/src/platforms/rp2040/src/lib/platform_nifs.c index b3f81aaca..e0f5310fb 100644 --- a/src/platforms/rp2040/src/lib/platform_nifs.c +++ b/src/platforms/rp2040/src/lib/platform_nifs.c @@ -39,7 +39,7 @@ #include "gpiodriver.h" -//#define ENABLE_TRACE +// #define ENABLE_TRACE #include "trace.h" #define VALIDATE_VALUE(value, verify_function) \ diff --git a/tests/test.c b/tests/test.c index 10da9c755..787befa46 100644 --- a/tests/test.c +++ b/tests/test.c @@ -48,19 +48,19 @@ struct Test // Favor modules that return 0 #define TEST_CASE(module) \ { \ -#module, 0, false, false \ + #module, 0, false, false \ } #define TEST_CASE_EXPECTED(module, expected) \ { \ -#module, expected, false, false \ + #module, expected, false, false \ } #define TEST_CASE_ATOMVM_ONLY(module, expected) \ { \ -#module, expected, false, true \ + #module, expected, false, true \ } #define TEST_CASE_COND(module, expected, skip) \ { \ -#module, expected, skip, false \ + #module, expected, skip, false \ } #ifndef AVM_NO_SMP