View | Details | Raw Unified | Return to bug 1868
Collapse All | Expand All

(-)a/examples/routing/manet-routing-compare.cc (-1 / +1 lines)
 Lines 343-349    Link Here 
343
  onoff1.SetAttribute ("OnTime", StringValue ("ns3::ConstantRandomVariable[Constant=1.0]"));
343
  onoff1.SetAttribute ("OnTime", StringValue ("ns3::ConstantRandomVariable[Constant=1.0]"));
344
  onoff1.SetAttribute ("OffTime", StringValue ("ns3::ConstantRandomVariable[Constant=0.0]"));
344
  onoff1.SetAttribute ("OffTime", StringValue ("ns3::ConstantRandomVariable[Constant=0.0]"));
345
345
346
  for (int i = 0; i <= nSinks - 1; i++)
346
  for (int i = 0; nSinks - i > 0; i++)
347
    {
347
    {
348
      Ptr<Socket> sink = SetupPacketReceive (adhocInterfaces.GetAddress (i), adhocNodes.Get (i));
348
      Ptr<Socket> sink = SetupPacketReceive (adhocInterfaces.GetAddress (i), adhocNodes.Get (i));
349
349
(-)a/src/lte/model/cqa-ff-mac-scheduler.cc (-1 / +1 lines)
 Lines 1963-1969    Link Here 
1963
      uldci.m_rbLen = rbPerFlow;
1963
      uldci.m_rbLen = rbPerFlow;
1964
      bool allocated = false;
1964
      bool allocated = false;
1965
      NS_LOG_INFO (this << " RB Allocated " << rbAllocated << " rbPerFlow " << rbPerFlow << " flows " << nflows);
1965
      NS_LOG_INFO (this << " RB Allocated " << rbAllocated << " rbPerFlow " << rbPerFlow << " flows " << nflows);
1966
      while ((!allocated)&&((rbAllocated + rbPerFlow - 1) < m_cschedCellConfig.m_ulBandwidth) && (rbPerFlow != 0))
1966
      while ((!allocated)&&((rbAllocated + rbPerFlow - m_cschedCellConfig.m_ulBandwidth) < 1) && (rbPerFlow != 0))
1967
        {
1967
        {
1968
          // check availability
1968
          // check availability
1969
          bool free = true;
1969
          bool free = true;
(-)a/src/lte/model/fdbet-ff-mac-scheduler.cc (-1 / +4 lines)
 Lines 1593-1599    Link Here 
1593
      uldci.m_rbLen = rbPerFlow;
1593
      uldci.m_rbLen = rbPerFlow;
1594
      bool allocated = false;
1594
      bool allocated = false;
1595
      NS_LOG_INFO (this << " RB Allocated " << rbAllocated << " rbPerFlow " << rbPerFlow << " flows " << nflows);
1595
      NS_LOG_INFO (this << " RB Allocated " << rbAllocated << " rbPerFlow " << rbPerFlow << " flows " << nflows);
1596
      while ((!allocated)&&((rbAllocated + rbPerFlow - 1) < m_cschedCellConfig.m_ulBandwidth) && (rbPerFlow != 0))
1596
      while ( (!allocated) &&
1597
              (rbAllocated + rbPerFlow - m_cschedCellConfig.m_ulBandwidth < 1) &&
1598
              (rbPerFlow != 0)
1599
              )
1597
        {
1600
        {
1598
          // check availability
1601
          // check availability
1599
          bool free = true;
1602
          bool free = true;
(-)a/src/lte/model/fdmt-ff-mac-scheduler.cc (-1 / +4 lines)
 Lines 1571-1577    Link Here 
1571
      uldci.m_rbLen = rbPerFlow;
1571
      uldci.m_rbLen = rbPerFlow;
1572
      bool allocated = false;
1572
      bool allocated = false;
1573
      NS_LOG_INFO (this << " RB Allocated " << rbAllocated << " rbPerFlow " << rbPerFlow << " flows " << nflows);
1573
      NS_LOG_INFO (this << " RB Allocated " << rbAllocated << " rbPerFlow " << rbPerFlow << " flows " << nflows);
1574
      while ((!allocated)&&((rbAllocated + rbPerFlow - 1) < m_cschedCellConfig.m_ulBandwidth) && (rbPerFlow != 0))
1574
      while ( (!allocated) &&
1575
              (rbAllocated + rbPerFlow - m_cschedCellConfig.m_ulBandwidth < 1) &&
1576
              (rbPerFlow != 0)
1577
              )
1575
        {
1578
        {
1576
          // check availability
1579
          // check availability
1577
          bool free = true;
1580
          bool free = true;
(-)a/src/lte/model/fdtbfq-ff-mac-scheduler.cc (-1 / +4 lines)
 Lines 1822-1828    Link Here 
1822
      uldci.m_rbLen = rbPerFlow;
1822
      uldci.m_rbLen = rbPerFlow;
1823
      bool allocated = false;
1823
      bool allocated = false;
1824
      NS_LOG_INFO (this << " RB Allocated " << rbAllocated << " rbPerFlow " << rbPerFlow << " flows " << nflows);
1824
      NS_LOG_INFO (this << " RB Allocated " << rbAllocated << " rbPerFlow " << rbPerFlow << " flows " << nflows);
1825
      while ((!allocated)&&((rbAllocated + rbPerFlow - 1) < m_cschedCellConfig.m_ulBandwidth) && (rbPerFlow != 0))
1825
      while ( (!allocated) &&
1826
              (rbAllocated + rbPerFlow - m_cschedCellConfig.m_ulBandwidth < 1) &&
1827
              (rbPerFlow != 0)
1828
              )
1826
        {
1829
        {
1827
          // check availability
1830
          // check availability
1828
          bool free = true;
1831
          bool free = true;
(-)a/src/lte/model/lte-enb-rrc.cc (-1 / +1 lines)
 Lines 1041-1047    Link Here 
1041
{
1041
{
1042
  NS_LOG_FUNCTION (this);
1042
  NS_LOG_FUNCTION (this);
1043
  const uint8_t MAX_DRB_ID = 32;  
1043
  const uint8_t MAX_DRB_ID = 32;  
1044
  for (uint8_t drbid = (m_lastAllocatedDrbid + 1) % MAX_DRB_ID; 
1044
  for (int drbid = (m_lastAllocatedDrbid + 1) % MAX_DRB_ID; 
1045
       drbid != m_lastAllocatedDrbid; 
1045
       drbid != m_lastAllocatedDrbid; 
1046
       drbid = (drbid + 1) % MAX_DRB_ID)
1046
       drbid = (drbid + 1) % MAX_DRB_ID)
1047
    {
1047
    {
(-)a/src/lte/model/lte-rlc-sequence-number.h (-1 / +1 lines)
 Lines 78-84    Link Here 
78
  SequenceNumber10 operator++ (int)
78
  SequenceNumber10 operator++ (int)
79
  {
79
  {
80
    SequenceNumber10 retval (m_value);
80
    SequenceNumber10 retval (m_value);
81
    m_value = (m_value + 1) % 1024;
81
    m_value = ((uint32_t)m_value + 1) % 1024;
82
    return retval;
82
    return retval;
83
  }
83
  }
84
84
(-)a/src/lte/model/pf-ff-mac-scheduler.cc (-1 / +4 lines)
 Lines 1617-1623    Link Here 
1617
      uldci.m_rbLen = rbPerFlow;
1617
      uldci.m_rbLen = rbPerFlow;
1618
      bool allocated = false;
1618
      bool allocated = false;
1619
      NS_LOG_INFO (this << " RB Allocated " << rbAllocated << " rbPerFlow " << rbPerFlow << " flows " << nflows);
1619
      NS_LOG_INFO (this << " RB Allocated " << rbAllocated << " rbPerFlow " << rbPerFlow << " flows " << nflows);
1620
      while ((!allocated)&&((rbAllocated + rbPerFlow - 1) < m_cschedCellConfig.m_ulBandwidth) && (rbPerFlow != 0))
1620
      while ( (!allocated) &&
1621
              (rbAllocated + rbPerFlow - m_cschedCellConfig.m_ulBandwidth < 1) &&
1622
              (rbPerFlow != 0)
1623
              )
1621
        {
1624
        {
1622
          // check availability
1625
          // check availability
1623
          bool free = true;
1626
          bool free = true;
(-)a/src/lte/model/pss-ff-mac-scheduler.cc (-1 / +4 lines)
 Lines 1922-1928    Link Here 
1922
      uldci.m_rbLen = rbPerFlow;
1922
      uldci.m_rbLen = rbPerFlow;
1923
      bool allocated = false;
1923
      bool allocated = false;
1924
      NS_LOG_INFO (this << " RB Allocated " << rbAllocated << " rbPerFlow " << rbPerFlow << " flows " << nflows);
1924
      NS_LOG_INFO (this << " RB Allocated " << rbAllocated << " rbPerFlow " << rbPerFlow << " flows " << nflows);
1925
      while ((!allocated)&&((rbAllocated + rbPerFlow - 1) < m_cschedCellConfig.m_ulBandwidth) && (rbPerFlow != 0))
1925
      while ( (!allocated) &&
1926
              (rbAllocated + rbPerFlow - m_cschedCellConfig.m_ulBandwidth < 1) &&
1927
              (rbPerFlow != 0)
1928
              )
1926
        {
1929
        {
1927
          // check availability
1930
          // check availability
1928
          bool free = true;
1931
          bool free = true;
(-)a/src/lte/model/rr-ff-mac-scheduler.cc (-1 / +4 lines)
 Lines 1454-1460    Link Here 
1454
      uldci.m_rbLen = rbPerFlow;
1454
      uldci.m_rbLen = rbPerFlow;
1455
      bool allocated = false;
1455
      bool allocated = false;
1456
      NS_LOG_INFO (this << " RB Allocated " << rbAllocated << " rbPerFlow " << rbPerFlow << " flows " << nflows);
1456
      NS_LOG_INFO (this << " RB Allocated " << rbAllocated << " rbPerFlow " << rbPerFlow << " flows " << nflows);
1457
      while ((!allocated)&&((rbAllocated + rbPerFlow - 1) < m_cschedCellConfig.m_ulBandwidth) && (rbPerFlow != 0))
1457
      while ( (!allocated) &&
1458
              (rbAllocated + rbPerFlow - m_cschedCellConfig.m_ulBandwidth < 1) &&
1459
              (rbPerFlow != 0)
1460
              )
1458
        {
1461
        {
1459
          // check availability
1462
          // check availability
1460
          bool free = true;
1463
          bool free = true;
(-)a/src/lte/model/tdbet-ff-mac-scheduler.cc (-1 / +4 lines)
 Lines 1515-1521    Link Here 
1515
      uldci.m_rbLen = rbPerFlow;
1515
      uldci.m_rbLen = rbPerFlow;
1516
      bool allocated = false;
1516
      bool allocated = false;
1517
      NS_LOG_INFO (this << " RB Allocated " << rbAllocated << " rbPerFlow " << rbPerFlow << " flows " << nflows);
1517
      NS_LOG_INFO (this << " RB Allocated " << rbAllocated << " rbPerFlow " << rbPerFlow << " flows " << nflows);
1518
      while ((!allocated)&&((rbAllocated + rbPerFlow - 1) < m_cschedCellConfig.m_ulBandwidth) && (rbPerFlow != 0))
1518
      while ( (!allocated) &&
1519
              (rbAllocated + rbPerFlow - m_cschedCellConfig.m_ulBandwidth < 1) &&
1520
              (rbPerFlow != 0)
1521
              )
1519
        {
1522
        {
1520
          // check availability
1523
          // check availability
1521
          bool free = true;
1524
          bool free = true;
(-)a/src/lte/model/tdmt-ff-mac-scheduler.cc (-1 / +4 lines)
 Lines 1511-1517    Link Here 
1511
      uldci.m_rbLen = rbPerFlow;
1511
      uldci.m_rbLen = rbPerFlow;
1512
      bool allocated = false;
1512
      bool allocated = false;
1513
      NS_LOG_INFO (this << " RB Allocated " << rbAllocated << " rbPerFlow " << rbPerFlow << " flows " << nflows);
1513
      NS_LOG_INFO (this << " RB Allocated " << rbAllocated << " rbPerFlow " << rbPerFlow << " flows " << nflows);
1514
      while ((!allocated)&&((rbAllocated + rbPerFlow - 1) < m_cschedCellConfig.m_ulBandwidth) && (rbPerFlow != 0))
1514
      while ( (!allocated) &&
1515
              (rbAllocated + rbPerFlow - m_cschedCellConfig.m_ulBandwidth < 1) &&
1516
              (rbPerFlow != 0)
1517
              )
1515
        {
1518
        {
1516
          // check availability
1519
          // check availability
1517
          bool free = true;
1520
          bool free = true;
(-)a/src/lte/model/tdtbfq-ff-mac-scheduler.cc (-1 / +4 lines)
 Lines 1609-1615    Link Here 
1609
      uldci.m_rbLen = rbPerFlow;
1609
      uldci.m_rbLen = rbPerFlow;
1610
      bool allocated = false;
1610
      bool allocated = false;
1611
      NS_LOG_INFO (this << " RB Allocated " << rbAllocated << " rbPerFlow " << rbPerFlow << " flows " << nflows);
1611
      NS_LOG_INFO (this << " RB Allocated " << rbAllocated << " rbPerFlow " << rbPerFlow << " flows " << nflows);
1612
      while ((!allocated)&&((rbAllocated + rbPerFlow - 1) < m_cschedCellConfig.m_ulBandwidth) && (rbPerFlow != 0))
1612
      while ( (!allocated) &&
1613
              (rbAllocated + rbPerFlow - m_cschedCellConfig.m_ulBandwidth < 1) &&
1614
              (rbPerFlow != 0)
1615
              )
1613
        {
1616
        {
1614
          // check availability
1617
          // check availability
1615
          bool free = true;
1618
          bool free = true;
(-)a/src/lte/model/tta-ff-mac-scheduler.cc (-1 / +4 lines)
 Lines 1590-1596    Link Here 
1590
      uldci.m_rbLen = rbPerFlow;
1590
      uldci.m_rbLen = rbPerFlow;
1591
      bool allocated = false;
1591
      bool allocated = false;
1592
      NS_LOG_INFO (this << " RB Allocated " << rbAllocated << " rbPerFlow " << rbPerFlow << " flows " << nflows);
1592
      NS_LOG_INFO (this << " RB Allocated " << rbAllocated << " rbPerFlow " << rbPerFlow << " flows " << nflows);
1593
      while ((!allocated)&&((rbAllocated + rbPerFlow - 1) < m_cschedCellConfig.m_ulBandwidth) && (rbPerFlow != 0))
1593
      while ( (!allocated) &&
1594
              (rbAllocated + rbPerFlow - m_cschedCellConfig.m_ulBandwidth < 1) &&
1595
              (rbPerFlow != 0)
1596
              )
1594
        {
1597
        {
1595
          // check availability
1598
          // check availability
1596
          bool free = true;
1599
          bool free = true;
(-)a/src/network/model/address.cc (-2 / +2 lines)
 Lines 90-96    Link Here 
90
Address::CopyAllTo (uint8_t *buffer, uint8_t len) const
90
Address::CopyAllTo (uint8_t *buffer, uint8_t len) const
91
{
91
{
92
  NS_LOG_FUNCTION (this << &buffer << static_cast<uint32_t> (len));
92
  NS_LOG_FUNCTION (this << &buffer << static_cast<uint32_t> (len));
93
  NS_ASSERT (len >= m_len + 2);
93
  NS_ASSERT ((int)len - m_len > 1);
94
  buffer[0] = m_type;
94
  buffer[0] = m_type;
95
  buffer[1] = m_len;
95
  buffer[1] = m_len;
96
  std::memcpy (buffer + 2, m_data, m_len);
96
  std::memcpy (buffer + 2, m_data, m_len);
 Lines 114-120    Link Here 
114
  m_type = buffer[0];
114
  m_type = buffer[0];
115
  m_len = buffer[1];
115
  m_len = buffer[1];
116
116
117
  NS_ASSERT (len >= m_len + 2);
117
  NS_ASSERT ((int)len - m_len > 1);
118
  std::memcpy (m_data, buffer + 2, m_len);
118
  std::memcpy (m_data, buffer + 2, m_len);
119
  return m_len + 2;
119
  return m_len + 2;
120
}
120
}
(-)a/src/network/utils/ipv6-address.cc (-5 / +4 lines)
 Lines 154-160    Link Here 
154
  static const char xdigits_u[] = "0123456789ABCDEF";
154
  static const char xdigits_u[] = "0123456789ABCDEF";
155
  unsigned char tmp[16];
155
  unsigned char tmp[16];
156
  unsigned char* tp = tmp;
156
  unsigned char* tp = tmp;
157
  unsigned char* endp = 0;
157
  unsigned char* const endp = tp + 16;
158
  unsigned char* colonp = 0;
158
  unsigned char* colonp = 0;
159
  const char* xdigits = 0;
159
  const char* xdigits = 0;
160
#if 0
160
#if 0
 Lines 165-171    Link Here 
165
  unsigned int val = 0;
165
  unsigned int val = 0;
166
166
167
  memset (tp, 0x00, 16);
167
  memset (tp, 0x00, 16);
168
  endp = tp + 16;
169
168
170
  /* Leading :: requires some special handling. */
169
  /* Leading :: requires some special handling. */
171
  if (*address == ':')
170
  if (*address == ':')
 Lines 212-218    Link Here 
212
              continue;
211
              continue;
213
            }
212
            }
214
213
215
          if (tp + 2 > endp)
214
          if (endp - tp < 2)
216
            {
215
            {
217
              return (0);
216
              return (0);
218
            }
217
            }
 Lines 226-232    Link Here 
226
225
227
      /* \todo Handle IPv4 mapped address (2001::192.168.0.1) */
226
      /* \todo Handle IPv4 mapped address (2001::192.168.0.1) */
228
#if 0
227
#if 0
229
      if (ch == '.' && ((tp + 4 /*NS_INADDRSZ*/) <= endp) &&
228
      if (ch == '.' && (endp - tp > 3 /*NS_INADDRSZ*/)) &&
230
          inet_pton4 (curtok, tp) > 0)
229
          inet_pton4 (curtok, tp) > 0)
231
        {
230
        {
232
          tp += 4 /*NS_INADDRSZ*/;
231
          tp += 4 /*NS_INADDRSZ*/;
 Lines 239-245    Link Here 
239
238
240
  if (seen_xdigits)
239
  if (seen_xdigits)
241
    {
240
    {
242
      if (tp + 2 > endp)
241
      if ( endp - tp < 2)
243
        {
242
        {
244
          return (0);
243
          return (0);
245
        }
244
        }
(-)a/src/network/utils/packetbb.cc (-1 / +1 lines)
 Lines 2516-2522    Link Here 
2516
        }
2516
        }
2517
2517
2518
      /* If headlen == fulllen - 1, then tail is 0 */
2518
      /* If headlen == fulllen - 1, then tail is 0 */
2519
      if (headlen <= GetAddressLength () - 1)
2519
      if (GetAddressLength () - (int)headlen > 0)
2520
        {
2520
        {
2521
          for (i = GetAddressLength () - 1;
2521
          for (i = GetAddressLength () - 1;
2522
               GetAddressLength () - 1 - i <= taillen && i > headlen;
2522
               GetAddressLength () - 1 - i <= taillen && i > headlen;
(-)a/src/wimax/model/cid-factory.cc (-2 / +2 lines)
 Lines 99-111    Link Here 
99
CidFactory::IsTransport (Cid cid) const
99
CidFactory::IsTransport (Cid cid) const
100
{
100
{
101
  uint16_t id = cid.m_identifier;
101
  uint16_t id = cid.m_identifier;
102
  return id >= 2 * m_m + 1 && id <= 0xfefe;
102
  return ((int)id - 2 * (int)m_m > 0) && (id <= 0xfefe);
103
}
103
}
104
bool
104
bool
105
CidFactory::IsPrimary (Cid cid) const
105
CidFactory::IsPrimary (Cid cid) const
106
{
106
{
107
  uint16_t id = cid.m_identifier;
107
  uint16_t id = cid.m_identifier;
108
  return id >= m_m + 1 && id <= 2 * m_m;
108
  return ((int)id - m_m > 0) && (id <= 2 * m_m);
109
}
109
}
110
bool
110
bool
111
CidFactory::IsBasic (Cid cid) const
111
CidFactory::IsBasic (Cid cid) const
(-)a/wscript (+2 lines)
 Lines 325-330    Link Here 
325
        if Options.options.build_profile == 'optimized': 
325
        if Options.options.build_profile == 'optimized': 
326
            if conf.check_compilation_flag('-march=native'):
326
            if conf.check_compilation_flag('-march=native'):
327
                env.append_value('CXXFLAGS', '-march=native') 
327
                env.append_value('CXXFLAGS', '-march=native') 
328
            env.append_value('CXXFLAGS', '-fstrict-overflow')
329
            env.append_value('CXXFLAGS', '-Wstrict-overflow=5')
328
330
329
        if sys.platform == 'win32':
331
        if sys.platform == 'win32':
330
            env.append_value("LINKFLAGS", "-Wl,--enable-runtime-pseudo-reloc")
332
            env.append_value("LINKFLAGS", "-Wl,--enable-runtime-pseudo-reloc")

Return to bug 1868