]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mon/Elector: make paxos_size() an int 46862/head
authorKamoltat <ksirivad@redhat.com>
Mon, 27 Jun 2022 19:00:09 +0000 (19:00 +0000)
committerKamoltat <ksirivad@redhat.com>
Tue, 28 Jun 2022 13:01:22 +0000 (13:01 +0000)
commitf75dfbc055ccf4e43b817ed5aa52898ff680e19e
tree6e86acff83ba6a6be4fd592a9fdee796520243e9
parent72ef0ff97d6f8ae33838d16cb182becd71ed278d
mon/Elector: make paxos_size() an int

We want to get rid of the warning:

‘int’ and ‘unsigned int’ [-Wsign-compare]
if (rank_removed < paxos_size()) {
~~~~~~~~~~~~^~~~~~~~~~~~~

Also, according to google style guide, we should
"try to avoid unsigned types and not use an
unsigned type merely to assert that a variable
is non-negative".

https://google.github.io/styleguide/cppguide.html#Integer_Types

Fixes: https://tracker.ceph.com/issues/56392
Signed-off-by: Kamoltat <ksirivad@redhat.com>
src/mon/ElectionLogic.h
src/mon/Elector.cc
src/mon/Elector.h
src/test/mon/test_election.cc