From 8eadf021021f8d869673c7ae5494aa71ab1a6c50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20K=C3=A4fer?= Date: Thu, 8 Oct 2026 11:25:30 +0200 Subject: [PATCH] Fix -Wsign-conversion warning in commit_submessage --- CHANGELOG.md | 2 ++ include/protozero/basic_pbf_writer.hpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c3e8a95..5ec5e13e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,8 @@ This project adheres to [Semantic Versioning](https://semver.org/). ### Fixed +- Fix `-Wsign-conversion` warning in `basic_pbf_writer::commit_submessage()`. + ## [1.8.2] - 2026-06-30 ### Fixed diff --git a/include/protozero/basic_pbf_writer.hpp b/include/protozero/basic_pbf_writer.hpp index cc0f7cd5..9e0af4ea 100644 --- a/include/protozero/basic_pbf_writer.hpp +++ b/include/protozero/basic_pbf_writer.hpp @@ -204,7 +204,7 @@ class basic_pbf_writer { protozero_assert(buffer_customization::size(m_data) >= m_pos - reserve_bytes); const auto n = add_varint_to_buffer(buffer_customization::at_pos(m_data, m_pos - reserve_bytes), length); - buffer_customization::erase_range(m_data, m_pos - reserve_bytes + n, m_pos); + buffer_customization::erase_range(m_data, m_pos - reserve_bytes + static_cast(n), m_pos); m_pos = 0; }