Skip to content

Commit

Permalink
testautomation_guid.c: fix integer warning in 32 bit builds.
Browse files Browse the repository at this point in the history
  • Loading branch information
sezero committed May 31, 2023
1 parent 0b28cbe commit e9e4a91
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions test/testautomation_guid.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,46 @@
#include <SDL3/SDL_test.h>
#include "testautomation_suites.h"

#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif

/* ================= Test Case Implementation ================== */

/* Helper functions */

#define NUM_TEST_GUIDS 5

#ifndef UINT64_C
#ifdef _MSC_VER
#define UINT64_C(x) x##ui64
#elif defined(_LP64)
#define UINT64_C(x) x##UL
#else
#define UINT64_C(x) x##ULL
#endif
#endif

static struct
{
char *str;
Uint64 upper, lower;
} test_guids[NUM_TEST_GUIDS] = {
{ "0000000000000000"
"ffffffffffffffff",
0x0000000000000000, 0xfffffffffffffffflu },
UINT64_C(0x0000000000000000), UINT64_C(0xffffffffffffffff) },
{ "0011223344556677"
"8091a2b3c4d5e6f0",
0x0011223344556677lu, 0x8091a2b3c4d5e6f0lu },
UINT64_C(0x0011223344556677), UINT64_C(0x8091a2b3c4d5e6f0) },
{ "a011223344556677"
"8091a2b3c4d5e6f0",
0xa011223344556677lu, 0x8091a2b3c4d5e6f0lu },
UINT64_C(0xa011223344556677), UINT64_C(0x8091a2b3c4d5e6f0) },
{ "a011223344556677"
"8091a2b3c4d5e6f1",
0xa011223344556677lu, 0x8091a2b3c4d5e6f1lu },
UINT64_C(0xa011223344556677), UINT64_C(0x8091a2b3c4d5e6f1) },
{ "a011223344556677"
"8191a2b3c4d5e6f0",
0xa011223344556677lu, 0x8191a2b3c4d5e6f0lu },
UINT64_C(0xa011223344556677), UINT64_C(0x8191a2b3c4d5e6f0) },
};

static void
Expand Down

0 comments on commit e9e4a91

Please sign in to comment.