]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
client: fix compile warning and incorrect computing the max_fwd 45983/head
authorXiubo Li <xiubli@redhat.com>
Thu, 21 Apr 2022 10:15:20 +0000 (18:15 +0800)
committerXiubo Li <xiubli@redhat.com>
Fri, 22 Apr 2022 10:32:31 +0000 (18:32 +0800)
commit6a28c337d9c669f49855367da4dc91131b836b94
treed4022de5246d01c32243a5ed1244618dc1bac4a8
parente43ba4c388272cea734c328c5508de4c025d4f4c
client: fix compile warning and incorrect computing the max_fwd

warning: suggest parentheses around ‘-’ inside ‘<<’ [-Wparentheses]
   max_fwd = 1 << (max_fwd * CHAR_BIT) - 1;
                  ~~~~~~~~~~~~~~~~~~~~~^~~

And also the '-' has precedence over the '<<', more detail please
see https://en.cppreference.com/w/c/language/operator_precedence.

Fixes: https://tracker.ceph.com/issues/55409
Reported-by: Jos Collin <jcollin@redhat.com>
Reported-by: Rishabh Dave <ridave@redhat.com>
Signed-off-by: Xiubo Li <xiubli@redhat.com>
src/client/Client.cc