upb: finish locking down the upb_Array internals

PiperOrigin-RevId: 597629658
pull/15379/head
Eric Salo 1 year ago committed by Copybara-Service
parent 1581e72425
commit c7f44a02eb
  1. 6
      upb/message/accessors.h
  2. 30
      upb/message/array.c
  3. 13
      upb/message/array.h
  4. 2
      upb/message/copy.c
  5. 18
      upb/message/internal/array.h
  6. 2
      upb/message/promote.c
  7. 240
      upb/reflection/stage0/google/protobuf/descriptor.upb.h
  8. 30
      upb/wire/decode.c
  9. 10
      upb/wire/encode.c
  10. 11
      upb/wire/internal/decode_fast.c
  11. 8
      upb_generator/protoc-gen-upb.cc
  12. 24
      upb_generator/stage0/google/protobuf/compiler/plugin.upb.h

@ -417,8 +417,10 @@ UPB_API_INLINE void* upb_Message_ResizeArrayUninitialized(
upb_Arena* arena) {
UPB_PRIVATE(_upb_MiniTableField_CheckIsArray)(field);
upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, field, arena);
if (!arr || !_upb_Array_ResizeUninitialized(arr, size, arena)) return NULL;
return _upb_array_ptr(arr);
if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(arr, size, arena)) {
return NULL;
}
return upb_Array_MutableDataPtr(arr);
}
UPB_API_INLINE const upb_Map* upb_Message_GetMap(

@ -23,17 +23,9 @@ upb_Array* upb_Array_New(upb_Arena* a, upb_CType type) {
return UPB_PRIVATE(_upb_Array_New)(a, 4, lg2);
}
const void* upb_Array_DataPtr(const upb_Array* arr) {
return _upb_array_ptr((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->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 char* data = upb_Array_DataPtr(arr);
const int lg2 = UPB_PRIVATE(_upb_Array_ElemSizeLg2)(arr);
UPB_ASSERT(i < arr->UPB_PRIVATE(size));
memcpy(&ret, data + (i << lg2), 1 << lg2);
@ -42,7 +34,7 @@ upb_MessageValue upb_Array_Get(const upb_Array* arr, size_t i) {
upb_MutableMessageValue upb_Array_GetMutable(upb_Array* arr, size_t i) {
upb_MutableMessageValue ret;
char* data = _upb_array_ptr(arr);
char* data = upb_Array_MutableDataPtr(arr);
const int lg2 = UPB_PRIVATE(_upb_Array_ElemSizeLg2)(arr);
UPB_ASSERT(i < arr->UPB_PRIVATE(size));
memcpy(&ret, data + (i << lg2), 1 << lg2);
@ -50,7 +42,7 @@ upb_MutableMessageValue upb_Array_GetMutable(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);
char* data = upb_Array_MutableDataPtr(arr);
const int lg2 = UPB_PRIVATE(_upb_Array_ElemSizeLg2)(arr);
UPB_ASSERT(i < arr->UPB_PRIVATE(size));
memcpy(data + (i << lg2), &val, 1 << lg2);
@ -58,7 +50,8 @@ void upb_Array_Set(upb_Array* arr, size_t i, upb_MessageValue val) {
bool upb_Array_Append(upb_Array* arr, upb_MessageValue val, upb_Arena* arena) {
UPB_ASSERT(arena);
if (!_upb_Array_ResizeUninitialized(arr, arr->UPB_PRIVATE(size) + 1, arena)) {
if (!UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
arr, arr->UPB_PRIVATE(size) + 1, arena)) {
return false;
}
upb_Array_Set(arr, arr->UPB_PRIVATE(size) - 1, val);
@ -68,7 +61,7 @@ bool upb_Array_Append(upb_Array* arr, upb_MessageValue val, upb_Arena* arena) {
void upb_Array_Move(upb_Array* arr, size_t dst_idx, size_t src_idx,
size_t count) {
const int lg2 = UPB_PRIVATE(_upb_Array_ElemSizeLg2)(arr);
char* data = _upb_array_ptr(arr);
char* data = upb_Array_MutableDataPtr(arr);
memmove(&data[dst_idx << lg2], &data[src_idx << lg2], count << lg2);
}
@ -78,8 +71,8 @@ bool upb_Array_Insert(upb_Array* arr, size_t i, size_t count,
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)) {
if (!UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
arr, arr->UPB_PRIVATE(size) + count, arena)) {
return false;
}
upb_Array_Move(arr, i + count, i, oldsize - i);
@ -100,13 +93,14 @@ void upb_Array_Delete(upb_Array* arr, size_t i, size_t count) {
bool upb_Array_Resize(upb_Array* arr, size_t size, upb_Arena* arena) {
const size_t oldsize = arr->UPB_PRIVATE(size);
if (UPB_UNLIKELY(!_upb_Array_ResizeUninitialized(arr, size, arena))) {
if (UPB_UNLIKELY(
!UPB_PRIVATE(_upb_Array_ResizeUninitialized)(arr, size, arena))) {
return false;
}
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);
char* data = upb_Array_MutableDataPtr(arr);
memset(data + (oldsize << lg2), 0, (newsize - oldsize) << lg2);
}
return true;
@ -117,7 +111,7 @@ bool UPB_PRIVATE(_upb_Array_Realloc)(upb_Array* array, size_t min_capacity,
size_t new_capacity = UPB_MAX(array->UPB_PRIVATE(capacity), 4);
const int lg2 = UPB_PRIVATE(_upb_Array_ElemSizeLg2)(array);
size_t old_bytes = array->UPB_PRIVATE(capacity) << lg2;
void* ptr = _upb_array_ptr(array);
void* ptr = upb_Array_MutableDataPtr(array);
// Log2 ceiling of size.
while (new_capacity < min_capacity) new_capacity *= 2;

@ -12,6 +12,7 @@
#include "upb/base/descriptor_constants.h"
#include "upb/mem/arena.h"
#include "upb/message/internal/array.h"
#include "upb/message/value.h"
// Must be last.
@ -27,7 +28,9 @@ extern "C" {
UPB_API upb_Array* upb_Array_New(upb_Arena* a, upb_CType type);
// Returns the number of elements in the array.
UPB_API size_t upb_Array_Size(const upb_Array* arr);
UPB_API_INLINE size_t upb_Array_Size(const upb_Array* arr) {
return UPB_PRIVATE(_upb_Array_Size)(arr);
}
// Returns the given element, which must be within the array's current size.
UPB_API upb_MessageValue upb_Array_Get(const upb_Array* arr, size_t i);
@ -65,10 +68,14 @@ UPB_API void upb_Array_Delete(upb_Array* array, size_t i, size_t count);
UPB_API bool upb_Array_Resize(upb_Array* array, size_t size, upb_Arena* arena);
// Returns pointer to array data.
UPB_API const void* upb_Array_DataPtr(const upb_Array* arr);
UPB_API_INLINE const void* upb_Array_DataPtr(const upb_Array* arr) {
return UPB_PRIVATE(_upb_Array_DataPtr)(arr);
}
// Returns mutable pointer to array data.
UPB_API void* upb_Array_MutableDataPtr(upb_Array* arr);
UPB_API_INLINE void* upb_Array_MutableDataPtr(upb_Array* arr) {
return UPB_PRIVATE(_upb_Array_MutableDataPtr)(arr);
}
#ifdef __cplusplus
} /* extern "C" */

@ -145,7 +145,7 @@ upb_Array* upb_Array_DeepClone(const upb_Array* array, upb_CType value_type,
if (!cloned_array) {
return NULL;
}
if (!_upb_Array_ResizeUninitialized(cloned_array, size, arena)) {
if (!UPB_PRIVATE(_upb_Array_ResizeUninitialized)(cloned_array, size, arena)) {
return NULL;
}
for (size_t i = 0; i < size; ++i) {

@ -55,13 +55,15 @@ UPB_PRIVATE(_upb_Array_ElemSizeLg2)(const struct upb_Array* array) {
return lg2;
}
UPB_INLINE const void* _upb_array_constptr(const struct upb_Array* array) {
UPB_INLINE const void* UPB_PRIVATE(_upb_Array_DataPtr)(
const struct upb_Array* array) {
UPB_PRIVATE(_upb_Array_ElemSizeLg2)(array); // Check assertions.
return (void*)(array->UPB_ONLYBITS(data) & ~(uintptr_t)_UPB_ARRAY_MASK_ALL);
}
UPB_INLINE void* _upb_array_ptr(struct upb_Array* array) {
return (void*)_upb_array_constptr(array);
UPB_INLINE void* UPB_PRIVATE(_upb_Array_MutableDataPtr)(
struct upb_Array* array) {
return (void*)UPB_PRIVATE(_upb_Array_DataPtr)(array);
}
UPB_INLINE struct upb_Array* UPB_PRIVATE(_upb_Array_New)(upb_Arena* arena,
@ -93,8 +95,8 @@ UPB_INLINE bool UPB_PRIVATE(_upb_Array_Reserve)(struct upb_Array* array,
}
// Resize without initializing new elements.
UPB_INLINE bool _upb_Array_ResizeUninitialized(struct upb_Array* array,
size_t size, upb_Arena* arena) {
UPB_INLINE bool UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
struct upb_Array* array, size_t size, upb_Arena* arena) {
UPB_ASSERT(size <= array->UPB_ONLYBITS(size) ||
arena); // Allow NULL arena when shrinking.
if (!UPB_PRIVATE(_upb_Array_Reserve)(array, size, arena)) return false;
@ -110,10 +112,14 @@ UPB_INLINE void UPB_PRIVATE(_upb_Array_Set)(struct upb_Array* array, size_t i,
size_t elem_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);
char* arr_data = (char*)UPB_PRIVATE(_upb_Array_MutableDataPtr)(array);
memcpy(arr_data + (i * elem_size), data, elem_size);
}
UPB_INLINE size_t UPB_PRIVATE(_upb_Array_Size)(const struct upb_Array* arr) {
return arr->UPB_ONLYBITS(size);
}
// LINT.ThenChange(
// GoogleInternalName1,
//)

@ -193,7 +193,7 @@ upb_DecodeStatus upb_Array_PromoteMessages(upb_Array* arr,
const upb_MiniTable* mini_table,
int decode_options,
upb_Arena* arena) {
void** data = _upb_array_ptr(arr);
void** data = upb_Array_MutableDataPtr(arr);
size_t size = arr->UPB_PRIVATE(size);
for (size_t i = 0; i < size; i++) {
upb_TaggedMessagePtr tagged;

@ -279,7 +279,7 @@ UPB_INLINE const google_protobuf_FileDescriptorProto* const* google_protobuf_Fil
const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (const google_protobuf_FileDescriptorProto* const*)_upb_array_constptr(arr);
return (const google_protobuf_FileDescriptorProto* const*)upb_Array_DataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -308,7 +308,7 @@ UPB_INLINE google_protobuf_FileDescriptorProto** google_protobuf_FileDescriptorS
upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (google_protobuf_FileDescriptorProto**)_upb_array_ptr(arr);
return (google_protobuf_FileDescriptorProto**)upb_Array_MutableDataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -323,7 +323,7 @@ UPB_INLINE struct google_protobuf_FileDescriptorProto* google_protobuf_FileDescr
upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FileDescriptorSet_msg_init(), 1);
upb_Array* arr = upb_Message_GetOrCreateMutableArray(
UPB_UPCAST(msg), &field, arena);
if (!arr || !_upb_Array_ResizeUninitialized(
if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
arr, arr->UPB_PRIVATE(size) + 1, arena)) {
return NULL;
}
@ -411,7 +411,7 @@ UPB_INLINE upb_StringView const* google_protobuf_FileDescriptorProto_dependency(
const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (upb_StringView const*)_upb_array_constptr(arr);
return (upb_StringView const*)upb_Array_DataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -443,7 +443,7 @@ UPB_INLINE const google_protobuf_DescriptorProto* const* google_protobuf_FileDes
const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (const google_protobuf_DescriptorProto* const*)_upb_array_constptr(arr);
return (const google_protobuf_DescriptorProto* const*)upb_Array_DataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -475,7 +475,7 @@ UPB_INLINE const google_protobuf_EnumDescriptorProto* const* google_protobuf_Fil
const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (const google_protobuf_EnumDescriptorProto* const*)_upb_array_constptr(arr);
return (const google_protobuf_EnumDescriptorProto* const*)upb_Array_DataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -507,7 +507,7 @@ UPB_INLINE const google_protobuf_ServiceDescriptorProto* const* google_protobuf_
const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (const google_protobuf_ServiceDescriptorProto* const*)_upb_array_constptr(arr);
return (const google_protobuf_ServiceDescriptorProto* const*)upb_Array_DataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -539,7 +539,7 @@ UPB_INLINE const google_protobuf_FieldDescriptorProto* const* google_protobuf_Fi
const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (const google_protobuf_FieldDescriptorProto* const*)_upb_array_constptr(arr);
return (const google_protobuf_FieldDescriptorProto* const*)upb_Array_DataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -603,7 +603,7 @@ UPB_INLINE int32_t const* google_protobuf_FileDescriptorProto_public_dependency(
const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (int32_t const*)_upb_array_constptr(arr);
return (int32_t const*)upb_Array_DataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -635,7 +635,7 @@ UPB_INLINE int32_t const* google_protobuf_FileDescriptorProto_weak_dependency(co
const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (int32_t const*)_upb_array_constptr(arr);
return (int32_t const*)upb_Array_DataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -704,7 +704,7 @@ UPB_INLINE upb_StringView* google_protobuf_FileDescriptorProto_mutable_dependenc
upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (upb_StringView*)_upb_array_ptr(arr);
return (upb_StringView*)upb_Array_MutableDataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -719,7 +719,7 @@ UPB_INLINE bool google_protobuf_FileDescriptorProto_add_dependency(google_protob
upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FileDescriptorProto_msg_init(), 3);
upb_Array* arr = upb_Message_GetOrCreateMutableArray(
UPB_UPCAST(msg), &field, arena);
if (!arr || !_upb_Array_ResizeUninitialized(
if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
arr, arr->UPB_PRIVATE(size) + 1, arena)) {
return false;
}
@ -732,7 +732,7 @@ UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_FileDescriptorProto
upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (google_protobuf_DescriptorProto**)_upb_array_ptr(arr);
return (google_protobuf_DescriptorProto**)upb_Array_MutableDataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -747,7 +747,7 @@ UPB_INLINE struct google_protobuf_DescriptorProto* google_protobuf_FileDescripto
upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FileDescriptorProto_msg_init(), 4);
upb_Array* arr = upb_Message_GetOrCreateMutableArray(
UPB_UPCAST(msg), &field, arena);
if (!arr || !_upb_Array_ResizeUninitialized(
if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
arr, arr->UPB_PRIVATE(size) + 1, arena)) {
return NULL;
}
@ -762,7 +762,7 @@ UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_FileDescriptorP
upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (google_protobuf_EnumDescriptorProto**)_upb_array_ptr(arr);
return (google_protobuf_EnumDescriptorProto**)upb_Array_MutableDataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -777,7 +777,7 @@ UPB_INLINE struct google_protobuf_EnumDescriptorProto* google_protobuf_FileDescr
upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FileDescriptorProto_msg_init(), 5);
upb_Array* arr = upb_Message_GetOrCreateMutableArray(
UPB_UPCAST(msg), &field, arena);
if (!arr || !_upb_Array_ResizeUninitialized(
if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
arr, arr->UPB_PRIVATE(size) + 1, arena)) {
return NULL;
}
@ -792,7 +792,7 @@ UPB_INLINE google_protobuf_ServiceDescriptorProto** google_protobuf_FileDescript
upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (google_protobuf_ServiceDescriptorProto**)_upb_array_ptr(arr);
return (google_protobuf_ServiceDescriptorProto**)upb_Array_MutableDataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -807,7 +807,7 @@ UPB_INLINE struct google_protobuf_ServiceDescriptorProto* google_protobuf_FileDe
upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FileDescriptorProto_msg_init(), 6);
upb_Array* arr = upb_Message_GetOrCreateMutableArray(
UPB_UPCAST(msg), &field, arena);
if (!arr || !_upb_Array_ResizeUninitialized(
if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
arr, arr->UPB_PRIVATE(size) + 1, arena)) {
return NULL;
}
@ -822,7 +822,7 @@ UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_FileDescriptor
upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (google_protobuf_FieldDescriptorProto**)_upb_array_ptr(arr);
return (google_protobuf_FieldDescriptorProto**)upb_Array_MutableDataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -837,7 +837,7 @@ UPB_INLINE struct google_protobuf_FieldDescriptorProto* google_protobuf_FileDesc
upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FileDescriptorProto_msg_init(), 7);
upb_Array* arr = upb_Message_GetOrCreateMutableArray(
UPB_UPCAST(msg), &field, arena);
if (!arr || !_upb_Array_ResizeUninitialized(
if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
arr, arr->UPB_PRIVATE(size) + 1, arena)) {
return NULL;
}
@ -876,7 +876,7 @@ UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_mutable_public_dependenc
upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (int32_t*)_upb_array_ptr(arr);
return (int32_t*)upb_Array_MutableDataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -891,7 +891,7 @@ UPB_INLINE bool google_protobuf_FileDescriptorProto_add_public_dependency(google
upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FileDescriptorProto_msg_init(), 10);
upb_Array* arr = upb_Message_GetOrCreateMutableArray(
UPB_UPCAST(msg), &field, arena);
if (!arr || !_upb_Array_ResizeUninitialized(
if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
arr, arr->UPB_PRIVATE(size) + 1, arena)) {
return false;
}
@ -904,7 +904,7 @@ UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_mutable_weak_dependency(
upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (int32_t*)_upb_array_ptr(arr);
return (int32_t*)upb_Array_MutableDataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -919,7 +919,7 @@ UPB_INLINE bool google_protobuf_FileDescriptorProto_add_weak_dependency(google_p
upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FileDescriptorProto_msg_init(), 11);
upb_Array* arr = upb_Message_GetOrCreateMutableArray(
UPB_UPCAST(msg), &field, arena);
if (!arr || !_upb_Array_ResizeUninitialized(
if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
arr, arr->UPB_PRIVATE(size) + 1, arena)) {
return false;
}
@ -997,7 +997,7 @@ UPB_INLINE const google_protobuf_FieldDescriptorProto* const* google_protobuf_De
const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (const google_protobuf_FieldDescriptorProto* const*)_upb_array_constptr(arr);
return (const google_protobuf_FieldDescriptorProto* const*)upb_Array_DataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -1029,7 +1029,7 @@ UPB_INLINE const google_protobuf_DescriptorProto* const* google_protobuf_Descrip
const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (const google_protobuf_DescriptorProto* const*)_upb_array_constptr(arr);
return (const google_protobuf_DescriptorProto* const*)upb_Array_DataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -1061,7 +1061,7 @@ UPB_INLINE const google_protobuf_EnumDescriptorProto* const* google_protobuf_Des
const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (const google_protobuf_EnumDescriptorProto* const*)_upb_array_constptr(arr);
return (const google_protobuf_EnumDescriptorProto* const*)upb_Array_DataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -1093,7 +1093,7 @@ UPB_INLINE const google_protobuf_DescriptorProto_ExtensionRange* const* google_p
const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (const google_protobuf_DescriptorProto_ExtensionRange* const*)_upb_array_constptr(arr);
return (const google_protobuf_DescriptorProto_ExtensionRange* const*)upb_Array_DataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -1125,7 +1125,7 @@ UPB_INLINE const google_protobuf_FieldDescriptorProto* const* google_protobuf_De
const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (const google_protobuf_FieldDescriptorProto* const*)_upb_array_constptr(arr);
return (const google_protobuf_FieldDescriptorProto* const*)upb_Array_DataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -1173,7 +1173,7 @@ UPB_INLINE const google_protobuf_OneofDescriptorProto* const* google_protobuf_De
const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (const google_protobuf_OneofDescriptorProto* const*)_upb_array_constptr(arr);
return (const google_protobuf_OneofDescriptorProto* const*)upb_Array_DataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -1205,7 +1205,7 @@ UPB_INLINE const google_protobuf_DescriptorProto_ReservedRange* const* google_pr
const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (const google_protobuf_DescriptorProto_ReservedRange* const*)_upb_array_constptr(arr);
return (const google_protobuf_DescriptorProto_ReservedRange* const*)upb_Array_DataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -1237,7 +1237,7 @@ UPB_INLINE upb_StringView const* google_protobuf_DescriptorProto_reserved_name(c
const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (upb_StringView const*)_upb_array_constptr(arr);
return (upb_StringView const*)upb_Array_DataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -1270,7 +1270,7 @@ UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProt
upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (google_protobuf_FieldDescriptorProto**)_upb_array_ptr(arr);
return (google_protobuf_FieldDescriptorProto**)upb_Array_MutableDataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -1285,7 +1285,7 @@ UPB_INLINE struct google_protobuf_FieldDescriptorProto* google_protobuf_Descript
upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__DescriptorProto_msg_init(), 2);
upb_Array* arr = upb_Message_GetOrCreateMutableArray(
UPB_UPCAST(msg), &field, arena);
if (!arr || !_upb_Array_ResizeUninitialized(
if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
arr, arr->UPB_PRIVATE(size) + 1, arena)) {
return NULL;
}
@ -1300,7 +1300,7 @@ UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_DescriptorProto_mut
upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (google_protobuf_DescriptorProto**)_upb_array_ptr(arr);
return (google_protobuf_DescriptorProto**)upb_Array_MutableDataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -1315,7 +1315,7 @@ UPB_INLINE struct google_protobuf_DescriptorProto* google_protobuf_DescriptorPro
upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__DescriptorProto_msg_init(), 3);
upb_Array* arr = upb_Message_GetOrCreateMutableArray(
UPB_UPCAST(msg), &field, arena);
if (!arr || !_upb_Array_ResizeUninitialized(
if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
arr, arr->UPB_PRIVATE(size) + 1, arena)) {
return NULL;
}
@ -1330,7 +1330,7 @@ UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_DescriptorProto
upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (google_protobuf_EnumDescriptorProto**)_upb_array_ptr(arr);
return (google_protobuf_EnumDescriptorProto**)upb_Array_MutableDataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -1345,7 +1345,7 @@ UPB_INLINE struct google_protobuf_EnumDescriptorProto* google_protobuf_Descripto
upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__DescriptorProto_msg_init(), 4);
upb_Array* arr = upb_Message_GetOrCreateMutableArray(
UPB_UPCAST(msg), &field, arena);
if (!arr || !_upb_Array_ResizeUninitialized(
if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
arr, arr->UPB_PRIVATE(size) + 1, arena)) {
return NULL;
}
@ -1360,7 +1360,7 @@ UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange** google_protobuf_Desc
upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (google_protobuf_DescriptorProto_ExtensionRange**)_upb_array_ptr(arr);
return (google_protobuf_DescriptorProto_ExtensionRange**)upb_Array_MutableDataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -1375,7 +1375,7 @@ UPB_INLINE struct google_protobuf_DescriptorProto_ExtensionRange* google_protobu
upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__DescriptorProto_msg_init(), 5);
upb_Array* arr = upb_Message_GetOrCreateMutableArray(
UPB_UPCAST(msg), &field, arena);
if (!arr || !_upb_Array_ResizeUninitialized(
if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
arr, arr->UPB_PRIVATE(size) + 1, arena)) {
return NULL;
}
@ -1390,7 +1390,7 @@ UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProt
upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (google_protobuf_FieldDescriptorProto**)_upb_array_ptr(arr);
return (google_protobuf_FieldDescriptorProto**)upb_Array_MutableDataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -1405,7 +1405,7 @@ UPB_INLINE struct google_protobuf_FieldDescriptorProto* google_protobuf_Descript
upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__DescriptorProto_msg_init(), 6);
upb_Array* arr = upb_Message_GetOrCreateMutableArray(
UPB_UPCAST(msg), &field, arena);
if (!arr || !_upb_Array_ResizeUninitialized(
if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
arr, arr->UPB_PRIVATE(size) + 1, arena)) {
return NULL;
}
@ -1432,7 +1432,7 @@ UPB_INLINE google_protobuf_OneofDescriptorProto** google_protobuf_DescriptorProt
upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (google_protobuf_OneofDescriptorProto**)_upb_array_ptr(arr);
return (google_protobuf_OneofDescriptorProto**)upb_Array_MutableDataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -1447,7 +1447,7 @@ UPB_INLINE struct google_protobuf_OneofDescriptorProto* google_protobuf_Descript
upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__DescriptorProto_msg_init(), 8);
upb_Array* arr = upb_Message_GetOrCreateMutableArray(
UPB_UPCAST(msg), &field, arena);
if (!arr || !_upb_Array_ResizeUninitialized(
if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
arr, arr->UPB_PRIVATE(size) + 1, arena)) {
return NULL;
}
@ -1462,7 +1462,7 @@ UPB_INLINE google_protobuf_DescriptorProto_ReservedRange** google_protobuf_Descr
upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (google_protobuf_DescriptorProto_ReservedRange**)_upb_array_ptr(arr);
return (google_protobuf_DescriptorProto_ReservedRange**)upb_Array_MutableDataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -1477,7 +1477,7 @@ UPB_INLINE struct google_protobuf_DescriptorProto_ReservedRange* google_protobuf
upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__DescriptorProto_msg_init(), 9);
upb_Array* arr = upb_Message_GetOrCreateMutableArray(
UPB_UPCAST(msg), &field, arena);
if (!arr || !_upb_Array_ResizeUninitialized(
if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
arr, arr->UPB_PRIVATE(size) + 1, arena)) {
return NULL;
}
@ -1492,7 +1492,7 @@ UPB_INLINE upb_StringView* google_protobuf_DescriptorProto_mutable_reserved_name
upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (upb_StringView*)_upb_array_ptr(arr);
return (upb_StringView*)upb_Array_MutableDataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -1507,7 +1507,7 @@ UPB_INLINE bool google_protobuf_DescriptorProto_add_reserved_name(google_protobu
upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__DescriptorProto_msg_init(), 10);
upb_Array* arr = upb_Message_GetOrCreateMutableArray(
UPB_UPCAST(msg), &field, arena);
if (!arr || !_upb_Array_ResizeUninitialized(
if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
arr, arr->UPB_PRIVATE(size) + 1, arena)) {
return false;
}
@ -1745,7 +1745,7 @@ UPB_INLINE const google_protobuf_ExtensionRangeOptions_Declaration* const* googl
const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (const google_protobuf_ExtensionRangeOptions_Declaration* const*)_upb_array_constptr(arr);
return (const google_protobuf_ExtensionRangeOptions_Declaration* const*)upb_Array_DataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -1809,7 +1809,7 @@ UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_Ext
const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (const google_protobuf_UninterpretedOption* const*)_upb_array_constptr(arr);
return (const google_protobuf_UninterpretedOption* const*)upb_Array_DataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -1838,7 +1838,7 @@ UPB_INLINE google_protobuf_ExtensionRangeOptions_Declaration** google_protobuf_E
upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (google_protobuf_ExtensionRangeOptions_Declaration**)_upb_array_ptr(arr);
return (google_protobuf_ExtensionRangeOptions_Declaration**)upb_Array_MutableDataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -1853,7 +1853,7 @@ UPB_INLINE struct google_protobuf_ExtensionRangeOptions_Declaration* google_prot
upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__ExtensionRangeOptions_msg_init(), 2);
upb_Array* arr = upb_Message_GetOrCreateMutableArray(
UPB_UPCAST(msg), &field, arena);
if (!arr || !_upb_Array_ResizeUninitialized(
if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
arr, arr->UPB_PRIVATE(size) + 1, arena)) {
return NULL;
}
@ -1884,7 +1884,7 @@ UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ExtensionRangeO
upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (google_protobuf_UninterpretedOption**)_upb_array_ptr(arr);
return (google_protobuf_UninterpretedOption**)upb_Array_MutableDataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -1899,7 +1899,7 @@ UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_Extension
upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__ExtensionRangeOptions_msg_init(), 999);
upb_Array* arr = upb_Message_GetOrCreateMutableArray(
UPB_UPCAST(msg), &field, arena);
if (!arr || !_upb_Array_ResizeUninitialized(
if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
arr, arr->UPB_PRIVATE(size) + 1, arena)) {
return NULL;
}
@ -2461,7 +2461,7 @@ UPB_INLINE const google_protobuf_EnumValueDescriptorProto* const* google_protobu
const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (const google_protobuf_EnumValueDescriptorProto* const*)_upb_array_constptr(arr);
return (const google_protobuf_EnumValueDescriptorProto* const*)upb_Array_DataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -2509,7 +2509,7 @@ UPB_INLINE const google_protobuf_EnumDescriptorProto_EnumReservedRange* const* g
const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (const google_protobuf_EnumDescriptorProto_EnumReservedRange* const*)_upb_array_constptr(arr);
return (const google_protobuf_EnumDescriptorProto_EnumReservedRange* const*)upb_Array_DataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -2541,7 +2541,7 @@ UPB_INLINE upb_StringView const* google_protobuf_EnumDescriptorProto_reserved_na
const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (upb_StringView const*)_upb_array_constptr(arr);
return (upb_StringView const*)upb_Array_DataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -2574,7 +2574,7 @@ UPB_INLINE google_protobuf_EnumValueDescriptorProto** google_protobuf_EnumDescri
upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (google_protobuf_EnumValueDescriptorProto**)_upb_array_ptr(arr);
return (google_protobuf_EnumValueDescriptorProto**)upb_Array_MutableDataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -2589,7 +2589,7 @@ UPB_INLINE struct google_protobuf_EnumValueDescriptorProto* google_protobuf_Enum
upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__EnumDescriptorProto_msg_init(), 2);
upb_Array* arr = upb_Message_GetOrCreateMutableArray(
UPB_UPCAST(msg), &field, arena);
if (!arr || !_upb_Array_ResizeUninitialized(
if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
arr, arr->UPB_PRIVATE(size) + 1, arena)) {
return NULL;
}
@ -2616,7 +2616,7 @@ UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange** google_protob
upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (google_protobuf_EnumDescriptorProto_EnumReservedRange**)_upb_array_ptr(arr);
return (google_protobuf_EnumDescriptorProto_EnumReservedRange**)upb_Array_MutableDataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -2631,7 +2631,7 @@ UPB_INLINE struct google_protobuf_EnumDescriptorProto_EnumReservedRange* google_
upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__EnumDescriptorProto_msg_init(), 4);
upb_Array* arr = upb_Message_GetOrCreateMutableArray(
UPB_UPCAST(msg), &field, arena);
if (!arr || !_upb_Array_ResizeUninitialized(
if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
arr, arr->UPB_PRIVATE(size) + 1, arena)) {
return NULL;
}
@ -2646,7 +2646,7 @@ UPB_INLINE upb_StringView* google_protobuf_EnumDescriptorProto_mutable_reserved_
upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (upb_StringView*)_upb_array_ptr(arr);
return (upb_StringView*)upb_Array_MutableDataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -2661,7 +2661,7 @@ UPB_INLINE bool google_protobuf_EnumDescriptorProto_add_reserved_name(google_pro
upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__EnumDescriptorProto_msg_init(), 5);
upb_Array* arr = upb_Message_GetOrCreateMutableArray(
UPB_UPCAST(msg), &field, arena);
if (!arr || !_upb_Array_ResizeUninitialized(
if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
arr, arr->UPB_PRIVATE(size) + 1, arena)) {
return false;
}
@ -2915,7 +2915,7 @@ UPB_INLINE const google_protobuf_MethodDescriptorProto* const* google_protobuf_S
const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (const google_protobuf_MethodDescriptorProto* const*)_upb_array_constptr(arr);
return (const google_protobuf_MethodDescriptorProto* const*)upb_Array_DataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -2964,7 +2964,7 @@ UPB_INLINE google_protobuf_MethodDescriptorProto** google_protobuf_ServiceDescri
upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (google_protobuf_MethodDescriptorProto**)_upb_array_ptr(arr);
return (google_protobuf_MethodDescriptorProto**)upb_Array_MutableDataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -2979,7 +2979,7 @@ UPB_INLINE struct google_protobuf_MethodDescriptorProto* google_protobuf_Service
upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__ServiceDescriptorProto_msg_init(), 2);
upb_Array* arr = upb_Message_GetOrCreateMutableArray(
UPB_UPCAST(msg), &field, arena);
if (!arr || !_upb_Array_ResizeUninitialized(
if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
arr, arr->UPB_PRIVATE(size) + 1, arena)) {
return NULL;
}
@ -3533,7 +3533,7 @@ UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_Fil
const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (const google_protobuf_UninterpretedOption* const*)_upb_array_constptr(arr);
return (const google_protobuf_UninterpretedOption* const*)upb_Array_DataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -3650,7 +3650,7 @@ UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FileOptions_mut
upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (google_protobuf_UninterpretedOption**)_upb_array_ptr(arr);
return (google_protobuf_UninterpretedOption**)upb_Array_MutableDataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -3665,7 +3665,7 @@ UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_FileOptio
upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FileOptions_msg_init(), 999);
upb_Array* arr = upb_Message_GetOrCreateMutableArray(
UPB_UPCAST(msg), &field, arena);
if (!arr || !_upb_Array_ResizeUninitialized(
if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
arr, arr->UPB_PRIVATE(size) + 1, arena)) {
return NULL;
}
@ -3817,7 +3817,7 @@ UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_Mes
const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (const google_protobuf_UninterpretedOption* const*)_upb_array_constptr(arr);
return (const google_protobuf_UninterpretedOption* const*)upb_Array_DataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -3878,7 +3878,7 @@ UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MessageOptions_
upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (google_protobuf_UninterpretedOption**)_upb_array_ptr(arr);
return (google_protobuf_UninterpretedOption**)upb_Array_MutableDataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -3893,7 +3893,7 @@ UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_MessageOp
upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__MessageOptions_msg_init(), 999);
upb_Array* arr = upb_Message_GetOrCreateMutableArray(
UPB_UPCAST(msg), &field, arena);
if (!arr || !_upb_Array_ResizeUninitialized(
if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
arr, arr->UPB_PRIVATE(size) + 1, arena)) {
return NULL;
}
@ -4093,7 +4093,7 @@ UPB_INLINE int32_t const* google_protobuf_FieldOptions_targets(const google_prot
const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (int32_t const*)_upb_array_constptr(arr);
return (int32_t const*)upb_Array_DataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -4125,7 +4125,7 @@ UPB_INLINE const google_protobuf_FieldOptions_EditionDefault* const* google_prot
const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (const google_protobuf_FieldOptions_EditionDefault* const*)_upb_array_constptr(arr);
return (const google_protobuf_FieldOptions_EditionDefault* const*)upb_Array_DataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -4173,7 +4173,7 @@ UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_Fie
const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (const google_protobuf_UninterpretedOption* const*)_upb_array_constptr(arr);
return (const google_protobuf_UninterpretedOption* const*)upb_Array_DataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -4238,7 +4238,7 @@ UPB_INLINE int32_t* google_protobuf_FieldOptions_mutable_targets(google_protobuf
upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (int32_t*)_upb_array_ptr(arr);
return (int32_t*)upb_Array_MutableDataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -4253,7 +4253,7 @@ UPB_INLINE bool google_protobuf_FieldOptions_add_targets(google_protobuf_FieldOp
upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FieldOptions_msg_init(), 19);
upb_Array* arr = upb_Message_GetOrCreateMutableArray(
UPB_UPCAST(msg), &field, arena);
if (!arr || !_upb_Array_ResizeUninitialized(
if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
arr, arr->UPB_PRIVATE(size) + 1, arena)) {
return false;
}
@ -4266,7 +4266,7 @@ UPB_INLINE google_protobuf_FieldOptions_EditionDefault** google_protobuf_FieldOp
upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (google_protobuf_FieldOptions_EditionDefault**)_upb_array_ptr(arr);
return (google_protobuf_FieldOptions_EditionDefault**)upb_Array_MutableDataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -4281,7 +4281,7 @@ UPB_INLINE struct google_protobuf_FieldOptions_EditionDefault* google_protobuf_F
upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FieldOptions_msg_init(), 20);
upb_Array* arr = upb_Message_GetOrCreateMutableArray(
UPB_UPCAST(msg), &field, arena);
if (!arr || !_upb_Array_ResizeUninitialized(
if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
arr, arr->UPB_PRIVATE(size) + 1, arena)) {
return NULL;
}
@ -4308,7 +4308,7 @@ UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FieldOptions_mu
upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (google_protobuf_UninterpretedOption**)_upb_array_ptr(arr);
return (google_protobuf_UninterpretedOption**)upb_Array_MutableDataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -4323,7 +4323,7 @@ UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_FieldOpti
upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FieldOptions_msg_init(), 999);
upb_Array* arr = upb_Message_GetOrCreateMutableArray(
UPB_UPCAST(msg), &field, arena);
if (!arr || !_upb_Array_ResizeUninitialized(
if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
arr, arr->UPB_PRIVATE(size) + 1, arena)) {
return NULL;
}
@ -4473,7 +4473,7 @@ UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_One
const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (const google_protobuf_UninterpretedOption* const*)_upb_array_constptr(arr);
return (const google_protobuf_UninterpretedOption* const*)upb_Array_DataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -4514,7 +4514,7 @@ UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_OneofOptions_mu
upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (google_protobuf_UninterpretedOption**)_upb_array_ptr(arr);
return (google_protobuf_UninterpretedOption**)upb_Array_MutableDataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -4529,7 +4529,7 @@ UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_OneofOpti
upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__OneofOptions_msg_init(), 999);
upb_Array* arr = upb_Message_GetOrCreateMutableArray(
UPB_UPCAST(msg), &field, arena);
if (!arr || !_upb_Array_ResizeUninitialized(
if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
arr, arr->UPB_PRIVATE(size) + 1, arena)) {
return NULL;
}
@ -4649,7 +4649,7 @@ UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_Enu
const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (const google_protobuf_UninterpretedOption* const*)_upb_array_constptr(arr);
return (const google_protobuf_UninterpretedOption* const*)upb_Array_DataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -4702,7 +4702,7 @@ UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumOptions_mut
upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (google_protobuf_UninterpretedOption**)_upb_array_ptr(arr);
return (google_protobuf_UninterpretedOption**)upb_Array_MutableDataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -4717,7 +4717,7 @@ UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_EnumOptio
upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__EnumOptions_msg_init(), 999);
upb_Array* arr = upb_Message_GetOrCreateMutableArray(
UPB_UPCAST(msg), &field, arena);
if (!arr || !_upb_Array_ResizeUninitialized(
if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
arr, arr->UPB_PRIVATE(size) + 1, arena)) {
return NULL;
}
@ -4821,7 +4821,7 @@ UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_Enu
const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (const google_protobuf_UninterpretedOption* const*)_upb_array_constptr(arr);
return (const google_protobuf_UninterpretedOption* const*)upb_Array_DataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -4870,7 +4870,7 @@ UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumValueOption
upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (google_protobuf_UninterpretedOption**)_upb_array_ptr(arr);
return (google_protobuf_UninterpretedOption**)upb_Array_MutableDataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -4885,7 +4885,7 @@ UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_EnumValue
upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__EnumValueOptions_msg_init(), 999);
upb_Array* arr = upb_Message_GetOrCreateMutableArray(
UPB_UPCAST(msg), &field, arena);
if (!arr || !_upb_Array_ResizeUninitialized(
if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
arr, arr->UPB_PRIVATE(size) + 1, arena)) {
return NULL;
}
@ -4973,7 +4973,7 @@ UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_Ser
const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (const google_protobuf_UninterpretedOption* const*)_upb_array_constptr(arr);
return (const google_protobuf_UninterpretedOption* const*)upb_Array_DataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -5018,7 +5018,7 @@ UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ServiceOptions_
upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (google_protobuf_UninterpretedOption**)_upb_array_ptr(arr);
return (google_protobuf_UninterpretedOption**)upb_Array_MutableDataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -5033,7 +5033,7 @@ UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_ServiceOp
upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__ServiceOptions_msg_init(), 999);
upb_Array* arr = upb_Message_GetOrCreateMutableArray(
UPB_UPCAST(msg), &field, arena);
if (!arr || !_upb_Array_ResizeUninitialized(
if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
arr, arr->UPB_PRIVATE(size) + 1, arena)) {
return NULL;
}
@ -5137,7 +5137,7 @@ UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_Met
const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (const google_protobuf_UninterpretedOption* const*)_upb_array_constptr(arr);
return (const google_protobuf_UninterpretedOption* const*)upb_Array_DataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -5186,7 +5186,7 @@ UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MethodOptions_m
upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (google_protobuf_UninterpretedOption**)_upb_array_ptr(arr);
return (google_protobuf_UninterpretedOption**)upb_Array_MutableDataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -5201,7 +5201,7 @@ UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_MethodOpt
upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__MethodOptions_msg_init(), 999);
upb_Array* arr = upb_Message_GetOrCreateMutableArray(
UPB_UPCAST(msg), &field, arena);
if (!arr || !_upb_Array_ResizeUninitialized(
if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
arr, arr->UPB_PRIVATE(size) + 1, arena)) {
return NULL;
}
@ -5257,7 +5257,7 @@ UPB_INLINE const google_protobuf_UninterpretedOption_NamePart* const* google_pro
const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (const google_protobuf_UninterpretedOption_NamePart* const*)_upb_array_constptr(arr);
return (const google_protobuf_UninterpretedOption_NamePart* const*)upb_Array_DataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -5382,7 +5382,7 @@ UPB_INLINE google_protobuf_UninterpretedOption_NamePart** google_protobuf_Uninte
upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (google_protobuf_UninterpretedOption_NamePart**)_upb_array_ptr(arr);
return (google_protobuf_UninterpretedOption_NamePart**)upb_Array_MutableDataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -5397,7 +5397,7 @@ UPB_INLINE struct google_protobuf_UninterpretedOption_NamePart* google_protobuf_
upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__UninterpretedOption_msg_init(), 2);
upb_Array* arr = upb_Message_GetOrCreateMutableArray(
UPB_UPCAST(msg), &field, arena);
if (!arr || !_upb_Array_ResizeUninitialized(
if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
arr, arr->UPB_PRIVATE(size) + 1, arena)) {
return NULL;
}
@ -5713,7 +5713,7 @@ UPB_INLINE const google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* co
const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (const google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* const*)_upb_array_constptr(arr);
return (const google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* const*)upb_Array_DataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -5774,7 +5774,7 @@ UPB_INLINE google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault** google_
upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault**)_upb_array_ptr(arr);
return (google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault**)upb_Array_MutableDataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -5789,7 +5789,7 @@ UPB_INLINE struct google_protobuf_FeatureSetDefaults_FeatureSetEditionDefault* g
upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__FeatureSetDefaults_msg_init(), 1);
upb_Array* arr = upb_Message_GetOrCreateMutableArray(
UPB_UPCAST(msg), &field, arena);
if (!arr || !_upb_Array_ResizeUninitialized(
if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
arr, arr->UPB_PRIVATE(size) + 1, arena)) {
return NULL;
}
@ -5939,7 +5939,7 @@ UPB_INLINE const google_protobuf_SourceCodeInfo_Location* const* google_protobuf
const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (const google_protobuf_SourceCodeInfo_Location* const*)_upb_array_constptr(arr);
return (const google_protobuf_SourceCodeInfo_Location* const*)upb_Array_DataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -5968,7 +5968,7 @@ UPB_INLINE google_protobuf_SourceCodeInfo_Location** google_protobuf_SourceCodeI
upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (google_protobuf_SourceCodeInfo_Location**)_upb_array_ptr(arr);
return (google_protobuf_SourceCodeInfo_Location**)upb_Array_MutableDataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -5983,7 +5983,7 @@ UPB_INLINE struct google_protobuf_SourceCodeInfo_Location* google_protobuf_Sourc
upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__SourceCodeInfo_msg_init(), 1);
upb_Array* arr = upb_Message_GetOrCreateMutableArray(
UPB_UPCAST(msg), &field, arena);
if (!arr || !_upb_Array_ResizeUninitialized(
if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
arr, arr->UPB_PRIVATE(size) + 1, arena)) {
return NULL;
}
@ -6039,7 +6039,7 @@ UPB_INLINE int32_t const* google_protobuf_SourceCodeInfo_Location_path(const goo
const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (int32_t const*)_upb_array_constptr(arr);
return (int32_t const*)upb_Array_DataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -6071,7 +6071,7 @@ UPB_INLINE int32_t const* google_protobuf_SourceCodeInfo_Location_span(const goo
const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (int32_t const*)_upb_array_constptr(arr);
return (int32_t const*)upb_Array_DataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -6135,7 +6135,7 @@ UPB_INLINE upb_StringView const* google_protobuf_SourceCodeInfo_Location_leading
const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (upb_StringView const*)_upb_array_constptr(arr);
return (upb_StringView const*)upb_Array_DataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -6164,7 +6164,7 @@ UPB_INLINE int32_t* google_protobuf_SourceCodeInfo_Location_mutable_path(google_
upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (int32_t*)_upb_array_ptr(arr);
return (int32_t*)upb_Array_MutableDataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -6179,7 +6179,7 @@ UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_add_path(google_protobuf
upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__SourceCodeInfo__Location_msg_init(), 1);
upb_Array* arr = upb_Message_GetOrCreateMutableArray(
UPB_UPCAST(msg), &field, arena);
if (!arr || !_upb_Array_ResizeUninitialized(
if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
arr, arr->UPB_PRIVATE(size) + 1, arena)) {
return false;
}
@ -6192,7 +6192,7 @@ UPB_INLINE int32_t* google_protobuf_SourceCodeInfo_Location_mutable_span(google_
upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (int32_t*)_upb_array_ptr(arr);
return (int32_t*)upb_Array_MutableDataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -6207,7 +6207,7 @@ UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_add_span(google_protobuf
upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__SourceCodeInfo__Location_msg_init(), 2);
upb_Array* arr = upb_Message_GetOrCreateMutableArray(
UPB_UPCAST(msg), &field, arena);
if (!arr || !_upb_Array_ResizeUninitialized(
if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
arr, arr->UPB_PRIVATE(size) + 1, arena)) {
return false;
}
@ -6228,7 +6228,7 @@ UPB_INLINE upb_StringView* google_protobuf_SourceCodeInfo_Location_mutable_leadi
upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (upb_StringView*)_upb_array_ptr(arr);
return (upb_StringView*)upb_Array_MutableDataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -6243,7 +6243,7 @@ UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_add_leading_detached_com
upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__SourceCodeInfo__Location_msg_init(), 6);
upb_Array* arr = upb_Message_GetOrCreateMutableArray(
UPB_UPCAST(msg), &field, arena);
if (!arr || !_upb_Array_ResizeUninitialized(
if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
arr, arr->UPB_PRIVATE(size) + 1, arena)) {
return false;
}
@ -6297,7 +6297,7 @@ UPB_INLINE const google_protobuf_GeneratedCodeInfo_Annotation* const* google_pro
const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (const google_protobuf_GeneratedCodeInfo_Annotation* const*)_upb_array_constptr(arr);
return (const google_protobuf_GeneratedCodeInfo_Annotation* const*)upb_Array_DataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -6326,7 +6326,7 @@ UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation** google_protobuf_Genera
upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (google_protobuf_GeneratedCodeInfo_Annotation**)_upb_array_ptr(arr);
return (google_protobuf_GeneratedCodeInfo_Annotation**)upb_Array_MutableDataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -6341,7 +6341,7 @@ UPB_INLINE struct google_protobuf_GeneratedCodeInfo_Annotation* google_protobuf_
upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__GeneratedCodeInfo_msg_init(), 1);
upb_Array* arr = upb_Message_GetOrCreateMutableArray(
UPB_UPCAST(msg), &field, arena);
if (!arr || !_upb_Array_ResizeUninitialized(
if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
arr, arr->UPB_PRIVATE(size) + 1, arena)) {
return NULL;
}
@ -6397,7 +6397,7 @@ UPB_INLINE int32_t const* google_protobuf_GeneratedCodeInfo_Annotation_path(cons
const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (int32_t const*)_upb_array_constptr(arr);
return (int32_t const*)upb_Array_DataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -6490,7 +6490,7 @@ UPB_INLINE int32_t* google_protobuf_GeneratedCodeInfo_Annotation_mutable_path(go
upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (int32_t*)_upb_array_ptr(arr);
return (int32_t*)upb_Array_MutableDataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -6505,7 +6505,7 @@ UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_add_path(google_pro
upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__GeneratedCodeInfo__Annotation_msg_init(), 1);
upb_Array* arr = upb_Message_GetOrCreateMutableArray(
UPB_UPCAST(msg), &field, arena);
if (!arr || !_upb_Array_ResizeUninitialized(
if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
arr, arr->UPB_PRIVATE(size) + 1, arena)) {
return false;
}

@ -412,7 +412,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->UPB_PRIVATE(size) * 4, void);
void* mem = UPB_PTR_AT(upb_Array_MutableDataPtr(arr),
arr->UPB_PRIVATE(size) * 4, void);
arr->UPB_PRIVATE(size)++;
memcpy(mem, val, 4);
return ptr;
@ -429,8 +430,8 @@ 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->UPB_PRIVATE(size) << lg2, void);
void* mem = UPB_PTR_AT(upb_Array_MutableDataPtr(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.
@ -461,15 +462,15 @@ 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->UPB_PRIVATE(size) << lg2, void);
char* out = UPB_PTR_AT(upb_Array_MutableDataPtr(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->UPB_PRIVATE(size) << lg2, void);
out = UPB_PTR_AT(upb_Array_MutableDataPtr(arr),
arr->UPB_PRIVATE(size) << lg2, void);
}
arr->UPB_PRIVATE(size)++;
memcpy(out, &elem, scale);
@ -486,7 +487,8 @@ 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->UPB_PRIVATE(size) * 4, void);
char* out = UPB_PTR_AT(upb_Array_MutableDataPtr(arr),
arr->UPB_PRIVATE(size) * 4, void);
while (!_upb_Decoder_IsDone(d, &ptr)) {
wireval elem;
ptr = _upb_Decoder_DecodeVarint(d, ptr, &elem.uint64_val);
@ -495,7 +497,8 @@ static const char* _upb_Decoder_DecodeEnumPacked(
continue;
}
if (_upb_Decoder_Reserve(d, arr, 1)) {
out = UPB_PTR_AT(_upb_array_ptr(arr), arr->UPB_PRIVATE(size) * 4, void);
out = UPB_PTR_AT(upb_Array_MutableDataPtr(arr),
arr->UPB_PRIVATE(size) * 4, void);
}
arr->UPB_PRIVATE(size)++;
memcpy(out, &elem, 4);
@ -535,7 +538,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->UPB_PRIVATE(size) << op, void);
mem = UPB_PTR_AT(upb_Array_MutableDataPtr(arr),
arr->UPB_PRIVATE(size) << op, void);
arr->UPB_PRIVATE(size)++;
memcpy(mem, val, 1 << op);
return ptr;
@ -544,15 +548,15 @@ 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->UPB_PRIVATE(size);
upb_StringView* str = (upb_StringView*)upb_Array_MutableDataPtr(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->UPB_PRIVATE(size) * sizeof(void*),
upb_Array_MutableDataPtr(arr), arr->UPB_PRIVATE(size) * sizeof(void*),
upb_TaggedMessagePtr);
upb_Message* submsg = _upb_Decoder_NewSubMessage(d, subs, field, target);
arr->UPB_PRIVATE(size)++;

@ -183,7 +183,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->UPB_PRIVATE(size) * elem_size;
const char* data = _upb_array_constptr(arr);
const char* data = upb_Array_DataPtr(arr);
const char* ptr = data + bytes - elem_size;
if (tag || !upb_IsLittleEndian()) {
@ -321,7 +321,7 @@ static void encode_array(upb_encstate* e, const upb_Message* msg,
#define VARINT_CASE(ctype, encode) \
{ \
const ctype* start = _upb_array_constptr(arr); \
const ctype* start = upb_Array_DataPtr(arr); \
const ctype* ptr = start + arr->UPB_PRIVATE(size); \
uint32_t tag = \
packed ? 0 : (f->UPB_PRIVATE(number) << 3) | kUpb_WireType_Varint; \
@ -366,7 +366,7 @@ static void encode_array(upb_encstate* e, const upb_Message* msg,
VARINT_CASE(int64_t, encode_zz64(*ptr));
case kUpb_FieldType_String:
case kUpb_FieldType_Bytes: {
const upb_StringView* start = _upb_array_constptr(arr);
const upb_StringView* start = upb_Array_DataPtr(arr);
const upb_StringView* ptr = start + arr->UPB_PRIVATE(size);
do {
ptr--;
@ -377,7 +377,7 @@ static void encode_array(upb_encstate* e, const upb_Message* msg,
return;
}
case kUpb_FieldType_Group: {
const upb_TaggedMessagePtr* start = _upb_array_constptr(arr);
const upb_TaggedMessagePtr* start = upb_Array_DataPtr(arr);
const upb_TaggedMessagePtr* ptr = start + arr->UPB_PRIVATE(size);
const upb_MiniTable* subm =
upb_MiniTableSub_Message(subs[f->UPB_PRIVATE(submsg_index)]);
@ -393,7 +393,7 @@ static void encode_array(upb_encstate* e, const upb_Message* msg,
return;
}
case kUpb_FieldType_Message: {
const upb_TaggedMessagePtr* start = _upb_array_constptr(arr);
const upb_TaggedMessagePtr* start = upb_Array_DataPtr(arr);
const upb_TaggedMessagePtr* ptr = start + arr->UPB_PRIVATE(size);
const upb_MiniTable* subm =
upb_MiniTableSub_Message(subs[f->UPB_PRIVATE(submsg_index)]);

@ -169,7 +169,7 @@ static void* fastdecode_resizearr(upb_Decoder* d, void* dst,
size_t old_bytes = old_capacity * valbytes;
size_t new_capacity = old_capacity * 2;
size_t new_bytes = new_capacity * valbytes;
char* old_ptr = _upb_array_ptr(farr->arr);
char* old_ptr = upb_Array_MutableDataPtr(farr->arr);
char* new_ptr = upb_Arena_Realloc(&d->arena, old_ptr, old_bytes, new_bytes);
uint8_t elem_size_lg2 = __builtin_ctz(valbytes);
UPB_PRIVATE(_upb_Array_SetTaggedPtr)(farr->arr, new_ptr, elem_size_lg2);
@ -193,7 +193,8 @@ UPB_FORCEINLINE
static void fastdecode_commitarr(void* dst, fastdecode_arr* farr,
int valbytes) {
farr->arr->UPB_PRIVATE(size) =
(size_t)((char*)dst - (char*)_upb_array_ptr(farr->arr)) / valbytes;
(size_t)((char*)dst - (char*)upb_Array_MutableDataPtr(farr->arr)) /
valbytes;
}
UPB_FORCEINLINE
@ -260,7 +261,7 @@ static void* fastdecode_getfield(upb_Decoder* d, const char* ptr,
} else {
farr->arr = *arr_p;
}
begin = _upb_array_ptr(farr->arr);
begin = upb_Array_MutableDataPtr(farr->arr);
farr->end = begin + (farr->arr->UPB_PRIVATE(capacity) * valbytes);
*data = _upb_FastDecoder_LoadTag(ptr);
return begin + (farr->arr->UPB_PRIVATE(size) * valbytes);
@ -546,10 +547,10 @@ TAGBYTES(p)
_upb_FastDecoder_ErrorJmp(d, kUpb_DecodeStatus_Malformed); \
} \
} else { \
_upb_Array_ResizeUninitialized(arr, elems, &d->arena); \
UPB_PRIVATE(_upb_Array_ResizeUninitialized)(arr, elems, &d->arena); \
} \
\
char* dst = _upb_array_ptr(arr); \
char* dst = upb_Array_MutableDataPtr(arr); \
memcpy(dst, ptr, size); \
arr->UPB_PRIVATE(size) = elems; \
\

@ -505,7 +505,7 @@ void GenerateRepeatedGetters(upb::FieldDefPtr field, const DefPoolPair& pools,
const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return ($0 const*)_upb_array_constptr(arr);
return ($0 const*)upb_Array_DataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -653,7 +653,7 @@ void GenerateRepeatedSetters(upb::FieldDefPtr field, const DefPoolPair& pools,
upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return ($0*)_upb_array_ptr(arr);
return ($0*)upb_Array_MutableDataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -679,7 +679,7 @@ void GenerateRepeatedSetters(upb::FieldDefPtr field, const DefPoolPair& pools,
upb_MiniTableField field = $4;
upb_Array* arr = upb_Message_GetOrCreateMutableArray(
UPB_UPCAST(msg), &field, arena);
if (!arr || !_upb_Array_ResizeUninitialized(
if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
arr, arr->UPB_PRIVATE(size) + 1, arena)) {
return NULL;
}
@ -700,7 +700,7 @@ void GenerateRepeatedSetters(upb::FieldDefPtr field, const DefPoolPair& pools,
upb_MiniTableField field = $3;
upb_Array* arr = upb_Message_GetOrCreateMutableArray(
UPB_UPCAST(msg), &field, arena);
if (!arr || !_upb_Array_ResizeUninitialized(
if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
arr, arr->UPB_PRIVATE(size) + 1, arena)) {
return false;
}

@ -203,7 +203,7 @@ UPB_INLINE upb_StringView const* google_protobuf_compiler_CodeGeneratorRequest_f
const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (upb_StringView const*)_upb_array_constptr(arr);
return (upb_StringView const*)upb_Array_DataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -267,7 +267,7 @@ UPB_INLINE const struct google_protobuf_FileDescriptorProto* const* google_proto
const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (const struct google_protobuf_FileDescriptorProto* const*)_upb_array_constptr(arr);
return (const struct google_protobuf_FileDescriptorProto* const*)upb_Array_DataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -299,7 +299,7 @@ UPB_INLINE const struct google_protobuf_FileDescriptorProto* const* google_proto
const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (const struct google_protobuf_FileDescriptorProto* const*)_upb_array_constptr(arr);
return (const struct google_protobuf_FileDescriptorProto* const*)upb_Array_DataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -328,7 +328,7 @@ UPB_INLINE upb_StringView* google_protobuf_compiler_CodeGeneratorRequest_mutable
upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (upb_StringView*)_upb_array_ptr(arr);
return (upb_StringView*)upb_Array_MutableDataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -343,7 +343,7 @@ UPB_INLINE bool google_protobuf_compiler_CodeGeneratorRequest_add_file_to_genera
upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__compiler__CodeGeneratorRequest_msg_init(), 1);
upb_Array* arr = upb_Message_GetOrCreateMutableArray(
UPB_UPCAST(msg), &field, arena);
if (!arr || !_upb_Array_ResizeUninitialized(
if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
arr, arr->UPB_PRIVATE(size) + 1, arena)) {
return false;
}
@ -372,7 +372,7 @@ UPB_INLINE struct google_protobuf_FileDescriptorProto** google_protobuf_compiler
upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (struct google_protobuf_FileDescriptorProto**)_upb_array_ptr(arr);
return (struct google_protobuf_FileDescriptorProto**)upb_Array_MutableDataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -387,7 +387,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_GetOrCreateMutableArray(
UPB_UPCAST(msg), &field, arena);
if (!arr || !_upb_Array_ResizeUninitialized(
if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
arr, arr->UPB_PRIVATE(size) + 1, arena)) {
return NULL;
}
@ -402,7 +402,7 @@ UPB_INLINE struct google_protobuf_FileDescriptorProto** google_protobuf_compiler
upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (struct google_protobuf_FileDescriptorProto**)_upb_array_ptr(arr);
return (struct google_protobuf_FileDescriptorProto**)upb_Array_MutableDataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -417,7 +417,7 @@ UPB_INLINE struct google_protobuf_FileDescriptorProto* google_protobuf_compiler_
upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__compiler__CodeGeneratorRequest_msg_init(), 17);
upb_Array* arr = upb_Message_GetOrCreateMutableArray(
UPB_UPCAST(msg), &field, arena);
if (!arr || !_upb_Array_ResizeUninitialized(
if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
arr, arr->UPB_PRIVATE(size) + 1, arena)) {
return NULL;
}
@ -537,7 +537,7 @@ UPB_INLINE const google_protobuf_compiler_CodeGeneratorResponse_File* const* goo
const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (const google_protobuf_compiler_CodeGeneratorResponse_File* const*)_upb_array_constptr(arr);
return (const google_protobuf_compiler_CodeGeneratorResponse_File* const*)upb_Array_DataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -582,7 +582,7 @@ UPB_INLINE google_protobuf_compiler_CodeGeneratorResponse_File** google_protobuf
upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
if (arr) {
if (size) *size = arr->UPB_PRIVATE(size);
return (google_protobuf_compiler_CodeGeneratorResponse_File**)_upb_array_ptr(arr);
return (google_protobuf_compiler_CodeGeneratorResponse_File**)upb_Array_MutableDataPtr(arr);
} else {
if (size) *size = 0;
return NULL;
@ -597,7 +597,7 @@ UPB_INLINE struct google_protobuf_compiler_CodeGeneratorResponse_File* google_pr
upb_MiniTableField field = *upb_MiniTable_FindFieldByNumber(google__protobuf__compiler__CodeGeneratorResponse_msg_init(), 15);
upb_Array* arr = upb_Message_GetOrCreateMutableArray(
UPB_UPCAST(msg), &field, arena);
if (!arr || !_upb_Array_ResizeUninitialized(
if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
arr, arr->UPB_PRIVATE(size) + 1, arena)) {
return NULL;
}

Loading…
Cancel
Save