From: Stefan Weil <weil@mail.berlios.de>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] Fix some compiler warnings for windows
Date: Sun, 01 Mar 2009 18:38:25 +0100 [thread overview]
Message-ID: <49AAC811.8070600@mail.berlios.de> (raw)
In-Reply-To: <Pine.LNX.4.64.0903011459110.2764@linmac.oyster.ru>
malc schrieb:
> On Sun, 1 Mar 2009, Stefan Weil wrote:
>
>
>> Stefan Weil schrieb:
>>
>>> Hello,
>>>
>>> this patch fixes some warnings for compilation with mingw32.
>>>
>>> Regards
>>> Stefan Weil
>>>
>> Here is an update of my patch for the current Qemu trunk.
>> It reduces the number of warnings for win32 from 256 to 67.
>>
>> At least one warning indicates an error in Qemu for Windows:
>> vl.c:5386: warning: fds[1] is used uninitialized in this function
>> This was fixed, too.
>>
>> Could one of the maintainers please apply this patch to Qemu trunk?
>>
>
> Index: trunk/block-raw-win32.c
> ===================================================================
> --- trunk.orig/block-raw-win32.c 2009-03-01 11:04:03.000000000
> +0100
> +++ trunk/block-raw-win32.c 2009-03-01 11:04:10.000000000 +0100
> @@ -279,7 +279,7 @@
> static int raw_truncate(BlockDriverState *bs, int64_t offset)
> {
> BDRVRawState *s = bs->opaque;
> - DWORD low, high;
> + LONG low, high;
>
> low = offset;
> high = offset >> 32;
> @@ -301,7 +301,8 @@
>
> switch(s->type) {
> case FTYPE_FILE:
> - l.LowPart = GetFileSize(s->hfile, &l.HighPart);
> + l.LowPart = GetFileSize(s->hfile, &count);
> + l.HighPart = count;
> if (l.LowPart == 0xffffffffUL && GetLastError() != NO_ERROR)
> return -EIO;
> break;
>
> [..snip..]
>
> http://msdn.microsoft.com/en-us/library/aa364955(VS.85).aspx
> DWORD WINAPI GetFileSize(
> __in HANDLE hFile,
> __out_opt LPDWORD lpFileSizeHigh
> );
>
> IOW LONG doesn't seem to be correct.
>
>
LONG low, high belongs to a call to SetFilePointer which takes LONG, PLONG
arguments: http://msdn.microsoft.com/en-us/library/aa365541(VS.85).aspx
GetFileSize is in another function.
Everything (not really, but more than now) will be correct, when my patch
is finally applied :-)
Regards
Stefan
prev parent reply other threads:[~2009-03-01 17:38 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-13 21:26 [Qemu-devel] [PATCH] Fix some compiler warnings for windows Stefan Weil
2009-02-25 21:30 ` Robert Riebisch
2009-03-01 10:38 ` Stefan Weil
2009-03-01 12:00 ` malc
2009-03-01 17:38 ` Stefan Weil [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=49AAC811.8070600@mail.berlios.de \
--to=weil@mail.berlios.de \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).