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

.clang-format
Client/main.c
Library/dw_util.h

index 53f287cead874dd2defab8b484fba8f4e573dc50..a00b8c07ece88e0dc36ba452d2f1cb2141c72646 100644 (file)
@@ -10,3 +10,5 @@ AllowShortIfStatementsOnASingleLine: Always
 AllowShortBlocksOnASingleLine: Never
 AllowShortLoopsOnASingleLine: true
 SpaceBeforeParens: Never
+StatementMacros:
+ - __dw_big_endian
index afb662b3ee543b1d4cf74606032a680c781bdb15..589f41e2c0abce1dd0b42a6f03fab42ddde14604 100644 (file)
@@ -114,9 +114,7 @@ int main(int argc, char** argv) {
        printf("\n");
        printf("Type a command (.help) for the help\n");
        printf("\n");
-       double val;
-       __dw_big_endian(123.3, double, val = __converted);
-       printf("%f\n", val);
+       __dw_big_endian(123, double, );
        int len = 0;
        char* buf = malloc(1);
        buf[0] = 0;
index 2c3dd1482d639598e1f6b57ecf54de04926e0a1f..ad8c6fb4b8008e25d554934f951329bdeec9181a 100644 (file)
@@ -55,7 +55,8 @@ bool __dw_strcaseequ(const char* a, const char* b);
        type __converted; \
        signed char* __converted_ptr = (signed char*)&__converted; \
        int __i; \
-       char __endian = dataworks_get_endian(); \
+       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]; \