Skip to content

Commit

Permalink
Auto-generate files after cl/708120760
Browse files Browse the repository at this point in the history
  • Loading branch information
protobuf-team-bot committed Dec 20, 2024
1 parent e9e08cd commit 3b2bb51
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
12 changes: 6 additions & 6 deletions php/ext/google/protobuf/php-upb.c
Original file line number Diff line number Diff line change
Expand Up @@ -4013,8 +4013,8 @@ void _upb_Message_DiscardUnknown_shallow(upb_Message* msg) {
UPB_ASSERT(!upb_Message_IsFrozen(msg));
upb_Message_Internal* in = UPB_PRIVATE(_upb_Message_GetInternal)(msg);
if (!in) return;
size_t size = 0;
for (size_t i = 0; i < in->size; i++) {
uint32_t size = 0;
for (uint32_t i = 0; i < in->size; i++) {
upb_TaggedAuxPtr tagged_ptr = in->aux_data[i];
if (upb_TaggedAuxPtr_IsExtension(tagged_ptr)) {
in->aux_data[size++] = tagged_ptr;
Expand Down Expand Up @@ -4094,7 +4094,7 @@ void upb_Message_Freeze(upb_Message* msg, const upb_MiniTable* m) {
// Extensions.
upb_Message_Internal* in = UPB_PRIVATE(_upb_Message_GetInternal)(msg);
// TODO: b/376969853 - use iterator API
size_t size = in ? in->size : 0;
uint32_t size = in ? in->size : 0;
for (size_t i = 0; i < size; i++) {
upb_TaggedAuxPtr tagged_ptr = in->aux_data[i];
if (!upb_TaggedAuxPtr_IsExtension(tagged_ptr)) {
Expand Down Expand Up @@ -12491,7 +12491,7 @@ const float kUpb_FltInfinity = UPB_INFINITY;
const double kUpb_Infinity = UPB_INFINITY;
const double kUpb_NaN = UPB_NAN;

static size_t _upb_Message_SizeOfInternal(size_t count) {
static size_t _upb_Message_SizeOfInternal(uint32_t count) {
return UPB_SIZEOF_FLEX(upb_Message_Internal, aux_data, count);
}

Expand All @@ -12501,15 +12501,15 @@ bool UPB_PRIVATE(_upb_Message_ReserveSlot)(struct upb_Message* msg,
upb_Message_Internal* in = UPB_PRIVATE(_upb_Message_GetInternal)(msg);
if (!in) {
// No internal data, allocate from scratch.
size_t capacity = 4;
uint32_t capacity = 4;
in = upb_Arena_Malloc(a, _upb_Message_SizeOfInternal(capacity));
if (!in) return false;
in->size = 0;
in->capacity = capacity;
UPB_PRIVATE(_upb_Message_SetInternal)(msg, in);
} else if (in->capacity == in->size) {
// Internal data is too small, reallocate.
size_t new_capacity = upb_RoundUpToPowerOfTwo(in->size + 1);
uint32_t new_capacity = upb_RoundUpToPowerOfTwo(in->size + 1);
in = upb_Arena_Realloc(a, in, _upb_Message_SizeOfInternal(in->capacity),
_upb_Message_SizeOfInternal(new_capacity));
if (!in) return false;
Expand Down
6 changes: 3 additions & 3 deletions php/ext/google/protobuf/php-upb.h
Original file line number Diff line number Diff line change
Expand Up @@ -3097,8 +3097,8 @@ upb_TaggedAuxPtr_MakeUnknownData(const upb_StringView* sv) {

typedef struct upb_Message_Internal {
// Total number of entries set in aux_data
size_t size;
size_t capacity;
uint32_t size;
uint32_t capacity;
// Tagged pointers to upb_StringView or upb_Extension
upb_TaggedAuxPtr aux_data[];
} upb_Message_Internal;
Expand Down Expand Up @@ -3210,7 +3210,7 @@ UPB_INLINE bool UPB_PRIVATE(_upb_Message_NextExtensionReverse)(
upb_Message_Internal* in = UPB_PRIVATE(_upb_Message_GetInternal)(msg);
if (!in) return false;
uintptr_t i = *iter;
size_t size = in->size;
uint32_t size = in->size;
while (i < size) {
upb_TaggedAuxPtr tagged_ptr = in->aux_data[size - 1 - i];
i++;
Expand Down
12 changes: 6 additions & 6 deletions ruby/ext/google/protobuf_c/ruby-upb.c
Original file line number Diff line number Diff line change
Expand Up @@ -4013,8 +4013,8 @@ void _upb_Message_DiscardUnknown_shallow(upb_Message* msg) {
UPB_ASSERT(!upb_Message_IsFrozen(msg));
upb_Message_Internal* in = UPB_PRIVATE(_upb_Message_GetInternal)(msg);
if (!in) return;
size_t size = 0;
for (size_t i = 0; i < in->size; i++) {
uint32_t size = 0;
for (uint32_t i = 0; i < in->size; i++) {
upb_TaggedAuxPtr tagged_ptr = in->aux_data[i];
if (upb_TaggedAuxPtr_IsExtension(tagged_ptr)) {
in->aux_data[size++] = tagged_ptr;
Expand Down Expand Up @@ -4094,7 +4094,7 @@ void upb_Message_Freeze(upb_Message* msg, const upb_MiniTable* m) {
// Extensions.
upb_Message_Internal* in = UPB_PRIVATE(_upb_Message_GetInternal)(msg);
// TODO: b/376969853 - use iterator API
size_t size = in ? in->size : 0;
uint32_t size = in ? in->size : 0;
for (size_t i = 0; i < size; i++) {
upb_TaggedAuxPtr tagged_ptr = in->aux_data[i];
if (!upb_TaggedAuxPtr_IsExtension(tagged_ptr)) {
Expand Down Expand Up @@ -11978,7 +11978,7 @@ const float kUpb_FltInfinity = UPB_INFINITY;
const double kUpb_Infinity = UPB_INFINITY;
const double kUpb_NaN = UPB_NAN;

static size_t _upb_Message_SizeOfInternal(size_t count) {
static size_t _upb_Message_SizeOfInternal(uint32_t count) {
return UPB_SIZEOF_FLEX(upb_Message_Internal, aux_data, count);
}

Expand All @@ -11988,15 +11988,15 @@ bool UPB_PRIVATE(_upb_Message_ReserveSlot)(struct upb_Message* msg,
upb_Message_Internal* in = UPB_PRIVATE(_upb_Message_GetInternal)(msg);
if (!in) {
// No internal data, allocate from scratch.
size_t capacity = 4;
uint32_t capacity = 4;
in = upb_Arena_Malloc(a, _upb_Message_SizeOfInternal(capacity));
if (!in) return false;
in->size = 0;
in->capacity = capacity;
UPB_PRIVATE(_upb_Message_SetInternal)(msg, in);
} else if (in->capacity == in->size) {
// Internal data is too small, reallocate.
size_t new_capacity = upb_RoundUpToPowerOfTwo(in->size + 1);
uint32_t new_capacity = upb_RoundUpToPowerOfTwo(in->size + 1);
in = upb_Arena_Realloc(a, in, _upb_Message_SizeOfInternal(in->capacity),
_upb_Message_SizeOfInternal(new_capacity));
if (!in) return false;
Expand Down
6 changes: 3 additions & 3 deletions ruby/ext/google/protobuf_c/ruby-upb.h
Original file line number Diff line number Diff line change
Expand Up @@ -3099,8 +3099,8 @@ upb_TaggedAuxPtr_MakeUnknownData(const upb_StringView* sv) {

typedef struct upb_Message_Internal {
// Total number of entries set in aux_data
size_t size;
size_t capacity;
uint32_t size;
uint32_t capacity;
// Tagged pointers to upb_StringView or upb_Extension
upb_TaggedAuxPtr aux_data[];
} upb_Message_Internal;
Expand Down Expand Up @@ -3212,7 +3212,7 @@ UPB_INLINE bool UPB_PRIVATE(_upb_Message_NextExtensionReverse)(
upb_Message_Internal* in = UPB_PRIVATE(_upb_Message_GetInternal)(msg);
if (!in) return false;
uintptr_t i = *iter;
size_t size = in->size;
uint32_t size = in->size;
while (i < size) {
upb_TaggedAuxPtr tagged_ptr = in->aux_data[size - 1 - i];
i++;
Expand Down

0 comments on commit 3b2bb51

Please sign in to comment.