Skip to content

Commit 58346a3

Browse files
authored
Merge pull request #1605 from joto/contrib-update
Contrib update
2 parents 50a5d8a + f873f27 commit 58346a3

File tree

7 files changed

+83
-63
lines changed

7 files changed

+83
-63
lines changed

contrib/catch2/README.contrib

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
Source: https://github.com/catchorg/Catch2
2-
Revision: v2.13.7
2+
Revision: v2.13.8

contrib/catch2/include/catch.hpp

Lines changed: 60 additions & 53 deletions
Large diffs are not rendered by default.

contrib/protozero/README.contrib

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
Source: https://github.com/mapbox/protozero
2-
Revision: v1.7.0
2+
Revision: v1.7.1

contrib/protozero/include/protozero/buffer_string.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ documentation.
1818
*/
1919

2020
#include "buffer_tmpl.hpp"
21+
#include "config.hpp"
2122

2223
#include <cstddef>
2324
#include <iterator>
@@ -56,7 +57,8 @@ struct buffer_customization<std::string> {
5657
protozero_assert(from <= buffer->size());
5758
protozero_assert(to <= buffer->size());
5859
protozero_assert(from <= to);
59-
buffer->erase(std::next(buffer->begin(), from), std::next(buffer->begin(), to));
60+
buffer->erase(std::next(buffer->begin(), static_cast<std::string::iterator::difference_type>(from)),
61+
std::next(buffer->begin(), static_cast<std::string::iterator::difference_type>(to)));
6062
}
6163

6264
static char* at_pos(std::string* buffer, std::size_t pos) {

contrib/protozero/include/protozero/buffer_vector.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ documentation.
1818
*/
1919

2020
#include "buffer_tmpl.hpp"
21+
#include "config.hpp"
2122

2223
#include <cstddef>
2324
#include <iterator>
@@ -56,7 +57,8 @@ struct buffer_customization<std::vector<char>> {
5657
protozero_assert(from <= buffer->size());
5758
protozero_assert(to <= buffer->size());
5859
protozero_assert(from <= to);
59-
buffer->erase(std::next(buffer->begin(), from), std::next(buffer->begin(), to));
60+
buffer->erase(std::next(buffer->begin(), static_cast<std::string::iterator::difference_type>(from)),
61+
std::next(buffer->begin(), static_cast<std::string::iterator::difference_type>(to)));
6062
}
6163

6264
static char* at_pos(std::vector<char>* buffer, std::size_t pos) {

contrib/protozero/include/protozero/byteswap.hpp

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ documentation.
1919
#include "config.hpp"
2020

2121
#include <cstdint>
22+
#include <cstring>
2223

2324
namespace protozero {
2425
namespace detail {
@@ -75,14 +76,22 @@ inline void byteswap_inplace(int64_t* ptr) noexcept {
7576

7677
/// byteswap the data pointed to by ptr in-place.
7778
inline void byteswap_inplace(float* ptr) noexcept {
78-
auto* bptr = reinterpret_cast<uint32_t*>(ptr);
79-
*bptr = detail::byteswap_impl(*bptr);
79+
static_assert(sizeof(float) == 4, "Expecting four byte float");
80+
81+
uint32_t tmp = 0;
82+
std::memcpy(&tmp, ptr, 4);
83+
tmp = detail::byteswap_impl(tmp); // uint32 overload
84+
std::memcpy(ptr, &tmp, 4);
8085
}
8186

8287
/// byteswap the data pointed to by ptr in-place.
8388
inline void byteswap_inplace(double* ptr) noexcept {
84-
auto* bptr = reinterpret_cast<uint64_t*>(ptr);
85-
*bptr = detail::byteswap_impl(*bptr);
89+
static_assert(sizeof(double) == 8, "Expecting eight byte double");
90+
91+
uint64_t tmp = 0;
92+
std::memcpy(&tmp, ptr, 8);
93+
tmp = detail::byteswap_impl(tmp); // uint64 overload
94+
std::memcpy(ptr, &tmp, 8);
8695
}
8796

8897
namespace detail {

contrib/protozero/include/protozero/version.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ documentation.
2323
#define PROTOZERO_VERSION_MINOR 7
2424

2525
/// The patch number
26-
#define PROTOZERO_VERSION_PATCH 0
26+
#define PROTOZERO_VERSION_PATCH 1
2727

2828
/// The complete version number
2929
#define PROTOZERO_VERSION_CODE (PROTOZERO_VERSION_MAJOR * 10000 + PROTOZERO_VERSION_MINOR * 100 + PROTOZERO_VERSION_PATCH)
3030

3131
/// Version number as string
32-
#define PROTOZERO_VERSION_STRING "1.7.0"
32+
#define PROTOZERO_VERSION_STRING "1.7.1"
3333

3434
#endif // PROTOZERO_VERSION_HPP

0 commit comments

Comments
 (0)