[12/18] windowscodecs: Do not assume that vtable is the first element of the object, avoid not necessary casts.
Michael Stefaniuc
mstefani at redhat.com
Tue Jul 24 03:36:42 CDT 2012
Hello Dmitry,
On 07/24/2012 08:12 AM, Dmitry Timoshkov wrote:
> ---
> dlls/windowscodecs/jpegformat.c | 23 +++++++++++++----------
> 1 file changed, 13 insertions(+), 10 deletions(-)
>
> diff --git a/dlls/windowscodecs/jpegformat.c b/dlls/windowscodecs/jpegformat.c
> index 53d7ec4..2c77d4f 100644
> --- a/dlls/windowscodecs/jpegformat.c
> +++ b/dlls/windowscodecs/jpegformat.c
> @@ -469,6 +470,8 @@ static const IWICBitmapDecoderVtbl JpegDecoder_Vtbl = {
> static HRESULT WINAPI JpegDecoder_Frame_QueryInterface(IWICBitmapFrameDecode *iface, REFIID iid,
> void **ppv)
> {
> + JpegDecoder *This = impl_from_IWICBitmapFrameDecode(iface);
> +
> TRACE("(%p,%s,%p)\n", iface, debugstr_guid(iid), ppv);
>
> if (!ppv) return E_INVALIDARG;
> @@ -477,7 +480,7 @@ static HRESULT WINAPI JpegDecoder_Frame_QueryInterface(IWICBitmapFrameDecode *if
> IsEqualIID(&IID_IWICBitmapSource, iid) ||
> IsEqualIID(&IID_IWICBitmapFrameDecode, iid))
> {
> - *ppv = iface;
> + *ppv = &This->IWICBitmapFrameDecode_iface;
> }
> else
> {
same here: not needed.
bye
michael
More information about the wine-devel
mailing list