From 8aae66b893444c74a22ad7beb89e3828e0444108 Mon Sep 17 00:00:00 2001 From: Daniel Agar Date: Fri, 27 Mar 2015 19:08:44 -0400 Subject: trivial code style cleanup round 2 --- src/lib/mathlib/math/Limits.cpp | 5 +++-- src/lib/mathlib/math/Limits.hpp | 3 ++- src/lib/mathlib/math/test/test.cpp | 6 +++--- src/lib/rc/st24.c | 3 ++- 4 files changed, 10 insertions(+), 7 deletions(-) (limited to 'src/lib') diff --git a/src/lib/mathlib/math/Limits.cpp b/src/lib/mathlib/math/Limits.cpp index e16f33bd6..0ae545f1a 100644 --- a/src/lib/mathlib/math/Limits.cpp +++ b/src/lib/mathlib/math/Limits.cpp @@ -44,9 +44,10 @@ #include "Limits.hpp" -namespace math { +namespace math +{ -#ifndef CONFIG_ARCH_ARM +#ifndef CONFIG_ARCH_ARM #define M_PI_F 3.14159265358979323846f #endif diff --git a/src/lib/mathlib/math/Limits.hpp b/src/lib/mathlib/math/Limits.hpp index fca4197b8..f04d72507 100644 --- a/src/lib/mathlib/math/Limits.hpp +++ b/src/lib/mathlib/math/Limits.hpp @@ -42,7 +42,8 @@ #include #include -namespace math { +namespace math +{ float __EXPORT min(float val1, float val2); diff --git a/src/lib/mathlib/math/test/test.cpp b/src/lib/mathlib/math/test/test.cpp index 2fa2f7e7c..c52771ab8 100644 --- a/src/lib/mathlib/math/test/test.cpp +++ b/src/lib/mathlib/math/test/test.cpp @@ -51,7 +51,7 @@ bool __EXPORT equal(float a, float b, float epsilon) printf("not equal ->\n\ta: %12.8f\n\tb: %12.8f\n", double(a), double(b)); return false; - } else return true; + } else { return true; } } void __EXPORT float2SigExp( @@ -84,10 +84,10 @@ void __EXPORT float2SigExp( // cheap power since it is integer if (exp > 0) { - for (int i = 0; i < abs(exp); i++) sig /= 10; + for (int i = 0; i < abs(exp); i++) { sig /= 10; } } else { - for (int i = 0; i < abs(exp); i++) sig *= 10; + for (int i = 0; i < abs(exp); i++) { sig *= 10; } } } diff --git a/src/lib/rc/st24.c b/src/lib/rc/st24.c index 5c53a1602..f75827903 100644 --- a/src/lib/rc/st24.c +++ b/src/lib/rc/st24.c @@ -104,7 +104,7 @@ uint8_t st24_common_crc8(uint8_t *ptr, uint8_t len) int st24_decode(uint8_t byte, uint8_t *rssi, uint8_t *rx_count, uint16_t *channel_count, uint16_t *channels, - uint16_t max_chan_count) + uint16_t max_chan_count) { int ret = 1; @@ -113,6 +113,7 @@ int st24_decode(uint8_t byte, uint8_t *rssi, uint8_t *rx_count, uint16_t *channe case ST24_DECODE_STATE_UNSYNCED: if (byte == ST24_STX1) { _decode_state = ST24_DECODE_STATE_GOT_STX1; + } else { ret = 3; } -- cgit v1.2.3