mmdevapi: Correctly convert UINT32 to INT64
Michael Stefaniuc
mstefani at redhat.com
Mon Jan 30 03:58:05 CST 2012
Hello Joerg,
On 01/30/2012 09:46 AM, Joerg-Cyril.Hoehle at t-systems.com wrote:
> thank you very much for finding a bug in my code.
>
> I'll have to meditate signed/unsigned conversions for the next months.
>
> Perhaps it's my lack of familiarity with the MS-Windows API that had
> me not find a signed equivalent of UINT32. Indeed there's none in
> windef.h. So I choose 'long'. But now I see basestd.h defines LONG32.
LONG32 is kinda redundant. LONG is 32bit on all Windows versions on
16bit, 32bit and 64bit Windows.
> INT64 is not appropriate. getbuf_last should be of the same size than
> the other frame holding types. I once wrote a patch to turn all
> #frame holding entities from UINT64 into 32. Please rewrite the patch
> to use the LONG32 type, then you'll need no surprising cast.
>
> If the loss of 1 bit worries you, the solution IMHO is not to go to
> INT64 rather than prevent a duration that large in Initialize. In
> shared mode, there's no 2s limit. My tests opened a 10s buffer. I've
> not tested anything larger.
> LONG32 leaves enough room for 10000 seconds at 200000fps.
bye
michael
More information about the wine-devel
mailing list