Re: [ Code ] My previous post...

From: Sammy (samedi@DHC.NET)
Date: 07/31/97


On Thu, 31 Jul 1997, George wrote:

> #define FREE(ptr)       do { free((ptr)); (ptr) = NULL; } while 0;

Freaky.

I checked this time, and you can do it without the do if you use brackets:

#define FREE(ptr)       ({free((ptr); (ptr) = NULL;})

If you replace all the free's with FREE's (something I'll probably do), it
may save a lot of code, depending on whether your compiler notices that it
doesn't really need a loop there.

Sam


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/08/00 PST