Really fix bug 1345 - ns-3 should build with clang >= 3.0 (requires -Wno-deprecated due to sgi-hashmap.h)
authorVedran Mileti? <rivanvx@gmail.com>
Fri, 14 Sep 2012 22:07:40 +0200
changeset 9077 16e6f501eeef
parent 9076 7c9f34fa2dd6
child 9078 11ac313c0610
Really fix bug 1345 - ns-3 should build with clang >= 3.0 (requires -Wno-deprecated due to sgi-hashmap.h)
src/core/model/rng-stream.cc
src/dsdv/examples/dsdv-manet.cc
src/lte/model/lte-spectrum-phy.h
src/lte/model/lte-spectrum-value-helper.cc
src/lte/test/lte-test-downlink-sinr.cc
src/lte/test/lte-test-uplink-sinr.cc
src/stats/model/sqlite-data-output.h
--- a/src/core/model/rng-stream.cc	Fri Sep 14 11:48:14 2012 -0700
+++ b/src/core/model/rng-stream.cc	Fri Sep 14 22:07:40 2012 +0200
@@ -180,12 +180,13 @@
 //-------------------------------------------------------------------------
 // Compute the matrix B = (A^n Mod m);  works even if A = B.
 //
+/*
 void MatPowModM (const double A[3][3], double B[3][3], double m, int32_t n)
 {
   int i, j;
   double W[3][3];
 
-  /* initialize: W = A; B = I */
+  // initialize: W = A; B = I
   for (i = 0; i < 3; ++i)
     {
       for (j = 0; j < 3; ++j)
@@ -199,7 +200,7 @@
       B[j][j] = 1.0;
     }
 
-  /* Compute B = A^n mod m using the binary decomposition of n */
+  // Compute B = A^n mod m using the binary decomposition of n
   while (n > 0)
     {
       if (n % 2)
@@ -210,6 +211,7 @@
       n /= 2;
     }
 }
+*/
 
 // The following are the transition matrices of the two MRG components
 // (in matrix form), raised to all powers of 2 from 1 to 191
--- a/src/dsdv/examples/dsdv-manet.cc	Fri Sep 14 11:48:14 2012 -0700
+++ b/src/dsdv/examples/dsdv-manet.cc	Fri Sep 14 22:07:40 2012 +0200
@@ -155,7 +155,7 @@
 {
   NS_LOG_UNCOND (Simulator::Now ().GetSeconds () << " Received one packet!");
   Ptr <Packet> packet;
-  while (packet = socket->Recv ())
+  while ((packet = socket->Recv ()))
     {
       bytesTotal += packet->GetSize ();
       packetsReceived += 1;
--- a/src/lte/model/lte-spectrum-phy.h	Fri Sep 14 11:48:14 2012 -0700
+++ b/src/lte/model/lte-spectrum-phy.h	Fri Sep 14 22:07:40 2012 +0200
@@ -70,9 +70,9 @@
 class LteNetDevice;
 class AntennaModel;
 class LteControlMessage;
-class LteSpectrumSignalParametersDataFrame;
-class LteSpectrumSignalParametersDlCtrlFrame;
-class LteSpectrumSignalParametersUlSrsFrame;
+struct LteSpectrumSignalParametersDataFrame;
+struct LteSpectrumSignalParametersDlCtrlFrame;
+struct LteSpectrumSignalParametersUlSrsFrame;
 
 
 /**
--- a/src/lte/model/lte-spectrum-value-helper.cc	Fri Sep 14 11:48:14 2012 -0700
+++ b/src/lte/model/lte-spectrum-value-helper.cc	Fri Sep 14 22:07:40 2012 +0200
@@ -27,6 +27,24 @@
 
 #include "lte-spectrum-value-helper.h"
 
+// just needed to log a std::vector<int> properly...
+namespace std {
+
+ostream&
+operator << (ostream& os, const vector<int>& v)
+{
+  vector<int>::const_iterator it = v.begin ();
+  while (it != v.end ())
+    {
+      os << *it << " " ;
+      ++it;
+    }
+  os << endl;
+  return os;
+}
+
+}
+
 NS_LOG_COMPONENT_DEFINE ("LteSpectrumValueHelper");
 
 namespace ns3 {
@@ -213,21 +231,6 @@
   return ret;
 }
 
-// just needed to log a std::vector<int> properly...
-std::ostream&
-operator << (std::ostream& os, const std::vector<int>& v)
-{
-  std::vector<int>::const_iterator it = v.begin ();
-  while (it != v.end ())
-    {
-      os << *it << " " ;
-      ++it;
-    }
-  os << std::endl;
-  return os;
-}
-
-
 Ptr<SpectrumValue> 
 LteSpectrumValueHelper::CreateTxPowerSpectralDensity (uint16_t earfcn, uint8_t txBandwidthConfiguration, double powerTx, std::vector <int> activeRbs)
 {
--- a/src/lte/test/lte-test-downlink-sinr.cc	Fri Sep 14 11:48:14 2012 -0700
+++ b/src/lte/test/lte-test-downlink-sinr.cc	Fri Sep 14 22:07:40 2012 +0200
@@ -148,10 +148,10 @@
    */
 
   // Number of packet bursts (1 data + 4 interferences)
-  int numOfPbs = 5;
+  const int numOfPbs = 5;
 
   // Number of packets in the packet bursts
-  int numOfPkts = 10;
+  const int numOfPkts = 10;
 
   // Packet bursts
   Ptr<PacketBurst> packetBursts[numOfPbs];
@@ -319,10 +319,10 @@
   */
   
   // Number of ctrl bursts (1 data + 4 interferences)
-  int numOfUes = 5;
+  const int numOfUes = 5;
   
   // Number of control messages in the list
-  int numOfCtrlMsgs = 10;
+  const int numOfCtrlMsgs = 10;
   
   // control messages in the list
   std::list<Ptr<LteControlMessage> > ctrlMsgList[numOfUes];
@@ -443,4 +443,4 @@
 }
 
 
-} // namespace
\ No newline at end of file
+} // namespace
--- a/src/lte/test/lte-test-uplink-sinr.cc	Fri Sep 14 11:48:14 2012 -0700
+++ b/src/lte/test/lte-test-uplink-sinr.cc	Fri Sep 14 22:07:40 2012 +0200
@@ -156,12 +156,12 @@
   */
 
   // Number of packet bursts (2 data + 4 interferences)
-  int numOfDataPbs = 2;
-  int numOfIntfPbs = 4;
-  int numOfPbs = numOfDataPbs + numOfIntfPbs;
+  const int numOfDataPbs = 2;
+  const int numOfIntfPbs = 4;
+  const int numOfPbs = numOfDataPbs + numOfIntfPbs;
 
   // Number of packets in the packet bursts
-  int numOfPkts = 10;
+  const int numOfPkts = 10;
 
   // Packet bursts
   Ptr<PacketBurst> packetBursts[numOfPbs];
--- a/src/stats/model/sqlite-data-output.h	Fri Sep 14 11:48:14 2012 -0700
+++ b/src/stats/model/sqlite-data-output.h	Fri Sep 14 22:07:40 2012 +0200
@@ -27,7 +27,7 @@
 
 #define STATS_HAS_SQLITE3
 
-class sqlite3;
+struct sqlite3;
 
 namespace ns3 {