PATCH: hglobalstream static
Alexandre Julliard
julliard at winehq.org
Mon May 16 09:01:55 CDT 2005
"Dmitry Timoshkov" <dmitry at baikal.ru> writes:
> "Marcus Meissner" <marcus at jet.franken.de> wrote:
>
> > /***
> > + * This implements the IUnknown method AddRef for this
> > + * class
> > + */
> > +static ULONG WINAPI HGLOBALStreamImpl_AddRef(
> > + IStream* iface)
> > +{
> > + HGLOBALStreamImpl* const This=(HGLOBALStreamImpl*)iface;
> > + return InterlockedIncrement(&This->ref);
> > +}
>
> I understand that this is an existing code, but calling InterlockedIncrement
> for a 'const' pointer looks very suspicious. Same for HGLOBALStreamImpl_Release,
> HGLOBALStreamImpl_Read and other interfaces which actually change the pointed
> data.
The pointer itself is const, not the data being pointed to. The const
in that case simply means that This will not to be changed to point to
something else.
--
Alexandre Julliard
julliard at winehq.org
More information about the wine-devel
mailing list