Skip to content

Commit

Permalink
fix build with gcc-13 (#372)
Browse files Browse the repository at this point in the history
  • Loading branch information
avsej authored Feb 19, 2023
1 parent 37b593f commit 673974c
Show file tree
Hide file tree
Showing 17 changed files with 32 additions and 17 deletions.
3 changes: 2 additions & 1 deletion core/error_context/analytics.hxx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
* Copyright 2020-2021 Couchbase, Inc.
* Copyright 2020-Present Couchbase, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -19,6 +19,7 @@

#include <couchbase/retry_reason.hxx>

#include <cstdint>
#include <optional>
#include <set>
#include <string>
Expand Down
3 changes: 2 additions & 1 deletion core/error_context/http.hxx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
* Copyright 2020-2021 Couchbase, Inc.
* Copyright 2020-Present Couchbase, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -19,6 +19,7 @@

#include <couchbase/retry_reason.hxx>

#include <cstdint>
#include <optional>
#include <set>
#include <string>
Expand Down
3 changes: 2 additions & 1 deletion core/error_context/query.hxx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
* Copyright 2020-2021 Couchbase, Inc.
* Copyright 2020-Present Couchbase, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -19,6 +19,7 @@

#include <couchbase/retry_reason.hxx>

#include <cstdint>
#include <optional>
#include <set>
#include <string>
Expand Down
3 changes: 2 additions & 1 deletion core/error_context/search.hxx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
* Copyright 2020-2021 Couchbase, Inc.
* Copyright 2020-Present Couchbase, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -19,6 +19,7 @@

#include <couchbase/retry_reason.hxx>

#include <cstdint>
#include <optional>
#include <set>
#include <string>
Expand Down
3 changes: 2 additions & 1 deletion core/error_context/view.hxx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
* Copyright 2020-2021 Couchbase, Inc.
* Copyright 2020-Present Couchbase, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -19,6 +19,7 @@

#include <couchbase/retry_reason.hxx>

#include <cstdint>
#include <optional>
#include <set>
#include <string>
Expand Down
1 change: 1 addition & 0 deletions core/impl/subdoc/lookup_in_macro.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <couchbase/error_codes.hxx>
#include <couchbase/subdoc/lookup_in_macro.hxx>

#include <cstdint>
#include <string>

namespace couchbase::subdoc
Expand Down
1 change: 1 addition & 0 deletions core/impl/subdoc/mutate_in_macro.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <couchbase/error_codes.hxx>
#include <couchbase/subdoc/mutate_in_macro.hxx>

#include <cstdint>
#include <string>

namespace couchbase::subdoc
Expand Down
3 changes: 2 additions & 1 deletion core/operations/management/analytics_problem.hxx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
* Copyright 2020-2021 Couchbase, Inc.
* Copyright 2020-Present Couchbase, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -17,6 +17,7 @@

#pragma once

#include <cstdint>
#include <string>

namespace couchbase::core::operations::management
Expand Down
3 changes: 2 additions & 1 deletion core/operations/management/eventing_problem.hxx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
* Copyright 2020-2021 Couchbase, Inc.
* Copyright 2020-Present Couchbase, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -17,6 +17,7 @@

#pragma once

#include <cstdint>
#include <string>

namespace couchbase::core::operations::management
Expand Down
3 changes: 2 additions & 1 deletion core/platform/base64.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
* Copyright 2016 Couchbase, Inc.
* Copyright 2016-Present Couchbase, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -26,6 +26,7 @@
#include <algorithm>
#include <array>
#include <cctype>
#include <cstdint>
#include <stdexcept>
#include <string>
#include <vector>
Expand Down
1 change: 1 addition & 0 deletions core/protocol/client_opcode.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

#pragma once

#include <cstdint>
#include <string>
#include <vector>

Expand Down
3 changes: 2 additions & 1 deletion core/protocol/cmd_info.hxx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
* Copyright 2020-2021 Couchbase, Inc.
* Copyright 2020-Present Couchbase, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -17,6 +17,7 @@

#pragma once

#include <cstdint>
#include <string_view>

namespace couchbase::core::protocol
Expand Down
2 changes: 1 addition & 1 deletion core/transactions/atr_ids.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ std::size_t
atr_ids::vbucket_for_key(const std::string& key)
{
static const int num_vbuckets = 1024;
uint32_t digest = core::utils::hash_crc32(key.data(), key.size());
std::uint32_t digest = core::utils::hash_crc32(key.data(), key.size());
return static_cast<std::size_t>(digest % num_vbuckets);
}

Expand Down
5 changes: 3 additions & 2 deletions core/utils/crc32.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* src/usr.bin/cksum/crc32.c.
*/

#include <cstdint>

namespace couchbase::core::utils
{
static const std::uint32_t crc32tab[256] = {
Expand Down Expand Up @@ -37,10 +39,9 @@ static const std::uint32_t crc32tab[256] = {
static inline std::uint32_t
hash_crc32(const char* key, size_t key_length)
{
std::uint64_t x;
std::uint32_t crc = UINT32_MAX;

for (x = 0; x < key_length; x++) {
for (std::uint64_t x = 0; x < key_length; x++) {
crc = (crc >> 8) ^ crc32tab[(crc ^ static_cast<std::uint64_t>(key[x])) & 0xff];
}

Expand Down
3 changes: 2 additions & 1 deletion core/utils/json_streaming_lexer.hxx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
* Copyright 2020-2021 Couchbase, Inc.
* Copyright 2020-Present Couchbase, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -21,6 +21,7 @@

#include <couchbase/error_codes.hxx>

#include <cstdint>
#include <functional>
#include <memory>
#include <string>
Expand Down
3 changes: 2 additions & 1 deletion core/utils/url_codec.cxx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
* Copyright 2020-2021 Couchbase, Inc.
* Copyright 2020-Present Couchbase, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -21,6 +21,7 @@

#include <cctype>
#include <climits>
#include <cstdint>

namespace couchbase::core::utils::string_codec
{
Expand Down
6 changes: 3 additions & 3 deletions test/utils/integration_shortcuts.hxx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
* Copyright 2020-2021 Couchbase, Inc.
* Copyright 2020-Present Couchbase, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -29,7 +29,7 @@ execute(std::shared_ptr<couchbase::core::cluster> cluster, Request request)
auto barrier = std::make_shared<std::promise<response_type>>();
auto f = barrier->get_future();
cluster->execute(request, [barrier](response_type resp) { barrier->set_value(std::move(resp)); });
return std::move(f.get());
return f.get();
}

void
Expand All @@ -43,4 +43,4 @@ open_bucket(std::shared_ptr<couchbase::core::cluster> cluster, const std::string

void
close_bucket(std::shared_ptr<couchbase::core::cluster> cluster, const std::string& bucket_name);
} // namespace test::utils
} // namespace test::utils

0 comments on commit 673974c

Please sign in to comment.