diff options
| author | tylov <[email protected]> | 2023-07-08 23:45:13 +0200 |
|---|---|---|
| committer | tylov <[email protected]> | 2023-07-08 23:45:13 +0200 |
| commit | c8a11225cf30740590d469d835c7ba367627abca (patch) | |
| tree | 93b610036b0ce04fbb9f7e8b4dc64322e9b1a0f9 | |
| parent | a7f7951490b9709dd75e143d0afdf51d5869eb54 (diff) | |
| download | STC-modified-c8a11225cf30740590d469d835c7ba367627abca.tar.gz STC-modified-c8a11225cf30740590d469d835c7ba367627abca.zip | |
Fixes from 32-bit raspberry pi testing.
| -rw-r--r-- | include/stc/ccommon.h | 2 | ||||
| -rw-r--r-- | misc/tests/cspan_test.c | 5 | ||||
| -rw-r--r-- | misc/tests/ctest.h | 3 |
3 files changed, 5 insertions, 5 deletions
diff --git a/include/stc/ccommon.h b/include/stc/ccommon.h index 6f42bcc1..0cce1610 100644 --- a/include/stc/ccommon.h +++ b/include/stc/ccommon.h @@ -174,7 +174,7 @@ STC_INLINE intptr_t cnextpow2(intptr_t n) { n |= n >> 1, n |= n >> 2; n |= n >> 4, n |= n >> 8; n |= n >> 16; - #if INTPTR_SIZE == INT64_SIZE + #if INTPTR_MAX == INT64_MAX n |= n >> 32; #endif return n + 1; diff --git a/misc/tests/cspan_test.c b/misc/tests/cspan_test.c index d266fa38..b6953936 100644 --- a/misc/tests/cspan_test.c +++ b/misc/tests/cspan_test.c @@ -113,10 +113,9 @@ CTEST_TEARDOWN(cspan_cube) { CTEST_F(cspan_cube, slice3) { - intptr_t n = cstack_int_size(&_self->stack); - //printf("\ntiles: %d, cells: %d\n", (int)Tiles_size(&_self->tiles), (int)n); + long long n = cstack_int_size(&_self->stack); + long long sum = 0; - int64_t sum = 0; // iterate each 3d tile in sequence c_foreach (i, Tiles, _self->tiles) c_foreach (t, intspan3, *i.ref) diff --git a/misc/tests/ctest.h b/misc/tests/ctest.h index 373cda0e..6b1b1084 100644 --- a/misc/tests/ctest.h +++ b/misc/tests/ctest.h @@ -408,7 +408,8 @@ void assert_dbl_compare(const char* cmp, double exp, double real, double tol, co void assert_pointers(const char* cmp, const void* exp, const void* real, const char* caller, int line) { if ((exp == real) != (cmp[0] == '=')) { - CTEST_ERR("%s:%d assertion failed (0x%02llx) %s (0x%02llx)", caller, line, (unsigned long long)exp , cmp, (unsigned long long)real); + CTEST_ERR("%s:%d assertion failed (0x%02llx) %s (0x%02llx)", caller, line, + (unsigned long long)(uintptr_t)exp , cmp, (unsigned long long)(uintptr_t)real); } } |
