Skip to content

Commit

Permalink
Auto-generate files after cl/631454136
Browse files Browse the repository at this point in the history
  • Loading branch information
protobuf-team-bot committed May 7, 2024
1 parent 6ccda4d commit ae17e81
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
19 changes: 19 additions & 0 deletions php/ext/google/protobuf/php-upb.h
Original file line number Diff line number Diff line change
Expand Up @@ -3269,6 +3269,21 @@ UPB_API_INLINE void upb_Message_ClearExtension(
}
}

UPB_API_INLINE void upb_Message_ClearOneof(struct upb_Message* msg,
const upb_MiniTable* m,
const upb_MiniTableField* f) {
UPB_ASSERT(!upb_Message_IsFrozen(msg));
uint32_t field_number = upb_Message_WhichOneofFieldNumber(msg, f);
if (field_number == 0) {
// No field in the oneof is set.
return;
}

const upb_MiniTableField* field =
upb_MiniTable_FindFieldByNumber(m, field_number);
upb_Message_ClearBaseField(msg, field);
}

UPB_API_INLINE void* upb_Message_ResizeArrayUninitialized(
struct upb_Message* msg, const upb_MiniTableField* f, size_t size,
upb_Arena* arena) {
Expand Down Expand Up @@ -3544,6 +3559,10 @@ UPB_API_INLINE void upb_Message_ClearBaseField(upb_Message* msg,
UPB_API_INLINE void upb_Message_ClearExtension(upb_Message* msg,
const upb_MiniTableExtension* e);

UPB_API_INLINE void upb_Message_ClearOneof(upb_Message* msg,
const upb_MiniTable* m,
const upb_MiniTableField* f);

UPB_API_INLINE bool upb_Message_HasBaseField(const upb_Message* msg,
const upb_MiniTableField* f);

Expand Down
19 changes: 19 additions & 0 deletions ruby/ext/google/protobuf_c/ruby-upb.h
Original file line number Diff line number Diff line change
Expand Up @@ -3271,6 +3271,21 @@ UPB_API_INLINE void upb_Message_ClearExtension(
}
}

UPB_API_INLINE void upb_Message_ClearOneof(struct upb_Message* msg,
const upb_MiniTable* m,
const upb_MiniTableField* f) {
UPB_ASSERT(!upb_Message_IsFrozen(msg));
uint32_t field_number = upb_Message_WhichOneofFieldNumber(msg, f);
if (field_number == 0) {
// No field in the oneof is set.
return;
}

const upb_MiniTableField* field =
upb_MiniTable_FindFieldByNumber(m, field_number);
upb_Message_ClearBaseField(msg, field);
}

UPB_API_INLINE void* upb_Message_ResizeArrayUninitialized(
struct upb_Message* msg, const upb_MiniTableField* f, size_t size,
upb_Arena* arena) {
Expand Down Expand Up @@ -3546,6 +3561,10 @@ UPB_API_INLINE void upb_Message_ClearBaseField(upb_Message* msg,
UPB_API_INLINE void upb_Message_ClearExtension(upb_Message* msg,
const upb_MiniTableExtension* e);

UPB_API_INLINE void upb_Message_ClearOneof(upb_Message* msg,
const upb_MiniTable* m,
const upb_MiniTableField* f);

UPB_API_INLINE bool upb_Message_HasBaseField(const upb_Message* msg,
const upb_MiniTableField* f);

Expand Down

0 comments on commit ae17e81

Please sign in to comment.