diff --git a/src/MultiPlayer/multiplaymgr.cxx b/src/MultiPlayer/multiplaymgr.cxx index b1318f64c..16c0a6e5f 100644 --- a/src/MultiPlayer/multiplaymgr.cxx +++ b/src/MultiPlayer/multiplaymgr.cxx @@ -716,7 +716,7 @@ FGMultiplayMgr::Update(void) ////////////////////////////////////////////////// // Read the receive socket and process any data ////////////////////////////////////////////////// - size_t bytes; + ssize_t bytes; do { MsgBuf msgBuf; ////////////////////////////////////////////////// @@ -736,7 +736,7 @@ FGMultiplayMgr::Update(void) perror("FGMultiplayMgr::MP_ProcessData"); break; } - if (bytes <= sizeof(T_MsgHdr)) { + if (bytes <= static_cast(sizeof(T_MsgHdr))) { SG_LOG( SG_NETWORK, SG_ALERT, "FGMultiplayMgr::MP_ProcessData - " << "received message with insufficient data" ); break; diff --git a/src/Network/generic.cxx b/src/Network/generic.cxx index 178103e5c..ad362e258 100644 --- a/src/Network/generic.cxx +++ b/src/Network/generic.cxx @@ -143,7 +143,7 @@ bool FGGeneric::gen_message_binary() { if (binary_byte_order == BYTE_ORDER_MATCHES_NETWORK_ORDER) { *((int32_t*)&buf[length]) = (int32_t)fixed; } else { - *((uint32_t*)&buf[length]) = sg_bswap_32((uint32_t)val); + *((uint32_t*)&buf[length]) = sg_bswap_32((uint32_t)fixed); } length += sizeof(int32_t); break; @@ -399,6 +399,7 @@ bool FGGeneric::parse_message_ascii() { break; case FG_FIXED: + case FG_FLOAT: case FG_DOUBLE: val = _in_message[i].offset + strtod(p1, 0) * _in_message[i].factor; _in_message[i].prop->setFloatValue((float)val);