Re: /bzr/squid3/trunk/ r13458: Revert rename of Comm::Flag ERROR

From: Alex Rousskov <rousskov_at_measurement-factory.com>
Date: Mon, 09 Jun 2014 10:58:23 -0600

On 06/09/2014 07:18 AM, Amos Jeffries wrote:
> ------------------------------------------------------------
> revno: 13458
> Revert rename of Comm::Flag ERROR

> On MinGW at least ERROR is a #define'd macro resulting in build failure.
> Revert to the old name COMM_ERROR until we can find a better one that
> does not duplicate 'comm'.

The correct solution, IMO, is to avoid all-caps names in C++ enums and
use common prefixes for all names inside an enum. For example:

 typedef enum {
     fgOk = 0,
     fgError = -1,
     fgNoMessage = -3,
     fgTimeout = -4,
...
 } Flag;

or, more verbose:

 typedef enum {
     flagOk = 0,
     flagError = -1,
     flagNoMessage = -3,
     flagTimeout = -4,
...
 } Flag;

HTH,

Alex.
Received on Mon Jun 09 2014 - 16:58:34 MDT

This archive was generated by hypermail 2.2.0 : Tue Jun 10 2014 - 12:00:11 MDT