aboutsummaryrefslogtreecommitdiff
path: root/src/winNT_portio.c
diff options
context:
space:
mode:
authorIOhannes m zmölnig <zmoelnig@users.sourceforge.net>2008-01-03 12:11:24 +0000
committerIOhannes m zmölnig <zmoelnig@users.sourceforge.net>2008-01-03 12:11:24 +0000
commit1b67b9b68a88c3c365caa24f4edd415726948734 (patch)
treebf630dac330cfd0045af27744e61511813552fe0 /src/winNT_portio.c
parentcecea45d580c99f052409a53e7c3007754e9f3f5 (diff)
run with "-pedantic" and "-std=c99": removed warnings
svn path=/trunk/externals/zexy/; revision=9113
Diffstat (limited to 'src/winNT_portio.c')
-rw-r--r--src/winNT_portio.c21
1 files changed, 12 insertions, 9 deletions
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 */