[Mplayer-cvslog] CVS: main/loader driver.c,1.9,1.10 module.c,1.15,1.16 win32.c,1.70,1.71

Arpi of Ize arpi at mplayerhq.hu
Sat Dec 14 18:57:00 CET 2002


Update of /cvsroot/mplayer/main/loader
In directory mail:/var/tmp.root/cvs-serv30768/loader

Modified Files:
	driver.c module.c win32.c 
Log Message:
compiler warning fixes
based on patch by Dominik Mierzejewski <dominik at rangers.eu.org>


Index: driver.c
===================================================================
RCS file: /cvsroot/mplayer/main/loader/driver.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- driver.c	13 Sep 2002 19:43:13 -0000	1.9
+++ driver.c	14 Dec 2002 17:56:21 -0000	1.10
@@ -17,6 +17,7 @@
 #include "registry.h"
 #include "ldt_keeper.h"
 #include "driver.h"
+#include "ext.h"
 
 extern char* def_path;
 

Index: module.c
===================================================================
RCS file: /cvsroot/mplayer/main/loader/module.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- module.c	30 Nov 2002 22:02:37 -0000	1.15
+++ module.c	14 Dec 2002 17:56:21 -0000	1.16
@@ -430,10 +430,10 @@
 
 //	    dispatch_addr = GetProcAddress(wm->module, "theQuickTimeDispatcher", TRUE);
 	    dispatch_addr = PE_FindExportedFunction(wm, "theQuickTimeDispatcher", TRUE);
-	    if (dispatch_addr == 0x62924c30)
+	    if (dispatch_addr == (void *)0x62924c30)
 	    {
 	        fprintf(stderr, "QuickTime5 DLLs found\n");
-		ptr = 0x62b75ca4; // dispatch_ptr
+		ptr = (void **)0x62b75ca4; // dispatch_ptr
 	        for (i=0;i<5;i++)  ((char*)0x6299e842)[i]=0x90; // make_new_region ?
 	        for (i=0;i<28;i++) ((char*)0x6299e86d)[i]=0x90; // call__call_CreateCompatibleDC ?
 		for (i=0;i<5;i++)  ((char*)0x6299e898)[i]=0x90; // jmp_to_call_loadbitmap ?
@@ -458,10 +458,10 @@
 		((char *)0x6288e0ae)[0] = 0xc3; // font/dc remover
 		for (i=0;i<24;i++) ((char*)0x6287a1ad)[i]=0x90; // destroy window
 #endif
-	    } else if (dispatch_addr == 0x6693b330)
+	    } else if (dispatch_addr == (void *)0x6693b330)
 	    {
     		fprintf(stderr, "QuickTime6 DLLs found\n");
-		ptr = 0x66bb9524; // dispatcher_ptr
+		ptr = (void **)0x66bb9524; // dispatcher_ptr
 		for (i=0;i<5;i++)  ((char *)0x66a730cc)[i]=0x90; // make_new_region
 		for (i=0;i<28;i++) ((char *)0x66a730f7)[i]=0x90; // call__call_CreateCompatibleDC
 		for (i=0;i<5;i++)  ((char *)0x66a73122)[i]=0x90; // jmp_to_call_loadbitmap
@@ -469,9 +469,9 @@
 		for (i=0;i<96;i++) ((char *)0x66aac852)[i]=0x90; // disable threads
 	    } else
 	    {
-	        fprintf(stderr, "Unsupported QuickTime version (0x%x)\n",
+	        fprintf(stderr, "Unsupported QuickTime version (%p)\n",
 		    dispatch_addr);
-		return NULL;
+		return 0;
 	    }
 
 	    fprintf(stderr,"QuickTime.qts patched!!! old entry=%p\n",ptr[0]);
@@ -724,15 +724,15 @@
   // memory management:
   case 0x150011: //NewPtrClear
   case 0x150012: //NewPtrSysClear
-      reg->eax=malloc(((u_int32_t *)stack_base)[1]);
-      memset(reg->eax,0,((u_int32_t *)stack_base)[1]);
+      reg->eax=(u_int32_t)malloc(((u_int32_t *)stack_base)[1]);
+      memset((void *)reg->eax,0,((u_int32_t *)stack_base)[1]);
 #ifdef DEBUG_QTX_API
       printf("%*sLEAVE(%d): EMULATED! 0x%X\n",ret_i*2,"",ret_i, reg->eax);
 #endif
       return 1;
   case 0x15000F: //NewPtr
   case 0x150010: //NewPtrSys
-      reg->eax=malloc(((u_int32_t *)stack_base)[1]);
+      reg->eax=(u_int32_t)malloc(((u_int32_t *)stack_base)[1]);
 #ifdef DEBUG_QTX_API
       printf("%*sLEAVE(%d): EMULATED! 0x%X\n",ret_i*2,"",ret_i, reg->eax);
 #endif
@@ -741,7 +741,7 @@
       if(((u_int32_t *)stack_base)[1]>=0x60000000)
           printf("WARNING! Invalid Ptr handle!\n");
       else
-          free(((u_int32_t *)stack_base)[1]);
+          free((void *)((u_int32_t *)stack_base)[1]);
       reg->eax=0;
 #ifdef DEBUG_QTX_API
       printf("%*sLEAVE(%d): EMULATED! 0x%X\n",ret_i*2,"",ret_i, reg->eax);
@@ -956,7 +956,7 @@
       report_entry = report_func;
       report_ret   = report_func_ret;
       wrapper_target=retproc;
-      retproc=wrapper;
+      retproc=(FARPROC)wrapper;
     }
 
     }

Index: win32.c
===================================================================
RCS file: /cvsroot/mplayer/main/loader/win32.c,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -r1.70 -r1.71
--- win32.c	7 Dec 2002 20:02:29 -0000	1.70
+++ win32.c	14 Dec 2002 17:56:21 -0000	1.71
@@ -40,6 +40,7 @@
 #include "registry.h"
 #include "loader.h"
 #include "com.h"
+#include "ext.h"
 
 #include <stdlib.h>
 #include <assert.h>
@@ -820,7 +821,7 @@
 {
     int i;
     void *object;
-    int ret;
+    void *ret;
 
     dbgprintf("WaitForMultipleObjects(%d, 0x%x, %d, duration %d) =>\n",
 	count, objects, WaitAll, duration);
@@ -846,7 +847,7 @@
 static HANDLE WINAPI expCreateMutexA(void *pSecAttr,
 		    char bInitialOwner, const char *name)
 {
-    HANDLE mlist = expCreateEventA(pSecAttr, 0, 0, name);
+    HANDLE mlist = (HANDLE)expCreateEventA(pSecAttr, 0, 0, name);
     
     if (name)
 	dbgprintf("CreateMutexA(0x%x, %d, '%s') => 0x%x\n",
@@ -1376,6 +1377,9 @@
     pthread_mutex_unlock(&(cs->mutex));
     return;
 }
+
+static void expfree(void* mem); /* forward declaration */
+
 static void WINAPI expDeleteCriticalSection(CRITICAL_SECTION *c)
 {
 #ifdef CRITSECS_NEWTYPE
@@ -2492,7 +2496,7 @@
 
     if (lpmi->cbSize == sizeof(MONITORINFOEX))
     {
-	LPMONITORINFOEX lpmiex = lpmi;
+	LPMONITORINFOEX lpmiex = (LPMONITORINFOEX)lpmi;
 	dbgprintf("MONITORINFOEX!\n");
 	strncpy(lpmiex->szDevice, "Monitor1", CCHDEVICENAME);
     }
@@ -3529,9 +3533,9 @@
 #endif
 #else
     if (strrchr(lpFileName, '\\'))
-	*lpFilePart = strrchr(lpFileName, '\\');
+	lpFilePart = strrchr(lpFileName, '\\');
     else
-	*lpFilePart = lpFileName;
+	lpFilePart = lpFileName;
 #endif
     strcpy(lpBuffer, lpFileName);
 //    strncpy(lpBuffer, lpFileName, rindex(lpFileName, '\\')-lpFileName);
@@ -4403,7 +4407,7 @@
 
 static void WINAPI expExitProcess( DWORD status )
 {
-    printf("EXIT - code %d\n",status);
+    printf("EXIT - code %ld\n",status);
     exit(status);
 }
 
@@ -4462,7 +4466,7 @@
 static int expDirectDrawCreate(void)
 {
     dbgprintf("DirectDrawCreate(...) => NULL\n");
-    return NULL;
+    return 0;
 }
 
 #if 1
@@ -4488,8 +4492,8 @@
     dbgprintf("CreatePalette(%x) => NULL\n", lpgpl);
 
     i = sizeof(LOGPALETTE)+((lpgpl->palNumEntries-1)*sizeof(PALETTEENTRY));
-    test = malloc(i);
-    memcpy(test, lpgpl, i);
+    test = (HPALETTE)malloc(i);
+    memcpy((void *)test, lpgpl, i);
 
     return test;
 }




More information about the MPlayer-cvslog mailing list