upb: remove the unused (upb_MiniTable*) arg from upb_Message_SetMessage()

PiperOrigin-RevId: 632267379
pull/16777/head
Eric Salo 2024-05-09 14:16:20 -07:00 committed by Copybara-Service
parent f68350225f
commit 6245733655
5 changed files with 10 additions and 16 deletions

View File

@ -153,9 +153,8 @@ UPB_API_INLINE bool upb_Message_SetInt64(upb_Message* msg,
int64_t value, upb_Arena* a);
UPB_API_INLINE void upb_Message_SetMessage(upb_Message* msg,
const upb_MiniTable* m,
const upb_MiniTableField* f,
upb_Message* sub_message);
upb_Message* value);
UPB_API_INLINE bool upb_Message_SetString(upb_Message* msg,
const upb_MiniTableField* f,

View File

@ -329,10 +329,8 @@ TEST(GeneratedCode, SubMessage) {
arena));
upb_Message_SetInt32(new_nested_message, nested_message_a_field, 123,
nullptr);
upb_Message_SetMessage(
UPB_UPCAST(msg),
&protobuf_0test_0messages__proto2__TestAllTypesProto2_msg_init,
optional_message_field, new_nested_message);
upb_Message_SetMessage(UPB_UPCAST(msg), optional_message_field,
new_nested_message);
upb_Message* mutable_message = upb_Message_GetOrCreateMutableMessage(
UPB_UPCAST(msg),

View File

@ -108,10 +108,8 @@ TEST(GeneratedCode, DeepCloneMessageSubMessage) {
source_arena);
protobuf_test_messages_proto2_TestAllTypesProto2_NestedMessage_set_a(
nested, kTestNestedInt32);
upb_Message_SetMessage(
UPB_UPCAST(msg),
&protobuf_0test_0messages__proto2__TestAllTypesProto2_msg_init,
nested_message_field, UPB_UPCAST(nested));
upb_Message_SetMessage(UPB_UPCAST(msg), nested_message_field,
UPB_UPCAST(nested));
upb_Arena* arena = upb_Arena_New();
protobuf_test_messages_proto2_TestAllTypesProto2* clone =
(protobuf_test_messages_proto2_TestAllTypesProto2*)upb_Message_DeepClone(

View File

@ -791,13 +791,12 @@ UPB_API_INLINE bool upb_Message_SetInt64(struct upb_Message* msg,
}
// Sets the value of a message-typed field. The mini_tables of `msg` and
// `sub_message` must have been linked for this to work correctly.
// `value` must have been linked for this to work correctly.
UPB_API_INLINE void upb_Message_SetMessage(struct upb_Message* msg,
const upb_MiniTable* m,
const upb_MiniTableField* f,
struct upb_Message* sub_message) {
struct upb_Message* value) {
UPB_PRIVATE(_upb_Message_SetTaggedMessagePtr)
(msg, f, UPB_PRIVATE(_upb_TaggedMessagePtr_Pack)(sub_message, false));
(msg, f, UPB_PRIVATE(_upb_TaggedMessagePtr_Pack)(value, false));
}
// Sets the value of a `string` or `bytes` field. The bytes of the value are not

View File

@ -188,7 +188,7 @@ upb_DecodeStatus upb_Message_PromoteMessage(upb_Message* parent,
upb_Message_PromoteOne(&tagged, sub_table, decode_options, arena);
if (ret == kUpb_DecodeStatus_Ok) {
*promoted = upb_TaggedMessagePtr_GetNonEmptyMessage(tagged);
upb_Message_SetMessage(parent, mini_table, field, *promoted);
upb_Message_SetMessage(parent, field, *promoted);
}
return ret;
}
@ -280,7 +280,7 @@ upb_UnknownToMessageRet upb_MiniTable_PromoteUnknownToMessage(
if (is_oneof) {
UPB_PRIVATE(_upb_Message_SetOneofCase)(msg, field);
}
upb_Message_SetMessage(msg, mini_table, field, message);
upb_Message_SetMessage(msg, field, message);
ret.message = message;
}
return ret;