Update some types to be more current.

pull/9020/head
Thomas Van Lenten 3 years ago
parent 1288d1ee2d
commit 57da2b45ae
  1. 2
      objectivec/DevTools/check_version_stamps.sh
  2. 2
      src/google/protobuf/compiler/objectivec/objectivec_file.cc
  3. 18
      src/google/protobuf/compiler/objectivec/objectivec_helpers.cc

@ -25,7 +25,7 @@ check_constant() {
# Collect version from generator sources.
local GeneratorVersion=$( \
cat "${GeneratorSrc}" \
| sed -n -e "s:const int32 ${ConstantName} = \([0-9]*\);:\1:p"
| sed -n -e "s:const int32_t ${ConstantName} = \([0-9]*\);:\1:p"
)
if [[ -z "${GeneratorVersion}" ]] ; then
die "Failed to find ${ConstantName} in the generator source (${GeneratorSrc})."

@ -52,7 +52,7 @@ namespace objectivec {
namespace {
// This is also found in GPBBootstrap.h, and needs to be kept in sync.
const int32 GOOGLE_PROTOBUF_OBJC_VERSION = 30004;
const int32_t GOOGLE_PROTOBUF_OBJC_VERSION = 30004;
const char* kHeaderExtension = ".pbobjc.h";

@ -994,7 +994,7 @@ std::string DefaultValue(const FieldDescriptor* field) {
// Must convert to a standard byte order for packing length into
// a cstring.
uint32 length = ghtonl(default_string.length());
uint32_t length = ghtonl(default_string.length());
std::string bytes((const char*)&length, sizeof(length));
bytes.append(default_string);
return "(NSData*)\"" + EscapeTrigraphs(CEscape(bytes)) + "\"";
@ -1423,7 +1423,7 @@ TextFormatDecodeData::TextFormatDecodeData() { }
TextFormatDecodeData::~TextFormatDecodeData() { }
void TextFormatDecodeData::AddString(int32 key,
void TextFormatDecodeData::AddString(int32_t key,
const std::string& input_for_decode,
const std::string& desired_output) {
for (std::vector<DataEntry>::const_iterator i = entries_.begin();
@ -1479,12 +1479,12 @@ class DecodeDataBuilder {
}
private:
static constexpr uint8 kAddUnderscore = 0x80;
static constexpr uint8_t kAddUnderscore = 0x80;
static constexpr uint8 kOpAsIs = 0x00;
static constexpr uint8 kOpFirstUpper = 0x40;
static constexpr uint8 kOpFirstLower = 0x20;
static constexpr uint8 kOpAllUpper = 0x60;
static constexpr uint8_t kOpAsIs = 0x00;
static constexpr uint8_t kOpFirstUpper = 0x40;
static constexpr uint8_t kOpFirstLower = 0x20;
static constexpr uint8_t kOpAllUpper = 0x60;
static constexpr int kMaxSegmentLen = 0x1f;
@ -1494,7 +1494,7 @@ class DecodeDataBuilder {
}
void Push() {
uint8 op = (op_ | segment_len_);
uint8_t op = (op_ | segment_len_);
if (need_underscore_) op |= kAddUnderscore;
if (op != 0) {
decode_data_ += (char)op;
@ -1526,7 +1526,7 @@ class DecodeDataBuilder {
bool need_underscore_;
bool is_all_upper_;
uint8 op_;
uint8_t op_;
int segment_len_;
std::string decode_data_;

Loading…
Cancel
Save