|
|
|
@ -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:
|
|
|
|
|