Auto-generate files after cl/695864676

pull/19243/head
Protobuf Team Bot 2 weeks ago
parent 82e37cda2c
commit 8b3df249ae
  1. 17
      csharp/src/Google.Protobuf/Reflection/FeatureSetDescriptor.g.cs
  2. 27
      php/ext/google/protobuf/php-upb.c
  3. 25
      php/ext/google/protobuf/php-upb.h
  4. 27
      ruby/ext/google/protobuf_c/ruby-upb.c
  5. 25
      ruby/ext/google/protobuf_c/ruby-upb.h

@ -0,0 +1,17 @@
#region Copyright notice and license
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
//
// 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
#endregion
namespace Google.Protobuf.Reflection;
internal sealed partial class FeatureSetDescriptor
{
// Canonical serialized form of the edition defaults, generated by embed_edition_defaults.
private const string DefaultsBase64 =
"ChMYhAciACoMCAEQAhgCIAMoATACChMY5wciACoMCAIQARgBIAIoATABChMY6AciDAgBEAEYASACKAEwASoAIOYHKOgH";
}

@ -3926,24 +3926,31 @@ const char* upb_Message_GetUnknown(const upb_Message* msg, size_t* len) {
}
}
void upb_Message_DeleteUnknown(upb_Message* msg, const char* data, size_t len) {
bool upb_Message_DeleteUnknown(upb_Message* msg, upb_StringView* data,
uintptr_t* iter) {
UPB_ASSERT(!upb_Message_IsFrozen(msg));
UPB_ASSERT(*iter == kUpb_Message_UnknownBegin + 1);
upb_Message_Internal* in = UPB_PRIVATE(_upb_Message_GetInternal)(msg);
const char* internal_unknown_end = UPB_PTR_AT(in, in->unknown_end, char);
#ifndef NDEBUG
size_t full_unknown_size;
const char* full_unknown = upb_Message_GetUnknown(msg, &full_unknown_size);
UPB_ASSERT((uintptr_t)data >= (uintptr_t)full_unknown);
UPB_ASSERT((uintptr_t)data < (uintptr_t)(full_unknown + full_unknown_size));
UPB_ASSERT((uintptr_t)(data + len) > (uintptr_t)data);
UPB_ASSERT((uintptr_t)(data + len) <= (uintptr_t)internal_unknown_end);
UPB_ASSERT((uintptr_t)data->data >= (uintptr_t)full_unknown);
UPB_ASSERT((uintptr_t)data->data <
(uintptr_t)(full_unknown + full_unknown_size));
UPB_ASSERT((uintptr_t)(data->data + data->size) > (uintptr_t)data->data);
UPB_ASSERT((uintptr_t)(data->data + data->size) <=
(uintptr_t)internal_unknown_end);
#endif
if ((data + len) != internal_unknown_end) {
memmove((char*)data, data + len, internal_unknown_end - data - len);
}
in->unknown_end -= len;
const char* end = data->data + data->size;
size_t offset = data->data - (const char*)in;
if (end != internal_unknown_end) {
memmove(UPB_PTR_AT(in, offset, char), end, internal_unknown_end - end);
}
in->unknown_end -= data->size;
data->size = in->unknown_end - offset;
return data->size != 0;
}
size_t upb_Message_ExtensionCount(const upb_Message* msg) {

@ -4353,8 +4353,29 @@ bool upb_Message_NextUnknown(const upb_Message* msg, upb_StringView* data,
// Returns a reference to the message's unknown data.
const char* upb_Message_GetUnknown(const upb_Message* msg, size_t* len);
// Removes partial unknown data from message.
void upb_Message_DeleteUnknown(upb_Message* msg, const char* data, size_t len);
// Removes a segment of unknown data from the message, advancing to the next
// segment. Returns false if the removed segment was at the end of the last
// chunk.
//
// This must be done while iterating:
//
// uintptr_t iter = kUpb_Message_UnknownBegin;
// upb_StringView data;
// // Iterate chunks
// while (upb_Message_NextUnknown(msg, &data, &iter)) {
// // Iterate within a chunk, deleting ranges
// while (ShouldDeleteSubSegment(&data)) {
// // Data now points to the region to be deleted
// if (!upb_Message_DeleteUnknown(msg, &data, &iter)) return;
// // If DeleteUnknown returned true, then data now points to the
// // remaining unknown fields after the region that was just deleted.
// }
// }
//
// The range given in `data` must be contained inside the most recently
// returned region.
bool upb_Message_DeleteUnknown(upb_Message* msg, upb_StringView* data,
uintptr_t* iter);
// Returns the number of extensions present in this message.
size_t upb_Message_ExtensionCount(const upb_Message* msg);

@ -3926,24 +3926,31 @@ const char* upb_Message_GetUnknown(const upb_Message* msg, size_t* len) {
}
}
void upb_Message_DeleteUnknown(upb_Message* msg, const char* data, size_t len) {
bool upb_Message_DeleteUnknown(upb_Message* msg, upb_StringView* data,
uintptr_t* iter) {
UPB_ASSERT(!upb_Message_IsFrozen(msg));
UPB_ASSERT(*iter == kUpb_Message_UnknownBegin + 1);
upb_Message_Internal* in = UPB_PRIVATE(_upb_Message_GetInternal)(msg);
const char* internal_unknown_end = UPB_PTR_AT(in, in->unknown_end, char);
#ifndef NDEBUG
size_t full_unknown_size;
const char* full_unknown = upb_Message_GetUnknown(msg, &full_unknown_size);
UPB_ASSERT((uintptr_t)data >= (uintptr_t)full_unknown);
UPB_ASSERT((uintptr_t)data < (uintptr_t)(full_unknown + full_unknown_size));
UPB_ASSERT((uintptr_t)(data + len) > (uintptr_t)data);
UPB_ASSERT((uintptr_t)(data + len) <= (uintptr_t)internal_unknown_end);
UPB_ASSERT((uintptr_t)data->data >= (uintptr_t)full_unknown);
UPB_ASSERT((uintptr_t)data->data <
(uintptr_t)(full_unknown + full_unknown_size));
UPB_ASSERT((uintptr_t)(data->data + data->size) > (uintptr_t)data->data);
UPB_ASSERT((uintptr_t)(data->data + data->size) <=
(uintptr_t)internal_unknown_end);
#endif
if ((data + len) != internal_unknown_end) {
memmove((char*)data, data + len, internal_unknown_end - data - len);
}
in->unknown_end -= len;
const char* end = data->data + data->size;
size_t offset = data->data - (const char*)in;
if (end != internal_unknown_end) {
memmove(UPB_PTR_AT(in, offset, char), end, internal_unknown_end - end);
}
in->unknown_end -= data->size;
data->size = in->unknown_end - offset;
return data->size != 0;
}
size_t upb_Message_ExtensionCount(const upb_Message* msg) {

@ -4355,8 +4355,29 @@ bool upb_Message_NextUnknown(const upb_Message* msg, upb_StringView* data,
// Returns a reference to the message's unknown data.
const char* upb_Message_GetUnknown(const upb_Message* msg, size_t* len);
// Removes partial unknown data from message.
void upb_Message_DeleteUnknown(upb_Message* msg, const char* data, size_t len);
// Removes a segment of unknown data from the message, advancing to the next
// segment. Returns false if the removed segment was at the end of the last
// chunk.
//
// This must be done while iterating:
//
// uintptr_t iter = kUpb_Message_UnknownBegin;
// upb_StringView data;
// // Iterate chunks
// while (upb_Message_NextUnknown(msg, &data, &iter)) {
// // Iterate within a chunk, deleting ranges
// while (ShouldDeleteSubSegment(&data)) {
// // Data now points to the region to be deleted
// if (!upb_Message_DeleteUnknown(msg, &data, &iter)) return;
// // If DeleteUnknown returned true, then data now points to the
// // remaining unknown fields after the region that was just deleted.
// }
// }
//
// The range given in `data` must be contained inside the most recently
// returned region.
bool upb_Message_DeleteUnknown(upb_Message* msg, upb_StringView* data,
uintptr_t* iter);
// Returns the number of extensions present in this message.
size_t upb_Message_ExtensionCount(const upb_Message* msg);

Loading…
Cancel
Save