From 8ae54656fc3607b5780a6e8152b440ae0e415a78 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sat, 7 Mar 2026 15:41:45 -1000 Subject: [PATCH] Move varint_slow to private It has a precondition (value >= 128) and should not be callable from outside the class. Co-Authored-By: Claude Opus 4.6 --- esphome/components/api/proto.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esphome/components/api/proto.h b/esphome/components/api/proto.h index 10581a7f0a9..b6d68885b8f 100644 --- a/esphome/components/api/proto.h +++ b/esphome/components/api/proto.h @@ -518,10 +518,10 @@ class ProtoSize { return varint_wide(value); return varint_slow(value); } - // Slow path for varint >= 128, outlined to keep fast path small - static uint32_t varint_slow(uint32_t value) __attribute__((noinline)); private: + // Slow path for varint >= 128, outlined to keep fast path small + static uint32_t varint_slow(uint32_t value) __attribute__((noinline)); // Shared cascade for values >= 128 (used by both constexpr and noinline paths) static constexpr inline uint32_t ESPHOME_ALWAYS_INLINE varint_wide(uint32_t value) { if (value < 16384)