upb: clean up upb/hash/ a bit

PiperOrigin-RevId: 565057412
pull/14065/head
Eric Salo 1 year ago committed by Copybara-Service
parent 207331d860
commit 91e79b0572
  1. 22
      upb/upb/hash/common.h
  2. 2
      upb/upb/message/BUILD
  3. 1
      upb/upb/message/internal/message.h

@ -78,7 +78,7 @@ UPB_INLINE void _upb_value_setval(upb_value* v, uint64_t val) { v->val = val; }
*
* // Construct a new upb_value from an int32.
* upb_value upb_value_int32(int32_t val); */
#define FUNCS(name, membername, type_t, converter, proto_type) \
#define FUNCS(name, membername, type_t, converter) \
UPB_INLINE void upb_value_set##name(upb_value* val, type_t cval) { \
val->val = (converter)cval; \
} \
@ -91,15 +91,15 @@ UPB_INLINE void _upb_value_setval(upb_value* v, uint64_t val) { v->val = val; }
return (type_t)(converter)val.val; \
}
FUNCS(int32, int32, int32_t, int32_t, UPB_CTYPE_INT32)
FUNCS(int64, int64, int64_t, int64_t, UPB_CTYPE_INT64)
FUNCS(uint32, uint32, uint32_t, uint32_t, UPB_CTYPE_UINT32)
FUNCS(uint64, uint64, uint64_t, uint64_t, UPB_CTYPE_UINT64)
FUNCS(bool, _bool, bool, bool, UPB_CTYPE_BOOL)
FUNCS(cstr, cstr, char*, uintptr_t, UPB_CTYPE_CSTR)
FUNCS(uintptr, uptr, uintptr_t, uintptr_t, UPB_CTYPE_UPTR)
FUNCS(ptr, ptr, void*, uintptr_t, UPB_CTYPE_PTR)
FUNCS(constptr, constptr, const void*, uintptr_t, UPB_CTYPE_CONSTPTR)
FUNCS(int32, int32, int32_t, int32_t)
FUNCS(int64, int64, int64_t, int64_t)
FUNCS(uint32, uint32, uint32_t, uint32_t)
FUNCS(uint64, uint64, uint64_t, uint64_t)
FUNCS(bool, _bool, bool, bool)
FUNCS(cstr, cstr, char*, uintptr_t)
FUNCS(uintptr, uptr, uintptr_t, uintptr_t)
FUNCS(ptr, ptr, void*, uintptr_t)
FUNCS(constptr, constptr, const void*, uintptr_t)
#undef FUNCS
@ -123,8 +123,6 @@ UPB_INLINE upb_value upb_value_double(double cval) {
return ret;
}
#undef SET_TYPE
/* upb_tabkey *****************************************************************/
/* Either:

@ -94,7 +94,6 @@ cc_library(
":types",
"//upb:base",
"//upb:base_internal",
"//upb:hash",
"//upb:mem",
"//upb:mini_table",
"//upb:port",
@ -148,7 +147,6 @@ cc_library(
"//upb:collections",
"//upb:collections_internal",
"//upb:eps_copy_input_stream",
"//upb:hash",
"//upb:mem",
"//upb:mini_table",
"//upb:port",

@ -41,7 +41,6 @@
#include <stdlib.h>
#include <string.h>
#include "upb/upb/hash/common.h"
#include "upb/upb/message/internal/extension.h"
#include "upb/upb/message/internal/types.h"
#include "upb/upb/message/message.h"

Loading…
Cancel
Save