Re: [CODE] Questions about macros

From: George Greer (
Date: 03/28/01

On Wed, 28 Mar 2001, Carlos Myers wrote:

>1. Why wasn't George Greer's IN_ROOM patch included in the latest patch

My what? I seem to have forgotten what that is.

>2. Any reason why IS_OBJ_STAT(obj, stat) is used instead of
>OBJ_FLAGGED(obj, flag)?

Massive macro creeping suckage?

perl -i -pe 's/IS_OBJ_STAT/OBJ_FLAGGED/g;' *.c

Ok, that's better.

>3. GET_OBJ_NUM(obj) in shop.h and GET_OBJ_RNUM(obj) in util.h are defined as
>the same, however, GET_OBJ_NUM(obj) is not used anywhere.  Is it there for
>compatibility with older patches to the shops or should it something that
>needs to be removed?

I think I already removed that one...[checks]  Yep, it's already gone, just
not committed.

>4. GET_EXP(ch), GET_AC(ch), GET_HIT(ch), GET_MAX_HIT(ch), GET_MOVE(ch),
>GET_MAX_MOVE(ch) and etc. macros are not used as extensively as they could
>have been in such functions as perform_set(), store_to_char() and
>init_char().  Any particular reasons why we are not use macros in these

Apparently because we suck. :)

I'll go fix those.

>5. CAN_WEAR(obj, part) and OBJWEAR_FLAGGED(obj, flag) are also defined as
>the same.  Any particular reason why one should be used over the other?

I'd use OBJWEAR_FLAGGED because CAN_WEAR sounds like it should take a 'ch'

>Overall, I think there is need for a general clean up of the macros in
>util.h.  It may even be time to declare some the macros, such as
>GET_OBJ_NUM(obj) and OBJWEAR_FLAGGED(obj, flag), as decrepit.

I generally just yank them in a few patchlevels.  If someone patches up (by
hand, right?), then they should notice.  I'll keep stuff around that is
Circle 2.x compatibility cruft but anything else will go.

George Greer

   | FAQ: |
   | Archives: |

This archive was generated by hypermail 2b30 : 12/04/01 PST