Slightly prettier way to express int min

pull/10220/head
Matt Fowles Kulukundis 3 years ago committed by GitHub
parent c9a2e3e0c9
commit c7908f46c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/google/protobuf/compiler/objectivec/objectivec_enum.cc

@ -47,7 +47,7 @@ std::string SafelyPrintIntToCode(int v) {
if (v == std::numeric_limits<int>::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);
}

Loading…
Cancel
Save