MCPcopy Create free account
hub / github.com/GDRETools/gdsdecomp / ghtons

Function ghtons

external/parallel_hashmap/phmap_bits.h:514–514  ·  view source on GitHub ↗

Definitions for ntohl etc. that don't require us to include netinet/in.h. We wrap gbswap_32 and gbswap_16 in functions rather than just #defining them because in debug mode, gcc doesn't correctly handle the (rather involved) definitions of bswap_32. gcc guarantees that inline functions are as fast as macros, so this isn't a performance hit.

Source from the content-addressed store, hash-verified

512 // gcc guarantees that inline functions are as fast as macros, so
513 // this isn't a performance hit.
514 inline uint16_t ghtons(uint16_t x) { return gbswap_16(x); }
515 inline uint32_t ghtonl(uint32_t x) { return gbswap_32(x); }
516 inline uint64_t ghtonll(uint64_t x) { return gbswap_64(x); }
517

Callers 1

gntohsFunction · 0.85

Calls 1

gbswap_16Function · 0.85

Tested by

no test coverage detected