libretro / picodrive

Fast MegaDrive/MegaCD/32X emulator
Other
40 stars 63 forks source link

Compile errors with master and gcc-14.1.0 #231

Closed heitbaum closed 3 months ago

heitbaum commented 3 months ago

The following errors stop the compile (this is compiling on x86_64 for x86_64)

platform/libretro/libretro.c: In function 'retro_get_memory_data':
platform/libretro/libretro.c:1683:15: error: assignment to 'uint8_t *' {aka 'unsigned char *'} from incompatible pointer type 'short unsigned int *' [-Wincompatible-pointer-types]
 1683 |          data = PicoMem.vram;
      |               ^
platform/libretro/libretro.c:1686:15: error: assignment to 'uint8_t *' {aka 'unsigned char *'} from incompatible pointer type 'short unsigned int *' [-Wincompatible-pointer-types]
 1686 |          data = PicoMem.cram;
      |               ^
irixxxx commented 3 months ago

I've currently no setup to check this. Are there any other compile problems after adding the now needed casts?

heitbaum commented 3 months ago

I've currently no setup to check this. Are there any other compile problems after adding the now needed casts?

I tested by adding the casts last night: data = (uint8_t *) PicoMem.vram; data = (uint8_t *) PicoMem.cram;

also - skip the cast and just return the pointer as the return is (void *)

return PicoMem.vram; return PicoMem.cram;

irixxxx commented 3 months ago

OK, thanks for checking. IMHO the best way is maybe to change the type of data to void *, as it's not the same as the return anyway.

irixxxx commented 3 months ago

fixed with 60ef69 in my repo