MCPcopy Create free account
hub / github.com/MaskRay/ccls / varUInt

Method varUInt

src/serializer.hh:107–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

105 }
106
107 void varUInt(uint64_t n) {
108 if (n < 253)
109 pack<uint8_t>(n);
110 else if (n < 65536) {
111 pack<uint8_t>(253);
112 pack<uint16_t>(n);
113 } else if (n < 4294967296) {
114 pack<uint8_t>(254);
115 pack<uint32_t>(n);
116 } else {
117 pack<uint8_t>(255);
118 pack<uint64_t>(n);
119 }
120 }
121 void varInt(int64_t n) { varUInt(uint64_t(n) << 1 ^ n >> 63); }
122 std::string take() { return std::move(buf_); }
123

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected