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
9
UPB_FORCEINLINE
uint32_t
10
UPB_PRIVATE
(
upb_WireWriter_VarintUnusedSizeFromLeadingZeros64
)(uint64_t clz) {
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__
def.inc
UPB_PRIVATE
#define UPB_PRIVATE(x)
Definition
def.inc:393
UPB_FORCEINLINE
#define UPB_FORCEINLINE
Definition
def.inc:288
undef.inc
upb_WireWriter_VarintUnusedSizeFromLeadingZeros64
UPB_FORCEINLINE uint32_t UPB_PRIVATE upb_WireWriter_VarintUnusedSizeFromLeadingZeros64(uint64_t clz)
Definition
writer.h:10
upb
wire
writer.h
Generated on Fri Oct 24 2025 05:38:28 for WPILibC++ by
1.12.0