]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
encoding: reset optional<> if it is uninitialized 17599/head
authorKefu Chai <kchai@redhat.com>
Fri, 8 Sep 2017 11:28:09 +0000 (19:28 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 8 Sep 2017 11:42:42 +0000 (19:42 +0800)
commit0363236dc754180a0215a818d58587943f84fb53
tree07c36e0b18a880fd0af17fc6551ba8edf8547d91
parentc9994788ca4aaee5c6cb3090fc4a000ef1513a0b
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>
src/include/encoding.h