From c7908f46c2fdc003d22bc7f36b967e6252c03a79 Mon Sep 17 00:00:00 2001 From: Matt Fowles Kulukundis Date: Wed, 6 Jul 2022 23:49:03 +0300 Subject: [PATCH] Slightly prettier way to express int min --- src/google/protobuf/compiler/objectivec/objectivec_enum.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/google/protobuf/compiler/objectivec/objectivec_enum.cc b/src/google/protobuf/compiler/objectivec/objectivec_enum.cc index 1f9420372f..b9e216ce9b 100644 --- a/src/google/protobuf/compiler/objectivec/objectivec_enum.cc +++ b/src/google/protobuf/compiler/objectivec/objectivec_enum.cc @@ -47,7 +47,7 @@ std::string SafelyPrintIntToCode(int v) { if (v == std::numeric_limits::min()) { // Some compilers try to parse -2147483648 as two tokens and then get spicy // about the fact that +2147483648 cannot be represented as an int. - return "-2147483647 - 1"; + return StrCat(v + 1, " - 1"); } else { return StrCat(v); }