OLD | NEW |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2009 MIRKO BANCHI | 3 * Copyright (c) 2009 MIRKO BANCHI |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 5 * This program is free software; you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 2 as | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
688 } | 688 } |
689 return false; | 689 return false; |
690 } | 690 } |
691 | 691 |
692 uint8_t | 692 uint8_t |
693 CtrlBAckResponseHeader::IndexInBitmap (uint16_t seq) const | 693 CtrlBAckResponseHeader::IndexInBitmap (uint16_t seq) const |
694 { | 694 { |
695 uint8_t index; | 695 uint8_t index; |
696 if (seq >= m_startingSeq) | 696 if (seq >= m_startingSeq) |
697 { | 697 { |
698 index = seq - m_startingSeq; | 698 index = static_cast<uint8_t>(seq - m_startingSeq); |
699 } | 699 } |
700 else | 700 else |
701 { | 701 { |
702 index = 4096 - m_startingSeq + seq; | 702 index = static_cast<uint8_t>(4096 - m_startingSeq + seq); |
703 } | 703 } |
704 NS_ASSERT (index <= 63); | 704 NS_ASSERT (index <= 63); |
705 return index; | 705 return index; |
706 } | 706 } |
707 | 707 |
708 bool | 708 bool |
709 CtrlBAckResponseHeader::IsInBitmap (uint16_t seq) const | 709 CtrlBAckResponseHeader::IsInBitmap (uint16_t seq) const |
710 { | 710 { |
711 return (seq - m_startingSeq + 4096) % 4096 < 64; | 711 return (seq - m_startingSeq + 4096) % 4096 < 64; |
712 } | 712 } |
(...skipping 10 matching lines...) Expand all Loading... |
723 return bitmap.m_compressedBitmap; | 723 return bitmap.m_compressedBitmap; |
724 } | 724 } |
725 | 725 |
726 void | 726 void |
727 CtrlBAckResponseHeader::ResetBitmap (void) | 727 CtrlBAckResponseHeader::ResetBitmap (void) |
728 { | 728 { |
729 memset (&bitmap, 0, sizeof (bitmap)); | 729 memset (&bitmap, 0, sizeof (bitmap)); |
730 } | 730 } |
731 | 731 |
732 } //namespace ns3 | 732 } //namespace ns3 |
OLD | NEW |