MCPcopy Create free account
hub / github.com/Tripwire/tripwire-open-source / DistanceToOne

Function DistanceToOne

src/twtest/codeconvert_t.cpp:117–128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

115}
116
117size_t DistanceToOne(size_t n)
118{
119 size_t dist;
120 for (dist = 0; n != 1; dist++)
121 {
122 n = (n >> 1);
123 }
124
125 TEST(n == 1); // n was not a power of 2!
126
127 return dist;
128}
129
130
131void ConvertAndCompareString(const std::string& s)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected