From 79e038985a431e03381ca376ce4fddaa962846d6 Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 12 Oct 2008 22:12:24 +0000 Subject: Remove unused variables. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27751 b3059339-0415-0410-9bf9-f77b7e298cf2 --- vidix/sysdep/libdha_win32.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'vidix') diff --git a/vidix/sysdep/libdha_win32.c b/vidix/sysdep/libdha_win32.c index ba3bacb5aa..d4ea84fb45 100644 --- a/vidix/sysdep/libdha_win32.c +++ b/vidix/sysdep/libdha_win32.c @@ -51,10 +51,8 @@ void *map_phys_mem(unsigned long base, unsigned long size) { if(!IsWinNT()){ HANDLE hDevice ; PVOID inBuf[1] ; /* buffer for struct pointer to VxD */ - DWORD RetInfo[2] ; /* buffer to receive data from VxD */ DWORD cbBytesReturned ; /* count of bytes returned from VxD */ MAPDEVREQUEST req ; /* map device request structure */ - DWORD *pNicstar, Status, Time ; int i ; char *endptr ; const PCHAR VxDName = "\\\\.\\MAPDEV.VXD" ; const PCHAR VxDNameAlreadyLoaded = "\\\\.\\MAPDEV" ; -- cgit v1.2.3 From e00c1a9e6de39a6b4d5ab683c519bb32602324b4 Mon Sep 17 00:00:00 2001 From: diego Date: Mon, 13 Oct 2008 14:47:11 +0000 Subject: Remove redundantly declared definitions FILE_ANY_ACCESS and CTL_CODE, fixes: vidix/sysdep/libdha_win32.c:34:1: warning: "FILE_ANY_ACCESS" redefined vidix/sysdep/libdha_win32.c:35:1: warning: "CTL_CODE" redefined git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27755 b3059339-0415-0410-9bf9-f77b7e298cf2 --- vidix/sysdep/libdha_win32.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'vidix') diff --git a/vidix/sysdep/libdha_win32.c b/vidix/sysdep/libdha_win32.c index d4ea84fb45..4f6075194f 100644 --- a/vidix/sysdep/libdha_win32.c +++ b/vidix/sysdep/libdha_win32.c @@ -31,9 +31,6 @@ typedef struct MapDevRequest /*#include "winioctl.h"*/ #define FILE_DEVICE_UNKNOWN 0x00000022 #define METHOD_NEITHER 3 -#define FILE_ANY_ACCESS 0 -#define CTL_CODE( DeviceType, Function, Method, Access ) ( \ - ((DeviceType)<<16) | ((Access)<<14) | ((Function)<<2) | (Method) ) int IsWinNT(){ -- cgit v1.2.3 From 4d644f513c841eaf4617edffb348338a798d37be Mon Sep 17 00:00:00 2001 From: diego Date: Mon, 13 Oct 2008 16:23:55 +0000 Subject: Replace preprocessor check for WIN32 with checks for __MINGW32__ and __CYGWIN__. This avoids a pointless indirection that only obscures what is really done. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27761 b3059339-0415-0410-9bf9-f77b7e298cf2 --- vidix/dha.c | 2 +- vidix/nvidia_vid.c | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'vidix') diff --git a/vidix/dha.c b/vidix/dha.c index 28dc8c8c09..638be29328 100644 --- a/vidix/dha.c +++ b/vidix/dha.c @@ -48,7 +48,7 @@ #endif #include -#if defined(WIN32) +#if defined(__MINGW32__) || defined(__CYGWIN__) #include "sysdep/libdha_win32.c" #elif defined (__EMX__) #include "sysdep/libdha_os2.c" diff --git a/vidix/nvidia_vid.c b/vidix/nvidia_vid.c index c53fa93d64..a045b397fe 100644 --- a/vidix/nvidia_vid.c +++ b/vidix/nvidia_vid.c @@ -614,13 +614,14 @@ static void rivatv_overlay_colorkey (rivatv_info* info, unsigned int chromakey){ switch (info->depth) { case 15: key = ((r >> 3) << 10) | ((g >> 3) << 5) | ((b >> 3)); -#ifndef WIN32 + +#if !defined(__MINGW32__) && !defined(__CYGWIN__) key = key | 0x00008000; #endif break; case 16: // XXX unchecked key = ((r >> 3) << 11) | ((g >> 2) << 5) | ((b >> 3)); -#ifndef WIN32 +#if !defined(__MINGW32__) && !defined(__CYGWIN__) key = key | 0x00008000; #endif break; @@ -629,7 +630,7 @@ static void rivatv_overlay_colorkey (rivatv_info* info, unsigned int chromakey){ break; case 32: key = chromakey; -#ifndef WIN32 +#if !defined(__MINGW32__) && !defined(__CYGWIN__) key = key | 0x80000000; #endif break; -- cgit v1.2.3 From 6b52a2e974ba3c3065d13a16cc2fa69f96745d0d Mon Sep 17 00:00:00 2001 From: diego Date: Thu, 16 Oct 2008 18:59:27 +0000 Subject: Change all occurrences of asm and __asm to __asm__, same as was done for FFmpeg. Neither variant is valid C99 syntax, but __asm__ is the most portable variant. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27788 b3059339-0415-0410-9bf9-f77b7e298cf2 --- vidix/AsmMacros.h | 9 ++------- vidix/sysdep/pci_os2.c | 2 +- 2 files changed, 3 insertions(+), 8 deletions(-) (limited to 'vidix') diff --git a/vidix/AsmMacros.h b/vidix/AsmMacros.h index f40929ade5..c202fd4cec 100644 --- a/vidix/AsmMacros.h +++ b/vidix/AsmMacros.h @@ -99,11 +99,6 @@ void outl(U16_t, U32_t); #else /* not _MINIX and _ACK */ -# if defined(__STDC__) && (__STDC__ == 1) -# ifndef NCR -# define asm __asm -# endif -# endif # ifdef SVR4 # include # ifndef __USLC__ @@ -115,8 +110,8 @@ void outl(U16_t, U32_t); #else # include "../common/scoasm.h" #endif -#define intr_disable() asm("cli") -#define intr_enable() asm("sti") +#define intr_disable() __asm__("cli") +#define intr_enable() __asm__("sti") #endif /* _MINIX and _ACK */ #endif /* __GNUC__ */ diff --git a/vidix/sysdep/pci_os2.c b/vidix/sysdep/pci_os2.c index 002494f682..5e19463820 100644 --- a/vidix/sysdep/pci_os2.c +++ b/vidix/sysdep/pci_os2.c @@ -62,7 +62,7 @@ static __inline__ int enable_os_io(void) /* Calling callgate with function 13 sets IOPL for the program */ - asm volatile ("movl $13,%%ebx;.byte 0xff,0x1d;.long _callgate" + __asm__ volatile ("movl $13,%%ebx;.byte 0xff,0x1d;.long _callgate" : /*no outputs */ : /*no inputs */ : "eax","ebx","ecx","edx","cc"); -- cgit v1.2.3 From 26b29f4f2d4284fb81647a00b81530f280881303 Mon Sep 17 00:00:00 2001 From: diego Date: Thu, 16 Oct 2008 20:17:56 +0000 Subject: Replace all occurrences of '__volatile__' and '__volatile' by plain 'volatile'. We were using an inconsistent mix of the three variants and 'volatile' should be the most correct and portable variant. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27791 b3059339-0415-0410-9bf9-f77b7e298cf2 --- vidix/nvidia_vid.c | 2 +- vidix/s3_regs.h | 2 +- vidix/sysdep/AsmMacros_powerpc.h | 2 +- vidix/sysdep/AsmMacros_sparc.h | 12 ++++++------ vidix/sysdep/AsmMacros_x86.h | 16 ++++++++-------- 5 files changed, 17 insertions(+), 17 deletions(-) (limited to 'vidix') diff --git a/vidix/nvidia_vid.c b/vidix/nvidia_vid.c index a045b397fe..767a358f37 100644 --- a/vidix/nvidia_vid.c +++ b/vidix/nvidia_vid.c @@ -372,7 +372,7 @@ static int nv_probe(int verbose, int force){ * PCI-Memory IO access macros. */ -#define MEM_BARRIER() __asm__ __volatile__ ("" : : : "memory") +#define MEM_BARRIER() __asm__ volatile ("" : : : "memory") #undef VID_WR08 #define VID_WR08(p,i,val) ({ MEM_BARRIER(); ((uint8_t *)(p))[(i)]=(val); }) diff --git a/vidix/s3_regs.h b/vidix/s3_regs.h index 0add1bea54..4fd0e427cf 100644 --- a/vidix/s3_regs.h +++ b/vidix/s3_regs.h @@ -196,7 +196,7 @@ do { \ #ifndef USE_RMW_CYCLES /* Can be used to inhibit READ-MODIFY-WRITE cycles. On by default. */ -#define MEM_BARRIER() __asm__ __volatile__ ("" : : : "memory") +#define MEM_BARRIER() __asm__ volatile ("" : : : "memory") #undef VID_WR08 #define VID_WR08(p,i,val) ({ MEM_BARRIER(); ((uint8_t *)(p))[(i)]=(val); }) diff --git a/vidix/sysdep/AsmMacros_powerpc.h b/vidix/sysdep/AsmMacros_powerpc.h index 7120446afe..0ae2fd57d2 100644 --- a/vidix/sysdep/AsmMacros_powerpc.h +++ b/vidix/sysdep/AsmMacros_powerpc.h @@ -68,7 +68,7 @@ extern unsigned char *ioBase; static __inline__ volatile void eieio() { - __asm__ __volatile__ ("eieio"); + __asm__ volatile ("eieio"); } static __inline__ void outb(short port, unsigned char value) diff --git a/vidix/sysdep/AsmMacros_sparc.h b/vidix/sysdep/AsmMacros_sparc.h index 2358adea6f..8ffdde26e1 100644 --- a/vidix/sysdep/AsmMacros_sparc.h +++ b/vidix/sysdep/AsmMacros_sparc.h @@ -68,37 +68,37 @@ static __inline__ void outb(unsigned long port, char val) { - __asm__ __volatile__("stba %0, [%1] %2" : : "r" (val), "r" (port), "i" (ASI_PL)); + __asm__ volatile("stba %0, [%1] %2" : : "r" (val), "r" (port), "i" (ASI_PL)); } static __inline__ void outw(unsigned long port, char val) { - __asm__ __volatile__("stha %0, [%1] %2" : : "r" (val), "r" (port), "i" (ASI_PL)); + __asm__ volatile("stha %0, [%1] %2" : : "r" (val), "r" (port), "i" (ASI_PL)); } static __inline__ void outl(unsigned long port, char val) { - __asm__ __volatile__("sta %0, [%1] %2" : : "r" (val), "r" (port), "i" (ASI_PL)); + __asm__ volatile("sta %0, [%1] %2" : : "r" (val), "r" (port), "i" (ASI_PL)); } static __inline__ unsigned int inb(unsigned long port) { unsigned char ret; - __asm__ __volatile__("lduba [%1] %2, %0" : "=r" (ret) : "r" (port), "i" (ASI_PL)); + __asm__ volatile("lduba [%1] %2, %0" : "=r" (ret) : "r" (port), "i" (ASI_PL)); return ret; } static __inline__ unsigned int inw(unsigned long port) { unsigned char ret; - __asm__ __volatile__("lduha [%1] %2, %0" : "=r" (ret) : "r" (port), "i" (ASI_PL)); + __asm__ volatile("lduha [%1] %2, %0" : "=r" (ret) : "r" (port), "i" (ASI_PL)); return ret; } static __inline__ unsigned int inl(unsigned long port) { unsigned char ret; - __asm__ __volatile__("lda [%1] %2, %0" : "=r" (ret) : "r" (port), "i" (ASI_PL)); + __asm__ volatile("lda [%1] %2, %0" : "=r" (ret) : "r" (port), "i" (ASI_PL)); return ret; } diff --git a/vidix/sysdep/AsmMacros_x86.h b/vidix/sysdep/AsmMacros_x86.h index c0b1afc105..6bebeaa505 100644 --- a/vidix/sysdep/AsmMacros_x86.h +++ b/vidix/sysdep/AsmMacros_x86.h @@ -171,7 +171,7 @@ static __inline__ void outb(short port,char val) } else #endif - __asm__ __volatile__("outb %0,%1" : :"a" (val), "d" (port)); + __asm__ volatile("outb %0,%1" : :"a" (val), "d" (port)); return; } @@ -199,7 +199,7 @@ static __inline__ void outw(short port,short val) } else #endif - __asm__ __volatile__("outw %0,%1" : :"a" (val), "d" (port)); + __asm__ volatile("outw %0,%1" : :"a" (val), "d" (port)); return; } @@ -227,7 +227,7 @@ static __inline__ void outl(short port,unsigned int val) } else #endif - __asm__ __volatile__("outl %0,%1" : :"a" (val), "d" (port)); + __asm__ volatile("outl %0,%1" : :"a" (val), "d" (port)); return; } @@ -255,7 +255,7 @@ static __inline__ unsigned int inb(short port) } else #endif - __asm__ __volatile__("inb %1,%0" : + __asm__ volatile("inb %1,%0" : "=a" (ret) : "d" (port)); return ret; @@ -285,7 +285,7 @@ static __inline__ unsigned int inw(short port) } else #endif - __asm__ __volatile__("inw %1,%0" : + __asm__ volatile("inw %1,%0" : "=a" (ret) : "d" (port)); return ret; @@ -315,7 +315,7 @@ static __inline__ unsigned int inl(short port) } else #endif - __asm__ __volatile__("inl %1,%0" : + __asm__ volatile("inl %1,%0" : "=a" (ret) : "d" (port)); return ret; @@ -327,7 +327,7 @@ static __inline__ void intr_disable() if (svgahelper_initialized == 1) return; #endif - __asm__ __volatile__("cli"); + __asm__ volatile("cli"); } static __inline__ void intr_enable() @@ -336,7 +336,7 @@ static __inline__ void intr_enable() if (svgahelper_initialized == 1) return; #endif - __asm__ __volatile__("sti"); + __asm__ volatile("sti"); } #endif /* MPLAYER_ASMMACROS_X86_H */ -- cgit v1.2.3 From a6b806a97a9738836a46af5370b405cf57c2a239 Mon Sep 17 00:00:00 2001 From: ranma Date: Sat, 18 Oct 2008 16:07:18 +0000 Subject: MAX_PCI_DEVICES 64 is not enough on my system (even though lspci only shows 25 devices), upped to 256 git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27797 b3059339-0415-0410-9bf9-f77b7e298cf2 --- vidix/dha.h | 2 +- vidix/pci.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'vidix') diff --git a/vidix/dha.h b/vidix/dha.h index eb2a269c46..501215172d 100644 --- a/vidix/dha.h +++ b/vidix/dha.h @@ -42,7 +42,7 @@ #define MAX_DEV_PER_VENDOR_CFG1 64 #define MAX_PCI_DEVICES_PER_BUS 32 -#define MAX_PCI_DEVICES 64 +#define MAX_PCI_DEVICES 256 #define PCI_MULTIFUNC_DEV 0x80 #define PCI_COMMAND_IO 0x1 /* Enable response to I/O space */ diff --git a/vidix/pci.c b/vidix/pci.c index 1006b14a80..6576996362 100644 --- a/vidix/pci.c +++ b/vidix/pci.c @@ -441,7 +441,7 @@ struct pci_config_reg { #define MAX_DEV_PER_VENDOR_CFG1 64 #define MAX_PCI_DEVICES_PER_BUS 32 -#define MAX_PCI_DEVICES 64 +#define MAX_PCI_DEVICES 256 #define NF ((void (*)())NULL), { 0.0, 0, 0, NULL } #define PCI_MULTIFUNC_DEV 0x80 #define PCI_ID_REG 0x00 -- cgit v1.2.3 From 1ec2a1c33f9a846084c9d4286fba7543277e9711 Mon Sep 17 00:00:00 2001 From: ranma Date: Sat, 18 Oct 2008 16:07:47 +0000 Subject: pci.c includes dha.h, remove redundant MAX_* defines git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27798 b3059339-0415-0410-9bf9-f77b7e298cf2 --- vidix/pci.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'vidix') diff --git a/vidix/pci.c b/vidix/pci.c index 6576996362..64d2a6c8b3 100644 --- a/vidix/pci.c +++ b/vidix/pci.c @@ -439,9 +439,6 @@ struct pci_config_reg { }; #endif /* !defined(__powerpc__) */ -#define MAX_DEV_PER_VENDOR_CFG1 64 -#define MAX_PCI_DEVICES_PER_BUS 32 -#define MAX_PCI_DEVICES 256 #define NF ((void (*)())NULL), { 0.0, 0, 0, NULL } #define PCI_MULTIFUNC_DEV 0x80 #define PCI_ID_REG 0x00 -- cgit v1.2.3