Re: [CODE] Circle MACRO - CREATE Aug 31, 97 06:02:39 am

From: Andrew Helm (ashe@IGLOU.COM)
Date: 08/31/97


> It says to make the (a = b) to ((a = b) != 0) to surpass the warning,
> and since I dont want to surpass ALL of the warnings of this type,
> should I rewrite the macro like this?
>
> #define CREATE(result, type, number)  do {\
>         if (!(((result) = (type *) != 0) calloc((number), \
> sizeof(type)))) { perror("malloc failure"); abort(); } } \
>         while(0)
>
> Is this a good idea? Or will it ruin my mud? :)

Try this:

#define CREATE(result, type, number) do {\
        if (((result) = (type *) calloc((number), \
       sizeof(type))) != 0) { perror("calloc failure"); abort(); } } \
        while(0)


     +------------------------------------------------------------+
     | 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