Code review comment for lp:~smspillaz/compiz-libcompizconfig/context-funcs-behind-interface

Revision history for this message
Sam Spilsbury (smspillaz) wrote :

> GET_INTERFACE seems overcomplicated and error prone. It requires the first
> two parameters to match up - when in every use the second is a second macro
> with no other use that calls a third with the first parameter. Confused?
>
> Current usage: GET_INTERFACE (CCSContextInterface, CCS_CONTEXT_INTERFACE_TYPE,
> context))
> Suggest usage: GET_INTERFACE (CCSContextInterface, context))
>
>
> Current #define GET_INTERFACE(CType,IType, o) (CType *) ccsObjectGetInterface
> ((CCSObject *) o, IType)
> Suggest #define GET_INTERFACE(CType, o)
> (CType*)ccsObjectGetInterface((CCSObject*) o, GET_INTERFACE_TYPE(CType))
>
> And get rid of CCS_CONTEXT_INTERFACE_TYPE which is then unused.

I'm a bit confused - how would GET_INTERFACE_TYPE(CCSContext) be able to replace CCS_CONTEXT_INTERFACE_TYPE ? There's no templates available so we can't do it that way ....

« Back to merge proposal