Commit 53576999 authored by Stefan Weil's avatar Stefan Weil Committed by Blue Swirl
Browse files

w64: Fix size of ram_addr_t



ram_addr_t must be large enough to address any address of the host.

For hosts with sizeof(unsigned long) == sizeof(void *), this patch
changes nothing. All currently supported hosts fall into this category.

For w64 hosts, sizeof(unsigned long) is 4 while sizeof(void *) is 8,
so the use of uintptr_t is needed.

Signed-off-by: default avatarStefan Weil <sw@weilnetz.de>
Signed-off-by: default avatarBlue Swirl <blauwirbel@gmail.com>
parent 5a30d3f1
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -28,9 +28,9 @@ typedef uint64_t ram_addr_t;
#  define RAM_ADDR_MAX UINT64_MAX
#  define RAM_ADDR_FMT "%" PRIx64
#else
typedef unsigned long ram_addr_t;
#  define RAM_ADDR_MAX ULONG_MAX
#  define RAM_ADDR_FMT "%lx"
typedef uintptr_t ram_addr_t;
#  define RAM_ADDR_MAX UINTPTR_MAX
#  define RAM_ADDR_FMT "%" PRIxPTR
#endif

/* memory API */