]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
common/pick_address.cc: silence GCC warning 32025/head
authorKefu Chai <kchai@redhat.com>
Thu, 5 Dec 2019 07:34:12 +0000 (15:34 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 11 Dec 2019 02:04:16 +0000 (10:04 +0800)
commitb9225dfbc36ae56c7b967e5bf78b20f5c3e44965
treec892adca92cefc16727ed49558b713ba5eeeebee
parent9a5e26d586f0d5ddc3d8fba63f30f0d8020d4aba
common/pick_address.cc: silence GCC warning

* use `string_view` instead of string
* use `auto` instead of `int` to silence the warning
* use `enum class` instead of plain `enum`
* do not specify the value of enum, as
  we don't care about it

this change silences following warning

```
../src/common/pick_address.cc: In function ‘int get_iface_numa_node(const string&, int*)’:
../src/common/pick_address.cc:517:11: warning: comparison of integer expressions of different signedness: ‘int’ and ‘const size_type’ {aka ‘const long unsigned int’} [-Wsign-com\
pare]
  517 |   if (pos != string::npos ) {
      |       ~~~~^~~~~~~~~~~~~~~
```

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/CMakeLists.txt
src/common/pick_address.cc