[PATCH] Add support for fall-through handling if the compiler supports it

jim jim.brown at rsmas.miami.edu
Tue Feb 20 16:00:06 UTC 2018


On 2/20/2018 10:45 AM, Andreas Schneider via samba-technical wrote:
> -static WERROR simpleclass_IClassFactory_CreateInstance (struct IClassFactory *d, TALLOC_CTX *mem_ctx, struct IUnknown *iunk, struct GUID *iid, struct IUnknown **ppv)
> +static WERROR simpleclass_IClassFactory_CreateInstance(struct IClassFactory *d,
> +						       TALLOC_CTX *mem_ctx,
> +						       struct MInterfacePointer *pUnknown,
> +						       struct GUID *iid,
> +						       struct MInterfacePointer *ppv)
>   {
>   	struct IStream *ret;
>   	/* FIXME: Check whether IID == ISTREAM_IID */
> @@ -71,8 +84,8 @@ static WERROR simpleclass_IClassFactory_CreateInstance (struct IClassFactory *d,
>   	ret->vtable = &simple_IStream_vtable;
>   	ret->object_data = NULL;
>   
> -	*ppv = (struct IUnknown *)ret;
> -	
> +	ppv = (struct MInterfacePointer *)ret;
> +
>   	return WERR_OK;
>   }
Andreas,

This change does not have the same effect.
Before the struct IStream pointer was returned into the calling argument 
ppv pointer.
Now this pointer is assigned with no effect to (local) argument ppv.
The argument should be 'struct MInterfacePointer **ppv' and '*ppv = 
(struct MInterfacePointer *)ret'.

Jim




More information about the samba-technical mailing list