Opened 17 years ago

Closed 17 years ago

Last modified 17 years ago

#2148 closed defect (fixed)

Rename MS_REFCNT_IS_NOT_ZERO() and MS_REFCNT_IS_ZERO() macros

Reported by: dmorissette Owned by: dmorissette
Priority: normal Milestone: 5.0 release
Component: MapServer C Library Version:
Severity: normal Keywords:
Cc: umberto

Description

As part of the work on RFC-24 the following two macros have been defined:

#define MS_REFCNT_IS_NOT_ZERO(obj) (MS_REFCNT_DECR(obj))>0
#define MS_REFCNT_IS_ZERO(obj) (MS_REFCNT_DECR(obj))<=0 

Code using those macros is confusing because it is not clear that they decrement the refcount in addition to testing whether it's zero. I proposed that we rename them to make it clear that the macros do not just test the refcount but also decrement it first. Umberto agreed with the change and we settled on the following names:

#define MS_REFCNT_DECR_IS_NOT_ZERO(obj) (MS_REFCNT_DECR(obj))>0
#define MS_REFCNT_DECR_IS_ZERO(obj) (MS_REFCNT_DECR(obj))<=0

This ticket is to track this change.

Change History (2)

comment:1 by dmorissette, 17 years ago

Resolution: fixed
Status: newclosed

Fixed. Macros renamed in r6285

comment:2 by dmorissette, 17 years ago

Milestone: 5.0 release
Note: See TracTickets for help on using tickets.