ports/multimedia/mplayer/files/patch-loader_module.c
Thomas Zander d8b84fe7c9 multimedia/mplayer: Fix build with llvm15
Details:
- clang15 performs stricter checks for pointer conversions, some
  questionable conversions graduated from warnings to errors
- Fixes multimedia/mencoder builds as well

MFH:		2023Q1
2023-02-12 12:59:46 +01:00

20 lines
892 B
C

--- loader/module.c.orig 2011-07-30 20:44:37 UTC
+++ loader/module.c
@@ -844,7 +844,7 @@ static int report_func(void *stack_base, int stack_siz
// memory management:
case 0x150011: //NewPtrClear
case 0x150012: //NewPtrSysClear
- reg->eax = malloc(((uint32_t *)stack_base)[1]);
+ reg->eax = (uint32_t)malloc(((uint32_t *)stack_base)[1]);
memset((void *)reg->eax,0,((uint32_t *)stack_base)[1]);
#ifdef DEBUG_QTX_API
printf("%*sLEAVE(%d): EMULATED! 0x%X\n",ret_i*2,"",ret_i, reg->eax);
@@ -852,7 +852,7 @@ static int report_func(void *stack_base, int stack_siz
return 1;
case 0x15000F: //NewPtr
case 0x150010: //NewPtrSys
- reg->eax = malloc(((uint32_t *)stack_base)[1]);
+ reg->eax = (uint32_t)malloc(((uint32_t *)stack_base)[1]);
#ifdef DEBUG_QTX_API
printf("%*sLEAVE(%d): EMULATED! 0x%X\n",ret_i*2,"",ret_i, reg->eax);
#endif