hton: avoid using type names as variables

This commit is contained in:
Danny Robson 2018-12-15 15:37:42 +11:00
parent 98e9fe45c4
commit e1e036e776

View File

@ -18,14 +18,14 @@ main (void)
{
cruft::TAP::logger tap;
uint16_t u16 = 0x1358;
uint32_t u32 = 0x12345678;
uint16_t val16 = 0x1358;
uint32_t val32 = 0x12345678;
tap.expect_eq (htons (u16), cruft::hton (u16), "htons");
tap.expect_eq (htonl (u32), cruft::hton (u32), "htonl");
tap.expect_eq (htons (val16), cruft::hton (val16), "htons");
tap.expect_eq (htonl (val32), cruft::hton (val32), "htonl");
tap.expect_eq (ntohs (u16), cruft::hton (u16), "ntohs");
tap.expect_eq (ntohl (u32), cruft::hton (u32), "ntohl");
tap.expect_eq (ntohs (val16), cruft::hton (val16), "ntohs");
tap.expect_eq (ntohl (val32), cruft::hton (val32), "ntohl");
return tap.status ();
}