Return value of fileio_get_async_count
Martin Wilck
Martin.Wilck at Fujitsu-Siemens.com
Mon Jun 10 06:04:33 CDT 2002
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)
--
Martin Wilck Phone: +49 5251 8 15113
Fujitsu Siemens Computers Fax: +49 5251 8 20409
Heinz-Nixdorf-Ring 1 mailto:Martin.Wilck at Fujitsu-Siemens.com
D-33106 Paderborn http://www.fujitsu-siemens.com/primergy
More information about the wine-devel
mailing list