On Jul 16 20:44, Ozkan Sezer wrote:
> On 7/16/12, Corinna Vinschen <vinsc...@redhat.com> wrote:
> > [New and improved: This time with attachement!]
> >
> > On Jul 16 18:58, Corinna Vinschen wrote:
> >> Hi,
> >>
> >> as discussed on IRC, I propose the below patch.  It changes the
> >> calls of the Interlocked functions from the C++ Interlocked inline
> >> functions defined at the end of winbase.h to use the system types
> >> just as these functions are defined.  Ok to apply?
> >>
> >>
> >> Thanks,
> >> Corinna
> >
> >
> >     * winbase.h: Use system types in calls to Interlocked functions.
> >
> >
> > Index: winbase.h
> > ===================================================================
> > --- winbase.h       (revision 5223)
> > +++ winbase.h       (working copy)
> [...]
> Why are types used inconsistently, e.g.:
> 
> >      FORCEINLINE unsigned long InterlockedIncrement(unsigned long volatile 
> > *Addend) {
> > -        return (unsigned long)InterlockedIncrement((volatile long*)Addend);
> > +        return (unsigned long)InterlockedIncrement((volatile LONG*)Addend);
>                           ^^^^                                ^^^^
> >      }
> >
> >      FORCEINLINE unsigned __int64 InterlockedIncrement(unsigned __int64 
> > volatile *Addend) {
> > -        return (unsigned __int64)InterlockedIncrement64((volatile 
> > __int64*)Addend);
> > +        return (unsigned __int64)InterlockedIncrement64((volatile 
> > LONGLONG*)Addend);
>                  ^^^^^^^^^^^^^^^^                                  ^^^^^^^^
> >      }

It just looks inconsistent.  The C++ functions are defined using base
types so the return type of the called Win32 functions still have to
be correctly casted to the type of the calling function.

I'm not sure these C++ functions really make sense, but apparently they
exist upstream as well.


Corinna

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to