From 818da9954963d7d822dfd189f93e4c7cb56fd4a5 Mon Sep 17 00:00:00 2001 From: Eric Salo Date: Mon, 8 Apr 2024 10:03:29 -0700 Subject: [PATCH] upb: replace upb_MiniDescriptor_BuildEnum() with upb_MiniTableEnum_Build() PiperOrigin-RevId: 622879398 --- upb/mini_descriptor/build_enum.c | 6 +++--- upb/mini_descriptor/build_enum.h | 20 ++++++-------------- 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/upb/mini_descriptor/build_enum.c b/upb/mini_descriptor/build_enum.c index 53f35958a1..485fee28da 100644 --- a/upb/mini_descriptor/build_enum.c +++ b/upb/mini_descriptor/build_enum.c @@ -119,9 +119,9 @@ static upb_MiniTableEnum* upb_MtDecoder_BuildMiniTableEnum( return upb_MtDecoder_DoBuildMiniTableEnum(decoder, data, len); } -upb_MiniTableEnum* upb_MiniDescriptor_BuildEnum(const char* data, size_t len, - upb_Arena* arena, - upb_Status* status) { +upb_MiniTableEnum* upb_MiniTableEnum_Build(const char* data, size_t len, + upb_Arena* arena, + upb_Status* status) { upb_MdEnumDecoder decoder = { .base = { diff --git a/upb/mini_descriptor/build_enum.h b/upb/mini_descriptor/build_enum.h index c4b95152c7..d867194f28 100644 --- a/upb/mini_descriptor/build_enum.h +++ b/upb/mini_descriptor/build_enum.h @@ -4,6 +4,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd + #ifndef UPB_MINI_DESCRIPTOR_BUILD_ENUM_H_ #define UPB_MINI_DESCRIPTOR_BUILD_ENUM_H_ @@ -18,20 +19,11 @@ extern "C" { #endif -// Builds a upb_MiniTableEnum from an enum MiniDescriptor. The MiniDescriptor -// must be for an enum, not a message. -UPB_API upb_MiniTableEnum* upb_MiniDescriptor_BuildEnum(const char* data, - size_t len, - upb_Arena* arena, - upb_Status* status); - -// TODO: Deprecated name; update callers. -UPB_API_INLINE upb_MiniTableEnum* upb_MiniTableEnum_Build(const char* data, - size_t len, - upb_Arena* arena, - upb_Status* status) { - return upb_MiniDescriptor_BuildEnum(data, len, arena, status); -} +// Builds a upb_MiniTableEnum from an enum mini descriptor. +// The mini descriptor must be for an enum, not a message. +UPB_API upb_MiniTableEnum* upb_MiniTableEnum_Build(const char* data, size_t len, + upb_Arena* arena, + upb_Status* status); #ifdef __cplusplus } /* extern "C" */