On Jan 3, 2010, at 5:26 PM, Scott Ribe wrote:
Easily fixed:
#define GDRelease(x) [(x) release], (x) = nil, (void)0
Not really a good fix; compiler error is preferable to tweaking your macro
to allow compilation of nonsense ;-)
Actually this causes a compiler error if you try if
On Jan 2, 2010, at 9:30 AM, Alexander Spohr wrote:
I put a , not a ; between the statements. So at least my last example would
work - had I just left the last ; out of it:
#define GDRelease(x) [(x) release], (x) = nil
expands to:
if(x)
[(x) release], (x) = nil;
else
foo(x);
But
2010/1/4 Greg Parker gpar...@apple.com:
On Jan 2, 2010, at 9:30 AM, Alexander Spohr wrote:
I put a , not a ; between the statements. So at least my last example would
work - had I just left the last ; out of it:
#define GDRelease(x) [(x) release], (x) = nil
expands to:
if(x)
[(x)
Easily fixed:
#define GDRelease(x) [(x) release], (x) = nil, (void)0
Not really a good fix; compiler error is preferable to tweaking your macro
to allow compilation of nonsense ;-)
--
Scott Ribe
scott_r...@killerbytes.com
http://www.killerbytes.com/
(303) 722-0567 voice
Am 02.01.2010 um 05:09 schrieb Stephen J. Butler:
If you really wanted a macro, it would look like this:
#define GDRelease(x) do { [(x) release]; (x) = nil; } while (0)
What is the do while good for?
Would this not work as well:
#define GDRelease(x) { [(x) release]; (x) = nil; }
Or even
On Jan 2, 2010, at 6:29 AM, Alexander Spohr wrote:
What is the do while good for?
It lets you reliably write constructs like:
if(condition)
MyMacro(foo);
--
David Duncan
Apple DTS Animation and Printing
___
Cocoa-dev mailing list
On Sat, Jan 2, 2010 at 6:29 AM, Alexander Spohr a...@freeport.de wrote:
Am 02.01.2010 um 05:09 schrieb Stephen J. Butler:
If you really wanted a macro, it would look like this:
#define GDRelease(x) do { [(x) release]; (x) = nil; } while (0)
What is the do while good for?
Would this not
Am 02.01.2010 um 17:28 schrieb Clark Cox:
On Sat, Jan 2, 2010 at 6:29 AM, Alexander Spohr a...@freeport.de wrote:
Would this not work as well:
#define GDRelease(x) { [(x) release]; (x) = nil; }
Or even this:
#define GDRelease(x) [(x) release], (x) = nil;
No, neither would work as
Hey All, quick question,
I wrote a simple macro to make memory cleanup a bit easier, but I ran
into something I'm not sure why is happening..
here's the macro:
NS_INLINE void GDRelease(id obj) {
[obj release];
obj=nil;
}
I use it like:
- (void) dealloc {
On Fri, Jan 1, 2010 at 10:01 PM, aaron smith
beingthexemplaryli...@gmail.com wrote:
Hey All, quick question,
I wrote a simple macro to make memory cleanup a bit easier, but I ran
into something I'm not sure why is happening..
here's the macro:
NS_INLINE void GDRelease(id obj) {
10 matches
Mail list logo