• R/O
  • SSH

libctools: Commit

This library contains code that extends and simplifies different operations
for C language based programs.


Commit MetaInfo

Revisiónbeb63fa242f20b73cf8f53b5cee031565349d189 (tree)
Tiempo2022-08-30 17:53:16
AutorSergey Gusarov <laborer2008@gmai...>
CommiterSergey Gusarov

Log Message

Code style fixes

Cambiar Resumen

Diferencia incremental

diff -r 478af2d144ff -r beb63fa242f2 .hgsubstate
--- a/.hgsubstate Tue Aug 30 11:15:48 2022 +0300
+++ b/.hgsubstate Tue Aug 30 11:53:16 2022 +0300
@@ -1,4 +1,4 @@
11 f7c8d204705ccf1d21bba9e8d33cd030635dd1ee cmake/cmake_tools
22 5013d507802becd2c434d4dbdafad45c3da5ef23 include/ctools/std/msinttypes
3-c687cce0a880bac77b1761057be5d13a23c9e098 pyrepo
3+25ebb88de95dddf840a746dfd5c4d89323cc27b9 pyrepo
44 3852926c00f210905db5feb7a9fa5d5dbf7963ea tests/unity
diff -r 478af2d144ff -r beb63fa242f2 include/ctools/os/thread.h
--- a/include/ctools/os/thread.h Tue Aug 30 11:15:48 2022 +0300
+++ b/include/ctools/os/thread.h Tue Aug 30 11:53:16 2022 +0300
@@ -71,7 +71,7 @@
7171 * Thread cancellation (pthread_cancel). Unlikely to ever be implemented because of the difficulty
7272 * and cost of implementing it, and the difficulty of using it correctly
7373 */
74-# if !defined(CT_OS_ANDROID)
74+# if !defined (CT_OS_ANDROID)
7575 # define CT_KILL_THREAD_AVAILABLE
7676 # endif
7777
diff -r 478af2d144ff -r beb63fa242f2 include/ctools/simple_round.h
--- a/include/ctools/simple_round.h Tue Aug 30 11:15:48 2022 +0300
+++ b/include/ctools/simple_round.h Tue Aug 30 11:53:16 2022 +0300
@@ -116,7 +116,7 @@
116116 * double is not supported.
117117 */
118118
119-#if defined(CT_COMPL_SDCC)
119+#if defined (CT_COMPL_SDCC)
120120 # define CT_SIMPLE_LROUND(x) CT_SIMPLE_ROUND__(float, long int, x)
121121 #else
122122 # define CT_SIMPLE_LROUND(x) CT_SIMPLE_ROUND__(double, long int, x)
@@ -124,7 +124,7 @@
124124
125125 #define CT_SIMPLE_LROUNDF(x) CT_SIMPLE_ROUND__(float, long int, x)
126126
127-#if defined(CT_COMPL_SDCC)
127+#if defined (CT_COMPL_SDCC)
128128 # define CT_SIMPLE_LLROUND(x) CT_SIMPLE_ROUND__(float, long long int, x)
129129 #else
130130 # define CT_SIMPLE_LROUNDL(x) CT_SIMPLE_ROUND__(long double, long int, x)
@@ -133,7 +133,7 @@
133133
134134 #define CT_SIMPLE_LLROUNDF(x) CT_SIMPLE_ROUND__(float, long long int, x)
135135
136-#if !defined(CT_COMPL_SDCC)
136+#if !defined (CT_COMPL_SDCC)
137137 # define CT_SIMPLE_LLROUNDL(x) CT_SIMPLE_ROUND__(long double, long long int, x)
138138 #endif
139139
@@ -152,7 +152,7 @@
152152 #define CT_SIMPLE_ROUNDF64(x) CT_SIMPLE_ROUND__(float, int64_t, x)
153153 #define CT_SIMPLE_UROUNDF64(x) CT_SIMPLE_ROUND__(float, uint64_t, x)
154154
155-#if defined(CT_COMPL_SDCC)
155+#if defined (CT_COMPL_SDCC)
156156 # define CT_SIMPLE_ROUND8(x) CT_SIMPLE_ROUND__(float, int8_t, x)
157157 # define CT_SIMPLE_UROUND8(x) CT_SIMPLE_ROUND__(float, uint8_t, x)
158158
diff -r 478af2d144ff -r beb63fa242f2 include/ctools/std/unistd.h
--- a/include/ctools/std/unistd.h Tue Aug 30 11:15:48 2022 +0300
+++ b/include/ctools/std/unistd.h Tue Aug 30 11:53:16 2022 +0300
@@ -29,7 +29,7 @@
2929 * We could include unistd.h for symlink() but on some systems(i.e. Gentoo 2015)
3030 * symlink woudn't get linked
3131 */
32-# if defined(CT_OS_ANDROID)
32+# if defined (CT_OS_ANDROID)
3333 extern int symlink(const char *, const char *);
3434 # else
3535 extern CT_SHARED_API int symlink(const char* __from, const char* __to) __THROW __nonnull((1, 2)) __wur;
diff -r 478af2d144ff -r beb63fa242f2 include/ctools/trace_ext.h
--- a/include/ctools/trace_ext.h Tue Aug 30 11:15:48 2022 +0300
+++ b/include/ctools/trace_ext.h Tue Aug 30 11:53:16 2022 +0300
@@ -150,7 +150,7 @@
150150 #endif
151151
152152 #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)
154154 # error CT_TRACE_LEVEL_NO_TRACE and CT_DYN_TRACES == 1 are mutually exclusive (both shoud not be passed simulteniously)
155155 # endif
156156
diff -r 478af2d144ff -r beb63fa242f2 src/os/io.c
--- a/src/os/io.c Tue Aug 30 11:15:48 2022 +0300
+++ b/src/os/io.c Tue Aug 30 11:53:16 2022 +0300
@@ -36,8 +36,8 @@
3636 * We could include stdlib.h for realpath() but on some systems(i.e. Ubuntu 14.04)
3737 * stdlib.h(->features.h) undefines everything
3838 */
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);
4141 # else
4242 extern char* realpath(const char* __restrict __name, char* __restrict __resolved) __THROW __wur;
4343 # endif
diff -r 478af2d144ff -r beb63fa242f2 src/std/stdio.c
--- a/src/std/stdio.c Tue Aug 30 11:15:48 2022 +0300
+++ b/src/std/stdio.c Tue Aug 30 11:53:16 2022 +0300
@@ -63,7 +63,7 @@
6363 CT_CHECK_PTR_AND_BREAK(path);
6464 CT_CHECK_PTR_AND_BREAK(mode);
6565
66-#if defined(CT_OS_WINDOWS)
66+#if defined (CT_OS_WINDOWS)
6767 if (!(mode[0] == 'a' || mode[0] == 'r' || mode[0] == 'w'))
6868 CT_TRACE_ERRORN("Invalid first mode characted: %c", mode[0]);
6969 #endif
diff -r 478af2d144ff -r beb63fa242f2 tests/src/os/test_io.c
--- a/tests/src/os/test_io.c Tue Aug 30 11:15:48 2022 +0300
+++ b/tests/src/os/test_io.c Tue Aug 30 11:53:16 2022 +0300
@@ -52,9 +52,9 @@
5252 TEST_ASSERT_TRUE(fileSize == -1);
5353
5454 absolutePath = getAbsolutePath(CT_NULL, CT_NULL, 0);
55-#if defined(CT_OS_UNIX)
55+#if defined (CT_OS_UNIX)
5656 TEST_ASSERT_TRUE(absolutePath == CT_NULL);
57-#elif defined(CT_OS_WINDOWS)
57+#elif defined (CT_OS_WINDOWS)
5858 // Windows function return current directory in such case. We test here compilability, so don't care
5959 TEST_ASSERT_TRUE(absolutePath != CT_NULL);
6060 #endif
diff -r 478af2d144ff -r beb63fa242f2 tests/src/predef/test_glibc.c
--- a/tests/src/predef/test_glibc.c Tue Aug 30 11:15:48 2022 +0300
+++ b/tests/src/predef/test_glibc.c Tue Aug 30 11:53:16 2022 +0300
@@ -18,11 +18,11 @@
1818
1919 #if defined (CT_LIBC_GLIBC)
2020
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)
2222 # error (_BSD_SOURCE or _DEFAULT_SOURCE) and CT_GLIBC_BSD_DEFAULT_SOURCE_WAS_DEFINED must be defined
2323 # endif
2424
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)
2626 # error (_SVID_SOURCE or _DEFAULT_SOURCE) and CT_GLIBC_SVID_DEFAULT_SOURCE_WAS_DEFINED must be defined
2727 # endif
2828
diff -r 478af2d144ff -r beb63fa242f2 tests/src/std/test_math.c
--- a/tests/src/std/test_math.c Tue Aug 30 11:15:48 2022 +0300
+++ b/tests/src/std/test_math.c Tue Aug 30 11:53:16 2022 +0300
@@ -65,7 +65,7 @@
6565 TEST_ASSERT_EQUAL_INT32(roundf32(1.5f), 2);
6666 TEST_ASSERT_EQUAL_UINT32(uroundf32(1.5f), 2U);
6767
68-#if defined(UNITY_INCLUDE_64) || (UNITY_LONG_WIDTH == 64)
68+#if defined (UNITY_INCLUDE_64) || (UNITY_LONG_WIDTH == 64)
6969 TEST_ASSERT_EQUAL_INT64(roundf64(1.5f), 2);
7070 TEST_ASSERT_EQUAL_UINT64(uroundf64(1.5f), 2U);
7171 #endif
@@ -80,7 +80,7 @@
8080 TEST_ASSERT_EQUAL_INT32(round32(1.5), 2);
8181 TEST_ASSERT_EQUAL_UINT32(uround32(1.5), 2U);
8282
83-#if defined(UNITY_INCLUDE_64) || (UNITY_LONG_WIDTH == 64)
83+#if defined (UNITY_INCLUDE_64) || (UNITY_LONG_WIDTH == 64)
8484 TEST_ASSERT_EQUAL_INT64(round64(1.5), 2);
8585 TEST_ASSERT_EQUAL_UINT64(uround64(1.5), 2U);
8686 #endif
diff -r 478af2d144ff -r beb63fa242f2 tests/src/test_simple_round.c
--- a/tests/src/test_simple_round.c Tue Aug 30 11:15:48 2022 +0300
+++ b/tests/src/test_simple_round.c Tue Aug 30 11:53:16 2022 +0300
@@ -26,12 +26,12 @@
2626 {
2727 TEST_ASSERT_EQUAL_INT(CT_SIMPLE_LROUND(1.5), 2);
2828 TEST_ASSERT_EQUAL_INT(CT_SIMPLE_LROUNDF(1.5), 2);
29-#if !defined(CT_COMPL_SDCC)
29+#if !defined (CT_COMPL_SDCC)
3030 TEST_ASSERT_EQUAL_INT(CT_SIMPLE_LROUNDL(1.5), 2);
3131 #endif
3232 TEST_ASSERT_EQUAL_INT(CT_SIMPLE_LLROUND(1.5), 2);
3333 TEST_ASSERT_EQUAL_INT(CT_SIMPLE_LLROUNDF(1.5), 2);
34-#if !defined(CT_COMPL_SDCC)
34+#if !defined (CT_COMPL_SDCC)
3535 TEST_ASSERT_EQUAL_INT(CT_SIMPLE_LLROUNDL(1.5), 2);
3636 #endif
3737
@@ -44,7 +44,7 @@
4444 TEST_ASSERT_EQUAL_INT32(CT_SIMPLE_ROUNDF32(1.5f), 2);
4545 TEST_ASSERT_EQUAL_UINT32(CT_SIMPLE_UROUNDF32(1.5f), 2U);
4646
47-#if defined(UNITY_INCLUDE_64) || (UNITY_LONG_WIDTH == 64)
47+#if defined (UNITY_INCLUDE_64) || (UNITY_LONG_WIDTH == 64)
4848 TEST_ASSERT_EQUAL_INT64(CT_SIMPLE_ROUNDF64(1.5f), 2);
4949 TEST_ASSERT_EQUAL_UINT64(CT_SIMPLE_UROUNDF64(1.5f), 2U);
5050 #endif
@@ -59,7 +59,7 @@
5959 TEST_ASSERT_EQUAL_INT32(CT_SIMPLE_ROUND32(1.5), 2);
6060 TEST_ASSERT_EQUAL_UINT32(CT_SIMPLE_UROUND32(1.5), 2U);
6161
62-#if defined(UNITY_INCLUDE_64) || (UNITY_LONG_WIDTH == 64)
62+#if defined (UNITY_INCLUDE_64) || (UNITY_LONG_WIDTH == 64)
6363 TEST_ASSERT_EQUAL_INT64(CT_SIMPLE_ROUND64(1.5), 2);
6464 TEST_ASSERT_EQUAL_UINT64(CT_SIMPLE_UROUND64(1.5), 2U);
6565 #endif
Show on old repository browser