This library contains code that extends and simplifies different operations
for C language based programs.
Revisión | beb63fa242f20b73cf8f53b5cee031565349d189 (tree) |
---|---|
Tiempo | 2022-08-30 17:53:16 |
Autor | Sergey Gusarov <laborer2008@gmai...> |
Commiter | Sergey Gusarov |
Code style fixes
@@ -1,4 +1,4 @@ | ||
1 | 1 | f7c8d204705ccf1d21bba9e8d33cd030635dd1ee cmake/cmake_tools |
2 | 2 | 5013d507802becd2c434d4dbdafad45c3da5ef23 include/ctools/std/msinttypes |
3 | -c687cce0a880bac77b1761057be5d13a23c9e098 pyrepo | |
3 | +25ebb88de95dddf840a746dfd5c4d89323cc27b9 pyrepo | |
4 | 4 | 3852926c00f210905db5feb7a9fa5d5dbf7963ea tests/unity |
@@ -71,7 +71,7 @@ | ||
71 | 71 | * Thread cancellation (pthread_cancel). Unlikely to ever be implemented because of the difficulty |
72 | 72 | * and cost of implementing it, and the difficulty of using it correctly |
73 | 73 | */ |
74 | -# if !defined(CT_OS_ANDROID) | |
74 | +# if !defined (CT_OS_ANDROID) | |
75 | 75 | # define CT_KILL_THREAD_AVAILABLE |
76 | 76 | # endif |
77 | 77 |
@@ -116,7 +116,7 @@ | ||
116 | 116 | * double is not supported. |
117 | 117 | */ |
118 | 118 | |
119 | -#if defined(CT_COMPL_SDCC) | |
119 | +#if defined (CT_COMPL_SDCC) | |
120 | 120 | # define CT_SIMPLE_LROUND(x) CT_SIMPLE_ROUND__(float, long int, x) |
121 | 121 | #else |
122 | 122 | # define CT_SIMPLE_LROUND(x) CT_SIMPLE_ROUND__(double, long int, x) |
@@ -124,7 +124,7 @@ | ||
124 | 124 | |
125 | 125 | #define CT_SIMPLE_LROUNDF(x) CT_SIMPLE_ROUND__(float, long int, x) |
126 | 126 | |
127 | -#if defined(CT_COMPL_SDCC) | |
127 | +#if defined (CT_COMPL_SDCC) | |
128 | 128 | # define CT_SIMPLE_LLROUND(x) CT_SIMPLE_ROUND__(float, long long int, x) |
129 | 129 | #else |
130 | 130 | # define CT_SIMPLE_LROUNDL(x) CT_SIMPLE_ROUND__(long double, long int, x) |
@@ -133,7 +133,7 @@ | ||
133 | 133 | |
134 | 134 | #define CT_SIMPLE_LLROUNDF(x) CT_SIMPLE_ROUND__(float, long long int, x) |
135 | 135 | |
136 | -#if !defined(CT_COMPL_SDCC) | |
136 | +#if !defined (CT_COMPL_SDCC) | |
137 | 137 | # define CT_SIMPLE_LLROUNDL(x) CT_SIMPLE_ROUND__(long double, long long int, x) |
138 | 138 | #endif |
139 | 139 |
@@ -152,7 +152,7 @@ | ||
152 | 152 | #define CT_SIMPLE_ROUNDF64(x) CT_SIMPLE_ROUND__(float, int64_t, x) |
153 | 153 | #define CT_SIMPLE_UROUNDF64(x) CT_SIMPLE_ROUND__(float, uint64_t, x) |
154 | 154 | |
155 | -#if defined(CT_COMPL_SDCC) | |
155 | +#if defined (CT_COMPL_SDCC) | |
156 | 156 | # define CT_SIMPLE_ROUND8(x) CT_SIMPLE_ROUND__(float, int8_t, x) |
157 | 157 | # define CT_SIMPLE_UROUND8(x) CT_SIMPLE_ROUND__(float, uint8_t, x) |
158 | 158 |
@@ -29,7 +29,7 @@ | ||
29 | 29 | * We could include unistd.h for symlink() but on some systems(i.e. Gentoo 2015) |
30 | 30 | * symlink woudn't get linked |
31 | 31 | */ |
32 | -# if defined(CT_OS_ANDROID) | |
32 | +# if defined (CT_OS_ANDROID) | |
33 | 33 | extern int symlink(const char *, const char *); |
34 | 34 | # else |
35 | 35 | extern CT_SHARED_API int symlink(const char* __from, const char* __to) __THROW __nonnull((1, 2)) __wur; |
@@ -150,7 +150,7 @@ | ||
150 | 150 | #endif |
151 | 151 | |
152 | 152 | #ifdef CT_TRACE_LEVEL_NO_TRACE |
153 | -# if defined(CT_DYN_TRACES) && (CT_DYN_TRACES == 1) | |
153 | +# if defined (CT_DYN_TRACES) && (CT_DYN_TRACES == 1) | |
154 | 154 | # error CT_TRACE_LEVEL_NO_TRACE and CT_DYN_TRACES == 1 are mutually exclusive (both shoud not be passed simulteniously) |
155 | 155 | # endif |
156 | 156 |
@@ -36,8 +36,8 @@ | ||
36 | 36 | * We could include stdlib.h for realpath() but on some systems(i.e. Ubuntu 14.04) |
37 | 37 | * stdlib.h(->features.h) undefines everything |
38 | 38 | */ |
39 | -# if defined(CT_OS_ANDROID) | |
40 | -extern char * realpath(const char *path, char *resolved); | |
39 | +# if defined (CT_OS_ANDROID) | |
40 | +extern char* realpath(const char* path, char* resolved); | |
41 | 41 | # else |
42 | 42 | extern char* realpath(const char* __restrict __name, char* __restrict __resolved) __THROW __wur; |
43 | 43 | # endif |
@@ -63,7 +63,7 @@ | ||
63 | 63 | CT_CHECK_PTR_AND_BREAK(path); |
64 | 64 | CT_CHECK_PTR_AND_BREAK(mode); |
65 | 65 | |
66 | -#if defined(CT_OS_WINDOWS) | |
66 | +#if defined (CT_OS_WINDOWS) | |
67 | 67 | if (!(mode[0] == 'a' || mode[0] == 'r' || mode[0] == 'w')) |
68 | 68 | CT_TRACE_ERRORN("Invalid first mode characted: %c", mode[0]); |
69 | 69 | #endif |
@@ -52,9 +52,9 @@ | ||
52 | 52 | TEST_ASSERT_TRUE(fileSize == -1); |
53 | 53 | |
54 | 54 | absolutePath = getAbsolutePath(CT_NULL, CT_NULL, 0); |
55 | -#if defined(CT_OS_UNIX) | |
55 | +#if defined (CT_OS_UNIX) | |
56 | 56 | TEST_ASSERT_TRUE(absolutePath == CT_NULL); |
57 | -#elif defined(CT_OS_WINDOWS) | |
57 | +#elif defined (CT_OS_WINDOWS) | |
58 | 58 | // Windows function return current directory in such case. We test here compilability, so don't care |
59 | 59 | TEST_ASSERT_TRUE(absolutePath != CT_NULL); |
60 | 60 | #endif |
@@ -18,11 +18,11 @@ | ||
18 | 18 | |
19 | 19 | #if defined (CT_LIBC_GLIBC) |
20 | 20 | |
21 | -# if !defined(_BSD_SOURCE) && !defined(_DEFAULT_SOURCE) && !defined(CT_GLIBC_BSD_DEFAULT_SOURCE_WAS_DEFINED) | |
21 | +# if !defined (_BSD_SOURCE) && !defined (_DEFAULT_SOURCE) && !defined (CT_GLIBC_BSD_DEFAULT_SOURCE_WAS_DEFINED) | |
22 | 22 | # error (_BSD_SOURCE or _DEFAULT_SOURCE) and CT_GLIBC_BSD_DEFAULT_SOURCE_WAS_DEFINED must be defined |
23 | 23 | # endif |
24 | 24 | |
25 | -# if !defined(_SVID_SOURCE) && !defined(_DEFAULT_SOURCE) && !defined(CT_GLIBC_SVID_DEFAULT_SOURCE_WAS_DEFINED) | |
25 | +# if !defined (_SVID_SOURCE) && !defined (_DEFAULT_SOURCE) && !defined (CT_GLIBC_SVID_DEFAULT_SOURCE_WAS_DEFINED) | |
26 | 26 | # error (_SVID_SOURCE or _DEFAULT_SOURCE) and CT_GLIBC_SVID_DEFAULT_SOURCE_WAS_DEFINED must be defined |
27 | 27 | # endif |
28 | 28 |
@@ -65,7 +65,7 @@ | ||
65 | 65 | TEST_ASSERT_EQUAL_INT32(roundf32(1.5f), 2); |
66 | 66 | TEST_ASSERT_EQUAL_UINT32(uroundf32(1.5f), 2U); |
67 | 67 | |
68 | -#if defined(UNITY_INCLUDE_64) || (UNITY_LONG_WIDTH == 64) | |
68 | +#if defined (UNITY_INCLUDE_64) || (UNITY_LONG_WIDTH == 64) | |
69 | 69 | TEST_ASSERT_EQUAL_INT64(roundf64(1.5f), 2); |
70 | 70 | TEST_ASSERT_EQUAL_UINT64(uroundf64(1.5f), 2U); |
71 | 71 | #endif |
@@ -80,7 +80,7 @@ | ||
80 | 80 | TEST_ASSERT_EQUAL_INT32(round32(1.5), 2); |
81 | 81 | TEST_ASSERT_EQUAL_UINT32(uround32(1.5), 2U); |
82 | 82 | |
83 | -#if defined(UNITY_INCLUDE_64) || (UNITY_LONG_WIDTH == 64) | |
83 | +#if defined (UNITY_INCLUDE_64) || (UNITY_LONG_WIDTH == 64) | |
84 | 84 | TEST_ASSERT_EQUAL_INT64(round64(1.5), 2); |
85 | 85 | TEST_ASSERT_EQUAL_UINT64(uround64(1.5), 2U); |
86 | 86 | #endif |
@@ -26,12 +26,12 @@ | ||
26 | 26 | { |
27 | 27 | TEST_ASSERT_EQUAL_INT(CT_SIMPLE_LROUND(1.5), 2); |
28 | 28 | TEST_ASSERT_EQUAL_INT(CT_SIMPLE_LROUNDF(1.5), 2); |
29 | -#if !defined(CT_COMPL_SDCC) | |
29 | +#if !defined (CT_COMPL_SDCC) | |
30 | 30 | TEST_ASSERT_EQUAL_INT(CT_SIMPLE_LROUNDL(1.5), 2); |
31 | 31 | #endif |
32 | 32 | TEST_ASSERT_EQUAL_INT(CT_SIMPLE_LLROUND(1.5), 2); |
33 | 33 | TEST_ASSERT_EQUAL_INT(CT_SIMPLE_LLROUNDF(1.5), 2); |
34 | -#if !defined(CT_COMPL_SDCC) | |
34 | +#if !defined (CT_COMPL_SDCC) | |
35 | 35 | TEST_ASSERT_EQUAL_INT(CT_SIMPLE_LLROUNDL(1.5), 2); |
36 | 36 | #endif |
37 | 37 |
@@ -44,7 +44,7 @@ | ||
44 | 44 | TEST_ASSERT_EQUAL_INT32(CT_SIMPLE_ROUNDF32(1.5f), 2); |
45 | 45 | TEST_ASSERT_EQUAL_UINT32(CT_SIMPLE_UROUNDF32(1.5f), 2U); |
46 | 46 | |
47 | -#if defined(UNITY_INCLUDE_64) || (UNITY_LONG_WIDTH == 64) | |
47 | +#if defined (UNITY_INCLUDE_64) || (UNITY_LONG_WIDTH == 64) | |
48 | 48 | TEST_ASSERT_EQUAL_INT64(CT_SIMPLE_ROUNDF64(1.5f), 2); |
49 | 49 | TEST_ASSERT_EQUAL_UINT64(CT_SIMPLE_UROUNDF64(1.5f), 2U); |
50 | 50 | #endif |
@@ -59,7 +59,7 @@ | ||
59 | 59 | TEST_ASSERT_EQUAL_INT32(CT_SIMPLE_ROUND32(1.5), 2); |
60 | 60 | TEST_ASSERT_EQUAL_UINT32(CT_SIMPLE_UROUND32(1.5), 2U); |
61 | 61 | |
62 | -#if defined(UNITY_INCLUDE_64) || (UNITY_LONG_WIDTH == 64) | |
62 | +#if defined (UNITY_INCLUDE_64) || (UNITY_LONG_WIDTH == 64) | |
63 | 63 | TEST_ASSERT_EQUAL_INT64(CT_SIMPLE_ROUND64(1.5), 2); |
64 | 64 | TEST_ASSERT_EQUAL_UINT64(CT_SIMPLE_UROUND64(1.5), 2U); |
65 | 65 | #endif |