Skip to content

Commit

Permalink
Merge 'treewide: misc fixes for libc++ 19' from Tyler Rockwood
Browse files Browse the repository at this point in the history
- **sstring: fixes for lib++ 19**
- **log: fixes for libc++ 19**
- **net: switch rss_key_type to std::span instead of std::string_view**

Closes #2649

* github.com:scylladb/seastar:
  net: switch rss_key_type to std::span instead of std::string_view
  log: fixes for libc++ 19
  sstring: fixes for lib++ 19
  • Loading branch information
avikivity committed Feb 18, 2025
2 parents 8ab0267 + b0972f3 commit 652dc71
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions include/seastar/core/sstring.hh
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ public:
}
}
int compare(std::basic_string_view<char_type, traits_type> x) const noexcept {
auto n = traits_type::compare(begin(), x.begin(), std::min(size(), x.size()));
auto n = traits_type::compare(begin(), x.data(), std::min(size(), x.size()));
if (n != 0) {
return n;
}
Expand All @@ -584,7 +584,7 @@ public:
}

sz = std::min(size() - pos, sz);
auto n = traits_type::compare(begin() + pos, x.begin(), std::min(sz, x.size()));
auto n = traits_type::compare(begin() + pos, x.data(), std::min(sz, x.size()));
if (n != 0) {
return n;
}
Expand Down
4 changes: 2 additions & 2 deletions include/seastar/net/toeplitz.hh
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@

#ifndef SEASTAR_MODULE
#include <cstdint>
#include <string_view>
#include <span>
#include <vector>
#endif

namespace seastar {

using rss_key_type = std::basic_string_view<uint8_t>;
using rss_key_type = std::span<const uint8_t>;

// Mellanox Linux's driver key
static constexpr uint8_t default_rsskey_40bytes_v[] = {
Expand Down
2 changes: 1 addition & 1 deletion src/util/log.cc
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ void log_buf::realloc_buffer_and_append(char c) noexcept {
_alloc_failure = true;
std::string_view msg = "(log buffer allocation failure)";
auto can_copy = std::min(msg.size(), size_t(_current - _begin));
std::memcpy(_current - can_copy, msg.begin(), can_copy);
std::memcpy(_current - can_copy, msg.data(), can_copy);
}
}

Expand Down

0 comments on commit 652dc71

Please sign in to comment.