diff --git a/upb/message/array.c b/upb/message/array.c index ba3f743010..d7858d3b22 100644 --- a/upb/message/array.c +++ b/upb/message/array.c @@ -28,13 +28,13 @@ const void* upb_Array_DataPtr(const upb_Array* arr) { void* upb_Array_MutableDataPtr(upb_Array* arr) { return _upb_array_ptr(arr); } -size_t upb_Array_Size(const upb_Array* arr) { return arr->size; } +size_t upb_Array_Size(const upb_Array* arr) { return arr->UPB_PRIVATE(size); } upb_MessageValue upb_Array_Get(const upb_Array* arr, size_t i) { upb_MessageValue ret; const char* data = _upb_array_constptr(arr); const int lg2 = UPB_PRIVATE(_upb_Array_ElemSizeLg2)(arr); - UPB_ASSERT(i < arr->size); + UPB_ASSERT(i < arr->UPB_PRIVATE(size)); memcpy(&ret, data + (i << lg2), 1 << lg2); return ret; } @@ -42,16 +42,16 @@ upb_MessageValue upb_Array_Get(const upb_Array* arr, size_t i) { void upb_Array_Set(upb_Array* arr, size_t i, upb_MessageValue val) { char* data = _upb_array_ptr(arr); const int lg2 = UPB_PRIVATE(_upb_Array_ElemSizeLg2)(arr); - UPB_ASSERT(i < arr->size); + UPB_ASSERT(i < arr->UPB_PRIVATE(size)); memcpy(data + (i << lg2), &val, 1 << lg2); } bool upb_Array_Append(upb_Array* arr, upb_MessageValue val, upb_Arena* arena) { UPB_ASSERT(arena); - if (!_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + if (!_upb_Array_ResizeUninitialized(arr, arr->UPB_PRIVATE(size) + 1, arena)) { return false; } - upb_Array_Set(arr, arr->size - 1, val); + upb_Array_Set(arr, arr->UPB_PRIVATE(size) - 1, val); return true; } @@ -65,10 +65,11 @@ void upb_Array_Move(upb_Array* arr, size_t dst_idx, size_t src_idx, bool upb_Array_Insert(upb_Array* arr, size_t i, size_t count, upb_Arena* arena) { UPB_ASSERT(arena); - UPB_ASSERT(i <= arr->size); - UPB_ASSERT(count + arr->size >= count); - const size_t oldsize = arr->size; - if (!_upb_Array_ResizeUninitialized(arr, arr->size + count, arena)) { + UPB_ASSERT(i <= arr->UPB_PRIVATE(size)); + UPB_ASSERT(count + arr->UPB_PRIVATE(size) >= count); + const size_t oldsize = arr->UPB_PRIVATE(size); + if (!_upb_Array_ResizeUninitialized(arr, arr->UPB_PRIVATE(size) + count, + arena)) { return false; } upb_Array_Move(arr, i + count, i, oldsize - i); @@ -82,17 +83,17 @@ bool upb_Array_Insert(upb_Array* arr, size_t i, size_t count, void upb_Array_Delete(upb_Array* arr, size_t i, size_t count) { const size_t end = i + count; UPB_ASSERT(i <= end); - UPB_ASSERT(end <= arr->size); - upb_Array_Move(arr, i, end, arr->size - end); - arr->size -= count; + UPB_ASSERT(end <= arr->UPB_PRIVATE(size)); + upb_Array_Move(arr, i, end, arr->UPB_PRIVATE(size) - end); + arr->UPB_PRIVATE(size) -= count; } bool upb_Array_Resize(upb_Array* arr, size_t size, upb_Arena* arena) { - const size_t oldsize = arr->size; + const size_t oldsize = arr->UPB_PRIVATE(size); if (UPB_UNLIKELY(!_upb_Array_ResizeUninitialized(arr, size, arena))) { return false; } - const size_t newsize = arr->size; + const size_t newsize = arr->UPB_PRIVATE(size); if (newsize > oldsize) { const int lg2 = UPB_PRIVATE(_upb_Array_ElemSizeLg2)(arr); char* data = _upb_array_ptr(arr); diff --git a/upb/message/copy.c b/upb/message/copy.c index b5a634df6c..7ad30ccc02 100644 --- a/upb/message/copy.c +++ b/upb/message/copy.c @@ -142,7 +142,7 @@ static upb_Map* upb_Message_Map_DeepClone(const upb_Map* map, upb_Array* upb_Array_DeepClone(const upb_Array* array, upb_CType value_type, const upb_MiniTable* sub, upb_Arena* arena) { - size_t size = array->size; + size_t size = array->UPB_PRIVATE(size); upb_Array* cloned_array = UPB_PRIVATE(_upb_Array_New)(arena, size, upb_CType_SizeLg2(value_type)); if (!cloned_array) { diff --git a/upb/message/internal/array.h b/upb/message/internal/array.h index 68aedf3377..4d03e4b978 100644 --- a/upb/message/internal/array.h +++ b/upb/message/internal/array.h @@ -35,7 +35,7 @@ struct upb_Array { // Bit #2 contains the frozen/immutable flag (currently unimplemented). uintptr_t data; - size_t size; // The number of elements in the array. + size_t UPB_ONLYBITS(size); // The number of elements in the array. size_t UPB_PRIVATE(capacity); // Allocated storage. Measured in elements. }; @@ -73,7 +73,7 @@ UPB_INLINE upb_Array* UPB_PRIVATE(_upb_Array_New)(upb_Arena* arena, if (!array) return NULL; UPB_PRIVATE(_upb_Array_SetTaggedPtr) (array, UPB_PTR_AT(array, array_size, void), elem_size_lg2); - array->size = 0; + array->UPB_ONLYBITS(size) = 0; array->UPB_PRIVATE(capacity) = init_capacity; return array; } @@ -92,9 +92,10 @@ UPB_INLINE bool UPB_PRIVATE(_upb_Array_Reserve)(upb_Array* array, size_t size, // Resize without initializing new elements. UPB_INLINE bool _upb_Array_ResizeUninitialized(upb_Array* array, size_t size, upb_Arena* arena) { - UPB_ASSERT(size <= array->size || arena); // Allow NULL arena when shrinking. + UPB_ASSERT(size <= array->UPB_ONLYBITS(size) || + arena); // Allow NULL arena when shrinking. if (!UPB_PRIVATE(_upb_Array_Reserve)(array, size, arena)) return false; - array->size = size; + array->UPB_ONLYBITS(size) = size; return true; } @@ -104,7 +105,7 @@ UPB_INLINE bool _upb_Array_ResizeUninitialized(upb_Array* array, size_t size, UPB_INLINE void UPB_PRIVATE(_upb_Array_Set)(upb_Array* array, size_t i, const void* data, size_t elem_size) { - UPB_ASSERT(i < array->size); + UPB_ASSERT(i < array->UPB_ONLYBITS(size)); UPB_ASSERT(elem_size == 1U << UPB_PRIVATE(_upb_Array_ElemSizeLg2)(array)); char* arr_data = (char*)_upb_array_ptr(array); memcpy(arr_data + (i * elem_size), data, elem_size); diff --git a/upb/message/promote.c b/upb/message/promote.c index e33af5bec6..4fd9e676a3 100644 --- a/upb/message/promote.c +++ b/upb/message/promote.c @@ -196,7 +196,7 @@ upb_DecodeStatus upb_Array_PromoteMessages(upb_Array* arr, int decode_options, upb_Arena* arena) { void** data = _upb_array_ptr(arr); - size_t size = arr->size; + size_t size = arr->UPB_PRIVATE(size); for (size_t i = 0; i < size; i++) { upb_TaggedMessagePtr tagged; memcpy(&tagged, &data[i], sizeof(tagged)); diff --git a/upb/reflection/stage0/google/protobuf/descriptor.upb.h b/upb/reflection/stage0/google/protobuf/descriptor.upb.h index 76ac5db89a..2ac29d6610 100644 --- a/upb/reflection/stage0/google/protobuf/descriptor.upb.h +++ b/upb/reflection/stage0/google/protobuf/descriptor.upb.h @@ -276,7 +276,7 @@ UPB_INLINE const google_protobuf_FileDescriptorProto* const* google_protobuf_Fil const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FileDescriptorSet_msg_init(), 1); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (const google_protobuf_FileDescriptorProto* const*)_upb_array_constptr(arr); } else { if (size) *size = 0; @@ -287,7 +287,7 @@ UPB_INLINE const upb_Array* _google_protobuf_FileDescriptorSet_file_upb_array(co const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FileDescriptorSet_msg_init(), 1); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -296,7 +296,7 @@ UPB_INLINE upb_Array* _google_protobuf_FileDescriptorSet_file_mutable_upb_array( upb_Array* arr = upb_Message_GetOrCreateMutableArray( (upb_Message*)msg, &field, arena); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -305,7 +305,7 @@ UPB_INLINE google_protobuf_FileDescriptorProto** google_protobuf_FileDescriptorS upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FileDescriptorSet_msg_init(), 1); upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (google_protobuf_FileDescriptorProto**)_upb_array_ptr(arr); } else { if (size) *size = 0; @@ -319,12 +319,14 @@ UPB_INLINE google_protobuf_FileDescriptorProto** google_protobuf_FileDescriptorS UPB_INLINE struct google_protobuf_FileDescriptorProto* google_protobuf_FileDescriptorSet_add_file(google_protobuf_FileDescriptorSet* msg, upb_Arena* arena) { upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FileDescriptorSet_msg_init(), 1); upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); - if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + if (!arr || !_upb_Array_ResizeUninitialized( + arr, arr->UPB_PRIVATE(size) + 1, arena)) { return NULL; } struct google_protobuf_FileDescriptorProto* sub = (struct google_protobuf_FileDescriptorProto*)_upb_Message_New(google__protobuf__FileDescriptorProto_msg_init(), arena); if (!arr || !sub) return NULL; - UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub)); + UPB_PRIVATE(_upb_Array_Set) + (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub)); return sub; } @@ -401,7 +403,7 @@ UPB_INLINE upb_StringView const* google_protobuf_FileDescriptorProto_dependency( const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FileDescriptorProto_msg_init(), 3); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (upb_StringView const*)_upb_array_constptr(arr); } else { if (size) *size = 0; @@ -412,7 +414,7 @@ UPB_INLINE const upb_Array* _google_protobuf_FileDescriptorProto_dependency_upb_ const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FileDescriptorProto_msg_init(), 3); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -421,7 +423,7 @@ UPB_INLINE upb_Array* _google_protobuf_FileDescriptorProto_dependency_mutable_up upb_Array* arr = upb_Message_GetOrCreateMutableArray( (upb_Message*)msg, &field, arena); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -433,7 +435,7 @@ UPB_INLINE const google_protobuf_DescriptorProto* const* google_protobuf_FileDes const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FileDescriptorProto_msg_init(), 4); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (const google_protobuf_DescriptorProto* const*)_upb_array_constptr(arr); } else { if (size) *size = 0; @@ -444,7 +446,7 @@ UPB_INLINE const upb_Array* _google_protobuf_FileDescriptorProto_message_type_up const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FileDescriptorProto_msg_init(), 4); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -453,7 +455,7 @@ UPB_INLINE upb_Array* _google_protobuf_FileDescriptorProto_message_type_mutable_ upb_Array* arr = upb_Message_GetOrCreateMutableArray( (upb_Message*)msg, &field, arena); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -465,7 +467,7 @@ UPB_INLINE const google_protobuf_EnumDescriptorProto* const* google_protobuf_Fil const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FileDescriptorProto_msg_init(), 5); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (const google_protobuf_EnumDescriptorProto* const*)_upb_array_constptr(arr); } else { if (size) *size = 0; @@ -476,7 +478,7 @@ UPB_INLINE const upb_Array* _google_protobuf_FileDescriptorProto_enum_type_upb_a const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FileDescriptorProto_msg_init(), 5); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -485,7 +487,7 @@ UPB_INLINE upb_Array* _google_protobuf_FileDescriptorProto_enum_type_mutable_upb upb_Array* arr = upb_Message_GetOrCreateMutableArray( (upb_Message*)msg, &field, arena); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -497,7 +499,7 @@ UPB_INLINE const google_protobuf_ServiceDescriptorProto* const* google_protobuf_ const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FileDescriptorProto_msg_init(), 6); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (const google_protobuf_ServiceDescriptorProto* const*)_upb_array_constptr(arr); } else { if (size) *size = 0; @@ -508,7 +510,7 @@ UPB_INLINE const upb_Array* _google_protobuf_FileDescriptorProto_service_upb_arr const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FileDescriptorProto_msg_init(), 6); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -517,7 +519,7 @@ UPB_INLINE upb_Array* _google_protobuf_FileDescriptorProto_service_mutable_upb_a upb_Array* arr = upb_Message_GetOrCreateMutableArray( (upb_Message*)msg, &field, arena); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -529,7 +531,7 @@ UPB_INLINE const google_protobuf_FieldDescriptorProto* const* google_protobuf_Fi const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FileDescriptorProto_msg_init(), 7); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (const google_protobuf_FieldDescriptorProto* const*)_upb_array_constptr(arr); } else { if (size) *size = 0; @@ -540,7 +542,7 @@ UPB_INLINE const upb_Array* _google_protobuf_FileDescriptorProto_extension_upb_a const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FileDescriptorProto_msg_init(), 7); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -549,7 +551,7 @@ UPB_INLINE upb_Array* _google_protobuf_FileDescriptorProto_extension_mutable_upb upb_Array* arr = upb_Message_GetOrCreateMutableArray( (upb_Message*)msg, &field, arena); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -591,7 +593,7 @@ UPB_INLINE int32_t const* google_protobuf_FileDescriptorProto_public_dependency( const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FileDescriptorProto_msg_init(), 10); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (int32_t const*)_upb_array_constptr(arr); } else { if (size) *size = 0; @@ -602,7 +604,7 @@ UPB_INLINE const upb_Array* _google_protobuf_FileDescriptorProto_public_dependen const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FileDescriptorProto_msg_init(), 10); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -611,7 +613,7 @@ UPB_INLINE upb_Array* _google_protobuf_FileDescriptorProto_public_dependency_mut upb_Array* arr = upb_Message_GetOrCreateMutableArray( (upb_Message*)msg, &field, arena); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -623,7 +625,7 @@ UPB_INLINE int32_t const* google_protobuf_FileDescriptorProto_weak_dependency(co const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FileDescriptorProto_msg_init(), 11); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (int32_t const*)_upb_array_constptr(arr); } else { if (size) *size = 0; @@ -634,7 +636,7 @@ UPB_INLINE const upb_Array* _google_protobuf_FileDescriptorProto_weak_dependency const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FileDescriptorProto_msg_init(), 11); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -643,7 +645,7 @@ UPB_INLINE upb_Array* _google_protobuf_FileDescriptorProto_weak_dependency_mutab upb_Array* arr = upb_Message_GetOrCreateMutableArray( (upb_Message*)msg, &field, arena); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -690,7 +692,7 @@ UPB_INLINE upb_StringView* google_protobuf_FileDescriptorProto_mutable_dependenc upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FileDescriptorProto_msg_init(), 3); upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (upb_StringView*)_upb_array_ptr(arr); } else { if (size) *size = 0; @@ -704,17 +706,19 @@ UPB_INLINE upb_StringView* google_protobuf_FileDescriptorProto_resize_dependency UPB_INLINE bool google_protobuf_FileDescriptorProto_add_dependency(google_protobuf_FileDescriptorProto* msg, upb_StringView val, upb_Arena* arena) { upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FileDescriptorProto_msg_init(), 3); upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); - if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + if (!arr || !_upb_Array_ResizeUninitialized( + arr, arr->UPB_PRIVATE(size) + 1, arena)) { return false; } - UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &val, sizeof(val)); + UPB_PRIVATE(_upb_Array_Set) + (arr, arr->UPB_PRIVATE(size) - 1, &val, sizeof(val)); return true; } UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_FileDescriptorProto_mutable_message_type(google_protobuf_FileDescriptorProto* msg, size_t* size) { upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FileDescriptorProto_msg_init(), 4); upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (google_protobuf_DescriptorProto**)_upb_array_ptr(arr); } else { if (size) *size = 0; @@ -728,19 +732,21 @@ UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_FileDescriptorProto UPB_INLINE struct google_protobuf_DescriptorProto* google_protobuf_FileDescriptorProto_add_message_type(google_protobuf_FileDescriptorProto* msg, upb_Arena* arena) { upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FileDescriptorProto_msg_init(), 4); upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); - if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + if (!arr || !_upb_Array_ResizeUninitialized( + arr, arr->UPB_PRIVATE(size) + 1, arena)) { return NULL; } struct google_protobuf_DescriptorProto* sub = (struct google_protobuf_DescriptorProto*)_upb_Message_New(google__protobuf__DescriptorProto_msg_init(), arena); if (!arr || !sub) return NULL; - UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub)); + UPB_PRIVATE(_upb_Array_Set) + (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_FileDescriptorProto_mutable_enum_type(google_protobuf_FileDescriptorProto* msg, size_t* size) { upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FileDescriptorProto_msg_init(), 5); upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (google_protobuf_EnumDescriptorProto**)_upb_array_ptr(arr); } else { if (size) *size = 0; @@ -754,19 +760,21 @@ UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_FileDescriptorP UPB_INLINE struct google_protobuf_EnumDescriptorProto* google_protobuf_FileDescriptorProto_add_enum_type(google_protobuf_FileDescriptorProto* msg, upb_Arena* arena) { upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FileDescriptorProto_msg_init(), 5); upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); - if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + if (!arr || !_upb_Array_ResizeUninitialized( + arr, arr->UPB_PRIVATE(size) + 1, arena)) { return NULL; } struct google_protobuf_EnumDescriptorProto* sub = (struct google_protobuf_EnumDescriptorProto*)_upb_Message_New(google__protobuf__EnumDescriptorProto_msg_init(), arena); if (!arr || !sub) return NULL; - UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub)); + UPB_PRIVATE(_upb_Array_Set) + (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE google_protobuf_ServiceDescriptorProto** google_protobuf_FileDescriptorProto_mutable_service(google_protobuf_FileDescriptorProto* msg, size_t* size) { upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FileDescriptorProto_msg_init(), 6); upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (google_protobuf_ServiceDescriptorProto**)_upb_array_ptr(arr); } else { if (size) *size = 0; @@ -780,19 +788,21 @@ UPB_INLINE google_protobuf_ServiceDescriptorProto** google_protobuf_FileDescript UPB_INLINE struct google_protobuf_ServiceDescriptorProto* google_protobuf_FileDescriptorProto_add_service(google_protobuf_FileDescriptorProto* msg, upb_Arena* arena) { upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FileDescriptorProto_msg_init(), 6); upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); - if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + if (!arr || !_upb_Array_ResizeUninitialized( + arr, arr->UPB_PRIVATE(size) + 1, arena)) { return NULL; } struct google_protobuf_ServiceDescriptorProto* sub = (struct google_protobuf_ServiceDescriptorProto*)_upb_Message_New(google__protobuf__ServiceDescriptorProto_msg_init(), arena); if (!arr || !sub) return NULL; - UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub)); + UPB_PRIVATE(_upb_Array_Set) + (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_FileDescriptorProto_mutable_extension(google_protobuf_FileDescriptorProto* msg, size_t* size) { upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FileDescriptorProto_msg_init(), 7); upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (google_protobuf_FieldDescriptorProto**)_upb_array_ptr(arr); } else { if (size) *size = 0; @@ -806,12 +816,14 @@ UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_FileDescriptor UPB_INLINE struct google_protobuf_FieldDescriptorProto* google_protobuf_FileDescriptorProto_add_extension(google_protobuf_FileDescriptorProto* msg, upb_Arena* arena) { upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FileDescriptorProto_msg_init(), 7); upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); - if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + if (!arr || !_upb_Array_ResizeUninitialized( + arr, arr->UPB_PRIVATE(size) + 1, arena)) { return NULL; } struct google_protobuf_FieldDescriptorProto* sub = (struct google_protobuf_FieldDescriptorProto*)_upb_Message_New(google__protobuf__FieldDescriptorProto_msg_init(), arena); if (!arr || !sub) return NULL; - UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub)); + UPB_PRIVATE(_upb_Array_Set) + (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void google_protobuf_FileDescriptorProto_set_options(google_protobuf_FileDescriptorProto *msg, google_protobuf_FileOptions* value) { @@ -842,7 +854,7 @@ UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_mutable_public_dependenc upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FileDescriptorProto_msg_init(), 10); upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (int32_t*)_upb_array_ptr(arr); } else { if (size) *size = 0; @@ -856,17 +868,19 @@ UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_resize_public_dependency UPB_INLINE bool google_protobuf_FileDescriptorProto_add_public_dependency(google_protobuf_FileDescriptorProto* msg, int32_t val, upb_Arena* arena) { upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FileDescriptorProto_msg_init(), 10); upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); - if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + if (!arr || !_upb_Array_ResizeUninitialized( + arr, arr->UPB_PRIVATE(size) + 1, arena)) { return false; } - UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &val, sizeof(val)); + UPB_PRIVATE(_upb_Array_Set) + (arr, arr->UPB_PRIVATE(size) - 1, &val, sizeof(val)); return true; } UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_mutable_weak_dependency(google_protobuf_FileDescriptorProto* msg, size_t* size) { upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FileDescriptorProto_msg_init(), 11); upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (int32_t*)_upb_array_ptr(arr); } else { if (size) *size = 0; @@ -880,10 +894,12 @@ UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_resize_weak_dependency(g UPB_INLINE bool google_protobuf_FileDescriptorProto_add_weak_dependency(google_protobuf_FileDescriptorProto* msg, int32_t val, upb_Arena* arena) { upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FileDescriptorProto_msg_init(), 11); upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); - if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + if (!arr || !_upb_Array_ResizeUninitialized( + arr, arr->UPB_PRIVATE(size) + 1, arena)) { return false; } - UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &val, sizeof(val)); + UPB_PRIVATE(_upb_Array_Set) + (arr, arr->UPB_PRIVATE(size) - 1, &val, sizeof(val)); return true; } UPB_INLINE void google_protobuf_FileDescriptorProto_set_syntax(google_protobuf_FileDescriptorProto *msg, upb_StringView value) { @@ -953,7 +969,7 @@ UPB_INLINE const google_protobuf_FieldDescriptorProto* const* google_protobuf_De const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__DescriptorProto_msg_init(), 2); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (const google_protobuf_FieldDescriptorProto* const*)_upb_array_constptr(arr); } else { if (size) *size = 0; @@ -964,7 +980,7 @@ UPB_INLINE const upb_Array* _google_protobuf_DescriptorProto_field_upb_array(con const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__DescriptorProto_msg_init(), 2); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -973,7 +989,7 @@ UPB_INLINE upb_Array* _google_protobuf_DescriptorProto_field_mutable_upb_array(c upb_Array* arr = upb_Message_GetOrCreateMutableArray( (upb_Message*)msg, &field, arena); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -985,7 +1001,7 @@ UPB_INLINE const google_protobuf_DescriptorProto* const* google_protobuf_Descrip const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__DescriptorProto_msg_init(), 3); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (const google_protobuf_DescriptorProto* const*)_upb_array_constptr(arr); } else { if (size) *size = 0; @@ -996,7 +1012,7 @@ UPB_INLINE const upb_Array* _google_protobuf_DescriptorProto_nested_type_upb_arr const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__DescriptorProto_msg_init(), 3); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -1005,7 +1021,7 @@ UPB_INLINE upb_Array* _google_protobuf_DescriptorProto_nested_type_mutable_upb_a upb_Array* arr = upb_Message_GetOrCreateMutableArray( (upb_Message*)msg, &field, arena); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -1017,7 +1033,7 @@ UPB_INLINE const google_protobuf_EnumDescriptorProto* const* google_protobuf_Des const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__DescriptorProto_msg_init(), 4); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (const google_protobuf_EnumDescriptorProto* const*)_upb_array_constptr(arr); } else { if (size) *size = 0; @@ -1028,7 +1044,7 @@ UPB_INLINE const upb_Array* _google_protobuf_DescriptorProto_enum_type_upb_array const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__DescriptorProto_msg_init(), 4); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -1037,7 +1053,7 @@ UPB_INLINE upb_Array* _google_protobuf_DescriptorProto_enum_type_mutable_upb_arr upb_Array* arr = upb_Message_GetOrCreateMutableArray( (upb_Message*)msg, &field, arena); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -1049,7 +1065,7 @@ UPB_INLINE const google_protobuf_DescriptorProto_ExtensionRange* const* google_p const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__DescriptorProto_msg_init(), 5); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (const google_protobuf_DescriptorProto_ExtensionRange* const*)_upb_array_constptr(arr); } else { if (size) *size = 0; @@ -1060,7 +1076,7 @@ UPB_INLINE const upb_Array* _google_protobuf_DescriptorProto_extension_range_upb const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__DescriptorProto_msg_init(), 5); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -1069,7 +1085,7 @@ UPB_INLINE upb_Array* _google_protobuf_DescriptorProto_extension_range_mutable_u upb_Array* arr = upb_Message_GetOrCreateMutableArray( (upb_Message*)msg, &field, arena); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -1081,7 +1097,7 @@ UPB_INLINE const google_protobuf_FieldDescriptorProto* const* google_protobuf_De const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__DescriptorProto_msg_init(), 6); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (const google_protobuf_FieldDescriptorProto* const*)_upb_array_constptr(arr); } else { if (size) *size = 0; @@ -1092,7 +1108,7 @@ UPB_INLINE const upb_Array* _google_protobuf_DescriptorProto_extension_upb_array const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__DescriptorProto_msg_init(), 6); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -1101,7 +1117,7 @@ UPB_INLINE upb_Array* _google_protobuf_DescriptorProto_extension_mutable_upb_arr upb_Array* arr = upb_Message_GetOrCreateMutableArray( (upb_Message*)msg, &field, arena); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -1128,7 +1144,7 @@ UPB_INLINE const google_protobuf_OneofDescriptorProto* const* google_protobuf_De const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__DescriptorProto_msg_init(), 8); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (const google_protobuf_OneofDescriptorProto* const*)_upb_array_constptr(arr); } else { if (size) *size = 0; @@ -1139,7 +1155,7 @@ UPB_INLINE const upb_Array* _google_protobuf_DescriptorProto_oneof_decl_upb_arra const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__DescriptorProto_msg_init(), 8); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -1148,7 +1164,7 @@ UPB_INLINE upb_Array* _google_protobuf_DescriptorProto_oneof_decl_mutable_upb_ar upb_Array* arr = upb_Message_GetOrCreateMutableArray( (upb_Message*)msg, &field, arena); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -1160,7 +1176,7 @@ UPB_INLINE const google_protobuf_DescriptorProto_ReservedRange* const* google_pr const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__DescriptorProto_msg_init(), 9); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (const google_protobuf_DescriptorProto_ReservedRange* const*)_upb_array_constptr(arr); } else { if (size) *size = 0; @@ -1171,7 +1187,7 @@ UPB_INLINE const upb_Array* _google_protobuf_DescriptorProto_reserved_range_upb_ const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__DescriptorProto_msg_init(), 9); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -1180,7 +1196,7 @@ UPB_INLINE upb_Array* _google_protobuf_DescriptorProto_reserved_range_mutable_up upb_Array* arr = upb_Message_GetOrCreateMutableArray( (upb_Message*)msg, &field, arena); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -1192,7 +1208,7 @@ UPB_INLINE upb_StringView const* google_protobuf_DescriptorProto_reserved_name(c const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__DescriptorProto_msg_init(), 10); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (upb_StringView const*)_upb_array_constptr(arr); } else { if (size) *size = 0; @@ -1203,7 +1219,7 @@ UPB_INLINE const upb_Array* _google_protobuf_DescriptorProto_reserved_name_upb_a const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__DescriptorProto_msg_init(), 10); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -1212,7 +1228,7 @@ UPB_INLINE upb_Array* _google_protobuf_DescriptorProto_reserved_name_mutable_upb upb_Array* arr = upb_Message_GetOrCreateMutableArray( (upb_Message*)msg, &field, arena); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -1225,7 +1241,7 @@ UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProt upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__DescriptorProto_msg_init(), 2); upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (google_protobuf_FieldDescriptorProto**)_upb_array_ptr(arr); } else { if (size) *size = 0; @@ -1239,19 +1255,21 @@ UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProt UPB_INLINE struct google_protobuf_FieldDescriptorProto* google_protobuf_DescriptorProto_add_field(google_protobuf_DescriptorProto* msg, upb_Arena* arena) { upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__DescriptorProto_msg_init(), 2); upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); - if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + if (!arr || !_upb_Array_ResizeUninitialized( + arr, arr->UPB_PRIVATE(size) + 1, arena)) { return NULL; } struct google_protobuf_FieldDescriptorProto* sub = (struct google_protobuf_FieldDescriptorProto*)_upb_Message_New(google__protobuf__FieldDescriptorProto_msg_init(), arena); if (!arr || !sub) return NULL; - UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub)); + UPB_PRIVATE(_upb_Array_Set) + (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_DescriptorProto_mutable_nested_type(google_protobuf_DescriptorProto* msg, size_t* size) { upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__DescriptorProto_msg_init(), 3); upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (google_protobuf_DescriptorProto**)_upb_array_ptr(arr); } else { if (size) *size = 0; @@ -1265,19 +1283,21 @@ UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_DescriptorProto_res UPB_INLINE struct google_protobuf_DescriptorProto* google_protobuf_DescriptorProto_add_nested_type(google_protobuf_DescriptorProto* msg, upb_Arena* arena) { upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__DescriptorProto_msg_init(), 3); upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); - if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + if (!arr || !_upb_Array_ResizeUninitialized( + arr, arr->UPB_PRIVATE(size) + 1, arena)) { return NULL; } struct google_protobuf_DescriptorProto* sub = (struct google_protobuf_DescriptorProto*)_upb_Message_New(google__protobuf__DescriptorProto_msg_init(), arena); if (!arr || !sub) return NULL; - UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub)); + UPB_PRIVATE(_upb_Array_Set) + (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_DescriptorProto_mutable_enum_type(google_protobuf_DescriptorProto* msg, size_t* size) { upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__DescriptorProto_msg_init(), 4); upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (google_protobuf_EnumDescriptorProto**)_upb_array_ptr(arr); } else { if (size) *size = 0; @@ -1291,19 +1311,21 @@ UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_DescriptorProto UPB_INLINE struct google_protobuf_EnumDescriptorProto* google_protobuf_DescriptorProto_add_enum_type(google_protobuf_DescriptorProto* msg, upb_Arena* arena) { upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__DescriptorProto_msg_init(), 4); upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); - if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + if (!arr || !_upb_Array_ResizeUninitialized( + arr, arr->UPB_PRIVATE(size) + 1, arena)) { return NULL; } struct google_protobuf_EnumDescriptorProto* sub = (struct google_protobuf_EnumDescriptorProto*)_upb_Message_New(google__protobuf__EnumDescriptorProto_msg_init(), arena); if (!arr || !sub) return NULL; - UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub)); + UPB_PRIVATE(_upb_Array_Set) + (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange** google_protobuf_DescriptorProto_mutable_extension_range(google_protobuf_DescriptorProto* msg, size_t* size) { upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__DescriptorProto_msg_init(), 5); upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (google_protobuf_DescriptorProto_ExtensionRange**)_upb_array_ptr(arr); } else { if (size) *size = 0; @@ -1317,19 +1339,21 @@ UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange** google_protobuf_Desc UPB_INLINE struct google_protobuf_DescriptorProto_ExtensionRange* google_protobuf_DescriptorProto_add_extension_range(google_protobuf_DescriptorProto* msg, upb_Arena* arena) { upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__DescriptorProto_msg_init(), 5); upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); - if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + if (!arr || !_upb_Array_ResizeUninitialized( + arr, arr->UPB_PRIVATE(size) + 1, arena)) { return NULL; } struct google_protobuf_DescriptorProto_ExtensionRange* sub = (struct google_protobuf_DescriptorProto_ExtensionRange*)_upb_Message_New(google__protobuf__DescriptorProto__ExtensionRange_msg_init(), arena); if (!arr || !sub) return NULL; - UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub)); + UPB_PRIVATE(_upb_Array_Set) + (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProto_mutable_extension(google_protobuf_DescriptorProto* msg, size_t* size) { upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__DescriptorProto_msg_init(), 6); upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (google_protobuf_FieldDescriptorProto**)_upb_array_ptr(arr); } else { if (size) *size = 0; @@ -1343,12 +1367,14 @@ UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProt UPB_INLINE struct google_protobuf_FieldDescriptorProto* google_protobuf_DescriptorProto_add_extension(google_protobuf_DescriptorProto* msg, upb_Arena* arena) { upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__DescriptorProto_msg_init(), 6); upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); - if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + if (!arr || !_upb_Array_ResizeUninitialized( + arr, arr->UPB_PRIVATE(size) + 1, arena)) { return NULL; } struct google_protobuf_FieldDescriptorProto* sub = (struct google_protobuf_FieldDescriptorProto*)_upb_Message_New(google__protobuf__FieldDescriptorProto_msg_init(), arena); if (!arr || !sub) return NULL; - UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub)); + UPB_PRIVATE(_upb_Array_Set) + (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void google_protobuf_DescriptorProto_set_options(google_protobuf_DescriptorProto *msg, google_protobuf_MessageOptions* value) { @@ -1367,7 +1393,7 @@ UPB_INLINE google_protobuf_OneofDescriptorProto** google_protobuf_DescriptorProt upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__DescriptorProto_msg_init(), 8); upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (google_protobuf_OneofDescriptorProto**)_upb_array_ptr(arr); } else { if (size) *size = 0; @@ -1381,19 +1407,21 @@ UPB_INLINE google_protobuf_OneofDescriptorProto** google_protobuf_DescriptorProt UPB_INLINE struct google_protobuf_OneofDescriptorProto* google_protobuf_DescriptorProto_add_oneof_decl(google_protobuf_DescriptorProto* msg, upb_Arena* arena) { upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__DescriptorProto_msg_init(), 8); upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); - if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + if (!arr || !_upb_Array_ResizeUninitialized( + arr, arr->UPB_PRIVATE(size) + 1, arena)) { return NULL; } struct google_protobuf_OneofDescriptorProto* sub = (struct google_protobuf_OneofDescriptorProto*)_upb_Message_New(google__protobuf__OneofDescriptorProto_msg_init(), arena); if (!arr || !sub) return NULL; - UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub)); + UPB_PRIVATE(_upb_Array_Set) + (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE google_protobuf_DescriptorProto_ReservedRange** google_protobuf_DescriptorProto_mutable_reserved_range(google_protobuf_DescriptorProto* msg, size_t* size) { upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__DescriptorProto_msg_init(), 9); upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (google_protobuf_DescriptorProto_ReservedRange**)_upb_array_ptr(arr); } else { if (size) *size = 0; @@ -1407,19 +1435,21 @@ UPB_INLINE google_protobuf_DescriptorProto_ReservedRange** google_protobuf_Descr UPB_INLINE struct google_protobuf_DescriptorProto_ReservedRange* google_protobuf_DescriptorProto_add_reserved_range(google_protobuf_DescriptorProto* msg, upb_Arena* arena) { upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__DescriptorProto_msg_init(), 9); upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); - if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + if (!arr || !_upb_Array_ResizeUninitialized( + arr, arr->UPB_PRIVATE(size) + 1, arena)) { return NULL; } struct google_protobuf_DescriptorProto_ReservedRange* sub = (struct google_protobuf_DescriptorProto_ReservedRange*)_upb_Message_New(google__protobuf__DescriptorProto__ReservedRange_msg_init(), arena); if (!arr || !sub) return NULL; - UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub)); + UPB_PRIVATE(_upb_Array_Set) + (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE upb_StringView* google_protobuf_DescriptorProto_mutable_reserved_name(google_protobuf_DescriptorProto* msg, size_t* size) { upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__DescriptorProto_msg_init(), 10); upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (upb_StringView*)_upb_array_ptr(arr); } else { if (size) *size = 0; @@ -1433,10 +1463,12 @@ UPB_INLINE upb_StringView* google_protobuf_DescriptorProto_resize_reserved_name( UPB_INLINE bool google_protobuf_DescriptorProto_add_reserved_name(google_protobuf_DescriptorProto* msg, upb_StringView val, upb_Arena* arena) { upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__DescriptorProto_msg_init(), 10); upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); - if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + if (!arr || !_upb_Array_ResizeUninitialized( + arr, arr->UPB_PRIVATE(size) + 1, arena)) { return false; } - UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &val, sizeof(val)); + UPB_PRIVATE(_upb_Array_Set) + (arr, arr->UPB_PRIVATE(size) - 1, &val, sizeof(val)); return true; } @@ -1660,7 +1692,7 @@ UPB_INLINE const google_protobuf_ExtensionRangeOptions_Declaration* const* googl const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__ExtensionRangeOptions_msg_init(), 2); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (const google_protobuf_ExtensionRangeOptions_Declaration* const*)_upb_array_constptr(arr); } else { if (size) *size = 0; @@ -1671,7 +1703,7 @@ UPB_INLINE const upb_Array* _google_protobuf_ExtensionRangeOptions_declaration_u const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__ExtensionRangeOptions_msg_init(), 2); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -1680,7 +1712,7 @@ UPB_INLINE upb_Array* _google_protobuf_ExtensionRangeOptions_declaration_mutable upb_Array* arr = upb_Message_GetOrCreateMutableArray( (upb_Message*)msg, &field, arena); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -1722,7 +1754,7 @@ UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_Ext const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__ExtensionRangeOptions_msg_init(), 999); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (const google_protobuf_UninterpretedOption* const*)_upb_array_constptr(arr); } else { if (size) *size = 0; @@ -1733,7 +1765,7 @@ UPB_INLINE const upb_Array* _google_protobuf_ExtensionRangeOptions_uninterpreted const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__ExtensionRangeOptions_msg_init(), 999); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -1742,7 +1774,7 @@ UPB_INLINE upb_Array* _google_protobuf_ExtensionRangeOptions_uninterpreted_optio upb_Array* arr = upb_Message_GetOrCreateMutableArray( (upb_Message*)msg, &field, arena); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -1751,7 +1783,7 @@ UPB_INLINE google_protobuf_ExtensionRangeOptions_Declaration** google_protobuf_E upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__ExtensionRangeOptions_msg_init(), 2); upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (google_protobuf_ExtensionRangeOptions_Declaration**)_upb_array_ptr(arr); } else { if (size) *size = 0; @@ -1765,12 +1797,14 @@ UPB_INLINE google_protobuf_ExtensionRangeOptions_Declaration** google_protobuf_E UPB_INLINE struct google_protobuf_ExtensionRangeOptions_Declaration* google_protobuf_ExtensionRangeOptions_add_declaration(google_protobuf_ExtensionRangeOptions* msg, upb_Arena* arena) { upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__ExtensionRangeOptions_msg_init(), 2); upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); - if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + if (!arr || !_upb_Array_ResizeUninitialized( + arr, arr->UPB_PRIVATE(size) + 1, arena)) { return NULL; } struct google_protobuf_ExtensionRangeOptions_Declaration* sub = (struct google_protobuf_ExtensionRangeOptions_Declaration*)_upb_Message_New(google__protobuf__ExtensionRangeOptions__Declaration_msg_init(), arena); if (!arr || !sub) return NULL; - UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub)); + UPB_PRIVATE(_upb_Array_Set) + (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void google_protobuf_ExtensionRangeOptions_set_verification(google_protobuf_ExtensionRangeOptions *msg, int32_t value) { @@ -1793,7 +1827,7 @@ UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ExtensionRangeO upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__ExtensionRangeOptions_msg_init(), 999); upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (google_protobuf_UninterpretedOption**)_upb_array_ptr(arr); } else { if (size) *size = 0; @@ -1807,12 +1841,14 @@ UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ExtensionRangeO UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_ExtensionRangeOptions_add_uninterpreted_option(google_protobuf_ExtensionRangeOptions* msg, upb_Arena* arena) { upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__ExtensionRangeOptions_msg_init(), 999); upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); - if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + if (!arr || !_upb_Array_ResizeUninitialized( + arr, arr->UPB_PRIVATE(size) + 1, arena)) { return NULL; } struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(google__protobuf__UninterpretedOption_msg_init(), arena); if (!arr || !sub) return NULL; - UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub)); + UPB_PRIVATE(_upb_Array_Set) + (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub)); return sub; } @@ -2343,7 +2379,7 @@ UPB_INLINE const google_protobuf_EnumValueDescriptorProto* const* google_protobu const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__EnumDescriptorProto_msg_init(), 2); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (const google_protobuf_EnumValueDescriptorProto* const*)_upb_array_constptr(arr); } else { if (size) *size = 0; @@ -2354,7 +2390,7 @@ UPB_INLINE const upb_Array* _google_protobuf_EnumDescriptorProto_value_upb_array const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__EnumDescriptorProto_msg_init(), 2); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -2363,7 +2399,7 @@ UPB_INLINE upb_Array* _google_protobuf_EnumDescriptorProto_value_mutable_upb_arr upb_Array* arr = upb_Message_GetOrCreateMutableArray( (upb_Message*)msg, &field, arena); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -2390,7 +2426,7 @@ UPB_INLINE const google_protobuf_EnumDescriptorProto_EnumReservedRange* const* g const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__EnumDescriptorProto_msg_init(), 4); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (const google_protobuf_EnumDescriptorProto_EnumReservedRange* const*)_upb_array_constptr(arr); } else { if (size) *size = 0; @@ -2401,7 +2437,7 @@ UPB_INLINE const upb_Array* _google_protobuf_EnumDescriptorProto_reserved_range_ const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__EnumDescriptorProto_msg_init(), 4); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -2410,7 +2446,7 @@ UPB_INLINE upb_Array* _google_protobuf_EnumDescriptorProto_reserved_range_mutabl upb_Array* arr = upb_Message_GetOrCreateMutableArray( (upb_Message*)msg, &field, arena); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -2422,7 +2458,7 @@ UPB_INLINE upb_StringView const* google_protobuf_EnumDescriptorProto_reserved_na const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__EnumDescriptorProto_msg_init(), 5); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (upb_StringView const*)_upb_array_constptr(arr); } else { if (size) *size = 0; @@ -2433,7 +2469,7 @@ UPB_INLINE const upb_Array* _google_protobuf_EnumDescriptorProto_reserved_name_u const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__EnumDescriptorProto_msg_init(), 5); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -2442,7 +2478,7 @@ UPB_INLINE upb_Array* _google_protobuf_EnumDescriptorProto_reserved_name_mutable upb_Array* arr = upb_Message_GetOrCreateMutableArray( (upb_Message*)msg, &field, arena); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -2455,7 +2491,7 @@ UPB_INLINE google_protobuf_EnumValueDescriptorProto** google_protobuf_EnumDescri upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__EnumDescriptorProto_msg_init(), 2); upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (google_protobuf_EnumValueDescriptorProto**)_upb_array_ptr(arr); } else { if (size) *size = 0; @@ -2469,12 +2505,14 @@ UPB_INLINE google_protobuf_EnumValueDescriptorProto** google_protobuf_EnumDescri UPB_INLINE struct google_protobuf_EnumValueDescriptorProto* google_protobuf_EnumDescriptorProto_add_value(google_protobuf_EnumDescriptorProto* msg, upb_Arena* arena) { upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__EnumDescriptorProto_msg_init(), 2); upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); - if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + if (!arr || !_upb_Array_ResizeUninitialized( + arr, arr->UPB_PRIVATE(size) + 1, arena)) { return NULL; } struct google_protobuf_EnumValueDescriptorProto* sub = (struct google_protobuf_EnumValueDescriptorProto*)_upb_Message_New(google__protobuf__EnumValueDescriptorProto_msg_init(), arena); if (!arr || !sub) return NULL; - UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub)); + UPB_PRIVATE(_upb_Array_Set) + (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void google_protobuf_EnumDescriptorProto_set_options(google_protobuf_EnumDescriptorProto *msg, google_protobuf_EnumOptions* value) { @@ -2493,7 +2531,7 @@ UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange** google_protob upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__EnumDescriptorProto_msg_init(), 4); upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (google_protobuf_EnumDescriptorProto_EnumReservedRange**)_upb_array_ptr(arr); } else { if (size) *size = 0; @@ -2507,19 +2545,21 @@ UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange** google_protob UPB_INLINE struct google_protobuf_EnumDescriptorProto_EnumReservedRange* google_protobuf_EnumDescriptorProto_add_reserved_range(google_protobuf_EnumDescriptorProto* msg, upb_Arena* arena) { upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__EnumDescriptorProto_msg_init(), 4); upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); - if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + if (!arr || !_upb_Array_ResizeUninitialized( + arr, arr->UPB_PRIVATE(size) + 1, arena)) { return NULL; } struct google_protobuf_EnumDescriptorProto_EnumReservedRange* sub = (struct google_protobuf_EnumDescriptorProto_EnumReservedRange*)_upb_Message_New(google__protobuf__EnumDescriptorProto__EnumReservedRange_msg_init(), arena); if (!arr || !sub) return NULL; - UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub)); + UPB_PRIVATE(_upb_Array_Set) + (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE upb_StringView* google_protobuf_EnumDescriptorProto_mutable_reserved_name(google_protobuf_EnumDescriptorProto* msg, size_t* size) { upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__EnumDescriptorProto_msg_init(), 5); upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (upb_StringView*)_upb_array_ptr(arr); } else { if (size) *size = 0; @@ -2533,10 +2573,12 @@ UPB_INLINE upb_StringView* google_protobuf_EnumDescriptorProto_resize_reserved_n UPB_INLINE bool google_protobuf_EnumDescriptorProto_add_reserved_name(google_protobuf_EnumDescriptorProto* msg, upb_StringView val, upb_Arena* arena) { upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__EnumDescriptorProto_msg_init(), 5); upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); - if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + if (!arr || !_upb_Array_ResizeUninitialized( + arr, arr->UPB_PRIVATE(size) + 1, arena)) { return false; } - UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &val, sizeof(val)); + UPB_PRIVATE(_upb_Array_Set) + (arr, arr->UPB_PRIVATE(size) - 1, &val, sizeof(val)); return true; } @@ -2775,7 +2817,7 @@ UPB_INLINE const google_protobuf_MethodDescriptorProto* const* google_protobuf_S const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__ServiceDescriptorProto_msg_init(), 2); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (const google_protobuf_MethodDescriptorProto* const*)_upb_array_constptr(arr); } else { if (size) *size = 0; @@ -2786,7 +2828,7 @@ UPB_INLINE const upb_Array* _google_protobuf_ServiceDescriptorProto_method_upb_a const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__ServiceDescriptorProto_msg_init(), 2); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -2795,7 +2837,7 @@ UPB_INLINE upb_Array* _google_protobuf_ServiceDescriptorProto_method_mutable_upb upb_Array* arr = upb_Message_GetOrCreateMutableArray( (upb_Message*)msg, &field, arena); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -2823,7 +2865,7 @@ UPB_INLINE google_protobuf_MethodDescriptorProto** google_protobuf_ServiceDescri upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__ServiceDescriptorProto_msg_init(), 2); upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (google_protobuf_MethodDescriptorProto**)_upb_array_ptr(arr); } else { if (size) *size = 0; @@ -2837,12 +2879,14 @@ UPB_INLINE google_protobuf_MethodDescriptorProto** google_protobuf_ServiceDescri UPB_INLINE struct google_protobuf_MethodDescriptorProto* google_protobuf_ServiceDescriptorProto_add_method(google_protobuf_ServiceDescriptorProto* msg, upb_Arena* arena) { upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__ServiceDescriptorProto_msg_init(), 2); upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); - if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + if (!arr || !_upb_Array_ResizeUninitialized( + arr, arr->UPB_PRIVATE(size) + 1, arena)) { return NULL; } struct google_protobuf_MethodDescriptorProto* sub = (struct google_protobuf_MethodDescriptorProto*)_upb_Message_New(google__protobuf__MethodDescriptorProto_msg_init(), arena); if (!arr || !sub) return NULL; - UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub)); + UPB_PRIVATE(_upb_Array_Set) + (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void google_protobuf_ServiceDescriptorProto_set_options(google_protobuf_ServiceDescriptorProto *msg, google_protobuf_ServiceOptions* value) { @@ -3375,7 +3419,7 @@ UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_Fil const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FileOptions_msg_init(), 999); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (const google_protobuf_UninterpretedOption* const*)_upb_array_constptr(arr); } else { if (size) *size = 0; @@ -3386,7 +3430,7 @@ UPB_INLINE const upb_Array* _google_protobuf_FileOptions_uninterpreted_option_up const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FileOptions_msg_init(), 999); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -3395,7 +3439,7 @@ UPB_INLINE upb_Array* _google_protobuf_FileOptions_uninterpreted_option_mutable_ upb_Array* arr = upb_Message_GetOrCreateMutableArray( (upb_Message*)msg, &field, arena); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -3496,7 +3540,7 @@ UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FileOptions_mut upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FileOptions_msg_init(), 999); upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (google_protobuf_UninterpretedOption**)_upb_array_ptr(arr); } else { if (size) *size = 0; @@ -3510,12 +3554,14 @@ UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FileOptions_res UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_FileOptions_add_uninterpreted_option(google_protobuf_FileOptions* msg, upb_Arena* arena) { upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FileOptions_msg_init(), 999); upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); - if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + if (!arr || !_upb_Array_ResizeUninitialized( + arr, arr->UPB_PRIVATE(size) + 1, arena)) { return NULL; } struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(google__protobuf__UninterpretedOption_msg_init(), arena); if (!arr || !sub) return NULL; - UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub)); + UPB_PRIVATE(_upb_Array_Set) + (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub)); return sub; } @@ -3652,7 +3698,7 @@ UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_Mes const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__MessageOptions_msg_init(), 999); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (const google_protobuf_UninterpretedOption* const*)_upb_array_constptr(arr); } else { if (size) *size = 0; @@ -3663,7 +3709,7 @@ UPB_INLINE const upb_Array* _google_protobuf_MessageOptions_uninterpreted_option const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__MessageOptions_msg_init(), 999); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -3672,7 +3718,7 @@ UPB_INLINE upb_Array* _google_protobuf_MessageOptions_uninterpreted_option_mutab upb_Array* arr = upb_Message_GetOrCreateMutableArray( (upb_Message*)msg, &field, arena); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -3713,7 +3759,7 @@ UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MessageOptions_ upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__MessageOptions_msg_init(), 999); upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (google_protobuf_UninterpretedOption**)_upb_array_ptr(arr); } else { if (size) *size = 0; @@ -3727,12 +3773,14 @@ UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MessageOptions_ UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_MessageOptions_add_uninterpreted_option(google_protobuf_MessageOptions* msg, upb_Arena* arena) { upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__MessageOptions_msg_init(), 999); upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); - if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + if (!arr || !_upb_Array_ResizeUninitialized( + arr, arr->UPB_PRIVATE(size) + 1, arena)) { return NULL; } struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(google__protobuf__UninterpretedOption_msg_init(), arena); if (!arr || !sub) return NULL; - UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub)); + UPB_PRIVATE(_upb_Array_Set) + (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub)); return sub; } @@ -3914,7 +3962,7 @@ UPB_INLINE int32_t const* google_protobuf_FieldOptions_targets(const google_prot const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FieldOptions_msg_init(), 19); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (int32_t const*)_upb_array_constptr(arr); } else { if (size) *size = 0; @@ -3925,7 +3973,7 @@ UPB_INLINE const upb_Array* _google_protobuf_FieldOptions_targets_upb_array(cons const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FieldOptions_msg_init(), 19); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -3934,7 +3982,7 @@ UPB_INLINE upb_Array* _google_protobuf_FieldOptions_targets_mutable_upb_array(co upb_Array* arr = upb_Message_GetOrCreateMutableArray( (upb_Message*)msg, &field, arena); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -3946,7 +3994,7 @@ UPB_INLINE const google_protobuf_FieldOptions_EditionDefault* const* google_prot const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FieldOptions_msg_init(), 20); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (const google_protobuf_FieldOptions_EditionDefault* const*)_upb_array_constptr(arr); } else { if (size) *size = 0; @@ -3957,7 +4005,7 @@ UPB_INLINE const upb_Array* _google_protobuf_FieldOptions_edition_defaults_upb_a const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FieldOptions_msg_init(), 20); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -3966,7 +4014,7 @@ UPB_INLINE upb_Array* _google_protobuf_FieldOptions_edition_defaults_mutable_upb upb_Array* arr = upb_Message_GetOrCreateMutableArray( (upb_Message*)msg, &field, arena); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -3993,7 +4041,7 @@ UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_Fie const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FieldOptions_msg_init(), 999); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (const google_protobuf_UninterpretedOption* const*)_upb_array_constptr(arr); } else { if (size) *size = 0; @@ -4004,7 +4052,7 @@ UPB_INLINE const upb_Array* _google_protobuf_FieldOptions_uninterpreted_option_u const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FieldOptions_msg_init(), 999); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -4013,7 +4061,7 @@ UPB_INLINE upb_Array* _google_protobuf_FieldOptions_uninterpreted_option_mutable upb_Array* arr = upb_Message_GetOrCreateMutableArray( (upb_Message*)msg, &field, arena); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -4058,7 +4106,7 @@ UPB_INLINE int32_t* google_protobuf_FieldOptions_mutable_targets(google_protobuf upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FieldOptions_msg_init(), 19); upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (int32_t*)_upb_array_ptr(arr); } else { if (size) *size = 0; @@ -4072,17 +4120,19 @@ UPB_INLINE int32_t* google_protobuf_FieldOptions_resize_targets(google_protobuf_ UPB_INLINE bool google_protobuf_FieldOptions_add_targets(google_protobuf_FieldOptions* msg, int32_t val, upb_Arena* arena) { upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FieldOptions_msg_init(), 19); upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); - if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + if (!arr || !_upb_Array_ResizeUninitialized( + arr, arr->UPB_PRIVATE(size) + 1, arena)) { return false; } - UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &val, sizeof(val)); + UPB_PRIVATE(_upb_Array_Set) + (arr, arr->UPB_PRIVATE(size) - 1, &val, sizeof(val)); return true; } UPB_INLINE google_protobuf_FieldOptions_EditionDefault** google_protobuf_FieldOptions_mutable_edition_defaults(google_protobuf_FieldOptions* msg, size_t* size) { upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FieldOptions_msg_init(), 20); upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (google_protobuf_FieldOptions_EditionDefault**)_upb_array_ptr(arr); } else { if (size) *size = 0; @@ -4096,12 +4146,14 @@ UPB_INLINE google_protobuf_FieldOptions_EditionDefault** google_protobuf_FieldOp UPB_INLINE struct google_protobuf_FieldOptions_EditionDefault* google_protobuf_FieldOptions_add_edition_defaults(google_protobuf_FieldOptions* msg, upb_Arena* arena) { upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FieldOptions_msg_init(), 20); upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); - if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + if (!arr || !_upb_Array_ResizeUninitialized( + arr, arr->UPB_PRIVATE(size) + 1, arena)) { return NULL; } struct google_protobuf_FieldOptions_EditionDefault* sub = (struct google_protobuf_FieldOptions_EditionDefault*)_upb_Message_New(google__protobuf__FieldOptions__EditionDefault_msg_init(), arena); if (!arr || !sub) return NULL; - UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub)); + UPB_PRIVATE(_upb_Array_Set) + (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void google_protobuf_FieldOptions_set_features(google_protobuf_FieldOptions *msg, google_protobuf_FeatureSet* value) { @@ -4120,7 +4172,7 @@ UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FieldOptions_mu upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FieldOptions_msg_init(), 999); upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (google_protobuf_UninterpretedOption**)_upb_array_ptr(arr); } else { if (size) *size = 0; @@ -4134,12 +4186,14 @@ UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FieldOptions_re UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_FieldOptions_add_uninterpreted_option(google_protobuf_FieldOptions* msg, upb_Arena* arena) { upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FieldOptions_msg_init(), 999); upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); - if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + if (!arr || !_upb_Array_ResizeUninitialized( + arr, arr->UPB_PRIVATE(size) + 1, arena)) { return NULL; } struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(google__protobuf__UninterpretedOption_msg_init(), arena); if (!arr || !sub) return NULL; - UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub)); + UPB_PRIVATE(_upb_Array_Set) + (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub)); return sub; } @@ -4276,7 +4330,7 @@ UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_One const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__OneofOptions_msg_init(), 999); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (const google_protobuf_UninterpretedOption* const*)_upb_array_constptr(arr); } else { if (size) *size = 0; @@ -4287,7 +4341,7 @@ UPB_INLINE const upb_Array* _google_protobuf_OneofOptions_uninterpreted_option_u const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__OneofOptions_msg_init(), 999); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -4296,7 +4350,7 @@ UPB_INLINE upb_Array* _google_protobuf_OneofOptions_uninterpreted_option_mutable upb_Array* arr = upb_Message_GetOrCreateMutableArray( (upb_Message*)msg, &field, arena); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -4317,7 +4371,7 @@ UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_OneofOptions_mu upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__OneofOptions_msg_init(), 999); upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (google_protobuf_UninterpretedOption**)_upb_array_ptr(arr); } else { if (size) *size = 0; @@ -4331,12 +4385,14 @@ UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_OneofOptions_re UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_OneofOptions_add_uninterpreted_option(google_protobuf_OneofOptions* msg, upb_Arena* arena) { upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__OneofOptions_msg_init(), 999); upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); - if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + if (!arr || !_upb_Array_ResizeUninitialized( + arr, arr->UPB_PRIVATE(size) + 1, arena)) { return NULL; } struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(google__protobuf__UninterpretedOption_msg_init(), arena); if (!arr || !sub) return NULL; - UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub)); + UPB_PRIVATE(_upb_Array_Set) + (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub)); return sub; } @@ -4443,7 +4499,7 @@ UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_Enu const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__EnumOptions_msg_init(), 999); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (const google_protobuf_UninterpretedOption* const*)_upb_array_constptr(arr); } else { if (size) *size = 0; @@ -4454,7 +4510,7 @@ UPB_INLINE const upb_Array* _google_protobuf_EnumOptions_uninterpreted_option_up const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__EnumOptions_msg_init(), 999); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -4463,7 +4519,7 @@ UPB_INLINE upb_Array* _google_protobuf_EnumOptions_uninterpreted_option_mutable_ upb_Array* arr = upb_Message_GetOrCreateMutableArray( (upb_Message*)msg, &field, arena); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -4496,7 +4552,7 @@ UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumOptions_mut upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__EnumOptions_msg_init(), 999); upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (google_protobuf_UninterpretedOption**)_upb_array_ptr(arr); } else { if (size) *size = 0; @@ -4510,12 +4566,14 @@ UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumOptions_res UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_EnumOptions_add_uninterpreted_option(google_protobuf_EnumOptions* msg, upb_Arena* arena) { upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__EnumOptions_msg_init(), 999); upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); - if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + if (!arr || !_upb_Array_ResizeUninitialized( + arr, arr->UPB_PRIVATE(size) + 1, arena)) { return NULL; } struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(google__protobuf__UninterpretedOption_msg_init(), arena); if (!arr || !sub) return NULL; - UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub)); + UPB_PRIVATE(_upb_Array_Set) + (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub)); return sub; } @@ -4607,7 +4665,7 @@ UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_Enu const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__EnumValueOptions_msg_init(), 999); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (const google_protobuf_UninterpretedOption* const*)_upb_array_constptr(arr); } else { if (size) *size = 0; @@ -4618,7 +4676,7 @@ UPB_INLINE const upb_Array* _google_protobuf_EnumValueOptions_uninterpreted_opti const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__EnumValueOptions_msg_init(), 999); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -4627,7 +4685,7 @@ UPB_INLINE upb_Array* _google_protobuf_EnumValueOptions_uninterpreted_option_mut upb_Array* arr = upb_Message_GetOrCreateMutableArray( (upb_Message*)msg, &field, arena); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -4656,7 +4714,7 @@ UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumValueOption upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__EnumValueOptions_msg_init(), 999); upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (google_protobuf_UninterpretedOption**)_upb_array_ptr(arr); } else { if (size) *size = 0; @@ -4670,12 +4728,14 @@ UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumValueOption UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_EnumValueOptions_add_uninterpreted_option(google_protobuf_EnumValueOptions* msg, upb_Arena* arena) { upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__EnumValueOptions_msg_init(), 999); upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); - if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + if (!arr || !_upb_Array_ResizeUninitialized( + arr, arr->UPB_PRIVATE(size) + 1, arena)) { return NULL; } struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(google__protobuf__UninterpretedOption_msg_init(), arena); if (!arr || !sub) return NULL; - UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub)); + UPB_PRIVATE(_upb_Array_Set) + (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub)); return sub; } @@ -4752,7 +4812,7 @@ UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_Ser const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__ServiceOptions_msg_init(), 999); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (const google_protobuf_UninterpretedOption* const*)_upb_array_constptr(arr); } else { if (size) *size = 0; @@ -4763,7 +4823,7 @@ UPB_INLINE const upb_Array* _google_protobuf_ServiceOptions_uninterpreted_option const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__ServiceOptions_msg_init(), 999); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -4772,7 +4832,7 @@ UPB_INLINE upb_Array* _google_protobuf_ServiceOptions_uninterpreted_option_mutab upb_Array* arr = upb_Message_GetOrCreateMutableArray( (upb_Message*)msg, &field, arena); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -4797,7 +4857,7 @@ UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ServiceOptions_ upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__ServiceOptions_msg_init(), 999); upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (google_protobuf_UninterpretedOption**)_upb_array_ptr(arr); } else { if (size) *size = 0; @@ -4811,12 +4871,14 @@ UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ServiceOptions_ UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_ServiceOptions_add_uninterpreted_option(google_protobuf_ServiceOptions* msg, upb_Arena* arena) { upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__ServiceOptions_msg_init(), 999); upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); - if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + if (!arr || !_upb_Array_ResizeUninitialized( + arr, arr->UPB_PRIVATE(size) + 1, arena)) { return NULL; } struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(google__protobuf__UninterpretedOption_msg_init(), arena); if (!arr || !sub) return NULL; - UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub)); + UPB_PRIVATE(_upb_Array_Set) + (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub)); return sub; } @@ -4908,7 +4970,7 @@ UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_Met const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__MethodOptions_msg_init(), 999); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (const google_protobuf_UninterpretedOption* const*)_upb_array_constptr(arr); } else { if (size) *size = 0; @@ -4919,7 +4981,7 @@ UPB_INLINE const upb_Array* _google_protobuf_MethodOptions_uninterpreted_option_ const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__MethodOptions_msg_init(), 999); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -4928,7 +4990,7 @@ UPB_INLINE upb_Array* _google_protobuf_MethodOptions_uninterpreted_option_mutabl upb_Array* arr = upb_Message_GetOrCreateMutableArray( (upb_Message*)msg, &field, arena); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -4957,7 +5019,7 @@ UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MethodOptions_m upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__MethodOptions_msg_init(), 999); upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (google_protobuf_UninterpretedOption**)_upb_array_ptr(arr); } else { if (size) *size = 0; @@ -4971,12 +5033,14 @@ UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MethodOptions_r UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_MethodOptions_add_uninterpreted_option(google_protobuf_MethodOptions* msg, upb_Arena* arena) { upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__MethodOptions_msg_init(), 999); upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); - if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + if (!arr || !_upb_Array_ResizeUninitialized( + arr, arr->UPB_PRIVATE(size) + 1, arena)) { return NULL; } struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_Message_New(google__protobuf__UninterpretedOption_msg_init(), arena); if (!arr || !sub) return NULL; - UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub)); + UPB_PRIVATE(_upb_Array_Set) + (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub)); return sub; } @@ -5023,7 +5087,7 @@ UPB_INLINE const google_protobuf_UninterpretedOption_NamePart* const* google_pro const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__UninterpretedOption_msg_init(), 2); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (const google_protobuf_UninterpretedOption_NamePart* const*)_upb_array_constptr(arr); } else { if (size) *size = 0; @@ -5034,7 +5098,7 @@ UPB_INLINE const upb_Array* _google_protobuf_UninterpretedOption_name_upb_array( const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__UninterpretedOption_msg_init(), 2); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -5043,7 +5107,7 @@ UPB_INLINE upb_Array* _google_protobuf_UninterpretedOption_name_mutable_upb_arra upb_Array* arr = upb_Message_GetOrCreateMutableArray( (upb_Message*)msg, &field, arena); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -5142,7 +5206,7 @@ UPB_INLINE google_protobuf_UninterpretedOption_NamePart** google_protobuf_Uninte upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__UninterpretedOption_msg_init(), 2); upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (google_protobuf_UninterpretedOption_NamePart**)_upb_array_ptr(arr); } else { if (size) *size = 0; @@ -5156,12 +5220,14 @@ UPB_INLINE google_protobuf_UninterpretedOption_NamePart** google_protobuf_Uninte UPB_INLINE struct google_protobuf_UninterpretedOption_NamePart* google_protobuf_UninterpretedOption_add_name(google_protobuf_UninterpretedOption* msg, upb_Arena* arena) { upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__UninterpretedOption_msg_init(), 2); upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); - if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + if (!arr || !_upb_Array_ResizeUninitialized( + arr, arr->UPB_PRIVATE(size) + 1, arena)) { return NULL; } struct google_protobuf_UninterpretedOption_NamePart* sub = (struct google_protobuf_UninterpretedOption_NamePart*)_upb_Message_New(google__protobuf__UninterpretedOption__NamePart_msg_init(), arena); if (!arr || !sub) return NULL; - UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub)); + UPB_PRIVATE(_upb_Array_Set) + (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void google_protobuf_UninterpretedOption_set_identifier_value(google_protobuf_UninterpretedOption *msg, upb_StringView value) { @@ -5458,7 +5524,7 @@ UPB_INLINE const google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* co const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FeatureSetDefaults_msg_init(), 1); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (const google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* const*)_upb_array_constptr(arr); } else { if (size) *size = 0; @@ -5469,7 +5535,7 @@ UPB_INLINE const upb_Array* _google_protobuf_FeatureSetDefaults_defaults_upb_arr const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FeatureSetDefaults_msg_init(), 1); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -5478,7 +5544,7 @@ UPB_INLINE upb_Array* _google_protobuf_FeatureSetDefaults_defaults_mutable_upb_a upb_Array* arr = upb_Message_GetOrCreateMutableArray( (upb_Message*)msg, &field, arena); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -5517,7 +5583,7 @@ UPB_INLINE google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault** google_ upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FeatureSetDefaults_msg_init(), 1); upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault**)_upb_array_ptr(arr); } else { if (size) *size = 0; @@ -5531,12 +5597,14 @@ UPB_INLINE google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault** google_ UPB_INLINE struct google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* google_protobuf_FeatureSetDefaults_add_defaults(google_protobuf_FeatureSetDefaults* msg, upb_Arena* arena) { upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FeatureSetDefaults_msg_init(), 1); upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); - if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + if (!arr || !_upb_Array_ResizeUninitialized( + arr, arr->UPB_PRIVATE(size) + 1, arena)) { return NULL; } struct google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* sub = (struct google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault*)_upb_Message_New(google__protobuf__FeatureSetDefaults__FeatureSetEditionDefault_msg_init(), arena); if (!arr || !sub) return NULL; - UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub)); + UPB_PRIVATE(_upb_Array_Set) + (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE void google_protobuf_FeatureSetDefaults_set_minimum_edition(google_protobuf_FeatureSetDefaults *msg, int32_t value) { @@ -5674,7 +5742,7 @@ UPB_INLINE const google_protobuf_SourceCodeInfo_Location* const* google_protobuf const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__SourceCodeInfo_msg_init(), 1); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (const google_protobuf_SourceCodeInfo_Location* const*)_upb_array_constptr(arr); } else { if (size) *size = 0; @@ -5685,7 +5753,7 @@ UPB_INLINE const upb_Array* _google_protobuf_SourceCodeInfo_location_upb_array(c const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__SourceCodeInfo_msg_init(), 1); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -5694,7 +5762,7 @@ UPB_INLINE upb_Array* _google_protobuf_SourceCodeInfo_location_mutable_upb_array upb_Array* arr = upb_Message_GetOrCreateMutableArray( (upb_Message*)msg, &field, arena); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -5703,7 +5771,7 @@ UPB_INLINE google_protobuf_SourceCodeInfo_Location** google_protobuf_SourceCodeI upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__SourceCodeInfo_msg_init(), 1); upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (google_protobuf_SourceCodeInfo_Location**)_upb_array_ptr(arr); } else { if (size) *size = 0; @@ -5717,12 +5785,14 @@ UPB_INLINE google_protobuf_SourceCodeInfo_Location** google_protobuf_SourceCodeI UPB_INLINE struct google_protobuf_SourceCodeInfo_Location* google_protobuf_SourceCodeInfo_add_location(google_protobuf_SourceCodeInfo* msg, upb_Arena* arena) { upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__SourceCodeInfo_msg_init(), 1); upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); - if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + if (!arr || !_upb_Array_ResizeUninitialized( + arr, arr->UPB_PRIVATE(size) + 1, arena)) { return NULL; } struct google_protobuf_SourceCodeInfo_Location* sub = (struct google_protobuf_SourceCodeInfo_Location*)_upb_Message_New(google__protobuf__SourceCodeInfo__Location_msg_init(), arena); if (!arr || !sub) return NULL; - UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub)); + UPB_PRIVATE(_upb_Array_Set) + (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub)); return sub; } @@ -5769,7 +5839,7 @@ UPB_INLINE int32_t const* google_protobuf_SourceCodeInfo_Location_path(const goo const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__SourceCodeInfo__Location_msg_init(), 1); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (int32_t const*)_upb_array_constptr(arr); } else { if (size) *size = 0; @@ -5780,7 +5850,7 @@ UPB_INLINE const upb_Array* _google_protobuf_SourceCodeInfo_Location_path_upb_ar const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__SourceCodeInfo__Location_msg_init(), 1); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -5789,7 +5859,7 @@ UPB_INLINE upb_Array* _google_protobuf_SourceCodeInfo_Location_path_mutable_upb_ upb_Array* arr = upb_Message_GetOrCreateMutableArray( (upb_Message*)msg, &field, arena); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -5801,7 +5871,7 @@ UPB_INLINE int32_t const* google_protobuf_SourceCodeInfo_Location_span(const goo const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__SourceCodeInfo__Location_msg_init(), 2); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (int32_t const*)_upb_array_constptr(arr); } else { if (size) *size = 0; @@ -5812,7 +5882,7 @@ UPB_INLINE const upb_Array* _google_protobuf_SourceCodeInfo_Location_span_upb_ar const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__SourceCodeInfo__Location_msg_init(), 2); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -5821,7 +5891,7 @@ UPB_INLINE upb_Array* _google_protobuf_SourceCodeInfo_Location_span_mutable_upb_ upb_Array* arr = upb_Message_GetOrCreateMutableArray( (upb_Message*)msg, &field, arena); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -5863,7 +5933,7 @@ UPB_INLINE upb_StringView const* google_protobuf_SourceCodeInfo_Location_leading const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__SourceCodeInfo__Location_msg_init(), 6); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (upb_StringView const*)_upb_array_constptr(arr); } else { if (size) *size = 0; @@ -5874,7 +5944,7 @@ UPB_INLINE const upb_Array* _google_protobuf_SourceCodeInfo_Location_leading_det const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__SourceCodeInfo__Location_msg_init(), 6); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -5883,7 +5953,7 @@ UPB_INLINE upb_Array* _google_protobuf_SourceCodeInfo_Location_leading_detached_ upb_Array* arr = upb_Message_GetOrCreateMutableArray( (upb_Message*)msg, &field, arena); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -5892,7 +5962,7 @@ UPB_INLINE int32_t* google_protobuf_SourceCodeInfo_Location_mutable_path(google_ upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__SourceCodeInfo__Location_msg_init(), 1); upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (int32_t*)_upb_array_ptr(arr); } else { if (size) *size = 0; @@ -5906,17 +5976,19 @@ UPB_INLINE int32_t* google_protobuf_SourceCodeInfo_Location_resize_path(google_p UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_add_path(google_protobuf_SourceCodeInfo_Location* msg, int32_t val, upb_Arena* arena) { upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__SourceCodeInfo__Location_msg_init(), 1); upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); - if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + if (!arr || !_upb_Array_ResizeUninitialized( + arr, arr->UPB_PRIVATE(size) + 1, arena)) { return false; } - UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &val, sizeof(val)); + UPB_PRIVATE(_upb_Array_Set) + (arr, arr->UPB_PRIVATE(size) - 1, &val, sizeof(val)); return true; } UPB_INLINE int32_t* google_protobuf_SourceCodeInfo_Location_mutable_span(google_protobuf_SourceCodeInfo_Location* msg, size_t* size) { upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__SourceCodeInfo__Location_msg_init(), 2); upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (int32_t*)_upb_array_ptr(arr); } else { if (size) *size = 0; @@ -5930,10 +6002,12 @@ UPB_INLINE int32_t* google_protobuf_SourceCodeInfo_Location_resize_span(google_p UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_add_span(google_protobuf_SourceCodeInfo_Location* msg, int32_t val, upb_Arena* arena) { upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__SourceCodeInfo__Location_msg_init(), 2); upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); - if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + if (!arr || !_upb_Array_ResizeUninitialized( + arr, arr->UPB_PRIVATE(size) + 1, arena)) { return false; } - UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &val, sizeof(val)); + UPB_PRIVATE(_upb_Array_Set) + (arr, arr->UPB_PRIVATE(size) - 1, &val, sizeof(val)); return true; } UPB_INLINE void google_protobuf_SourceCodeInfo_Location_set_leading_comments(google_protobuf_SourceCodeInfo_Location *msg, upb_StringView value) { @@ -5948,7 +6022,7 @@ UPB_INLINE upb_StringView* google_protobuf_SourceCodeInfo_Location_mutable_leadi upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__SourceCodeInfo__Location_msg_init(), 6); upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (upb_StringView*)_upb_array_ptr(arr); } else { if (size) *size = 0; @@ -5962,10 +6036,12 @@ UPB_INLINE upb_StringView* google_protobuf_SourceCodeInfo_Location_resize_leadin UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_add_leading_detached_comments(google_protobuf_SourceCodeInfo_Location* msg, upb_StringView val, upb_Arena* arena) { upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__SourceCodeInfo__Location_msg_init(), 6); upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); - if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + if (!arr || !_upb_Array_ResizeUninitialized( + arr, arr->UPB_PRIVATE(size) + 1, arena)) { return false; } - UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &val, sizeof(val)); + UPB_PRIVATE(_upb_Array_Set) + (arr, arr->UPB_PRIVATE(size) - 1, &val, sizeof(val)); return true; } @@ -6012,7 +6088,7 @@ UPB_INLINE const google_protobuf_GeneratedCodeInfo_Annotation* const* google_pro const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__GeneratedCodeInfo_msg_init(), 1); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (const google_protobuf_GeneratedCodeInfo_Annotation* const*)_upb_array_constptr(arr); } else { if (size) *size = 0; @@ -6023,7 +6099,7 @@ UPB_INLINE const upb_Array* _google_protobuf_GeneratedCodeInfo_annotation_upb_ar const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__GeneratedCodeInfo_msg_init(), 1); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -6032,7 +6108,7 @@ UPB_INLINE upb_Array* _google_protobuf_GeneratedCodeInfo_annotation_mutable_upb_ upb_Array* arr = upb_Message_GetOrCreateMutableArray( (upb_Message*)msg, &field, arena); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -6041,7 +6117,7 @@ UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation** google_protobuf_Genera upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__GeneratedCodeInfo_msg_init(), 1); upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (google_protobuf_GeneratedCodeInfo_Annotation**)_upb_array_ptr(arr); } else { if (size) *size = 0; @@ -6055,12 +6131,14 @@ UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation** google_protobuf_Genera UPB_INLINE struct google_protobuf_GeneratedCodeInfo_Annotation* google_protobuf_GeneratedCodeInfo_add_annotation(google_protobuf_GeneratedCodeInfo* msg, upb_Arena* arena) { upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__GeneratedCodeInfo_msg_init(), 1); upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); - if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + if (!arr || !_upb_Array_ResizeUninitialized( + arr, arr->UPB_PRIVATE(size) + 1, arena)) { return NULL; } struct google_protobuf_GeneratedCodeInfo_Annotation* sub = (struct google_protobuf_GeneratedCodeInfo_Annotation*)_upb_Message_New(google__protobuf__GeneratedCodeInfo__Annotation_msg_init(), arena); if (!arr || !sub) return NULL; - UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub)); + UPB_PRIVATE(_upb_Array_Set) + (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub)); return sub; } @@ -6107,7 +6185,7 @@ UPB_INLINE int32_t const* google_protobuf_GeneratedCodeInfo_Annotation_path(cons const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__GeneratedCodeInfo__Annotation_msg_init(), 1); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (int32_t const*)_upb_array_constptr(arr); } else { if (size) *size = 0; @@ -6118,7 +6196,7 @@ UPB_INLINE const upb_Array* _google_protobuf_GeneratedCodeInfo_Annotation_path_u const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__GeneratedCodeInfo__Annotation_msg_init(), 1); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -6127,7 +6205,7 @@ UPB_INLINE upb_Array* _google_protobuf_GeneratedCodeInfo_Annotation_path_mutable upb_Array* arr = upb_Message_GetOrCreateMutableArray( (upb_Message*)msg, &field, arena); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -6196,7 +6274,7 @@ UPB_INLINE int32_t* google_protobuf_GeneratedCodeInfo_Annotation_mutable_path(go upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__GeneratedCodeInfo__Annotation_msg_init(), 1); upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (int32_t*)_upb_array_ptr(arr); } else { if (size) *size = 0; @@ -6210,10 +6288,12 @@ UPB_INLINE int32_t* google_protobuf_GeneratedCodeInfo_Annotation_resize_path(goo UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_add_path(google_protobuf_GeneratedCodeInfo_Annotation* msg, int32_t val, upb_Arena* arena) { upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__GeneratedCodeInfo__Annotation_msg_init(), 1); upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); - if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + if (!arr || !_upb_Array_ResizeUninitialized( + arr, arr->UPB_PRIVATE(size) + 1, arena)) { return false; } - UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &val, sizeof(val)); + UPB_PRIVATE(_upb_Array_Set) + (arr, arr->UPB_PRIVATE(size) - 1, &val, sizeof(val)); return true; } UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_source_file(google_protobuf_GeneratedCodeInfo_Annotation *msg, upb_StringView value) { diff --git a/upb/wire/decode.c b/upb/wire/decode.c index fdd780e198..214fca0798 100644 --- a/upb/wire/decode.c +++ b/upb/wire/decode.c @@ -133,9 +133,10 @@ static void _upb_Decoder_VerifyUtf8(upb_Decoder* d, const char* buf, int len) { } static bool _upb_Decoder_Reserve(upb_Decoder* d, upb_Array* arr, size_t elem) { - bool need_realloc = arr->UPB_PRIVATE(capacity) - arr->size < elem; - if (need_realloc && - !UPB_PRIVATE(_upb_Array_Realloc)(arr, arr->size + elem, &d->arena)) { + bool need_realloc = + arr->UPB_PRIVATE(capacity) - arr->UPB_PRIVATE(size) < elem; + if (need_realloc && !UPB_PRIVATE(_upb_Array_Realloc)( + arr, arr->UPB_PRIVATE(size) + elem, &d->arena)) { _upb_Decoder_ErrorJmp(d, kUpb_DecodeStatus_OutOfMemory); } return need_realloc; @@ -409,8 +410,8 @@ static const char* _upb_Decoder_DecodeEnumArray(upb_Decoder* d, const char* ptr, wireval* val) { const upb_MiniTableEnum* e = _upb_MiniTableSubs_EnumByField(subs, field); if (!_upb_Decoder_CheckEnum(d, ptr, msg, e, field, val)) return ptr; - void* mem = UPB_PTR_AT(_upb_array_ptr(arr), arr->size * 4, void); - arr->size++; + void* mem = UPB_PTR_AT(_upb_array_ptr(arr), arr->UPB_PRIVATE(size) * 4, void); + arr->UPB_PRIVATE(size)++; memcpy(mem, val, 4); return ptr; } @@ -426,8 +427,9 @@ static const char* _upb_Decoder_DecodeFixedPacked( _upb_Decoder_ErrorJmp(d, kUpb_DecodeStatus_Malformed); } _upb_Decoder_Reserve(d, arr, count); - void* mem = UPB_PTR_AT(_upb_array_ptr(arr), arr->size << lg2, void); - arr->size += count; + void* mem = + UPB_PTR_AT(_upb_array_ptr(arr), arr->UPB_PRIVATE(size) << lg2, void); + arr->UPB_PRIVATE(size) += count; // Note: if/when the decoder supports multi-buffer input, we will need to // handle buffer seams here. if (_upb_IsLittleEndian()) { @@ -457,15 +459,17 @@ static const char* _upb_Decoder_DecodeVarintPacked( const upb_MiniTableField* field, int lg2) { int scale = 1 << lg2; int saved_limit = upb_EpsCopyInputStream_PushLimit(&d->input, ptr, val->size); - char* out = UPB_PTR_AT(_upb_array_ptr(arr), arr->size << lg2, void); + char* out = + UPB_PTR_AT(_upb_array_ptr(arr), arr->UPB_PRIVATE(size) << lg2, void); while (!_upb_Decoder_IsDone(d, &ptr)) { wireval elem; ptr = _upb_Decoder_DecodeVarint(d, ptr, &elem.uint64_val); _upb_Decoder_Munge(field->UPB_PRIVATE(descriptortype), &elem); if (_upb_Decoder_Reserve(d, arr, 1)) { - out = UPB_PTR_AT(_upb_array_ptr(arr), arr->size << lg2, void); + out = + UPB_PTR_AT(_upb_array_ptr(arr), arr->UPB_PRIVATE(size) << lg2, void); } - arr->size++; + arr->UPB_PRIVATE(size)++; memcpy(out, &elem, scale); out += scale; } @@ -480,7 +484,7 @@ static const char* _upb_Decoder_DecodeEnumPacked( wireval* val) { const upb_MiniTableEnum* e = _upb_MiniTableSubs_EnumByField(subs, field); int saved_limit = upb_EpsCopyInputStream_PushLimit(&d->input, ptr, val->size); - char* out = UPB_PTR_AT(_upb_array_ptr(arr), arr->size * 4, void); + char* out = UPB_PTR_AT(_upb_array_ptr(arr), arr->UPB_PRIVATE(size) * 4, void); while (!_upb_Decoder_IsDone(d, &ptr)) { wireval elem; ptr = _upb_Decoder_DecodeVarint(d, ptr, &elem.uint64_val); @@ -489,9 +493,9 @@ static const char* _upb_Decoder_DecodeEnumPacked( continue; } if (_upb_Decoder_Reserve(d, arr, 1)) { - out = UPB_PTR_AT(_upb_array_ptr(arr), arr->size * 4, void); + out = UPB_PTR_AT(_upb_array_ptr(arr), arr->UPB_PRIVATE(size) * 4, void); } - arr->size++; + arr->UPB_PRIVATE(size)++; memcpy(out, &elem, 4); out += 4; } @@ -529,8 +533,8 @@ static const char* _upb_Decoder_DecodeToArray(upb_Decoder* d, const char* ptr, case kUpb_DecodeOp_Scalar4Byte: case kUpb_DecodeOp_Scalar8Byte: /* Append scalar value. */ - mem = UPB_PTR_AT(_upb_array_ptr(arr), arr->size << op, void); - arr->size++; + mem = UPB_PTR_AT(_upb_array_ptr(arr), arr->UPB_PRIVATE(size) << op, void); + arr->UPB_PRIVATE(size)++; memcpy(mem, val, 1 << op); return ptr; case kUpb_DecodeOp_String: @@ -538,16 +542,18 @@ static const char* _upb_Decoder_DecodeToArray(upb_Decoder* d, const char* ptr, /* Fallthrough. */ case kUpb_DecodeOp_Bytes: { /* Append bytes. */ - upb_StringView* str = (upb_StringView*)_upb_array_ptr(arr) + arr->size; - arr->size++; + upb_StringView* str = + (upb_StringView*)_upb_array_ptr(arr) + arr->UPB_PRIVATE(size); + arr->UPB_PRIVATE(size)++; return _upb_Decoder_ReadString(d, ptr, val->size, str); } case kUpb_DecodeOp_SubMessage: { /* Append submessage / group. */ upb_TaggedMessagePtr* target = UPB_PTR_AT( - _upb_array_ptr(arr), arr->size * sizeof(void*), upb_TaggedMessagePtr); + _upb_array_ptr(arr), arr->UPB_PRIVATE(size) * sizeof(void*), + upb_TaggedMessagePtr); upb_Message* submsg = _upb_Decoder_NewSubMessage(d, subs, field, target); - arr->size++; + arr->UPB_PRIVATE(size)++; if (UPB_UNLIKELY(field->UPB_PRIVATE(descriptortype) == kUpb_FieldType_Group)) { return _upb_Decoder_DecodeKnownGroup(d, ptr, submsg, subs, field); diff --git a/upb/wire/decode_fast.c b/upb/wire/decode_fast.c index 4aebbf1c8d..889bb6432d 100644 --- a/upb/wire/decode_fast.c +++ b/upb/wire/decode_fast.c @@ -193,7 +193,7 @@ static bool fastdecode_tagmatch(uint32_t tag, uint64_t data, int tagbytes) { UPB_FORCEINLINE static void fastdecode_commitarr(void* dst, fastdecode_arr* farr, int valbytes) { - farr->arr->size = + farr->arr->UPB_PRIVATE(size) = (size_t)((char*)dst - (char*)_upb_array_ptr(farr->arr)) / valbytes; } @@ -264,7 +264,7 @@ static void* fastdecode_getfield(upb_Decoder* d, const char* ptr, begin = _upb_array_ptr(farr->arr); farr->end = begin + (farr->arr->UPB_PRIVATE(capacity) * valbytes); *data = _upb_FastDecoder_LoadTag(ptr); - return begin + (farr->arr->size * valbytes); + return begin + (farr->arr->UPB_PRIVATE(size) * valbytes); } default: UPB_UNREACHABLE(); @@ -552,7 +552,7 @@ TAGBYTES(p) \ char* dst = _upb_array_ptr(arr); \ memcpy(dst, ptr, size); \ - arr->size = elems; \ + arr->UPB_PRIVATE(size) = elems; \ \ ptr += size; \ UPB_MUSTTAIL return fastdecode_dispatch(UPB_PARSE_ARGS); diff --git a/upb/wire/encode.c b/upb/wire/encode.c index 672f612012..bcc0b6edae 100644 --- a/upb/wire/encode.c +++ b/upb/wire/encode.c @@ -181,7 +181,7 @@ static void encode_tag(upb_encstate* e, uint32_t field_number, static void encode_fixedarray(upb_encstate* e, const upb_Array* arr, size_t elem_size, uint32_t tag) { - size_t bytes = arr->size * elem_size; + size_t bytes = arr->UPB_PRIVATE(size) * elem_size; const char* data = _upb_array_constptr(arr); const char* ptr = data + bytes - elem_size; @@ -313,14 +313,14 @@ static void encode_array(upb_encstate* e, const upb_Message* msg, bool packed = upb_MiniTableField_IsPacked(f); size_t pre_len = e->limit - e->ptr; - if (arr == NULL || arr->size == 0) { + if (arr == NULL || arr->UPB_PRIVATE(size) == 0) { return; } #define VARINT_CASE(ctype, encode) \ { \ const ctype* start = _upb_array_constptr(arr); \ - const ctype* ptr = start + arr->size; \ + const ctype* ptr = start + arr->UPB_PRIVATE(size); \ uint32_t tag = \ packed ? 0 : (f->UPB_PRIVATE(number) << 3) | kUpb_WireType_Varint; \ do { \ @@ -365,7 +365,7 @@ static void encode_array(upb_encstate* e, const upb_Message* msg, case kUpb_FieldType_String: case kUpb_FieldType_Bytes: { const upb_StringView* start = _upb_array_constptr(arr); - const upb_StringView* ptr = start + arr->size; + const upb_StringView* ptr = start + arr->UPB_PRIVATE(size); do { ptr--; encode_bytes(e, ptr->data, ptr->size); @@ -376,7 +376,7 @@ static void encode_array(upb_encstate* e, const upb_Message* msg, } case kUpb_FieldType_Group: { const upb_TaggedMessagePtr* start = _upb_array_constptr(arr); - const upb_TaggedMessagePtr* ptr = start + arr->size; + const upb_TaggedMessagePtr* ptr = start + arr->UPB_PRIVATE(size); const upb_MiniTable* subm = upb_MiniTableSub_Message(subs[f->UPB_PRIVATE(submsg_index)]); if (--e->depth == 0) encode_err(e, kUpb_EncodeStatus_MaxDepthExceeded); @@ -392,7 +392,7 @@ static void encode_array(upb_encstate* e, const upb_Message* msg, } case kUpb_FieldType_Message: { const upb_TaggedMessagePtr* start = _upb_array_constptr(arr); - const upb_TaggedMessagePtr* ptr = start + arr->size; + const upb_TaggedMessagePtr* ptr = start + arr->UPB_PRIVATE(size); const upb_MiniTable* subm = upb_MiniTableSub_Message(subs[f->UPB_PRIVATE(submsg_index)]); if (--e->depth == 0) encode_err(e, kUpb_EncodeStatus_MaxDepthExceeded); diff --git a/upb_generator/protoc-gen-upb.cc b/upb_generator/protoc-gen-upb.cc index 2d84796561..8a7e213f54 100644 --- a/upb_generator/protoc-gen-upb.cc +++ b/upb_generator/protoc-gen-upb.cc @@ -503,7 +503,7 @@ void GenerateRepeatedGetters(upb::FieldDefPtr field, const DefPoolPair& pools, const upb_MiniTableField field = $3; const upb_Array* arr = upb_Message_GetArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return ($0 const*)_upb_array_constptr(arr); } else { if (size) *size = 0; @@ -528,7 +528,7 @@ void GenerateRepeatedGetters(upb::FieldDefPtr field, const DefPoolPair& pools, const upb_MiniTableField field = $3; const upb_Array* arr = upb_Message_GetArray(msg, &field); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -537,7 +537,7 @@ void GenerateRepeatedGetters(upb::FieldDefPtr field, const DefPoolPair& pools, upb_Array* arr = upb_Message_GetOrCreateMutableArray( (upb_Message*)msg, &field, arena); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -649,7 +649,7 @@ void GenerateRepeatedSetters(upb::FieldDefPtr field, const DefPoolPair& pools, upb_MiniTableField field = $3; upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return ($0*)_upb_array_ptr(arr); } else { if (size) *size = 0; @@ -674,12 +674,14 @@ void GenerateRepeatedSetters(upb::FieldDefPtr field, const DefPoolPair& pools, UPB_INLINE struct $0* $1_add_$2($1* msg, upb_Arena* arena) { upb_MiniTableField field = $4; upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); - if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + if (!arr || !_upb_Array_ResizeUninitialized( + arr, arr->UPB_PRIVATE(size) + 1, arena)) { return NULL; } struct $0* sub = (struct $0*)_upb_Message_New($3, arena); if (!arr || !sub) return NULL; - UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub)); + UPB_PRIVATE(_upb_Array_Set) + (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub)); return sub; } )cc", @@ -692,10 +694,12 @@ void GenerateRepeatedSetters(upb::FieldDefPtr field, const DefPoolPair& pools, UPB_INLINE bool $1_add_$2($1* msg, $0 val, upb_Arena* arena) { upb_MiniTableField field = $3; upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); - if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + if (!arr || !_upb_Array_ResizeUninitialized( + arr, arr->UPB_PRIVATE(size) + 1, arena)) { return false; } - UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &val, sizeof(val)); + UPB_PRIVATE(_upb_Array_Set) + (arr, arr->UPB_PRIVATE(size) - 1, &val, sizeof(val)); return true; } )cc", diff --git a/upb_generator/stage0/google/protobuf/compiler/plugin.upb.h b/upb_generator/stage0/google/protobuf/compiler/plugin.upb.h index 27de0bc0e9..b354a86aab 100644 --- a/upb_generator/stage0/google/protobuf/compiler/plugin.upb.h +++ b/upb_generator/stage0/google/protobuf/compiler/plugin.upb.h @@ -196,7 +196,7 @@ UPB_INLINE upb_StringView const* google_protobuf_compiler_CodeGeneratorRequest_f const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__compiler__CodeGeneratorRequest_msg_init(), 1); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (upb_StringView const*)_upb_array_constptr(arr); } else { if (size) *size = 0; @@ -207,7 +207,7 @@ UPB_INLINE const upb_Array* _google_protobuf_compiler_CodeGeneratorRequest_file_ const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__compiler__CodeGeneratorRequest_msg_init(), 1); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -216,7 +216,7 @@ UPB_INLINE upb_Array* _google_protobuf_compiler_CodeGeneratorRequest_file_to_gen upb_Array* arr = upb_Message_GetOrCreateMutableArray( (upb_Message*)msg, &field, arena); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -258,7 +258,7 @@ UPB_INLINE const struct google_protobuf_FileDescriptorProto* const* google_proto const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__compiler__CodeGeneratorRequest_msg_init(), 15); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (const struct google_protobuf_FileDescriptorProto* const*)_upb_array_constptr(arr); } else { if (size) *size = 0; @@ -269,7 +269,7 @@ UPB_INLINE const upb_Array* _google_protobuf_compiler_CodeGeneratorRequest_proto const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__compiler__CodeGeneratorRequest_msg_init(), 15); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -278,7 +278,7 @@ UPB_INLINE upb_Array* _google_protobuf_compiler_CodeGeneratorRequest_proto_file_ upb_Array* arr = upb_Message_GetOrCreateMutableArray( (upb_Message*)msg, &field, arena); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -290,7 +290,7 @@ UPB_INLINE const struct google_protobuf_FileDescriptorProto* const* google_proto const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__compiler__CodeGeneratorRequest_msg_init(), 17); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (const struct google_protobuf_FileDescriptorProto* const*)_upb_array_constptr(arr); } else { if (size) *size = 0; @@ -301,7 +301,7 @@ UPB_INLINE const upb_Array* _google_protobuf_compiler_CodeGeneratorRequest_sourc const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__compiler__CodeGeneratorRequest_msg_init(), 17); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -310,7 +310,7 @@ UPB_INLINE upb_Array* _google_protobuf_compiler_CodeGeneratorRequest_source_file upb_Array* arr = upb_Message_GetOrCreateMutableArray( (upb_Message*)msg, &field, arena); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -319,7 +319,7 @@ UPB_INLINE upb_StringView* google_protobuf_compiler_CodeGeneratorRequest_mutable upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__compiler__CodeGeneratorRequest_msg_init(), 1); upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (upb_StringView*)_upb_array_ptr(arr); } else { if (size) *size = 0; @@ -333,10 +333,12 @@ UPB_INLINE upb_StringView* google_protobuf_compiler_CodeGeneratorRequest_resize_ UPB_INLINE bool google_protobuf_compiler_CodeGeneratorRequest_add_file_to_generate(google_protobuf_compiler_CodeGeneratorRequest* msg, upb_StringView val, upb_Arena* arena) { upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__compiler__CodeGeneratorRequest_msg_init(), 1); upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); - if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + if (!arr || !_upb_Array_ResizeUninitialized( + arr, arr->UPB_PRIVATE(size) + 1, arena)) { return false; } - UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &val, sizeof(val)); + UPB_PRIVATE(_upb_Array_Set) + (arr, arr->UPB_PRIVATE(size) - 1, &val, sizeof(val)); return true; } UPB_INLINE void google_protobuf_compiler_CodeGeneratorRequest_set_parameter(google_protobuf_compiler_CodeGeneratorRequest *msg, upb_StringView value) { @@ -359,7 +361,7 @@ UPB_INLINE struct google_protobuf_FileDescriptorProto** google_protobuf_compiler upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__compiler__CodeGeneratorRequest_msg_init(), 15); upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (struct google_protobuf_FileDescriptorProto**)_upb_array_ptr(arr); } else { if (size) *size = 0; @@ -373,19 +375,21 @@ UPB_INLINE struct google_protobuf_FileDescriptorProto** google_protobuf_compiler UPB_INLINE struct google_protobuf_FileDescriptorProto* google_protobuf_compiler_CodeGeneratorRequest_add_proto_file(google_protobuf_compiler_CodeGeneratorRequest* msg, upb_Arena* arena) { upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__compiler__CodeGeneratorRequest_msg_init(), 15); upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); - if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + if (!arr || !_upb_Array_ResizeUninitialized( + arr, arr->UPB_PRIVATE(size) + 1, arena)) { return NULL; } struct google_protobuf_FileDescriptorProto* sub = (struct google_protobuf_FileDescriptorProto*)_upb_Message_New(google__protobuf__FileDescriptorProto_msg_init(), arena); if (!arr || !sub) return NULL; - UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub)); + UPB_PRIVATE(_upb_Array_Set) + (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub)); return sub; } UPB_INLINE struct google_protobuf_FileDescriptorProto** google_protobuf_compiler_CodeGeneratorRequest_mutable_source_file_descriptors(google_protobuf_compiler_CodeGeneratorRequest* msg, size_t* size) { upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__compiler__CodeGeneratorRequest_msg_init(), 17); upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (struct google_protobuf_FileDescriptorProto**)_upb_array_ptr(arr); } else { if (size) *size = 0; @@ -399,12 +403,14 @@ UPB_INLINE struct google_protobuf_FileDescriptorProto** google_protobuf_compiler UPB_INLINE struct google_protobuf_FileDescriptorProto* google_protobuf_compiler_CodeGeneratorRequest_add_source_file_descriptors(google_protobuf_compiler_CodeGeneratorRequest* msg, upb_Arena* arena) { upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__compiler__CodeGeneratorRequest_msg_init(), 17); upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); - if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + if (!arr || !_upb_Array_ResizeUninitialized( + arr, arr->UPB_PRIVATE(size) + 1, arena)) { return NULL; } struct google_protobuf_FileDescriptorProto* sub = (struct google_protobuf_FileDescriptorProto*)_upb_Message_New(google__protobuf__FileDescriptorProto_msg_init(), arena); if (!arr || !sub) return NULL; - UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub)); + UPB_PRIVATE(_upb_Array_Set) + (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub)); return sub; } @@ -511,7 +517,7 @@ UPB_INLINE const google_protobuf_compiler_CodeGeneratorResponse_File* const* goo const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__compiler__CodeGeneratorResponse_msg_init(), 15); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (const google_protobuf_compiler_CodeGeneratorResponse_File* const*)_upb_array_constptr(arr); } else { if (size) *size = 0; @@ -522,7 +528,7 @@ UPB_INLINE const upb_Array* _google_protobuf_compiler_CodeGeneratorResponse_file const upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__compiler__CodeGeneratorResponse_msg_init(), 15); const upb_Array* arr = upb_Message_GetArray(msg, &field); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -531,7 +537,7 @@ UPB_INLINE upb_Array* _google_protobuf_compiler_CodeGeneratorResponse_file_mutab upb_Array* arr = upb_Message_GetOrCreateMutableArray( (upb_Message*)msg, &field, arena); if (size) { - *size = arr ? arr->size : 0; + *size = arr ? arr->UPB_PRIVATE(size) : 0; } return arr; } @@ -556,7 +562,7 @@ UPB_INLINE google_protobuf_compiler_CodeGeneratorResponse_File** google_protobuf upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__compiler__CodeGeneratorResponse_msg_init(), 15); upb_Array* arr = upb_Message_GetMutableArray(msg, &field); if (arr) { - if (size) *size = arr->size; + if (size) *size = arr->UPB_PRIVATE(size); return (google_protobuf_compiler_CodeGeneratorResponse_File**)_upb_array_ptr(arr); } else { if (size) *size = 0; @@ -570,12 +576,14 @@ UPB_INLINE google_protobuf_compiler_CodeGeneratorResponse_File** google_protobuf UPB_INLINE struct google_protobuf_compiler_CodeGeneratorResponse_File* google_protobuf_compiler_CodeGeneratorResponse_add_file(google_protobuf_compiler_CodeGeneratorResponse* msg, upb_Arena* arena) { upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__compiler__CodeGeneratorResponse_msg_init(), 15); upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena); - if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) { + if (!arr || !_upb_Array_ResizeUninitialized( + arr, arr->UPB_PRIVATE(size) + 1, arena)) { return NULL; } struct google_protobuf_compiler_CodeGeneratorResponse_File* sub = (struct google_protobuf_compiler_CodeGeneratorResponse_File*)_upb_Message_New(google__protobuf__compiler__CodeGeneratorResponse__File_msg_init(), arena); if (!arr || !sub) return NULL; - UPB_PRIVATE(_upb_Array_Set)(arr, arr->size - 1, &sub, sizeof(sub)); + UPB_PRIVATE(_upb_Array_Set) + (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub)); return sub; }