[MPlayer-cvslog] r33411 - trunk/vidix/mga_vid.c

reimar subversion at mplayerhq.hu
Sat May 7 21:49:26 CEST 2011


Author: reimar
Date: Sat May  7 21:49:26 2011
New Revision: 33411

Log:
Simplify macros and get rid of incorrect casts from pointers to
uint32_t. Fixes also a huge amount of compiler warnings.

Modified:
   trunk/vidix/mga_vid.c

Modified: trunk/vidix/mga_vid.c
==============================================================================
--- trunk/vidix/mga_vid.c	Sat May  7 21:44:05 2011	(r33410)
+++ trunk/vidix/mga_vid.c	Sat May  7 21:49:26 2011	(r33411)
@@ -67,14 +67,13 @@
 #define ENOTSUP EOPNOTSUPP
 #endif
 
-/* from radeon_vid */
-#define GETREG(TYPE,PTR,OFFZ)		(*((volatile TYPE*)((PTR)+(OFFZ))))
-#define SETREG(TYPE,PTR,OFFZ,VAL)	(*((volatile TYPE*)((PTR)+(OFFZ))))=VAL
+#define GETREG(TYPE,PTR)		(*(volatile TYPE*)(PTR))
+#define SETREG(TYPE,PTR,VAL)		(*(volatile TYPE*)(PTR))=VAL
 
-#define readb(addr)		GETREG(uint8_t,(uint32_t)(addr),0)
-#define writeb(val,addr)	SETREG(uint8_t,(uint32_t)(addr),0,val)
-#define readl(addr)		GETREG(uint32_t,(uint32_t)(addr),0)
-#define writel(val,addr)	SETREG(uint32_t,(uint32_t)(addr),0,val)
+#define readb(addr)		GETREG(uint8_t,addr)
+#define writeb(val,addr)	SETREG(uint8_t,addr,val)
+#define readl(addr)		GETREG(uint32_t,addr)
+#define writel(val,addr)	SETREG(uint32_t,addr,val)
 
 static int mga_verbose = 0;
 


More information about the MPlayer-cvslog mailing list