From 1b67b9b68a88c3c365caa24f4edd415726948734 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 3 Jan 2008 12:11:24 +0000 Subject: run with "-pedantic" and "-std=c99": removed warnings svn path=/trunk/externals/zexy/; revision=9113 --- src/winNT_portio.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'src/winNT_portio.c') diff --git a/src/winNT_portio.c b/src/winNT_portio.c index 83fe89e..470df14 100644 --- a/src/winNT_portio.c +++ b/src/winNT_portio.c @@ -19,14 +19,13 @@ static BOOL bPrivException = FALSE; int read_parport(int port) { - // byte = _inp((unsigned short)port); unsigned char value; #ifdef _MSC_VER __asm mov edx,port __asm in al,dx __asm mov value,al #else - // hmm, i should read some documentation about inline assembler + /* hmm, i should read some documentation about inline assembler */ post("lpt: cannot read from parport (recompile!)"); return 0; #endif @@ -35,15 +34,17 @@ int read_parport(int port) void write_parport(int port, int invalue) { - // _outp((unsigned short)port, value); + /* _outp((unsigned short)port, value); */ BYTE value = (BYTE)invalue; #ifdef _MSC_VER __asm mov edx,port __asm mov al,value __asm out dx,al #else - // hmm, i should read some documentation about inline assembler - // and probably about assembler in general... + /* + * hmm, i should read some documentation about inline assembler + * and probably about assembler in general... + */ post("lpt: cannot write to parport (recompile!)"); /* asm( @@ -62,7 +63,7 @@ static LONG WINAPI HandlerExceptionFilter ( EXCEPTION_POINTERS *pExPtrs ) if (pExPtrs->ExceptionRecord->ExceptionCode == EXCEPTION_PRIV_INSTRUCTION) { - pExPtrs->ContextRecord->Eip ++; // Skip the OUT or IN instruction that caused the exception + pExPtrs->ContextRecord->Eip ++; /* Skip the OUT or IN instruction that caused the exception */ bPrivException = TRUE; return EXCEPTION_CONTINUE_EXECUTION; } @@ -75,13 +76,13 @@ static BOOL StartUpIoPorts(UINT PortToAccess, BOOL bShowMessageBox, HWND hParent HANDLE hUserPort; hUserPort = CreateFile("\\\\.\\UserPort", GENERIC_READ, 0, NULL,OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); - CloseHandle(hUserPort); // Activate the driver - Sleep(100); // We must make a process switch + CloseHandle(hUserPort); /* Activate the driver */ + Sleep(100); /* We must make a process switch */ SetUnhandledExceptionFilter(HandlerExceptionFilter); bPrivException = FALSE; - read_parport(PortToAccess); // Try to access the given port address + read_parport(PortToAccess); /* Try to access the given port address */ if (bPrivException) { @@ -124,4 +125,6 @@ int open_port(int port) return(0); } } +#else +static int i=0; #endif /* __WIN32__ & Z_WANT_LPT */ -- cgit v1.2.1