Lines Matching defs:ret

768   size_t ret = 128;
769 while (ret < bytes) {
770 ret *= 2;
772 return ret;
846 uint32_t ret;
847 memcpy(&ret, msg - f->presence, sizeof(ret));
848 return ret;
1384 int ret = 0;
1386 while (v >>= 1) ret++;
1387 ret = pow2 ? ret : ret + 1; /* Ceiling. */
1388 return UPB_MIN(UPB_MAXARRSIZE, ret);
2382 void *ret;
2388 ret = upb_arena_malloc(a, size);
2389 if (!ret) return NULL;
2394 memcpy(ret, ptr, oldsize); /* Preserve existing data. */
2398 return ret;
2981 str_t *ret = upb_malloc(alloc, sizeof(*ret) + len);
2982 if (!ret) return NULL;
2983 ret->len = len;
2984 memcpy(ret->str, data, len);
2985 ret->str[len] = '\0';
2986 return ret;
3169 uint32_t ret = upb_fielddef_number(f);
3171 UPB_ASSERT(ret < high_bit);
3173 ret |= high_bit;
3174 return ret;
3193 uint32_t ret = 1;
3194 if (upb_fielddef_isseq(f)) ret += 2; /* STARTSEQ/ENDSEQ */
3195 if (upb_fielddef_isstring(f)) ret += 2; /* [STRING]/STARTSTR/ENDSTR */
3198 ret += 0;
3201 ret += 3;
3204 return ret;
3886 uint32_t ret;
3889 ret = l->size;
3891 return ret;
4088 /* ret = prefix + '.' + name; */
4090 char *ret = upb_malloc(ctx->alloc, n + name.size + 2);
4091 CHK_OOM(ret);
4092 strcpy(ret, prefix);
4093 ret[n] = '.';
4094 memcpy(&ret[n + 1], name.data, name.size);
4095 ret[n + 1 + name.size] = '\0';
4096 return ret;
4197 const void *ret;
4198 if (!resolvename(ctx->addtab, f, base, sym, type, ctx->status, &ret) &&
4199 !resolvename(&ctx->symtab->syms, f, base, sym, type, ctx->status, &ret)) {
4205 return ret;
5242 upb_mutmsgval ret;
5246 memcpy(&ret, mem, sizeof(void*));
5248 if (a && (!ret.msg || wrong_oneof)) {
5253 ret.map = upb_map_new(a, upb_fielddef_type(key), upb_fielddef_type(value));
5255 ret.array = upb_array_new(a, upb_fielddef_type(f));
5258 ret.msg = upb_msg_new(upb_fielddef_msgsubdef(f), a);
5261 memcpy(mem, &ret, sizeof(void*));
5267 return ret;
5331 upb_msgval ret;
5335 memcpy(&ret, data + (i << lg2), 1 << lg2);
5336 return ret;
5393 upb_msgval ret;
5396 _upb_map_fromkey(upb_strtable_iter_key(&i), &ret, map->key_size);
5397 return ret;
5402 upb_msgval ret;
5405 _upb_map_fromvalue(upb_strtable_iter_value(&i), &ret, map->val_size);
5406 return ret;
5534 const void *ret;
5538 ret = h->top_closure_type;
5544 ret = h->table[sel].attr.return_closure_type;
5549 ret = h->table[sel].attr.return_closure_type;
5555 * ret = h->table[sel].attr.return_closure_type;
5558 return ret;
5674 upb_func *ret = (upb_func *)h->table[s].func;
5675 if (ret && handler_data) {
5678 return ret;
5979 bool ret;
5982 ret = upb_bytessink_start(sink, len, &subc);
5983 if (ret && len != 0) {
5984 ret = (upb_bytessink_putbuf(sink, subc, buf, len, &handle) >= len);
5986 if (ret) {
5987 ret = upb_bytessink_end(sink);
5989 return ret;
6001 int ret = _vsnprintf_s(s, n, _TRUNCATE, format, arg);
6002 if (ret < 0) {
6003 ret = _vscprintf(format, arg);
6005 return ret;
6011 int ret = msvc_vsnprintf(s, n, format, arg);
6013 return ret;
6044 upb_pbdecodermethod *ret = upb_gmalloc(sizeof(*ret));
6045 upb_byteshandler_init(&ret->input_handler_);
6047 ret->group = group;
6048 ret->dest_handlers_ = dest_handlers;
6049 upb_inttable_init(&ret->dispatch, UPB_CTYPE_UINT64);
6051 return ret;
6108 compiler *ret = upb_gmalloc(sizeof(*ret));
6111 ret->group = group;
6112 ret->lazy = lazy;
6114 ret->fwd_labels[i] = EMPTYLABEL;
6115 ret->back_labels[i] = EMPTYLABEL;
6117 return ret;
6214 int32_t ret = (*lptr == EMPTYLABEL) ? 0 : *lptr - pcofs(c);
6216 return ret;
7209 size_t ret = d->size_param - (d->end - d->checkpoint);
7216 return ret;
7303 size_t ret = curbufleft(d);
7304 memcpy(buf, d->ptr, ret);
7306 size_t copy = UPB_MIN(bytes - ret, d->size_param);
7307 memcpy((char *)buf + ret, d->buf_param, copy);
7308 ret += copy;
7310 return ret;
7371 int32_t ret = decode_varint(d, &u64);
7372 if (ret >= 0) return ret;
7703 int32_t ret = skip(d, n);
7705 UPB_ASSERT(ret >= 0);
7706 return ret;
8319 uint64_t ret;
8320 memcpy(&ret, &d, sizeof(uint64_t));
8321 return ret;
8325 uint32_t ret;
8326 memcpy(&ret, &d, sizeof(uint32_t));
8327 return ret;
9393 size_t ret = a * b;
9394 if (b != 0 && ret / b != a) {
9395 ret = SIZE_MAX;
9397 return ret;
10670 int64_t ret = epoch_days(tp->tm_year + 1900, tp->tm_mon + 1, tp->tm_mday);
10671 ret = (ret * 24) + tp->tm_hour;
10672 ret = (ret * 60) + tp->tm_min;
10673 ret = (ret * 60) + tp->tm_sec;
10674 return ret;
12456 strpc *ret = upb_gmalloc(sizeof(*ret));
12458 ret->ptr = upb_gstrdup(upb_fielddef_name(f));
12459 ret->len = strlen(ret->ptr);
12461 ret->ptr = upb_gstrdup(upb_fielddef_jsonname(f));
12462 ret->len = strlen(ret->ptr);
12465 upb_handlers_addcleanup(h, ret, freestrpc);
12466 return ret;
12471 strpc * ret = upb_gmalloc(sizeof(*ret));
12472 ret->ptr = upb_gstrdup(str);
12473 ret->len = strlen(str);
12474 upb_handlers_addcleanup(h, ret, freestrpc);
12475 return ret;
13788 upb_handlercache *ret = upb_handlercache_new(printer_sethandlers, cache);
13791 upb_handlercache_addcleanup(ret, cache, upb_gfree);
13793 return ret;