1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-19 17:25:17 +03:00
aports/testing/google-cloud-cpp/10-size_t.patch
Holger Jaekel 0a9db55dae testing/google-cloud-cpp: new aport
https://cloud.google.com/sdk
C++ Client Libraries for Google Cloud Services
2023-02-09 01:20:19 +00:00

27 lines
1.2 KiB
Diff

From 83b38a504c45f93ef076ee71e4738ee7cb29e580 Mon Sep 17 00:00:00 2001
From: Bradley White <14679271+devbww@users.noreply.github.com>
Date: Wed, 8 Feb 2023 04:12:14 -0500
Subject: [PATCH] cleanup: cater to platforms with 32-bit std::size_t
Explicitly cast the result of `std::stoull()` to `std::size_t`.
This is safe because the value being cast is a count of memory
pages in the 32-bit address space.
Addresses #10772. Part of #10775.
---
.../cloud/storage/tests/object_read_large_integration_test.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/google/cloud/storage/tests/object_read_large_integration_test.cc b/google/cloud/storage/tests/object_read_large_integration_test.cc
index 65a6ae39d7f..5e2982bf8e5 100644
--- a/google/cloud/storage/tests/object_read_large_integration_test.cc
+++ b/google/cloud/storage/tests/object_read_large_integration_test.cc
@@ -40,7 +40,7 @@ std::size_t CurrentRss() {
std::vector<std::string> fields = absl::StrSplit(
std::string{std::istreambuf_iterator<char>{is.rdbuf()}, {}}, ' ');
// The fields are documented in proc(5).
- return std::stoull(fields[1]) * 4096;
+ return static_cast<std::size_t>(std::stoull(fields[1])) * 4096;
}
std::string DebugRss() {