]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/input_output/FGfdmSocket.cpp
Clean up header file use of iostream and "using" declarations
[flightgear.git] / src / FDM / JSBSim / input_output / FGfdmSocket.cpp
index 37f29336ea310350aaeb2dca63b43b9694f93c27..2376f2b806f28c3c8d28962e1ab373c20bdd40b5 100644 (file)
@@ -37,6 +37,9 @@ HISTORY
 INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+#include <cstring>
+#include <iostream>
+
 #include "FGfdmSocket.h"
 
 namespace JSBSim {
@@ -44,6 +47,10 @@ namespace JSBSim {
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_FDMSOCKET;
 
+using std::cerr;
+using std::cout;
+using std::endl;
+
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS IMPLEMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -79,7 +86,7 @@ FGfdmSocket::FGfdmSocket(string address, int port)
       memset(&scktName, 0, sizeof(struct sockaddr_in));
       scktName.sin_family = AF_INET;
       scktName.sin_port = htons(port);
-      memcpy(&scktName.sin_addr, host->h_addr_list[0], host->h_length);
+      std::memcpy(&scktName.sin_addr, host->h_addr_list[0], host->h_length);
       int len = sizeof(struct sockaddr_in);
       if (connect(sckt, (struct sockaddr*)&scktName, len) == 0) {   // successful
         cout << "Successfully connected to socket for output ..." << endl;
@@ -113,7 +120,7 @@ FGfdmSocket::FGfdmSocket(int port)
   sckt = socket(AF_INET, SOCK_STREAM, 0);
 
   if (sckt >= 0) {  // successful
-    memset(&scktName, 0, sizeof(struct sockaddr_in));
+    std::memset(&scktName, 0, sizeof(struct sockaddr_in));
     scktName.sin_family = AF_INET;
     scktName.sin_port = htons(port);
     int len = sizeof(struct sockaddr_in);