[Zope3-checkins] CVS: Zope3/src/zope/proxy/context - wrapper.c:1.12 wrapper.h:1.4

Marius Gedminas mgedmin@codeworks.lt
Thu, 8 May 2003 09:56:58 +0300


On Wed, May 07, 2003 at 11:53:44AM -0400, Steve Alexander wrote:
> Log Message:
> Made ContextDescriptorType and ContextAwareType available from other C
> code.
[...]
>  #define WrapperType                       \
>          (_wrapper_api->wrappertype)
> +#define ContextDescriptorType             \
> +        (_wrapper_api->contextdescriptortype)
> +#define ContextAwareType                  \
> +        (_wrapper_api->contextawaretype)

Actually there's a way to make &ContextAwareType etc. do the right thing:
define them as

  #define WrapperType                       \
          (*_wrapper_api->wrappertype)
  #define ContextDescriptorType             \
          (*_wrapper_api->contextdescriptortype)
  #define ContextAwareType                  \
          (*_wrapper_api->contextawaretype)

and then & and * will cancel each other out.  A quick grep on Python
2.2.2 sources shows that py_curses.h does exactly this.

Marius Gedminas
-- 
Favorite MAC error message: "Not enough memory to eject disk!"