Auto-generate files after cl/592847506

pull/15153/head
Protobuf Team Bot 1 year ago
parent cdb078275d
commit a0e8195490
  1. 28
      php/ext/google/protobuf/php-upb.h
  2. 28
      ruby/ext/google/protobuf_c/ruby-upb.h

@ -1189,15 +1189,15 @@ UPB_PRIVATE(_upb_MiniTableField_CType)(const upb_MiniTableField* f) {
return upb_FieldType_CType(UPB_PRIVATE(_upb_MiniTableField_Type)(f)); return upb_FieldType_CType(UPB_PRIVATE(_upb_MiniTableField_Type)(f));
} }
UPB_INLINE char _upb_MiniTableField_HasbitMask( UPB_INLINE char UPB_PRIVATE(_upb_MiniTableField_HasbitMask)(
const struct upb_MiniTableField* f) { const struct upb_MiniTableField* f) {
UPB_ASSERT(f->presence > 0); UPB_ASSERT(f->presence > 0);
const size_t index = f->presence; const size_t index = f->presence;
return 1 << (index % 8); return 1 << (index % 8);
} }
UPB_INLINE size_t UPB_INLINE size_t UPB_PRIVATE(_upb_MiniTableField_HasbitOffset)(
_upb_MiniTableField_HasbitOffset(const struct upb_MiniTableField* f) { const struct upb_MiniTableField* f) {
UPB_ASSERT(f->presence > 0); UPB_ASSERT(f->presence > 0);
const size_t index = f->presence; const size_t index = f->presence;
return index / 8; return index / 8;
@ -1238,8 +1238,8 @@ UPB_PRIVATE(_upb_MiniTableField_Offset)(const struct upb_MiniTableField* f) {
return f->UPB_ONLYBITS(offset); return f->UPB_ONLYBITS(offset);
} }
UPB_INLINE size_t UPB_INLINE size_t UPB_PRIVATE(_upb_MiniTableField_OneofOffset)(
_upb_MiniTableField_OneofOffset(const struct upb_MiniTableField* f) { const struct upb_MiniTableField* f) {
UPB_ASSERT(UPB_PRIVATE(_upb_MiniTableField_IsInOneof)(f)); UPB_ASSERT(UPB_PRIVATE(_upb_MiniTableField_IsInOneof)(f));
return ~(ptrdiff_t)f->presence; return ~(ptrdiff_t)f->presence;
} }
@ -2499,22 +2499,25 @@ extern "C" {
UPB_INLINE bool UPB_PRIVATE(_upb_Message_GetHasbit)( UPB_INLINE bool UPB_PRIVATE(_upb_Message_GetHasbit)(
const upb_Message* msg, const upb_MiniTableField* f) { const upb_Message* msg, const upb_MiniTableField* f) {
const size_t offset = _upb_MiniTableField_HasbitOffset(f); const size_t offset = UPB_PRIVATE(_upb_MiniTableField_HasbitOffset)(f);
const char mask = _upb_MiniTableField_HasbitMask(f); const char mask = UPB_PRIVATE(_upb_MiniTableField_HasbitMask)(f);
return (*UPB_PTR_AT(msg, offset, const char) & mask) != 0; return (*UPB_PTR_AT(msg, offset, const char) & mask) != 0;
} }
UPB_INLINE void UPB_PRIVATE(_upb_Message_SetHasbit)( UPB_INLINE void UPB_PRIVATE(_upb_Message_SetHasbit)(
const upb_Message* msg, const upb_MiniTableField* f) { const upb_Message* msg, const upb_MiniTableField* f) {
const size_t offset = _upb_MiniTableField_HasbitOffset(f); const size_t offset = UPB_PRIVATE(_upb_MiniTableField_HasbitOffset)(f);
const char mask = _upb_MiniTableField_HasbitMask(f); const char mask = UPB_PRIVATE(_upb_MiniTableField_HasbitMask)(f);
(*UPB_PTR_AT(msg, offset, char)) |= mask; (*UPB_PTR_AT(msg, offset, char)) |= mask;
} }
UPB_INLINE void UPB_PRIVATE(_upb_Message_ClearHasbit)( UPB_INLINE void UPB_PRIVATE(_upb_Message_ClearHasbit)(
const upb_Message* msg, const upb_MiniTableField* f) { const upb_Message* msg, const upb_MiniTableField* f) {
const size_t offset = _upb_MiniTableField_HasbitOffset(f); const size_t offset = UPB_PRIVATE(_upb_MiniTableField_HasbitOffset)(f);
const char mask = _upb_MiniTableField_HasbitMask(f); const char mask = UPB_PRIVATE(_upb_MiniTableField_HasbitMask)(f);
(*UPB_PTR_AT(msg, offset, char)) &= ~mask; (*UPB_PTR_AT(msg, offset, char)) &= ~mask;
} }
@ -2522,7 +2525,8 @@ UPB_INLINE void UPB_PRIVATE(_upb_Message_ClearHasbit)(
UPB_INLINE uint32_t* UPB_PRIVATE(_upb_Message_OneofCasePtr)( UPB_INLINE uint32_t* UPB_PRIVATE(_upb_Message_OneofCasePtr)(
upb_Message* msg, const upb_MiniTableField* f) { upb_Message* msg, const upb_MiniTableField* f) {
return UPB_PTR_AT(msg, _upb_MiniTableField_OneofOffset(f), uint32_t); return UPB_PTR_AT(msg, UPB_PRIVATE(_upb_MiniTableField_OneofOffset)(f),
uint32_t);
} }
UPB_INLINE uint32_t UPB_PRIVATE(_upb_Message_GetOneofCase)( UPB_INLINE uint32_t UPB_PRIVATE(_upb_Message_GetOneofCase)(

@ -1191,15 +1191,15 @@ UPB_PRIVATE(_upb_MiniTableField_CType)(const upb_MiniTableField* f) {
return upb_FieldType_CType(UPB_PRIVATE(_upb_MiniTableField_Type)(f)); return upb_FieldType_CType(UPB_PRIVATE(_upb_MiniTableField_Type)(f));
} }
UPB_INLINE char _upb_MiniTableField_HasbitMask( UPB_INLINE char UPB_PRIVATE(_upb_MiniTableField_HasbitMask)(
const struct upb_MiniTableField* f) { const struct upb_MiniTableField* f) {
UPB_ASSERT(f->presence > 0); UPB_ASSERT(f->presence > 0);
const size_t index = f->presence; const size_t index = f->presence;
return 1 << (index % 8); return 1 << (index % 8);
} }
UPB_INLINE size_t UPB_INLINE size_t UPB_PRIVATE(_upb_MiniTableField_HasbitOffset)(
_upb_MiniTableField_HasbitOffset(const struct upb_MiniTableField* f) { const struct upb_MiniTableField* f) {
UPB_ASSERT(f->presence > 0); UPB_ASSERT(f->presence > 0);
const size_t index = f->presence; const size_t index = f->presence;
return index / 8; return index / 8;
@ -1240,8 +1240,8 @@ UPB_PRIVATE(_upb_MiniTableField_Offset)(const struct upb_MiniTableField* f) {
return f->UPB_ONLYBITS(offset); return f->UPB_ONLYBITS(offset);
} }
UPB_INLINE size_t UPB_INLINE size_t UPB_PRIVATE(_upb_MiniTableField_OneofOffset)(
_upb_MiniTableField_OneofOffset(const struct upb_MiniTableField* f) { const struct upb_MiniTableField* f) {
UPB_ASSERT(UPB_PRIVATE(_upb_MiniTableField_IsInOneof)(f)); UPB_ASSERT(UPB_PRIVATE(_upb_MiniTableField_IsInOneof)(f));
return ~(ptrdiff_t)f->presence; return ~(ptrdiff_t)f->presence;
} }
@ -2501,22 +2501,25 @@ extern "C" {
UPB_INLINE bool UPB_PRIVATE(_upb_Message_GetHasbit)( UPB_INLINE bool UPB_PRIVATE(_upb_Message_GetHasbit)(
const upb_Message* msg, const upb_MiniTableField* f) { const upb_Message* msg, const upb_MiniTableField* f) {
const size_t offset = _upb_MiniTableField_HasbitOffset(f); const size_t offset = UPB_PRIVATE(_upb_MiniTableField_HasbitOffset)(f);
const char mask = _upb_MiniTableField_HasbitMask(f); const char mask = UPB_PRIVATE(_upb_MiniTableField_HasbitMask)(f);
return (*UPB_PTR_AT(msg, offset, const char) & mask) != 0; return (*UPB_PTR_AT(msg, offset, const char) & mask) != 0;
} }
UPB_INLINE void UPB_PRIVATE(_upb_Message_SetHasbit)( UPB_INLINE void UPB_PRIVATE(_upb_Message_SetHasbit)(
const upb_Message* msg, const upb_MiniTableField* f) { const upb_Message* msg, const upb_MiniTableField* f) {
const size_t offset = _upb_MiniTableField_HasbitOffset(f); const size_t offset = UPB_PRIVATE(_upb_MiniTableField_HasbitOffset)(f);
const char mask = _upb_MiniTableField_HasbitMask(f); const char mask = UPB_PRIVATE(_upb_MiniTableField_HasbitMask)(f);
(*UPB_PTR_AT(msg, offset, char)) |= mask; (*UPB_PTR_AT(msg, offset, char)) |= mask;
} }
UPB_INLINE void UPB_PRIVATE(_upb_Message_ClearHasbit)( UPB_INLINE void UPB_PRIVATE(_upb_Message_ClearHasbit)(
const upb_Message* msg, const upb_MiniTableField* f) { const upb_Message* msg, const upb_MiniTableField* f) {
const size_t offset = _upb_MiniTableField_HasbitOffset(f); const size_t offset = UPB_PRIVATE(_upb_MiniTableField_HasbitOffset)(f);
const char mask = _upb_MiniTableField_HasbitMask(f); const char mask = UPB_PRIVATE(_upb_MiniTableField_HasbitMask)(f);
(*UPB_PTR_AT(msg, offset, char)) &= ~mask; (*UPB_PTR_AT(msg, offset, char)) &= ~mask;
} }
@ -2524,7 +2527,8 @@ UPB_INLINE void UPB_PRIVATE(_upb_Message_ClearHasbit)(
UPB_INLINE uint32_t* UPB_PRIVATE(_upb_Message_OneofCasePtr)( UPB_INLINE uint32_t* UPB_PRIVATE(_upb_Message_OneofCasePtr)(
upb_Message* msg, const upb_MiniTableField* f) { upb_Message* msg, const upb_MiniTableField* f) {
return UPB_PTR_AT(msg, _upb_MiniTableField_OneofOffset(f), uint32_t); return UPB_PTR_AT(msg, UPB_PRIVATE(_upb_MiniTableField_OneofOffset)(f),
uint32_t);
} }
UPB_INLINE uint32_t UPB_PRIVATE(_upb_Message_GetOneofCase)( UPB_INLINE uint32_t UPB_PRIVATE(_upb_Message_GetOneofCase)(

Loading…
Cancel
Save