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

Revision history for this message
Alan Griffiths (alan-griffiths) 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.

review: Needs Fixing

« Back to merge proposal