Auto-generate files after cl/584082079

pull/14815/head
Protobuf Team Bot 1 year ago
parent 7fa050d8c1
commit 78391a1318
  1. 15
      php/ext/google/protobuf/php-upb.c
  2. 68
      php/ext/google/protobuf/php-upb.h
  3. 15
      ruby/ext/google/protobuf_c/ruby-upb.c
  4. 68
      ruby/ext/google/protobuf_c/ruby-upb.h

@ -6097,7 +6097,7 @@ upb_Message* _upb_Message_Copy(upb_Message* dst, const upb_Message* src,
memcpy(dst, src, mini_table->size);
for (size_t i = 0; i < mini_table->field_count; ++i) {
const upb_MiniTableField* field = &mini_table->fields[i];
if (!upb_IsRepeatedOrMap(field)) {
if (!upb_MiniTableField_IsRepeatedOrMap(field)) {
switch (upb_MiniTableField_CType(field)) {
case kUpb_CType_Message: {
upb_TaggedMessagePtr tagged =
@ -6164,7 +6164,7 @@ upb_Message* _upb_Message_Copy(upb_Message* dst, const upb_Message* src,
upb_Message_Extension* dst_ext =
_upb_Message_GetOrCreateExtension(dst, msg_ext->ext, arena);
if (!dst_ext) return NULL;
if (!upb_IsRepeatedOrMap(field)) {
if (!upb_MiniTableField_IsRepeatedOrMap(field)) {
if (!upb_Clone_ExtensionValue(msg_ext->ext, msg_ext, dst_ext, arena)) {
return NULL;
}
@ -6835,6 +6835,7 @@ upb_MiniTableEnum* upb_MiniDescriptor_BuildEnum(const char* data, size_t len,
#include <inttypes.h>
#include <stdint.h>
#include <stdlib.h>
@ -7315,7 +7316,7 @@ int upb_MtDecoder_CompareFields(const void* _a, const void* _b) {
#define UPB_COMBINE(rep, ty, idx) (((rep << type_bits) | ty) << idx_bits) | idx
uint32_t a_packed = UPB_COMBINE(a->rep, a->type, a->field_index);
uint32_t b_packed = UPB_COMBINE(b->rep, b->type, b->field_index);
assert(a_packed != b_packed);
UPB_ASSERT(a_packed != b_packed);
#undef UPB_COMBINE
return a_packed < b_packed ? -1 : 1;
}
@ -7448,7 +7449,7 @@ static void upb_MtDecoder_ValidateEntryField(upb_MtDecoder* d,
name, expected_num, (int)f->number);
}
if (upb_IsRepeatedOrMap(f)) {
if (upb_MiniTableField_IsRepeatedOrMap(f)) {
upb_MdDecoder_ErrorJmp(
&d->base, "map %s cannot be repeated or map, or be in oneof", name);
}
@ -7623,7 +7624,7 @@ static const char* upb_MtDecoder_DoBuildMiniTableExtension(
if (extendee->ext & kUpb_ExtMode_IsMessageSet) {
// Extensions of MessageSet must be messages.
if (!upb_IsSubMessage(f)) return NULL;
if (!upb_MiniTableField_IsSubMessage(f)) return NULL;
// Extensions of MessageSet must be non-repeating.
if ((f->mode & kUpb_FieldMode_Mask) == kUpb_FieldMode_Array) return NULL;
@ -13124,8 +13125,8 @@ static const char* _upb_Decoder_DecodeToMap(upb_Decoder* d, const char* ptr,
UPB_ASSERT(entry);
UPB_ASSERT(entry->field_count == 2);
UPB_ASSERT(!upb_IsRepeatedOrMap(&entry->fields[0]));
UPB_ASSERT(!upb_IsRepeatedOrMap(&entry->fields[1]));
UPB_ASSERT(!upb_MiniTableField_IsRepeatedOrMap(&entry->fields[0]));
UPB_ASSERT(!upb_MiniTableField_IsRepeatedOrMap(&entry->fields[1]));
if (!map) {
map = _upb_Decoder_CreateMap(d, entry);

@ -1086,16 +1086,6 @@ UPB_INLINE void _upb_MiniTableField_CheckIsMap(
UPB_ASSUME(field->presence == 0);
}
UPB_INLINE bool upb_IsRepeatedOrMap(const struct upb_MiniTableField* field) {
// This works because upb_FieldMode has no value 3.
return !(field->mode & kUpb_FieldMode_Scalar);
}
UPB_INLINE bool upb_IsSubMessage(const struct upb_MiniTableField* field) {
return field->UPB_PRIVATE(descriptortype) == kUpb_FieldType_Message ||
field->UPB_PRIVATE(descriptortype) == kUpb_FieldType_Group;
}
#ifdef __cplusplus
} /* extern "C" */
#endif
@ -1217,20 +1207,32 @@ UPB_API_INLINE upb_CType upb_MiniTableField_CType(const upb_MiniTableField* f) {
return upb_FieldType_CType(upb_MiniTableField_Type(f));
}
UPB_API_INLINE bool upb_MiniTableField_IsClosedEnum(
const upb_MiniTableField* field) {
return field->UPB_PRIVATE(descriptortype) == kUpb_FieldType_Enum;
}
UPB_API_INLINE bool upb_MiniTableField_IsExtension(
const upb_MiniTableField* field) {
return field->mode & kUpb_LabelFlags_IsExtension;
}
UPB_API_INLINE bool upb_MiniTableField_IsClosedEnum(
UPB_API_INLINE bool upb_MiniTableField_IsRepeatedOrMap(
const upb_MiniTableField* field) {
return field->UPB_PRIVATE(descriptortype) == kUpb_FieldType_Enum;
// This works because upb_FieldMode has no value 3.
return !(field->mode & kUpb_FieldMode_Scalar);
}
UPB_API_INLINE bool upb_MiniTableField_IsSubMessage(
const upb_MiniTableField* field) {
return field->UPB_PRIVATE(descriptortype) == kUpb_FieldType_Message ||
field->UPB_PRIVATE(descriptortype) == kUpb_FieldType_Group;
}
UPB_API_INLINE bool upb_MiniTableField_HasPresence(
const upb_MiniTableField* field) {
if (upb_MiniTableField_IsExtension(field)) {
return !upb_IsRepeatedOrMap(field);
return !upb_MiniTableField_IsRepeatedOrMap(field);
} else {
return field->presence != 0;
}
@ -2397,7 +2399,7 @@ _upb_MiniTable_ElementSizeLg2(const upb_MiniTableField* field) {
// const upb_MiniTableField* field,
// bool value, upb_Arena* a) {
// UPB_ASSUME(field->UPB_PRIVATE(descriptortype) == kUpb_FieldType_Bool);
// UPB_ASSUME(!upb_IsRepeatedOrMap(field));
// UPB_ASSUME(!upb_MiniTableField_IsRepeatedOrMap(field));
// UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_1Byte);
// _upb_Message_SetField(msg, field, &value, a);
// }
@ -2722,7 +2724,7 @@ UPB_API_INLINE bool upb_Message_GetBool(const upb_Message* msg,
bool default_val) {
UPB_ASSUME(upb_MiniTableField_CType(field) == kUpb_CType_Bool);
UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_1Byte);
UPB_ASSUME(!upb_IsRepeatedOrMap(field));
UPB_ASSUME(!upb_MiniTableField_IsRepeatedOrMap(field));
bool ret;
_upb_Message_GetField(msg, field, &default_val, &ret);
return ret;
@ -2733,7 +2735,7 @@ UPB_API_INLINE bool upb_Message_SetBool(upb_Message* msg,
bool value, upb_Arena* a) {
UPB_ASSUME(upb_MiniTableField_CType(field) == kUpb_CType_Bool);
UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_1Byte);
UPB_ASSUME(!upb_IsRepeatedOrMap(field));
UPB_ASSUME(!upb_MiniTableField_IsRepeatedOrMap(field));
return _upb_Message_SetField(msg, field, &value, a);
}
@ -2743,7 +2745,7 @@ UPB_API_INLINE int32_t upb_Message_GetInt32(const upb_Message* msg,
UPB_ASSUME(upb_MiniTableField_CType(field) == kUpb_CType_Int32 ||
upb_MiniTableField_CType(field) == kUpb_CType_Enum);
UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_4Byte);
UPB_ASSUME(!upb_IsRepeatedOrMap(field));
UPB_ASSUME(!upb_MiniTableField_IsRepeatedOrMap(field));
int32_t ret;
_upb_Message_GetField(msg, field, &default_val, &ret);
return ret;
@ -2755,7 +2757,7 @@ UPB_API_INLINE bool upb_Message_SetInt32(upb_Message* msg,
UPB_ASSUME(upb_MiniTableField_CType(field) == kUpb_CType_Int32 ||
upb_MiniTableField_CType(field) == kUpb_CType_Enum);
UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_4Byte);
UPB_ASSUME(!upb_IsRepeatedOrMap(field));
UPB_ASSUME(!upb_MiniTableField_IsRepeatedOrMap(field));
return _upb_Message_SetField(msg, field, &value, a);
}
@ -2764,7 +2766,7 @@ UPB_API_INLINE uint32_t upb_Message_GetUInt32(const upb_Message* msg,
uint32_t default_val) {
UPB_ASSUME(upb_MiniTableField_CType(field) == kUpb_CType_UInt32);
UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_4Byte);
UPB_ASSUME(!upb_IsRepeatedOrMap(field));
UPB_ASSUME(!upb_MiniTableField_IsRepeatedOrMap(field));
uint32_t ret;
_upb_Message_GetField(msg, field, &default_val, &ret);
return ret;
@ -2775,7 +2777,7 @@ UPB_API_INLINE bool upb_Message_SetUInt32(upb_Message* msg,
uint32_t value, upb_Arena* a) {
UPB_ASSUME(upb_MiniTableField_CType(field) == kUpb_CType_UInt32);
UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_4Byte);
UPB_ASSUME(!upb_IsRepeatedOrMap(field));
UPB_ASSUME(!upb_MiniTableField_IsRepeatedOrMap(field));
return _upb_Message_SetField(msg, field, &value, a);
}
@ -2784,7 +2786,7 @@ UPB_API_INLINE void upb_Message_SetClosedEnum(
const upb_MiniTableField* field, int32_t value) {
UPB_ASSERT(upb_MiniTableField_IsClosedEnum(field));
UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_4Byte);
UPB_ASSUME(!upb_IsRepeatedOrMap(field));
UPB_ASSUME(!upb_MiniTableField_IsRepeatedOrMap(field));
UPB_ASSERT(upb_MiniTableEnum_CheckValue(
upb_MiniTable_GetSubEnumTable(msg_mini_table, field), value));
_upb_Message_SetNonExtensionField(msg, field, &value);
@ -2795,7 +2797,7 @@ UPB_API_INLINE int64_t upb_Message_GetInt64(const upb_Message* msg,
uint64_t default_val) {
UPB_ASSUME(upb_MiniTableField_CType(field) == kUpb_CType_Int64);
UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_8Byte);
UPB_ASSUME(!upb_IsRepeatedOrMap(field));
UPB_ASSUME(!upb_MiniTableField_IsRepeatedOrMap(field));
int64_t ret;
_upb_Message_GetField(msg, field, &default_val, &ret);
return ret;
@ -2806,7 +2808,7 @@ UPB_API_INLINE bool upb_Message_SetInt64(upb_Message* msg,
int64_t value, upb_Arena* a) {
UPB_ASSUME(upb_MiniTableField_CType(field) == kUpb_CType_Int64);
UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_8Byte);
UPB_ASSUME(!upb_IsRepeatedOrMap(field));
UPB_ASSUME(!upb_MiniTableField_IsRepeatedOrMap(field));
return _upb_Message_SetField(msg, field, &value, a);
}
@ -2815,7 +2817,7 @@ UPB_API_INLINE uint64_t upb_Message_GetUInt64(const upb_Message* msg,
uint64_t default_val) {
UPB_ASSUME(upb_MiniTableField_CType(field) == kUpb_CType_UInt64);
UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_8Byte);
UPB_ASSUME(!upb_IsRepeatedOrMap(field));
UPB_ASSUME(!upb_MiniTableField_IsRepeatedOrMap(field));
uint64_t ret;
_upb_Message_GetField(msg, field, &default_val, &ret);
return ret;
@ -2826,7 +2828,7 @@ UPB_API_INLINE bool upb_Message_SetUInt64(upb_Message* msg,
uint64_t value, upb_Arena* a) {
UPB_ASSUME(upb_MiniTableField_CType(field) == kUpb_CType_UInt64);
UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_8Byte);
UPB_ASSUME(!upb_IsRepeatedOrMap(field));
UPB_ASSUME(!upb_MiniTableField_IsRepeatedOrMap(field));
return _upb_Message_SetField(msg, field, &value, a);
}
@ -2835,7 +2837,7 @@ UPB_API_INLINE float upb_Message_GetFloat(const upb_Message* msg,
float default_val) {
UPB_ASSUME(upb_MiniTableField_CType(field) == kUpb_CType_Float);
UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_4Byte);
UPB_ASSUME(!upb_IsRepeatedOrMap(field));
UPB_ASSUME(!upb_MiniTableField_IsRepeatedOrMap(field));
float ret;
_upb_Message_GetField(msg, field, &default_val, &ret);
return ret;
@ -2846,7 +2848,7 @@ UPB_API_INLINE bool upb_Message_SetFloat(upb_Message* msg,
float value, upb_Arena* a) {
UPB_ASSUME(upb_MiniTableField_CType(field) == kUpb_CType_Float);
UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_4Byte);
UPB_ASSUME(!upb_IsRepeatedOrMap(field));
UPB_ASSUME(!upb_MiniTableField_IsRepeatedOrMap(field));
return _upb_Message_SetField(msg, field, &value, a);
}
@ -2855,7 +2857,7 @@ UPB_API_INLINE double upb_Message_GetDouble(const upb_Message* msg,
double default_val) {
UPB_ASSUME(upb_MiniTableField_CType(field) == kUpb_CType_Double);
UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_8Byte);
UPB_ASSUME(!upb_IsRepeatedOrMap(field));
UPB_ASSUME(!upb_MiniTableField_IsRepeatedOrMap(field));
double ret;
_upb_Message_GetField(msg, field, &default_val, &ret);
return ret;
@ -2866,7 +2868,7 @@ UPB_API_INLINE bool upb_Message_SetDouble(upb_Message* msg,
double value, upb_Arena* a) {
UPB_ASSUME(upb_MiniTableField_CType(field) == kUpb_CType_Double);
UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_8Byte);
UPB_ASSUME(!upb_IsRepeatedOrMap(field));
UPB_ASSUME(!upb_MiniTableField_IsRepeatedOrMap(field));
return _upb_Message_SetField(msg, field, &value, a);
}
@ -2876,7 +2878,7 @@ upb_Message_GetString(const upb_Message* msg, const upb_MiniTableField* field,
UPB_ASSUME(upb_MiniTableField_CType(field) == kUpb_CType_String ||
upb_MiniTableField_CType(field) == kUpb_CType_Bytes);
UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_StringView);
UPB_ASSUME(!upb_IsRepeatedOrMap(field));
UPB_ASSUME(!upb_MiniTableField_IsRepeatedOrMap(field));
upb_StringView ret;
_upb_Message_GetField(msg, field, &def_val, &ret);
return ret;
@ -2888,7 +2890,7 @@ UPB_API_INLINE bool upb_Message_SetString(upb_Message* msg,
UPB_ASSUME(upb_MiniTableField_CType(field) == kUpb_CType_String ||
upb_MiniTableField_CType(field) == kUpb_CType_Bytes);
UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_StringView);
UPB_ASSUME(!upb_IsRepeatedOrMap(field));
UPB_ASSUME(!upb_MiniTableField_IsRepeatedOrMap(field));
return _upb_Message_SetField(msg, field, &value, a);
}
@ -2898,7 +2900,7 @@ UPB_API_INLINE upb_TaggedMessagePtr upb_Message_GetTaggedMessagePtr(
UPB_ASSUME(upb_MiniTableField_CType(field) == kUpb_CType_Message);
UPB_ASSUME(_upb_MiniTableField_GetRep(field) ==
UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte));
UPB_ASSUME(!upb_IsRepeatedOrMap(field));
UPB_ASSUME(!upb_MiniTableField_IsRepeatedOrMap(field));
upb_TaggedMessagePtr tagged;
_upb_Message_GetNonExtensionField(msg, field, &default_val, &tagged);
return tagged;
@ -2921,7 +2923,7 @@ UPB_API_INLINE void _upb_Message_SetTaggedMessagePtr(
UPB_ASSUME(upb_MiniTableField_CType(field) == kUpb_CType_Message);
UPB_ASSUME(_upb_MiniTableField_GetRep(field) ==
UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte));
UPB_ASSUME(!upb_IsRepeatedOrMap(field));
UPB_ASSUME(!upb_MiniTableField_IsRepeatedOrMap(field));
UPB_ASSERT(mini_table->subs[field->UPB_PRIVATE(submsg_index)].submsg);
_upb_Message_SetNonExtensionField(msg, field, &sub_message);
}

@ -5612,7 +5612,7 @@ upb_Message* _upb_Message_Copy(upb_Message* dst, const upb_Message* src,
memcpy(dst, src, mini_table->size);
for (size_t i = 0; i < mini_table->field_count; ++i) {
const upb_MiniTableField* field = &mini_table->fields[i];
if (!upb_IsRepeatedOrMap(field)) {
if (!upb_MiniTableField_IsRepeatedOrMap(field)) {
switch (upb_MiniTableField_CType(field)) {
case kUpb_CType_Message: {
upb_TaggedMessagePtr tagged =
@ -5679,7 +5679,7 @@ upb_Message* _upb_Message_Copy(upb_Message* dst, const upb_Message* src,
upb_Message_Extension* dst_ext =
_upb_Message_GetOrCreateExtension(dst, msg_ext->ext, arena);
if (!dst_ext) return NULL;
if (!upb_IsRepeatedOrMap(field)) {
if (!upb_MiniTableField_IsRepeatedOrMap(field)) {
if (!upb_Clone_ExtensionValue(msg_ext->ext, msg_ext, dst_ext, arena)) {
return NULL;
}
@ -6350,6 +6350,7 @@ upb_MiniTableEnum* upb_MiniDescriptor_BuildEnum(const char* data, size_t len,
#include <inttypes.h>
#include <stdint.h>
#include <stdlib.h>
@ -6830,7 +6831,7 @@ int upb_MtDecoder_CompareFields(const void* _a, const void* _b) {
#define UPB_COMBINE(rep, ty, idx) (((rep << type_bits) | ty) << idx_bits) | idx
uint32_t a_packed = UPB_COMBINE(a->rep, a->type, a->field_index);
uint32_t b_packed = UPB_COMBINE(b->rep, b->type, b->field_index);
assert(a_packed != b_packed);
UPB_ASSERT(a_packed != b_packed);
#undef UPB_COMBINE
return a_packed < b_packed ? -1 : 1;
}
@ -6963,7 +6964,7 @@ static void upb_MtDecoder_ValidateEntryField(upb_MtDecoder* d,
name, expected_num, (int)f->number);
}
if (upb_IsRepeatedOrMap(f)) {
if (upb_MiniTableField_IsRepeatedOrMap(f)) {
upb_MdDecoder_ErrorJmp(
&d->base, "map %s cannot be repeated or map, or be in oneof", name);
}
@ -7138,7 +7139,7 @@ static const char* upb_MtDecoder_DoBuildMiniTableExtension(
if (extendee->ext & kUpb_ExtMode_IsMessageSet) {
// Extensions of MessageSet must be messages.
if (!upb_IsSubMessage(f)) return NULL;
if (!upb_MiniTableField_IsSubMessage(f)) return NULL;
// Extensions of MessageSet must be non-repeating.
if ((f->mode & kUpb_FieldMode_Mask) == kUpb_FieldMode_Array) return NULL;
@ -12639,8 +12640,8 @@ static const char* _upb_Decoder_DecodeToMap(upb_Decoder* d, const char* ptr,
UPB_ASSERT(entry);
UPB_ASSERT(entry->field_count == 2);
UPB_ASSERT(!upb_IsRepeatedOrMap(&entry->fields[0]));
UPB_ASSERT(!upb_IsRepeatedOrMap(&entry->fields[1]));
UPB_ASSERT(!upb_MiniTableField_IsRepeatedOrMap(&entry->fields[0]));
UPB_ASSERT(!upb_MiniTableField_IsRepeatedOrMap(&entry->fields[1]));
if (!map) {
map = _upb_Decoder_CreateMap(d, entry);

@ -1088,16 +1088,6 @@ UPB_INLINE void _upb_MiniTableField_CheckIsMap(
UPB_ASSUME(field->presence == 0);
}
UPB_INLINE bool upb_IsRepeatedOrMap(const struct upb_MiniTableField* field) {
// This works because upb_FieldMode has no value 3.
return !(field->mode & kUpb_FieldMode_Scalar);
}
UPB_INLINE bool upb_IsSubMessage(const struct upb_MiniTableField* field) {
return field->UPB_PRIVATE(descriptortype) == kUpb_FieldType_Message ||
field->UPB_PRIVATE(descriptortype) == kUpb_FieldType_Group;
}
#ifdef __cplusplus
} /* extern "C" */
#endif
@ -1219,20 +1209,32 @@ UPB_API_INLINE upb_CType upb_MiniTableField_CType(const upb_MiniTableField* f) {
return upb_FieldType_CType(upb_MiniTableField_Type(f));
}
UPB_API_INLINE bool upb_MiniTableField_IsClosedEnum(
const upb_MiniTableField* field) {
return field->UPB_PRIVATE(descriptortype) == kUpb_FieldType_Enum;
}
UPB_API_INLINE bool upb_MiniTableField_IsExtension(
const upb_MiniTableField* field) {
return field->mode & kUpb_LabelFlags_IsExtension;
}
UPB_API_INLINE bool upb_MiniTableField_IsClosedEnum(
UPB_API_INLINE bool upb_MiniTableField_IsRepeatedOrMap(
const upb_MiniTableField* field) {
return field->UPB_PRIVATE(descriptortype) == kUpb_FieldType_Enum;
// This works because upb_FieldMode has no value 3.
return !(field->mode & kUpb_FieldMode_Scalar);
}
UPB_API_INLINE bool upb_MiniTableField_IsSubMessage(
const upb_MiniTableField* field) {
return field->UPB_PRIVATE(descriptortype) == kUpb_FieldType_Message ||
field->UPB_PRIVATE(descriptortype) == kUpb_FieldType_Group;
}
UPB_API_INLINE bool upb_MiniTableField_HasPresence(
const upb_MiniTableField* field) {
if (upb_MiniTableField_IsExtension(field)) {
return !upb_IsRepeatedOrMap(field);
return !upb_MiniTableField_IsRepeatedOrMap(field);
} else {
return field->presence != 0;
}
@ -2399,7 +2401,7 @@ _upb_MiniTable_ElementSizeLg2(const upb_MiniTableField* field) {
// const upb_MiniTableField* field,
// bool value, upb_Arena* a) {
// UPB_ASSUME(field->UPB_PRIVATE(descriptortype) == kUpb_FieldType_Bool);
// UPB_ASSUME(!upb_IsRepeatedOrMap(field));
// UPB_ASSUME(!upb_MiniTableField_IsRepeatedOrMap(field));
// UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_1Byte);
// _upb_Message_SetField(msg, field, &value, a);
// }
@ -2724,7 +2726,7 @@ UPB_API_INLINE bool upb_Message_GetBool(const upb_Message* msg,
bool default_val) {
UPB_ASSUME(upb_MiniTableField_CType(field) == kUpb_CType_Bool);
UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_1Byte);
UPB_ASSUME(!upb_IsRepeatedOrMap(field));
UPB_ASSUME(!upb_MiniTableField_IsRepeatedOrMap(field));
bool ret;
_upb_Message_GetField(msg, field, &default_val, &ret);
return ret;
@ -2735,7 +2737,7 @@ UPB_API_INLINE bool upb_Message_SetBool(upb_Message* msg,
bool value, upb_Arena* a) {
UPB_ASSUME(upb_MiniTableField_CType(field) == kUpb_CType_Bool);
UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_1Byte);
UPB_ASSUME(!upb_IsRepeatedOrMap(field));
UPB_ASSUME(!upb_MiniTableField_IsRepeatedOrMap(field));
return _upb_Message_SetField(msg, field, &value, a);
}
@ -2745,7 +2747,7 @@ UPB_API_INLINE int32_t upb_Message_GetInt32(const upb_Message* msg,
UPB_ASSUME(upb_MiniTableField_CType(field) == kUpb_CType_Int32 ||
upb_MiniTableField_CType(field) == kUpb_CType_Enum);
UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_4Byte);
UPB_ASSUME(!upb_IsRepeatedOrMap(field));
UPB_ASSUME(!upb_MiniTableField_IsRepeatedOrMap(field));
int32_t ret;
_upb_Message_GetField(msg, field, &default_val, &ret);
return ret;
@ -2757,7 +2759,7 @@ UPB_API_INLINE bool upb_Message_SetInt32(upb_Message* msg,
UPB_ASSUME(upb_MiniTableField_CType(field) == kUpb_CType_Int32 ||
upb_MiniTableField_CType(field) == kUpb_CType_Enum);
UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_4Byte);
UPB_ASSUME(!upb_IsRepeatedOrMap(field));
UPB_ASSUME(!upb_MiniTableField_IsRepeatedOrMap(field));
return _upb_Message_SetField(msg, field, &value, a);
}
@ -2766,7 +2768,7 @@ UPB_API_INLINE uint32_t upb_Message_GetUInt32(const upb_Message* msg,
uint32_t default_val) {
UPB_ASSUME(upb_MiniTableField_CType(field) == kUpb_CType_UInt32);
UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_4Byte);
UPB_ASSUME(!upb_IsRepeatedOrMap(field));
UPB_ASSUME(!upb_MiniTableField_IsRepeatedOrMap(field));
uint32_t ret;
_upb_Message_GetField(msg, field, &default_val, &ret);
return ret;
@ -2777,7 +2779,7 @@ UPB_API_INLINE bool upb_Message_SetUInt32(upb_Message* msg,
uint32_t value, upb_Arena* a) {
UPB_ASSUME(upb_MiniTableField_CType(field) == kUpb_CType_UInt32);
UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_4Byte);
UPB_ASSUME(!upb_IsRepeatedOrMap(field));
UPB_ASSUME(!upb_MiniTableField_IsRepeatedOrMap(field));
return _upb_Message_SetField(msg, field, &value, a);
}
@ -2786,7 +2788,7 @@ UPB_API_INLINE void upb_Message_SetClosedEnum(
const upb_MiniTableField* field, int32_t value) {
UPB_ASSERT(upb_MiniTableField_IsClosedEnum(field));
UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_4Byte);
UPB_ASSUME(!upb_IsRepeatedOrMap(field));
UPB_ASSUME(!upb_MiniTableField_IsRepeatedOrMap(field));
UPB_ASSERT(upb_MiniTableEnum_CheckValue(
upb_MiniTable_GetSubEnumTable(msg_mini_table, field), value));
_upb_Message_SetNonExtensionField(msg, field, &value);
@ -2797,7 +2799,7 @@ UPB_API_INLINE int64_t upb_Message_GetInt64(const upb_Message* msg,
uint64_t default_val) {
UPB_ASSUME(upb_MiniTableField_CType(field) == kUpb_CType_Int64);
UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_8Byte);
UPB_ASSUME(!upb_IsRepeatedOrMap(field));
UPB_ASSUME(!upb_MiniTableField_IsRepeatedOrMap(field));
int64_t ret;
_upb_Message_GetField(msg, field, &default_val, &ret);
return ret;
@ -2808,7 +2810,7 @@ UPB_API_INLINE bool upb_Message_SetInt64(upb_Message* msg,
int64_t value, upb_Arena* a) {
UPB_ASSUME(upb_MiniTableField_CType(field) == kUpb_CType_Int64);
UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_8Byte);
UPB_ASSUME(!upb_IsRepeatedOrMap(field));
UPB_ASSUME(!upb_MiniTableField_IsRepeatedOrMap(field));
return _upb_Message_SetField(msg, field, &value, a);
}
@ -2817,7 +2819,7 @@ UPB_API_INLINE uint64_t upb_Message_GetUInt64(const upb_Message* msg,
uint64_t default_val) {
UPB_ASSUME(upb_MiniTableField_CType(field) == kUpb_CType_UInt64);
UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_8Byte);
UPB_ASSUME(!upb_IsRepeatedOrMap(field));
UPB_ASSUME(!upb_MiniTableField_IsRepeatedOrMap(field));
uint64_t ret;
_upb_Message_GetField(msg, field, &default_val, &ret);
return ret;
@ -2828,7 +2830,7 @@ UPB_API_INLINE bool upb_Message_SetUInt64(upb_Message* msg,
uint64_t value, upb_Arena* a) {
UPB_ASSUME(upb_MiniTableField_CType(field) == kUpb_CType_UInt64);
UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_8Byte);
UPB_ASSUME(!upb_IsRepeatedOrMap(field));
UPB_ASSUME(!upb_MiniTableField_IsRepeatedOrMap(field));
return _upb_Message_SetField(msg, field, &value, a);
}
@ -2837,7 +2839,7 @@ UPB_API_INLINE float upb_Message_GetFloat(const upb_Message* msg,
float default_val) {
UPB_ASSUME(upb_MiniTableField_CType(field) == kUpb_CType_Float);
UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_4Byte);
UPB_ASSUME(!upb_IsRepeatedOrMap(field));
UPB_ASSUME(!upb_MiniTableField_IsRepeatedOrMap(field));
float ret;
_upb_Message_GetField(msg, field, &default_val, &ret);
return ret;
@ -2848,7 +2850,7 @@ UPB_API_INLINE bool upb_Message_SetFloat(upb_Message* msg,
float value, upb_Arena* a) {
UPB_ASSUME(upb_MiniTableField_CType(field) == kUpb_CType_Float);
UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_4Byte);
UPB_ASSUME(!upb_IsRepeatedOrMap(field));
UPB_ASSUME(!upb_MiniTableField_IsRepeatedOrMap(field));
return _upb_Message_SetField(msg, field, &value, a);
}
@ -2857,7 +2859,7 @@ UPB_API_INLINE double upb_Message_GetDouble(const upb_Message* msg,
double default_val) {
UPB_ASSUME(upb_MiniTableField_CType(field) == kUpb_CType_Double);
UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_8Byte);
UPB_ASSUME(!upb_IsRepeatedOrMap(field));
UPB_ASSUME(!upb_MiniTableField_IsRepeatedOrMap(field));
double ret;
_upb_Message_GetField(msg, field, &default_val, &ret);
return ret;
@ -2868,7 +2870,7 @@ UPB_API_INLINE bool upb_Message_SetDouble(upb_Message* msg,
double value, upb_Arena* a) {
UPB_ASSUME(upb_MiniTableField_CType(field) == kUpb_CType_Double);
UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_8Byte);
UPB_ASSUME(!upb_IsRepeatedOrMap(field));
UPB_ASSUME(!upb_MiniTableField_IsRepeatedOrMap(field));
return _upb_Message_SetField(msg, field, &value, a);
}
@ -2878,7 +2880,7 @@ upb_Message_GetString(const upb_Message* msg, const upb_MiniTableField* field,
UPB_ASSUME(upb_MiniTableField_CType(field) == kUpb_CType_String ||
upb_MiniTableField_CType(field) == kUpb_CType_Bytes);
UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_StringView);
UPB_ASSUME(!upb_IsRepeatedOrMap(field));
UPB_ASSUME(!upb_MiniTableField_IsRepeatedOrMap(field));
upb_StringView ret;
_upb_Message_GetField(msg, field, &def_val, &ret);
return ret;
@ -2890,7 +2892,7 @@ UPB_API_INLINE bool upb_Message_SetString(upb_Message* msg,
UPB_ASSUME(upb_MiniTableField_CType(field) == kUpb_CType_String ||
upb_MiniTableField_CType(field) == kUpb_CType_Bytes);
UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_StringView);
UPB_ASSUME(!upb_IsRepeatedOrMap(field));
UPB_ASSUME(!upb_MiniTableField_IsRepeatedOrMap(field));
return _upb_Message_SetField(msg, field, &value, a);
}
@ -2900,7 +2902,7 @@ UPB_API_INLINE upb_TaggedMessagePtr upb_Message_GetTaggedMessagePtr(
UPB_ASSUME(upb_MiniTableField_CType(field) == kUpb_CType_Message);
UPB_ASSUME(_upb_MiniTableField_GetRep(field) ==
UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte));
UPB_ASSUME(!upb_IsRepeatedOrMap(field));
UPB_ASSUME(!upb_MiniTableField_IsRepeatedOrMap(field));
upb_TaggedMessagePtr tagged;
_upb_Message_GetNonExtensionField(msg, field, &default_val, &tagged);
return tagged;
@ -2923,7 +2925,7 @@ UPB_API_INLINE void _upb_Message_SetTaggedMessagePtr(
UPB_ASSUME(upb_MiniTableField_CType(field) == kUpb_CType_Message);
UPB_ASSUME(_upb_MiniTableField_GetRep(field) ==
UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte));
UPB_ASSUME(!upb_IsRepeatedOrMap(field));
UPB_ASSUME(!upb_MiniTableField_IsRepeatedOrMap(field));
UPB_ASSERT(mini_table->subs[field->UPB_PRIVATE(submsg_index)].submsg);
_upb_Message_SetNonExtensionField(msg, field, &sub_message);
}

Loading…
Cancel
Save