From 97c3b17ef94c93a0e80f4fffc76eff179e2c1187 Mon Sep 17 00:00:00 2001 From: Samuel Tardieu Date: Thu, 18 Jan 2024 16:43:22 +0100 Subject: [PATCH 1/3] Update Ubuntu version --- .github/workflows/style.yml | 4 ++-- .github/workflows/tests.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index 809c195b..2107d7d8 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -7,7 +7,7 @@ name: Non executable checks jobs: check-style: name: Check style and headers - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - run: sudo apt-get -y update @@ -17,7 +17,7 @@ jobs: clean-compilation: name: Clean compilation - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - run: sudo apt-get -y update diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 863220c9..8c86544b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -7,7 +7,7 @@ name: Execution checks jobs: test-utils: name: Test utility programs - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - run: sudo apt-get -y update @@ -17,7 +17,7 @@ jobs: unit-tests: name: Unit tests - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - run: sudo apt-get -y update From cfa7e175e76dcbb0ac259d5ffa969c0952106c9f Mon Sep 17 00:00:00 2001 From: Samuel Tardieu Date: Thu, 18 Jan 2024 16:47:17 +0100 Subject: [PATCH 2/3] Print clang-format version --- misc/fix-style | 1 + 1 file changed, 1 insertion(+) diff --git a/misc/fix-style b/misc/fix-style index f00008e2..5847cb9f 100755 --- a/misc/fix-style +++ b/misc/fix-style @@ -10,6 +10,7 @@ set -e if [ "x$1" = "x--check" ]; then check="-n -Werror" + echo "Using $(clang-format --version)" fi git ls-files | grep '\.[ch]$' | xargs -n 100 clang-format -i $check From 9c92adee0fac88c51ef42688f23f1980a12a2e2d Mon Sep 17 00:00:00 2001 From: Samuel Tardieu Date: Thu, 18 Jan 2024 16:39:54 +0100 Subject: [PATCH 3/3] Fix style --- examples/case-study-ardupilot/flt-mgmt.c | 3 +-- .../case-study-ardupilot/originalcode-adaptation.c | 3 +-- examples/case-study-ardupilot/user-functions.c | 3 +-- kernel/arch/x86/x86-qemu/debug.c | 2 +- libpok/libm/ilogb.c | 14 +++++++------- libpok/protocols/blowfish/blowfish.h | 2 +- libpok/protocols/des/des_locl.h | 2 +- 7 files changed, 13 insertions(+), 16 deletions(-) diff --git a/examples/case-study-ardupilot/flt-mgmt.c b/examples/case-study-ardupilot/flt-mgmt.c index 59011f01..8549bb78 100644 --- a/examples/case-study-ardupilot/flt-mgmt.c +++ b/examples/case-study-ardupilot/flt-mgmt.c @@ -106,8 +106,7 @@ int PID_altitude(int PID_set_Point, int PID_current_Point) { /* Computes the error */ altitude_I += (float)PID_error * dt; - altitude_I = - constrain(altitude_I, 20, -20); /* Limit the PID integrator... */ + altitude_I = constrain(altitude_I, 20, -20); /* Limit the PID integrator... */ /* Integratior part */ altitude_D = diff --git a/examples/case-study-ardupilot/originalcode-adaptation.c b/examples/case-study-ardupilot/originalcode-adaptation.c index 1d7bf297..999f14f5 100644 --- a/examples/case-study-ardupilot/originalcode-adaptation.c +++ b/examples/case-study-ardupilot/originalcode-adaptation.c @@ -854,8 +854,7 @@ int PID_altitude(int PID_set_Point, int PID_current_Point) { /* Computes the error */ altitude_I += (float)PID_error * dt; - altitude_I = - constrain(altitude_I, 20, -20); /* Limit the PID integrator... */ + altitude_I = constrain(altitude_I, 20, -20); /* Limit the PID integrator... */ /* Integratior part */ altitude_D = diff --git a/examples/case-study-ardupilot/user-functions.c b/examples/case-study-ardupilot/user-functions.c index 6f0eaec7..c365bb4e 100644 --- a/examples/case-study-ardupilot/user-functions.c +++ b/examples/case-study-ardupilot/user-functions.c @@ -121,8 +121,7 @@ int PID_altitude(int PID_set_Point, int PID_current_Point) { /* Computes the error */ altitude_I += (float)PID_error * dt; - altitude_I = - constrain(altitude_I, 20, -20); /* Limit the PID integrator... */ + altitude_I = constrain(altitude_I, 20, -20); /* Limit the PID integrator... */ /* Integratior part */ altitude_D = diff --git a/kernel/arch/x86/x86-qemu/debug.c b/kernel/arch/x86/x86-qemu/debug.c index 61fd6158..6d29f17d 100644 --- a/kernel/arch/x86/x86-qemu/debug.c +++ b/kernel/arch/x86/x86-qemu/debug.c @@ -14,7 +14,7 @@ #if (defined POK_NEEDS_DEBUG) || (defined POK_NEEDS_USER_DEBUG) -//#ifdef POK_NEEDS_DEBUG +// #ifdef POK_NEEDS_DEBUG #include "../event.h" #include diff --git a/libpok/libm/ilogb.c b/libpok/libm/ilogb.c index 4909a467..511f4928 100644 --- a/libpok/libm/ilogb.c +++ b/libpok/libm/ilogb.c @@ -45,13 +45,13 @@ int ilogb(double x) { if ((hx | lx) == 0) return 0x80000001; /* ilogb(0) = 0x80000001 */ else /* subnormal x */ - if (hx == 0) { - for (ix = -1043; lx > 0; lx <<= 1) - ix -= 1; - } else { - for (ix = -1022, hx <<= 11; hx > 0; hx <<= 1) - ix -= 1; - } + if (hx == 0) { + for (ix = -1043; lx > 0; lx <<= 1) + ix -= 1; + } else { + for (ix = -1022, hx <<= 11; hx > 0; hx <<= 1) + ix -= 1; + } return ix; } else if (hx < 0x7ff00000) return (hx >> 20) - 1023; diff --git a/libpok/protocols/blowfish/blowfish.h b/libpok/protocols/blowfish/blowfish.h index 2d5882a6..17b9b881 100644 --- a/libpok/protocols/blowfish/blowfish.h +++ b/libpok/protocols/blowfish/blowfish.h @@ -75,7 +75,7 @@ #ifndef HEADER_BLOWFISH_H #define HEADER_BLOWFISH_H -//#include +// #include #include #define BF_ENCRYPT 1 diff --git a/libpok/protocols/des/des_locl.h b/libpok/protocols/des/des_locl.h index b2122a16..acaf522f 100644 --- a/libpok/protocols/des/des_locl.h +++ b/libpok/protocols/des/des_locl.h @@ -126,7 +126,7 @@ #include #include #endif -//#include +// #include #endif #endif #include "des.h"