MCPcopy Create free account
hub / github.com/git/git / put_var_int

Function put_var_int

reftable/record.c:56–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54}
55
56int put_var_int(struct string_view *dest, uint64_t value)
57{
58 unsigned char varint[10];
59 unsigned pos = sizeof(varint) - 1;
60 varint[pos] = value & 0x7f;
61 while (value >>= 7)
62 varint[--pos] = 0x80 | (--value & 0x7f);
63 if (dest->len < sizeof(varint) - pos)
64 return REFTABLE_ENTRY_TOO_BIG_ERROR;
65 memcpy(dest->buf, varint + pos, sizeof(varint) - pos);
66 return sizeof(varint) - pos;
67}
68
69int reftable_is_block_type(uint8_t typ)
70{

Callers 7

encode_stringFunction · 0.85
reftable_encode_keyFunction · 0.85

Calls

no outgoing calls

Tested by 1