]> Nishi Git Mirror - dataworks.git/commitdiff
finally it works
authornishi <nishi@d4a5a174-5a4a-5b4b-b672-37683c10d7d5>
Sat, 18 May 2024 09:18:08 +0000 (09:18 +0000)
committernishi <nishi@d4a5a174-5a4a-5b4b-b672-37683c10d7d5>
Sat, 18 May 2024 09:18:08 +0000 (09:18 +0000)
git-svn-id: file:///raid/svn-main/nishi-dataworks/trunk@25 d4a5a174-5a4a-5b4b-b672-37683c10d7d5

.clang-format
Library/dw_util.h

index a00b8c07ece88e0dc36ba452d2f1cb2141c72646..a5e838a173b769e4b673951c295dac8768600df3 100644 (file)
@@ -10,5 +10,6 @@ AllowShortIfStatementsOnASingleLine: Always
 AllowShortBlocksOnASingleLine: Never
 AllowShortLoopsOnASingleLine: true
 SpaceBeforeParens: Never
+AlignEscapedNewlines: DontAlign
 StatementMacros:
  - __dw_big_endian
index ad8c6fb4b8008e25d554934f951329bdeec9181a..b95fcd4ec2ac70c3910b205471962a5a6926276c 100644 (file)
@@ -49,23 +49,24 @@ bool __dw_strcaseequ(const char* a, const char* b);
 #define __dw_xstr(x) #x
 #define __dw_str(x) __dw_xstr(x)
 
-#define __dw_big_endian(arg, type, exec) { \
-       type __original = arg; \
-       signed char* __ptr = (signed char*)&__original; \
-       type __converted; \
-       signed char* __converted_ptr = (signed char*)&__converted; \
-       int __i; \
-       int __endian_check = 1; \
-       char __endian = (1 == *(volatile char*)&__endian_check) ? 'L' : 'B'; \
-       for(__i = 0; __i < sizeof(type); __i++){ \
-               if(__endian == 'L'){ \
-                       __converted_ptr[sizeof(type) - __i - 1] = __ptr[__i]; \
-               }else{ \
-                       __converted_ptr[__i] = __ptr[__i]; \
+#define __dw_big_endian(arg, type, exec) \
+       { \
+               type __original = arg; \
+               signed char* __ptr = (signed char*)&__original; \
+               type __converted; \
+               signed char* __converted_ptr = (signed char*)&__converted; \
+               int __i; \
+               int __endian_check = 1; \
+               char __endian = (1 == *(volatile char*)&__endian_check) ? 'L' : 'B'; \
+               for(__i = 0; __i < sizeof(type); __i++) { \
+                       if(__endian == 'L') { \
+                               __converted_ptr[sizeof(type) - __i - 1] = __ptr[__i]; \
+                       } else { \
+                               __converted_ptr[__i] = __ptr[__i]; \
+                       } \
                } \
-       } \
-       exec; \
-}
+               exec; \
+       }
 
 #ifdef __cplusplus
 }