chore: Fix errors/warnings in GCC13 (#1155)

* chore: Fix errors/warnings in GCC13

* OpResult: Add non const overloads to */-> so we can std::move from the result

* Run clang-format on file
This commit is contained in:
Roy Jacobson 2023-04-30 10:32:30 +03:00 committed by GitHub
parent 0cd2efebf1
commit 46093e33ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 18 additions and 3 deletions

View file

@ -3,6 +3,7 @@
// //
#pragma once #pragma once
#include <cstdint>
#include <string_view> #include <string_view>
#include "core/core_types.h" #include "core/core_types.h"

View file

@ -4,6 +4,8 @@
#pragma once #pragma once
#include <string_view>
#include "core/dense_set.h" #include "core/dense_set.h"
extern "C" { extern "C" {

View file

@ -7,6 +7,8 @@
#include <cstdint> #include <cstdint>
#include <functional> #include <functional>
#include <optional> #include <optional>
#include <string>
#include <string_view>
#include "core/dense_set.h" #include "core/dense_set.h"

View file

@ -4,6 +4,7 @@
#pragma once #pragma once
#include <cstdint>
#include <string_view> #include <string_view>
#include <vector> #include <vector>
@ -48,7 +49,7 @@ class MemcacheParser {
union { union {
uint64_t cas_unique = 0; // for CAS COMMAND uint64_t cas_unique = 0; // for CAS COMMAND
uint64_t delta; // for DECR/INCR commands. uint64_t delta; // for DECR/INCR commands.
}; };
uint32_t expire_ts = 0; // relative time in seconds. uint32_t expire_ts = 0; // relative time in seconds.
@ -75,4 +76,4 @@ class MemcacheParser {
private: private:
}; };
} // namespace dfly } // namespace facade

View file

@ -4,6 +4,7 @@
#pragma once #pragma once
#include <cstdint>
#include <ostream> #include <ostream>
namespace facade { namespace facade {
@ -75,6 +76,14 @@ template <typename V> class OpResult : public OpResultBase {
return status() == OpStatus::OK ? v_ : v; return status() == OpStatus::OK ? v_ : v;
} }
V* operator->() {
return &v_;
}
V& operator*() {
return v_;
}
const V* operator->() const { const V* operator->() const {
return &v_; return &v_;
} }

View file

@ -1057,7 +1057,7 @@ optional<CapturingReplyBuilder::Payload> Service::FlushEvalAsyncCmds(ConnectionC
info->async_cmds_heap_mem = 0; info->async_cmds_heap_mem = 0;
info->async_cmds.clear(); info->async_cmds.clear();
auto reply = move(crb.Take()); auto reply = crb.Take();
return CapturingReplyBuilder::GetError(reply) ? make_optional(move(reply)) : nullopt; return CapturingReplyBuilder::GetError(reply) ? make_optional(move(reply)) : nullopt;
} }