Ticket #2148 (closed defect: fixed)

Opened 6 years ago

Last modified 6 years ago

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

Changed 6 years ago by dmorissette

  • status changed from new to closed
  • resolution set to fixed

Fixed. Macros renamed in r6285

Changed 6 years ago by dmorissette

  • milestone set to 5.0 release
Note: See TracTickets for help on using tickets.