Fixed "conditional expr is always true due to being unsigned < 0"
problem.
This commit is contained in:
parent
a58134aede
commit
065d537939
|
@ -124,7 +124,7 @@ typedef struct async_fileio
|
||||||
LPOVERLAPPED lpOverlapped;
|
LPOVERLAPPED lpOverlapped;
|
||||||
LPOVERLAPPED_COMPLETION_ROUTINE completion_func;
|
LPOVERLAPPED_COMPLETION_ROUTINE completion_func;
|
||||||
char *buffer;
|
char *buffer;
|
||||||
int count;
|
unsigned int count;
|
||||||
enum fd_type fd_type;
|
enum fd_type fd_type;
|
||||||
} async_fileio;
|
} async_fileio;
|
||||||
|
|
||||||
|
@ -141,8 +141,10 @@ static void fileio_set_async_status (async_private *ovp, const DWORD status)
|
||||||
static DWORD fileio_get_async_count (const struct async_private *ovp)
|
static DWORD fileio_get_async_count (const struct async_private *ovp)
|
||||||
{
|
{
|
||||||
async_fileio *fileio = (async_fileio*) ovp;
|
async_fileio *fileio = (async_fileio*) ovp;
|
||||||
DWORD ret = fileio->count - fileio->lpOverlapped->InternalHigh;
|
|
||||||
return (ret < 0 ? 0 : ret);
|
if (fileio->count < fileio->lpOverlapped->InternalHigh)
|
||||||
|
return 0;
|
||||||
|
return fileio->count - fileio->lpOverlapped->InternalHigh;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void CALLBACK fileio_call_completion_func (ULONG_PTR data)
|
static void CALLBACK fileio_call_completion_func (ULONG_PTR data)
|
||||||
|
|
Loading…
Reference in New Issue