From f5a0b8a5e24cede05e15ab696f0e15257a503525 Mon Sep 17 00:00:00 2001 From: Angelo Mantellini Date: Thu, 31 Jan 2019 18:20:48 +0100 Subject: [HICN24] Windows compatibility for hicn-light Change-Id: I8e19e52c9b4ec0fcbd7344c28765f5da1937569c Signed-off-by: Angelo Mantellini --- hicn-light/src/core/nameBitvector.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'hicn-light/src/core/nameBitvector.c') diff --git a/hicn-light/src/core/nameBitvector.c b/hicn-light/src/core/nameBitvector.c index 66f3eae20..c93f63292 100644 --- a/hicn-light/src/core/nameBitvector.c +++ b/hicn-light/src/core/nameBitvector.c @@ -49,7 +49,7 @@ struct name_bitvector { uint8_t IPversion; }; -NameBitvector *nameBitvector_CreateFromInAddr(uint32_t s_addr, uint8_t len) { +NameBitvector *nameBitvector_CreateFromInAddr(uint32_t addr, uint8_t len) { NameBitvector *bitvector = parcMemory_AllocateAndClear(sizeof(NameBitvector)); parcAssertNotNull(bitvector, "parcMemory_AllocateAndClear(%zu) returned NULL", sizeof(NameBitvector)); @@ -57,10 +57,10 @@ NameBitvector *nameBitvector_CreateFromInAddr(uint32_t s_addr, uint8_t len) { bitvector->bits[0] = 0; bitvector->bits[1] = 0; - uint8_t addr_1 = (s_addr & 0xff000000) >> 24; - uint8_t addr_2 = (s_addr & 0x00ff0000) >> 16; - uint8_t addr_3 = (s_addr & 0x0000ff00) >> 8; - uint8_t addr_4 = (s_addr & 0x000000ff); + uint8_t addr_1 = (addr & 0xff000000) >> 24; + uint8_t addr_2 = (addr & 0x00ff0000) >> 16; + uint8_t addr_3 = (addr & 0x0000ff00) >> 8; + uint8_t addr_4 = (addr & 0x000000ff); bitvector->bits[1] = (bitvector->bits[1] | addr_4) << 8; bitvector->bits[1] = (bitvector->bits[1] | addr_3) << 8; @@ -269,9 +269,9 @@ uint8_t nameBitvector_firstDiff(const NameBitvector *a, // res is computed over the bitvector which is composed by 128 bit all the // times however the prefixes may be diffrent just because the have different // lengths example: prefix 1: 0::/30 prefix 2: 0::/20 at this point of the - // function res would be 0 since both the bitvectors are composed by 0s but the - // function will return 127-20, which is the position at which the two prefix - // are different, since prefix 2 has only 20 bits + // function res would be 0 since both the bitvectors are composed by 0s but + // the function will return 127-20, which is the position at which the two + // prefix are different, since prefix 2 has only 20 bits uint8_t len_diff; if (a->len < b->len) -- cgit 1.2.3-korg