]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
encoding: reset optional<> if it is uninitialized 17624/head
authorKefu Chai <kchai@redhat.com>
Fri, 8 Sep 2017 11:28:09 +0000 (19:28 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 11 Sep 2017 03:07:57 +0000 (11:07 +0800)
commitfe2fe20100f7f5349d7101bc718f040f5e45bde1
tree7a905424c32afb52fb05a9fe436d692fd94167fe
parent5e5002d99360cc2a3c956aeee43ab4fb25a6eef9
encoding: reset optional<> if it is uninitialized

* should reset it, in case we reuse it after initializing it.
* initialize the value of `p` using the C++11 style initializer, so it
  is zero-initialized.
* revert 2a83ef3c which disables a warning of:
 ./include/encoding.h:317:7: warning: 't' may be used uninitialized in
    this function [-Wmaybe-uninitialized]
 where the `t` is the temporary variable for initializing the value of
 `p`.

Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit 0363236dc754180a0215a818d58587943f84fb53)
src/include/encoding.h