From ae17e81e42b77f9f6757361c3309a41448577fca Mon Sep 17 00:00:00 2001 From: Protobuf Team Bot Date: Tue, 7 May 2024 16:59:23 +0000 Subject: [PATCH] Auto-generate files after cl/631454136 --- php/ext/google/protobuf/php-upb.h | 19 +++++++++++++++++++ ruby/ext/google/protobuf_c/ruby-upb.h | 19 +++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/php/ext/google/protobuf/php-upb.h b/php/ext/google/protobuf/php-upb.h index 21448b174c..f9ca750bc9 100644 --- a/php/ext/google/protobuf/php-upb.h +++ b/php/ext/google/protobuf/php-upb.h @@ -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) { @@ -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); diff --git a/ruby/ext/google/protobuf_c/ruby-upb.h b/ruby/ext/google/protobuf_c/ruby-upb.h index ddb5106d45..0efa1b29ac 100755 --- a/ruby/ext/google/protobuf_c/ruby-upb.h +++ b/ruby/ext/google/protobuf_c/ruby-upb.h @@ -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) { @@ -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);