You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@trafficserver.apache.org by James Peach <jp...@apache.org> on 2014/05/22 05:13:16 UTC

Re: git commit: TS-2830 Make gcc 4.1.2 happy.

On May 21, 2014, at 6:58 PM, amc@apache.org wrote:

> Repository: trafficserver
> Updated Branches:
> refs/heads/master ad6d30052 -> ada6b33e8
> 
> 
> TS-2830 Make gcc 4.1.2 happy.
> 
> 
> Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
> Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/ada6b33e
> Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/ada6b33e
> Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/ada6b33e
> 
> Branch: refs/heads/master
> Commit: ada6b33e8b55a16acbb8d9580530e4c11fc24862
> Parents: ad6d300
> Author: Alan M. Carroll <am...@network-geographics.com>
> Authored: Wed May 21 18:58:24 2014 -0700
> Committer: Alan M. Carroll <am...@network-geographics.com>
> Committed: Wed May 21 18:58:24 2014 -0700
> 
> ----------------------------------------------------------------------
> lib/records/I_RecHttp.h | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
> ----------------------------------------------------------------------
> 
> 
> http://git-wip-us.apache.org/repos/asf/trafficserver/blob/ada6b33e/lib/records/I_RecHttp.h
> ----------------------------------------------------------------------
> diff --git a/lib/records/I_RecHttp.h b/lib/records/I_RecHttp.h
> index 83ffcbe..c121dfe 100644
> --- a/lib/records/I_RecHttp.h
> +++ b/lib/records/I_RecHttp.h
> @@ -45,7 +45,10 @@ class SessionProtocolSet {
>  /// Storage for the set - a bit vector.
>  uint32_t m_bits;
> public:
> -  static int const MAX = sizeof(m_bits) * CHAR_BIT;
> +  // The right way.
> +  //  static int const MAX = sizeof(m_bits) * CHAR_BIT;
> +  // The RHEL5/gcc 4.1.2 way
> +  static int const MAX = sizeof(uint32_t) * 8;

CHAR_BIT was already used as a compile-time constant and worked perfectly well. What wend wrong here?

Also, MAX is a terrible name, prone to collision with macros. We #define it ourselves in ink_defs.h. Can you please give MAX a descriptive name?

>  /// Default constructor.
>  /// Constructs and empty set.
>  SessionProtocolSet() : m_bits(0) { }
>