diff options
author | Angelo Mantellini <manangel@cisco.com> | 2019-01-31 18:20:48 +0100 |
---|---|---|
committer | Angelo Mantellini <manangel@cisco.com> | 2019-02-01 15:23:03 +0100 |
commit | f5a0b8a5e24cede05e15ab696f0e15257a503525 (patch) | |
tree | 8cab87196baf7ea5468cebc4002da45175d91ae8 /hicn-light/src/core/nameBitvector.c | |
parent | bf29f9a52ffa3a1f32f700e4fd36ea53885d83aa (diff) |
[HICN24] Windows compatibility for hicn-light
Change-Id: I8e19e52c9b4ec0fcbd7344c28765f5da1937569c
Signed-off-by: Angelo Mantellini <manangel@cisco.com>
Diffstat (limited to 'hicn-light/src/core/nameBitvector.c')
-rw-r--r-- | hicn-light/src/core/nameBitvector.c | 16 |
1 files changed, 8 insertions, 8 deletions
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) |