=== modified file 'src/CachePeer.h' --- src/CachePeer.h 2012-09-23 09:04:21 +0000 +++ src/CachePeer.h 2013-01-23 18:17:36 +0000 @@ -93,45 +93,45 @@ acl_access *access; struct { - unsigned int proxy_only:1; - unsigned int no_query:1; - unsigned int background_ping:1; - unsigned int no_digest:1; - unsigned int default_parent:1; - unsigned int roundrobin:1; - unsigned int weighted_roundrobin:1; - unsigned int mcast_responder:1; - unsigned int closest_only:1; + bool proxy_only; + bool no_query; + bool background_ping; + bool no_digest; + bool default_parent; + bool roundrobin; + bool weighted_roundrobin; + bool mcast_responder; + bool closest_only; #if USE_HTCP - unsigned int htcp:1; - unsigned int htcp_oldsquid:1; - unsigned int htcp_no_clr:1; - unsigned int htcp_no_purge_clr:1; - unsigned int htcp_only_clr:1; - unsigned int htcp_forward_clr:1; + bool htcp; + bool htcp_oldsquid; + bool htcp_no_clr; + bool htcp_no_purge_clr; + bool htcp_only_clr; + bool htcp_forward_clr; #endif - unsigned int no_netdb_exchange:1; + bool no_netdb_exchange; #if USE_DELAY_POOLS - unsigned int no_delay:1; + bool no_delay; #endif - unsigned int allow_miss:1; - unsigned int carp:1; + bool allow_miss; + bool carp; struct { - unsigned int set:1; //If false, whole url is to be used. Overrides others - unsigned int scheme:1; - unsigned int host:1; - unsigned int port:1; - unsigned int path:1; - unsigned int params:1; + bool set; //If false, whole url is to be used. Overrides others + bool scheme; + bool host; + bool port; + bool path; + bool params; } carp_key; #if USE_AUTH - unsigned int userhash:1; + bool userhash; #endif - unsigned int sourcehash:1; - unsigned int originserver:1; - unsigned int no_tproxy:1; + bool sourcehash; + bool originserver; + bool no_tproxy; #if PEER_MULTICAST_SIBLINGS - unsigned int mcast_siblings:1; + bool mcast_siblings; #endif } options; @@ -146,8 +146,8 @@ int id; struct { - unsigned int count_event_pending:1; - unsigned int counting:1; + bool count_event_pending; + bool counting; } flags; } mcast; #if USE_CACHE_DIGESTS === modified file 'src/cache_cf.cc' --- src/cache_cf.cc 2012-12-27 18:15:38 +0000 +++ src/cache_cf.cc 2013-01-23 18:16:28 +0000 @@ -2092,8 +2092,8 @@ p->type = parseNeighborType(token); if (p->type == PEER_MULTICAST) { - p->options.no_digest = 1; - p->options.no_netdb_exchange = 1; + p->options.no_digest = true; + p->options.no_netdb_exchange = true; } p->http_port = GetTcpService(); @@ -2106,27 +2106,27 @@ while ((token = strtok(NULL, w_space))) { if (!strcasecmp(token, "proxy-only")) { - p->options.proxy_only = 1; + p->options.proxy_only = true; } else if (!strcasecmp(token, "no-query")) { - p->options.no_query = 1; + p->options.no_query = true; } else if (!strcasecmp(token, "background-ping")) { - p->options.background_ping = 1; + p->options.background_ping = true; } else if (!strcasecmp(token, "no-digest")) { - p->options.no_digest = 1; + p->options.no_digest = true; } else if (!strcasecmp(token, "no-tproxy")) { - p->options.no_tproxy = 1; + p->options.no_tproxy = true; } else if (!strcasecmp(token, "multicast-responder")) { - p->options.mcast_responder = 1; + p->options.mcast_responder = true; #if PEER_MULTICAST_SIBLINGS } else if (!strcasecmp(token, "multicast-siblings")) { - p->options.mcast_siblings = 1; + p->options.mcast_siblings = true; #endif } else if (!strncasecmp(token, "weight=", 7)) { p->weight = xatoi(token + 7); } else if (!strncasecmp(token, "basetime=", 9)) { p->basetime = xatoi(token + 9); } else if (!strcasecmp(token, "closest-only")) { - p->options.closest_only = 1; + p->options.closest_only = true; } else if (!strncasecmp(token, "ttl=", 4)) { p->mcast.ttl = xatoi(token + 4); @@ -2136,17 +2136,17 @@ if (p->mcast.ttl > 128) p->mcast.ttl = 128; } else if (!strcasecmp(token, "default")) { - p->options.default_parent = 1; + p->options.default_parent = true; } else if (!strcasecmp(token, "round-robin")) { - p->options.roundrobin = 1; + p->options.roundrobin = true; } else if (!strcasecmp(token, "weighted-round-robin")) { - p->options.weighted_roundrobin = 1; + p->options.weighted_roundrobin = true; #if USE_HTCP } else if (!strcasecmp(token, "htcp")) { - p->options.htcp = 1; + p->options.htcp = true; } else if (!strncasecmp(token, "htcp=", 5) || !strncasecmp(token, "htcp-", 5)) { /* Note: The htcp- form is deprecated, replaced by htcp= */ - p->options.htcp = 1; + p->options.htcp = true; char *tmp = xstrdup(token+5); char *mode, *nextmode; for (mode = nextmode = tmp; mode; mode = nextmode) { @@ -2158,17 +2158,17 @@ if (!strcasecmp(mode, "no-clr")) { if (p->options.htcp_only_clr) fatalf("parse_peer: can't set htcp-no-clr and htcp-only-clr simultaneously"); - p->options.htcp_no_clr = 1; + p->options.htcp_no_clr = true; } else if (!strcasecmp(mode, "no-purge-clr")) { - p->options.htcp_no_purge_clr = 1; + p->options.htcp_no_purge_clr = true; } else if (!strcasecmp(mode, "only-clr")) { if (p->options.htcp_no_clr) fatalf("parse_peer: can't set htcp no-clr and only-clr simultaneously"); - p->options.htcp_only_clr = 1; + p->options.htcp_only_clr = true; } else if (!strcasecmp(mode, "forward-clr")) { - p->options.htcp_forward_clr = 1; + p->options.htcp_forward_clr = true; } else if (!strcasecmp(mode, "oldsquid")) { - p->options.htcp_oldsquid = 1; + p->options.htcp_oldsquid = true; } else { fatalf("invalid HTCP mode '%s'", mode); } @@ -2176,31 +2176,31 @@ safe_free(tmp); #endif } else if (!strcasecmp(token, "no-netdb-exchange")) { - p->options.no_netdb_exchange = 1; + p->options.no_netdb_exchange = true; } else if (!strcasecmp(token, "carp")) { if (p->type != PEER_PARENT) fatalf("parse_peer: non-parent carp peer %s/%d\n", p->host, p->http_port); - p->options.carp = 1; + p->options.carp = true; } else if (!strncasecmp(token, "carp-key=", 9)) { - if (p->options.carp != 1) + if (p->options.carp != true) fatalf("parse_peer: carp-key specified on non-carp peer %s/%d\n", p->host, p->http_port); - p->options.carp_key.set=1; + p->options.carp_key.set = true; char *nextkey=token+strlen("carp-key="), *key=nextkey; for (; key; key = nextkey) { nextkey=strchr(key,','); if (nextkey) ++nextkey; // skip the comma, any if (0==strncasecmp(key,"scheme",6)) { - p->options.carp_key.scheme=1; + p->options.carp_key.scheme = true; } else if (0==strncasecmp(key,"host",4)) { - p->options.carp_key.host=1; + p->options.carp_key.host = true; } else if (0==strncasecmp(key,"port",4)) { - p->options.carp_key.port=1; + p->options.carp_key.port = true; } else if (0==strncasecmp(key,"path",4)) { - p->options.carp_key.path=1; + p->options.carp_key.path = true; } else if (0==strncasecmp(key,"params",6)) { - p->options.carp_key.params=1; + p->options.carp_key.params = true; } else { fatalf("invalid carp-key '%s'",key); } @@ -2210,7 +2210,7 @@ if (p->type != PEER_PARENT) fatalf("parse_peer: non-parent userhash peer %s/%d\n", p->host, p->http_port); - p->options.userhash = 1; + p->options.userhash = true; #else fatalf("parse_peer: userhash requires authentication. peer %s/%d\n", p->host, p->http_port); #endif @@ -2218,11 +2218,11 @@ if (p->type != PEER_PARENT) fatalf("parse_peer: non-parent sourcehash peer %s/%d\n", p->host, p->http_port); - p->options.sourcehash = 1; + p->options.sourcehash = true; } else if (!strcasecmp(token, "no-delay")) { #if USE_DELAY_POOLS - p->options.no_delay = 1; + p->options.no_delay = true; #else debugs(0, DBG_CRITICAL, "WARNING: cache_peer option 'no-delay' requires --enable-delay-pools"); #endif @@ -2239,11 +2239,11 @@ #endif } else if (!strcasecmp(token, "allow-miss")) { - p->options.allow_miss = 1; + p->options.allow_miss = true; } else if (!strncasecmp(token, "max-conn=", 9)) { p->max_conn = xatoi(token + 9); } else if (!strcasecmp(token, "originserver")) { - p->options.originserver = 1; + p->options.originserver = true; } else if (!strncasecmp(token, "name=", 5)) { safe_free(p->name); === modified file 'src/neighbors.cc' --- src/neighbors.cc 2012-12-30 12:53:01 +0000 +++ src/neighbors.cc 2013-01-23 18:17:36 +0000 @@ -1360,7 +1360,7 @@ p, (double) when, 1); - p->mcast.flags.count_event_pending = 1; + p->mcast.flags.count_event_pending = true; } static void @@ -1374,7 +1374,7 @@ int reqnum; LOCAL_ARRAY(char, url, MAX_URL); assert(p->type == PEER_MULTICAST); - p->mcast.flags.count_event_pending = 0; + p->mcast.flags.count_event_pending = false; snprintf(url, MAX_URL, "http://"); p->in_addr.ToURL(url+7, MAX_URL -8 ); strcat(url, "/"); @@ -1401,7 +1401,7 @@ peerCountMcastPeersDone, psstate, Config.Timeout.mcast_icp_query / 1000.0, 1); - p->mcast.flags.counting = 1; + p->mcast.flags.counting = true; peerCountMcastPeersSchedule(p, MCAST_COUNT_RATE); } @@ -1413,7 +1413,7 @@ if (cbdataReferenceValid(psstate->callback_data)) { CachePeer *p = (CachePeer *)psstate->callback_data; - p->mcast.flags.counting = 0; + p->mcast.flags.counting = false; p->mcast.avg_n_members = Math::doubleAverage(p->mcast.avg_n_members, (double) psstate->ping.n_recv, ++p->mcast.n_times_counted, 10); debugs(15, DBG_IMPORTANT, "Group " << p->host << ": " << psstate->ping.n_recv << " replies, "<< std::setw(4)<< std::setprecision(2) <<