From e4a7186b22949db41b55ae8c3bc5e473d52accdc Mon Sep 17 00:00:00 2001 From: Peter Limkilde Svendsen Date: Thu, 28 May 2020 20:17:57 +0200 Subject: [PATCH] Use C type names in byteorder functions --- src/header/arpa_inet/mod.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/header/arpa_inet/mod.rs b/src/header/arpa_inet/mod.rs index 098fbc7e0e..777430da4a 100644 --- a/src/header/arpa_inet/mod.rs +++ b/src/header/arpa_inet/mod.rs @@ -16,22 +16,22 @@ use crate::{ }; #[no_mangle] -pub extern "C" fn htonl(hostlong: u32) -> u32 { +pub extern "C" fn htonl(hostlong: uint32_t) -> uint32_t { hostlong.to_be() } #[no_mangle] -pub extern "C" fn htons(hostshort: u16) -> u16 { +pub extern "C" fn htons(hostshort: uint16_t) -> uint16_t { hostshort.to_be() } #[no_mangle] -pub extern "C" fn ntohl(netlong: u32) -> u32 { +pub extern "C" fn ntohl(netlong: uint32_t) -> uint32_t { u32::from_be(netlong) } #[no_mangle] -pub extern "C" fn ntohs(netshort: u16) -> u16 { +pub extern "C" fn ntohs(netshort: uint16_t) -> uint16_t { u16::from_be(netshort) }