-
Notifications
You must be signed in to change notification settings - Fork 743
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
1 parent
839280e
commit d8b84fe
Showing
4 changed files
with
108 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- libmpcodecs/ve_lavc.c.orig 2022-08-30 20:40:03 UTC | ||
+++ libmpcodecs/ve_lavc.c | ||
@@ -441,7 +441,7 @@ static int config(struct vf_instance *vf, | ||
mp_msg(MSGT_MENCODER,MSGL_ERR,"error parsing vrc_q\n"); | ||
return 0; | ||
} | ||
- lavc_venc_context->rc_override= | ||
+ lavc_venc_context->rc_override=(struct RcOverride *) | ||
av_reallocp_array(lavc_venc_context->rc_override, i+1, sizeof(*lavc_venc_context->rc_override)); | ||
lavc_venc_context->rc_override[i].start_frame= start; | ||
lavc_venc_context->rc_override[i].end_frame = end; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- loader/ext.c.orig 2021-01-23 18:22:09 UTC | ||
+++ loader/ext.c | ||
@@ -444,7 +444,7 @@ LPVOID WINAPI VirtualAlloc(LPVOID address, DWORD size, | ||
|
||
if (type&MEM_RESERVE && (unsigned)address&0xffff) { | ||
size += (unsigned)address&0xffff; | ||
- address = (unsigned)address&~0xffff; | ||
+ address = (void*)((unsigned)address&~0xffff); | ||
} | ||
pgsz = sysconf(_SC_PAGESIZE); | ||
if (type&MEM_COMMIT && (unsigned)address%pgsz) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
--- loader/win32.c.orig 2021-01-23 18:22:09 UTC | ||
+++ loader/win32.c | ||
@@ -1504,7 +1504,7 @@ static void WINAPI expDeleteCriticalSection(CRITICAL_S | ||
static int WINAPI expGetCurrentThreadId(void) | ||
{ | ||
dbgprintf("GetCurrentThreadId() => %d\n", pthread_self()); | ||
- return pthread_self(); | ||
+ return (int)pthread_self(); | ||
} | ||
static int WINAPI expGetCurrentProcess(void) | ||
{ | ||
@@ -2019,15 +2019,15 @@ static DWORD WINAPI expSignalObjectAndWait(HANDLE hObj | ||
expSetEvent(mlist); | ||
break; | ||
case 1: // Semaphore | ||
- expReleaseSemaphore(mlist, 1, NULL); | ||
+ expReleaseSemaphore((long)mlist, 1, NULL); | ||
break; | ||
case 2: // Mutex | ||
- expReleaseMutex(mlist); | ||
+ expReleaseMutex((long)mlist); | ||
break; | ||
default: | ||
dbgprintf("Signalling unknown object type %d!\n", hObjectToSignal); | ||
} | ||
- return expWaitForSingleObject(hObjectToWaitOn, dwMilliseconds); | ||
+ return (DWORD)expWaitForSingleObject((void*)hObjectToWaitOn, dwMilliseconds); | ||
} | ||
|
||
static long WINAPI expRegOpenKeyExA(long key, const char* subkey, long reserved, long access, int* newkey) | ||
@@ -2751,7 +2751,7 @@ static int WINAPI expEnumDisplayMonitors(void *dc, REC | ||
{ | ||
dbgprintf("EnumDisplayMonitors(0x%x, 0x%x, 0x%x, 0x%x) => ?\n", | ||
dc, r, callback_proc, callback_param); | ||
- return callback_proc(0, dc, r, callback_param); | ||
+ return callback_proc(0, (HDC)dc, r, (LPARAM)callback_param); | ||
} | ||
|
||
#if 0 | ||
@@ -2851,14 +2851,14 @@ static int WINAPI expEnumWindows(int (*callback_func)( | ||
{ | ||
int i, i2; | ||
dbgprintf("EnumWindows(0x%x, 0x%x) => 1\n", callback_func, callback_param); | ||
- i = callback_func(0, callback_param); | ||
- i2 = callback_func(1, callback_param); | ||
+ i = callback_func(0, (LPARAM)callback_param); | ||
+ i2 = callback_func(1, (LPARAM)callback_param); | ||
return i && i2; | ||
} | ||
|
||
static int WINAPI expGetWindowThreadProcessId(HWND win, int *pid_data) | ||
{ | ||
- int tid = pthread_self(); | ||
+ int tid = (int)pthread_self(); | ||
dbgprintf("GetWindowThreadProcessId(0x%x, 0x%x) => %d\n", | ||
win, pid_data, tid); | ||
if (pid_data) | ||
@@ -4940,7 +4940,7 @@ static HPALETTE WINAPI expCreatePalette(CONST LOGPALET | ||
dbgprintf("CreatePalette(%x) => NULL\n", lpgpl); | ||
|
||
i = sizeof(LOGPALETTE)+((lpgpl->palNumEntries-1)*sizeof(PALETTEENTRY)); | ||
- test = malloc(i); | ||
+ test = (HPALETTE)malloc(i); | ||
memcpy((void *)test, lpgpl, i); | ||
|
||
return test; |