Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix ALIGN_DOWN() macro on 64bit.

When the align parameter was a 32bit value (like all default integer literals),
and the to-be-aligned value is a pointer the upper 32bit got corrupted because
the value was casted down to 32bit.

Note: This hasnt been a problem because apparently the sim always gets 32bit
addresses (I found this when compiling Rockbox as a library).

Change-Id: I0d2d3fd8bfa210326b27162bb22c059da97d207a

+1 -1
+1 -1
firmware/export/system.h
··· 114 114 #define ALIGN_UP_P2(n, p2) ALIGN_DOWN_P2((n) + P2_M1(p2),p2) 115 115 116 116 /* align up or down to nearest integer multiple of a */ 117 - #define ALIGN_DOWN(n, a) ((typeof(n))((typeof(a))(n)/(a)*(a))) 117 + #define ALIGN_DOWN(n, a) ((typeof(n))((uintptr_t)(n)/(a)*(a))) 118 118 #define ALIGN_UP(n, a) ALIGN_DOWN((n)+((a)-1),a) 119 119 120 120 /* align start and end of buffer to nearest integer multiple of a */