Definition at line 34 of file varint.c.
35{
36 uint8_t grp;
37 uint64_t q = val;
38 uint8_t *ptr = buf;
39 while (1)
40 {
41
42 grp = 0x7f & q;
43
44
45
46 q = q >> 7;
47
48
49 if ( q > 0 )
50 {
51
52
53
54
55
56
57 *ptr = 0x80 | grp;
58 ptr++;
59 }
60 else
61 {
62
63
64 *ptr = grp;
65 ptr++;
66 return ptr - buf;
67 }
68 }
69
70 lwerror(
"%s: Got out of infinite loop. Consciousness achieved.", __func__);
71 return (size_t)0;
72}
void void lwerror(const char *fmt,...) __attribute__((format(printf
Write a notice out to the error handler.
References lwerror().
Referenced by varint_s32_encode_buf(), varint_s64_encode_buf(), varint_u32_encode_buf(), and varint_u64_encode_buf().