Am Mon, 2002-06-10 um 04.26 schrieb Vincent BĂ©ron:
Could you have a look at the last line of fileio_get_async_count? It seems gcc -W says the test always has the same outcome. It has been reported as bug #778.
Yeah, DWORD is an unsigned type. The patch below should fix it. Actually, if we trust our own implementation of read and write, we might as well drop that case distinction altogether and simply return fileio->count - fileio->lpOverlapped->InternalHigh.
Martin
--- files/file.c.orig Mon Jun 10 12:52:00 2002 +++ files/file.c Mon Jun 10 12:59:11 2002 @@ -131,8 +131,8 @@ static DWORD fileio_get_async_count (const struct async_private *ovp) { async_fileio *fileio = (async_fileio*) ovp; - DWORD ret = fileio->count - fileio->lpOverlapped->InternalHigh; - return (ret < 0 ? 0 : ret); + return ( fileio->count <= fileio->lpOverlapped->InternalHigh ? + 0 : fileio->count - fileio->lpOverlapped->InternalHigh ); }
static void CALLBACK fileio_call_completion_func (ULONG_PTR data)