Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix style #66

Merged
merged 3 commits into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
3 changes: 1 addition & 2 deletions examples/case-study-ardupilot/flt-mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
3 changes: 1 addition & 2 deletions examples/case-study-ardupilot/originalcode-adaptation.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
3 changes: 1 addition & 2 deletions examples/case-study-ardupilot/user-functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
2 changes: 1 addition & 1 deletion kernel/arch/x86/x86-qemu/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 <libc.h>
Expand Down
14 changes: 7 additions & 7 deletions libpok/libm/ilogb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion libpok/protocols/blowfish/blowfish.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
#ifndef HEADER_BLOWFISH_H
#define HEADER_BLOWFISH_H

//#include <openssl/e_os2.h>
// #include <openssl/e_os2.h>
#include <types.h>

#define BF_ENCRYPT 1
Expand Down
2 changes: 1 addition & 1 deletion libpok/protocols/des/des_locl.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
#include <libc/stdlib.h>
#include <libc/string.h>
#endif
//#include <libm.h>
// #include <libm.h>
#endif
#endif
#include "des.h"
Expand Down
1 change: 1 addition & 0 deletions misc/fix-style
Original file line number Diff line number Diff line change
Expand Up @@ -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