Lines Matching refs:val

518   uint64_t val;
531 UPB_INLINE void _upb_value_setval(upb_value *v, uint64_t val) {
532 v->val = val;
535 UPB_INLINE upb_value _upb_value_val(uint64_t val) {
537 _upb_value_setval(&ret, val);
544 * int32_t upb_value_getint32(upb_value val);
545 * void upb_value_setint32(upb_value *val, int32_t cval);
548 * upb_value upb_value_int32(int32_t val); */
550 UPB_INLINE void upb_value_set ## name(upb_value *val, type_t cval) { \
551 val->val = (converter)cval; \
553 UPB_INLINE upb_value upb_value_ ## name(type_t val) { \
555 upb_value_set ## name(&ret, val); \
558 UPB_INLINE type_t upb_value_get ## name(upb_value val) { \
559 return (type_t)(converter)val.val; \
574 UPB_INLINE void upb_value_setfloat(upb_value *val, float cval) {
575 memcpy(&val->val, &cval, sizeof(cval));
578 UPB_INLINE void upb_value_setdouble(upb_value *val, double cval) {
579 memcpy(&val->val, &cval, sizeof(cval));
618 uint64_t val;
627 upb_tabval val;
691 return key.val != (uint64_t)-1;
738 bool upb_inttable_insert2(upb_inttable *t, uintptr_t key, upb_value val,
741 upb_value val, upb_alloc *a);
744 upb_value val) {
745 return upb_inttable_insert2(t, key, val, &upb_alloc_global);
749 size_t len, upb_value val) {
750 return upb_strtable_insert3(t, key, len, val, &upb_alloc_global);
755 upb_value val) {
756 return upb_strtable_insert2(t, key, strlen(key), val);
772 * and stores the removed item in *val if non-NULL. */
773 bool upb_inttable_remove(upb_inttable *t, uintptr_t key, upb_value *val);
775 upb_value *val, upb_alloc *alloc);
778 size_t len, upb_value *val) {
779 return upb_strtable_remove3(t, key, len, val, &upb_alloc_global);
791 bool upb_inttable_replace(upb_inttable *t, uintptr_t key, upb_value val);
795 bool upb_inttable_push2(upb_inttable *t, upb_value val, upb_alloc *a);
798 UPB_INLINE bool upb_inttable_push(upb_inttable *t, upb_value val) {
799 return upb_inttable_push2(t, val, &upb_alloc_global);
803 bool upb_inttable_insertptr2(upb_inttable *t, const void *key, upb_value val,
805 bool upb_inttable_removeptr(upb_inttable *t, const void *key, upb_value *val);
807 const upb_inttable *t, const void *key, upb_value *val);
810 upb_value val) {
811 return upb_inttable_insertptr2(t, key, val, &upb_alloc_global);
831 _upb_value_setval(v, arrval.val);
841 _upb_value_setval(v, e->val.val);
882 * const upb_value val = upb_strtable_iter_value(&i);
908 * upb_value val = upb_inttable_iter_value(&i);
1126 /* Size of key and val, based on the map type. Strings are represented as '0'
1141 upb_value val; /* For all other types. */
1145 upb_value val; /* For all other types. */
1177 UPB_INLINE upb_value _upb_map_tovalue(const void *val, size_t size,
1182 *strp = *(upb_strview*)val;
1185 memcpy(&ret, val, size);
1190 UPB_INLINE void _upb_map_fromvalue(upb_value val, void* out, size_t size) {
1192 const upb_strview *strp = (const upb_strview*)upb_value_getptr(val);
1195 memcpy(out, &val, size);
1206 size_t key_size, void *val, size_t val_size) {
1211 _upb_map_fromvalue(tabval, val, val_size);
1227 void *val, size_t val_size, upb_arena *arena) {
1229 upb_value tabval = _upb_map_tovalue(val, val_size, arena);
1254 const void *key, size_t key_size, void *val,
1258 return _upb_map_get(map, key, key_size, val, val_size);
1269 size_t key_size, void *val, size_t val_size,
1275 return _upb_map_set(*map, key, key_size, val, val_size, arena);
1302 UPB_INLINE void _upb_msg_map_value(const void* msg, void* val, size_t size) {
1305 _upb_value_setval(&v, ent->val.val);
1306 _upb_map_fromvalue(v, val, size);
1309 UPB_INLINE void _upb_msg_map_set_value(void* msg, const void* val, size_t size) {
1314 upb_strview *strp = (upb_strview*)ent->val.val;
1315 memcpy(strp, val, sizeof(*strp));
1317 memcpy(&ent->val.val, val, size);
1594 UPB_INLINE bool google_protobuf_FileDescriptorProto_add_dependency(google_protobuf_FileDescriptorProto *msg, upb_strview val, upb_arena *arena) {
1595 return _upb_array_append_accessor(msg, UPB_SIZE(36, 72), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
1682 UPB_INLINE bool google_protobuf_FileDescriptorProto_add_public_dependency(google_protobuf_FileDescriptorProto *msg, int32_t val, upb_arena *arena) {
1683 return _upb_array_append_accessor(msg, UPB_SIZE(56, 112), UPB_SIZE(4, 4), UPB_TYPE_INT32, &val,
1692 UPB_INLINE bool google_protobuf_FileDescriptorProto_add_weak_dependency(google_protobuf_FileDescriptorProto *msg, int32_t val, upb_arena *arena) {
1693 return _upb_array_append_accessor(msg, UPB_SIZE(60, 120), UPB_SIZE(4, 4), UPB_TYPE_INT32, &val,
1849 UPB_INLINE bool google_protobuf_DescriptorProto_add_reserved_name(google_protobuf_DescriptorProto *msg, upb_strview val, upb_arena *arena) {
1850 return _upb_array_append_accessor(msg, UPB_SIZE(44, 88), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
2157 UPB_INLINE bool google_protobuf_EnumDescriptorProto_add_reserved_name(google_protobuf_EnumDescriptorProto *msg, upb_strview val, upb_arena *arena) {
2158 return _upb_array_append_accessor(msg, UPB_SIZE(24, 48), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
2964 UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_add_path(google_protobuf_SourceCodeInfo_Location *msg, int32_t val, upb_arena *arena) {
2965 return _upb_array_append_accessor(msg, UPB_SIZE(20, 40), UPB_SIZE(4, 4), UPB_TYPE_INT32, &val,
2974 UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_add_span(google_protobuf_SourceCodeInfo_Location *msg, int32_t val, upb_arena *arena) {
2975 return _upb_array_append_accessor(msg, UPB_SIZE(24, 48), UPB_SIZE(4, 4), UPB_TYPE_INT32, &val,
2992 UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_add_leading_detached_comments(google_protobuf_SourceCodeInfo_Location *msg, upb_strview val, upb_arena *arena) {
2993 return _upb_array_append_accessor(msg, UPB_SIZE(28, 56), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
3056 UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_add_path(google_protobuf_GeneratedCodeInfo_Annotation *msg, int32_t val, upb_arena *arena) {
3057 return _upb_array_append_accessor(msg, UPB_SIZE(20, 32), UPB_SIZE(4, 4), UPB_TYPE_INT32, &val,
3448 void upb_msg_set(upb_msg *msg, const upb_fielddef *f, upb_msgval val,
3458 * upb_msgval val;
3459 * while (upb_msg_next(msg, m, ext_pool, &f, &val, &iter)) {
3460 * process_field(f, val);
3471 upb_msgval *val, size_t *iter);
3493 void upb_array_set(upb_array *arr, size_t i, upb_msgval val);
3496 bool upb_array_append(upb_array *array, upb_msgval val, upb_arena *arena);
3511 /* Stores a value for the given key into |*val| (or the zero value if the key is
3512 * not present). Returns whether the key was present. The |val| pointer may be
3514 bool upb_map_get(const upb_map *map, upb_msgval key, upb_msgval *val);
3521 bool upb_map_set(upb_map *map, upb_msgval key, upb_msgval val,
3532 * upb_msgval val = upb_mapiter_value(map, iter);
3695 typedef bool upb_int32_handlerfunc(void *c, const void *hd, int32_t val);
3696 typedef bool upb_int64_handlerfunc(void *c, const void *hd, int64_t val);
3697 typedef bool upb_uint32_handlerfunc(void *c, const void *hd, uint32_t val);
3698 typedef bool upb_uint64_handlerfunc(void *c, const void *hd, uint64_t val);
3699 typedef bool upb_float_handlerfunc(void *c, const void *hd, float val);
3700 typedef bool upb_double_handlerfunc(void *c, const void *hd, double val);
3701 typedef bool upb_bool_handlerfunc(void *c, const void *hd, bool val);
3798 * void OnValue1(MyClosure* c, const MyHandlerData* d, int32_t val) {
3803 * void OnValue2(MyClosure* c, int32_t val) {
3808 * bool OnValue3(MyClosure* c, int32_t val) {
3816 * void OnValue(int32_t val) {
3951 * C/C++ type for "val"):
3953 * bool OnValue(MyClosure* c, const MyHandlerData* d, int32_t val) {
5241 ctype val) { \
5248 return func(s.closure, hd, val); \
5498 bool PutInt32(HandlersPtr::Selector s, int32_t val) {
5499 return upb_sink_putint32(sink_, s, val);
5502 bool PutInt64(HandlersPtr::Selector s, int64_t val) {
5503 return upb_sink_putint64(sink_, s, val);
5506 bool PutUInt32(HandlersPtr::Selector s, uint32_t val) {
5507 return upb_sink_putuint32(sink_, s, val);
5510 bool PutUInt64(HandlersPtr::Selector s, uint64_t val) {
5511 return upb_sink_putuint64(sink_, s, val);
5514 bool PutFloat(HandlersPtr::Selector s, float val) {
5515 return upb_sink_putfloat(sink_, s, val);
5518 bool PutDouble(HandlersPtr::Selector s, double val) {
5519 return upb_sink_putdouble(sink_, s, val);
5522 bool PutBool(HandlersPtr::Selector s, bool val) {
5523 return upb_sink_putbool(sink_, s, val);
6259 UPB_INLINE uint64_t byteswap64(uint64_t val) {
6261 return (val & (byte << 56) >> 56)
6262 | (val & (byte << 48) >> 40)
6263 | (val & (byte << 40) >> 24)
6264 | (val & (byte << 32) >> 8)
6265 | (val & (byte << 24) << 8)
6266 | (val & (byte << 16) << 24)
6267 | (val & (byte << 8) << 40)
6268 | (val & (byte << 0) << 56);
6292 uint64_t val;
6295 UPB_INLINE upb_decoderet upb_decoderet_make(const char *p, uint64_t val) {
6298 ret.val = val;
6342 UPB_INLINE int upb_value_size(uint64_t val) {
6344 int high_bit = 63 - __builtin_clzll(val); /* 0-based, undef if val == 0. */
6347 uint64_t tmp = val;
6350 return val == 0 ? 1 : high_bit / 8 + 1;
6357 UPB_INLINE size_t upb_vencode64(uint64_t val, char *buf) {
6359 if (val == 0) { buf[0] = 0; return 1; }
6361 while (val) {
6362 uint8_t byte = val & 0x7fU;
6363 val >>= 7;
6364 if (val) byte |= 0x80U;
6370 UPB_INLINE size_t upb_varint_size(uint64_t val) {
6372 return upb_vencode64(val, buf);
6376 UPB_INLINE uint64_t upb_vencode32(uint32_t val) {
6378 size_t bytes = upb_vencode64(val, buf);