]> git.mxchange.org Git - flightgear.git/blobdiff - src/MultiPlayer/multiplaymgr.cxx
fix warnings in Multiplayer, Scripting, and Time
[flightgear.git] / src / MultiPlayer / multiplaymgr.cxx
index cf4ddd53e12add9c0fa9edf4ff9fb2b5eedfbf73..b1318f64c4869fba90215fe6e08626202d86d49d 100644 (file)
@@ -268,7 +268,7 @@ namespace
 {
   bool verifyProperties(const xdr_data_t* data, const xdr_data_t* end)
   {
-    using namespace simgear::props;
+    using namespace simgear;
     const xdr_data_t* xdr = data;
     while (xdr < end) {
       unsigned id = XDR_decode_uint32(*xdr);
@@ -279,13 +279,13 @@ namespace
         xdr++;
         // How we decode the remainder of the property depends on the type
         switch (plist->type) {
-        case INT:
-        case BOOL:
-        case LONG:
+        case props::INT:
+        case props::BOOL:
+        case props::LONG:
           xdr++;
           break;
-        case FLOAT:
-        case DOUBLE:
+        case props::FLOAT:
+        case props::DOUBLE:
           {
             float val = XDR_decode_float(*xdr);
             if (osg::isNaN(val))
@@ -293,8 +293,8 @@ namespace
             xdr++;
             break;
           }
-        case STRING:
-        case UNSPECIFIED:
+        case props::STRING:
+        case props::UNSPECIFIED:
           {
             // String is complicated. It consists of
             // The length of the string
@@ -716,7 +716,7 @@ FGMultiplayMgr::Update(void)
   //////////////////////////////////////////////////
   //  Read the receive socket and process any data
   //////////////////////////////////////////////////
-  int bytes;
+  size_t bytes;
   do {
     MsgBuf msgBuf;
     //////////////////////////////////////////////////
@@ -863,7 +863,7 @@ FGMultiplayMgr::ProcessPosMsg(const FGMultiplayMgr::MsgBuf& Msg,
   }
   while (xdr < Msg.propsRecvdEnd()) {
     FGPropertyData* pData = new FGPropertyData;
-    simgear::props::Type type = simgear::props::UNSPECIFIED;
+    // simgear::props::Type type = simgear::props::UNSPECIFIED;
     
     // First element is always the ID
     pData->id = XDR_decode_uint32(*xdr);
@@ -969,14 +969,12 @@ FGMultiplayMgr::ProcessChatMsg(const MsgBuf& Msg,
   }
   
   char *chatStr = new char[MsgHdr->MsgLen - sizeof(T_MsgHdr)];
-  strncpy(chatStr,
-          (reinterpret_cast<const T_ChatMsg *>(Msg.Msg + sizeof(T_MsgHdr)))
-          ->Text,
+  const T_ChatMsg* ChatMsg
+      = reinterpret_cast<const T_ChatMsg *>(Msg.Msg + sizeof(T_MsgHdr));
+  strncpy(chatStr, ChatMsg->Text,
           MsgHdr->MsgLen - sizeof(T_MsgHdr));
   chatStr[MsgHdr->MsgLen - sizeof(T_MsgHdr) - 1] = '\0';
   
-  const T_ChatMsg* ChatMsg
-      = reinterpret_cast<const T_ChatMsg *>(Msg.Msg + sizeof(T_MsgHdr));
   SG_LOG (SG_NETWORK, SG_WARN, "Chat [" << MsgHdr->Callsign << "]"
            << " " << chatStr);