///////////////////////////////////////////////////////////////////////// HELPER FUNCTIONS
| 297 | ////////////////////////////////////////////////////////////////////////////// |
| 298 | // HELPER FUNCTIONS |
| 299 | static constexpr uint32_t StringLength(const char *string) { |
| 300 | const char *end = string; |
| 301 | while (*end != 0) ++end; |
| 302 | // Double check that the precision losing conversion is safe. |
| 303 | // DCHECK(end >= string); |
| 304 | // DCHECK(static_cast<std::ptrdiff_t>(static_cast<uint32_t>(end - |
| 305 | // string)) == |
| 306 | // (end - string)); |
| 307 | return static_cast<uint32_t>(end - string); |
| 308 | } |
| 309 | static constexpr uint32_t SwapEndian(uint32_t a) { |
| 310 | return ((a & 0xff) << 24) | (((a >> 8) & 0xff) << 16) | |
| 311 | (((a >> 16) & 0xff) << 8) | ((a >> 24) & 0xff); |
nothing calls this directly
no outgoing calls
no test coverage detected