move to internal

pull/13171/head
Matt Kulukundis 3 years ago
parent d2ff429dc9
commit 17f3a0d236
  1. 13
      upb/msg_internal.h
  2. 12
      upb/upb.h
  3. 8
      upbc/protoc-gen-upb.cc

@ -50,6 +50,19 @@
extern "C" {
#endif
/** upb_*Int* conversion routines ********************************************/
UPB_INLINE int32_t _upb_Int32_FromI(int v) { return (int32_t)v; }
UPB_INLINE int64_t _upb_Int64_FromLL(long long v) { return (int64_t)v; }
UPB_INLINE uint32_t _upb_UInt32_FromU(unsigned v) { return (uint32_t)v; }
UPB_INLINE uint64_t _upb_UInt64_FromULL(unsigned long long v) {
return (uint64_t)v;
}
/** upb_MiniTable *************************************************************/
/* upb_MiniTable represents the memory layout of a given upb_MessageDef. The

@ -90,18 +90,6 @@ UPB_INLINE bool upb_StringView_IsEqual(upb_StringView a, upb_StringView b) {
return a.size == b.size && memcmp(a.data, b.data, a.size) == 0;
}
/** upb_*Int* conversion routines ********************************************/
UPB_INLINE int32_t upb_Int32_FromI(int v) { return (int32_t)v; }
UPB_INLINE int64_t upb_Int64_FromLL(long long v) { return (int64_t)v; }
UPB_INLINE uint32_t upb_UInt32_FromU(unsigned v) { return (uint32_t)v; }
UPB_INLINE uint64_t upb_UInt64_FromULL(unsigned long long v) {
return (uint64_t)v;
}
#define UPB_STRINGVIEW_INIT(ptr, len) \
{ ptr, len }

@ -323,16 +323,16 @@ std::string FieldDefault(const protobuf::FieldDescriptor* field) {
return absl::Substitute("upb_StringView_FromString(\"$0\")",
absl::CEscape(field->default_value_string()));
case protobuf::FieldDescriptor::CPPTYPE_INT32:
return absl::Substitute("upb_Int32_FromI($0)",
return absl::Substitute("_upb_Int32_FromI($0)",
field->default_value_int32());
case protobuf::FieldDescriptor::CPPTYPE_INT64:
return absl::Substitute("upb_Int64_FromLL($0ll)",
return absl::Substitute("_upb_Int64_FromLL($0ll)",
field->default_value_int64());
case protobuf::FieldDescriptor::CPPTYPE_UINT32:
return absl::Substitute("upb_UInt32_FromU($0u)",
return absl::Substitute("_upb_UInt32_FromU($0u)",
field->default_value_uint32());
case protobuf::FieldDescriptor::CPPTYPE_UINT64:
return absl::Substitute("upb_UInt64_FromULL($0ull)",
return absl::Substitute("_upb_UInt64_FromULL($0ull)",
field->default_value_uint64());
case protobuf::FieldDescriptor::CPPTYPE_FLOAT:
return absl::StrCat(field->default_value_float());

Loading…
Cancel
Save