WPILibC++ 2027.0.0-alpha-3
Loading...
Searching...
No Matches
writer.h
Go to the documentation of this file.
1#ifndef GOOGLE_UPB_UPB_WIRE_WRITER_H__
2#define GOOGLE_UPB_UPB_WIRE_WRITER_H__
3
4#include <stdint.h>
5
6// Must be last.
7#include "upb/port/def.inc"
8
9UPB_FORCEINLINE uint32_t
11 // Calculate how many bytes of the possible 10 bytes we will *not* encode,
12 // because they are part of a zero prefix. For the number 300, it would use 2
13 // bytes encoded, so the number of bytes to skip would be 8. Adding 7 to the
14 // clz input ensures that we're rounding up.
15 return (((uint32_t)clz + 7) * 9) >> 6;
16}
17
18#include "upb/port/undef.inc"
19
20#endif // GOOGLE_UPB_UPB_WIRE_WRITER_H__
#define UPB_PRIVATE(x)
Definition def.inc:393
#define UPB_FORCEINLINE
Definition def.inc:288
UPB_FORCEINLINE uint32_t UPB_PRIVATE upb_WireWriter_VarintUnusedSizeFromLeadingZeros64(uint64_t clz)
Definition writer.h:10