discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GNUstep.h (was: Re: Setter Gettor method style)


From: Tyson Whitehead
Subject: Re: GNUstep.h (was: Re: Setter Gettor method style)
Date: Wed, 07 Aug 2002 12:41:36 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020615 Debian/1.0.0-3

Sir Raorn wrote:

On Tue, Aug 06, 2002 at 10:20:49PM +0200, Lars Sonchocky-Helldorf wrote:
#define TEST_AUTORELEASE(object) ({ if (object) [object autorelease]; })
I'd suggest this variant:

#define TEST_AUTORELEASE(object) do{ if (object) [object autorelease]; }while(0)

And the same for other multioperator defines...

Sorry, I'm not very knowledgable about Objective C, so these may be stupid questions.

How do you expect the "do{...}while(0)" loop to ever end without an internal break or goto statement?

Shouldn't it be something like "while(object) [object autorelease]"?

Furthermore, how does the status of object change from repeatedly calling autorelease? I thought it just added it to the autorelease pool and then it would be appropriately adjusted when the parent (i.e. function call stack wise) returned.

-T

--
Tyson Whitehead  (-twhitehe@uwo.ca -- WSC-)
Computer Engineer                          Dept. of Applied Mathematics,
Graduate Student- Applied Mathematics      University of Western Ontario,
GnuPG Key ID# 0x8A2AB5D8                   London, Ontario, Canada






reply via email to

[Prev in Thread] Current Thread [Next in Thread]