]> git.mxchange.org Git - flightgear.git/commitdiff
MSVC++ tweaks contributed by Christian Mayer.
authorcurt <curt>
Tue, 21 Mar 2000 22:06:05 +0000 (22:06 +0000)
committercurt <curt>
Tue, 21 Mar 2000 22:06:05 +0000 (22:06 +0000)
src/Cockpit/panel.hxx
src/FDM/JSBSim/FGRotation.cpp
src/FDM/JSBSim/FGUtility.cpp
src/GUI/gui.cxx
src/Network/fg_file.hxx
src/Network/fg_serial.cxx
src/Network/fg_socket.cxx

index 79a2bee54ba07a77a01aac56c5b05c2b5064868d..f0f0ace82788c95719bc3621ba4a390733a82504 100644 (file)
 #include <plib/ssg.h>
 
 #include <vector>
-#include <hash_map>
+#include <map>
 #include <plib/fnt.h>
 
 FG_USING_STD(vector);
-FG_USING_STD(hash_map);
+FG_USING_STD(map);
 
 class FGPanelInstrument;
 
@@ -76,7 +76,7 @@ private:
   ssgTexture * _bg;
 
                                // Internalization table.
-  hash_map<const char *,ssgTexture *> _textureMap;
+  map<const char *,ssgTexture *> _textureMap;
 
                                // List of instruments in panel.
   instrument_list_type _instruments;
index 43712681c4a38f4240d252586f6665a011c33e6a..4385e13aa3009ea7b49e02fb4c4e0256e3269c34 100644 (file)
@@ -68,7 +68,7 @@ INCLUDES
 
 #ifndef M_PI
 /* get a definition for pi */
-#include <Include/fg_constants.h>
+#include <simgear/constants.h>
 #define M_PI FG_PI
 #endif
 
index 6a5225aab1b9d9cd89477290dc28a4f4034d5c6a..9ed89e70f269cfd0452bba353eda5f2b56cf9816 100644 (file)
@@ -59,7 +59,7 @@ INCLUDES
 
 #ifndef M_PI_2
 /* get a definition for pi */
-#include <Include/fg_constants.h>
+#include <simgear/constants.h>
 #define M_PI_2 FG_PI_2
 #endif
 
@@ -82,10 +82,12 @@ FGUtility::~FGUtility()
 
 float FGUtility::ToGeodetic()
 {
+    return 0.0;
 }
 
 
 float FGUtility:: FromGeodetic()
 {
+    return 0.0;
 }
 
index 44c634fda362ae394f6301acb32b89df0b8de772..7a8a71b94e4c11dfd85386003bcc41564bff2c9a 100644 (file)
@@ -70,8 +70,8 @@
 #include <Time/fg_time.hxx>
 
 #if defined( WIN32 ) && !defined( __CYGWIN__ )
-#  include <Screen/win32-printer.h>
-#  include <Screen/GlBitmaps.h>
+#  include <simgear/screen/win32-printer.h>
+#  include <simgear/screen/GlBitmaps.h>
 #endif
 
 /*
@@ -864,7 +864,7 @@ static void rotateView( double roll, double pitch, double yaw )
        // rotate view
 }
 
-static GLBitmap *b1 = NULL;
+static GlBitmap *b1 = NULL;
 extern FGInterface cur_view_fdm;
 GLubyte *hiResScreenCapture( int multiplier )
 {
index f7409948b6d632b9907d4d23d82caf6e04166c0a..4029825a5d8ed0be05a14ba831c66cf37786a7db 100644 (file)
@@ -36,7 +36,9 @@
 #include <sys/types.h>         // for open(), read(), write(), close()
 #include <sys/stat.h>          // for open(), read(), write(), close()
 #include <fcntl.h>             // for open(), read(), write(), close()
-#include <unistd.h>            // for open(), read(), write(), close()
+#if !defined( _MSC_VER )
+#  include <unistd.h>          // for open(), read(), write(), close()
+#endif
 
 #include "iochannel.hxx"
 #include "protocol.hxx"
index 78c1817a5c3c913b252a91c89acaad417e8381a8..e1897b59c8920a7417e357325ca478cca798f0b6 100644 (file)
@@ -113,7 +113,7 @@ int FGSerial::readline( char *buf, int length ) {
     // copy to external buffer
     strncpy( buf, save_buf, result );
     buf[result] = '\0';
-    cout << "fg_serial line = " << buf << endl;
+    FG_LOG( FG_IO, FG_INFO, "fg_serial line = " << buf );
 
     // shift save buffer
     for ( i = result; i < save_len; ++i ) {
index cbd50cf2735935707d753b9bea98b82cc3a5b14f..2252f031469be0d390a362d037ccb1c53b71055b 100644 (file)
 
 #include <simgear/compiler.h>
 
-#include <sys/time.h>          // select()
-#include <sys/types.h>         // socket(), bind(), select(), accept()
-#include <sys/socket.h>                // socket(), bind(), listen(), accept()
-#include <netinet/in.h>                // struct sockaddr_in
-#include <netdb.h>             // gethostbyname()
-#include <unistd.h>            // select(), fsync()/fdatasync()
+#if ! defined( _MSC_VER )
+#  include <sys/time.h>                // select()
+#  include <sys/types.h>       // socket(), bind(), select(), accept()
+#  include <sys/socket.h>      // socket(), bind(), listen(), accept()
+#  include <netinet/in.h>      // struct sockaddr_in
+#  include <netdb.h>           // gethostbyname()
+#  include <unistd.h>          // select(), fsync()/fdatasync()
+#else
+#  include <sys/timeb.h>       // select()
+#  include <winsock2.h>                // socket(), bind(), listen(), accept(),
+                               // struct sockaddr_in, gethostbyname()
+#  include <windows.h>
+#  include <io.h>
+#endif
 
 #if defined( sgi )
 #include <strings.h>
@@ -56,7 +64,7 @@ FGSocket::~FGSocket() {
 int FGSocket::make_server_socket () {
     struct sockaddr_in name;
 
-#if defined( __CYGWIN__ ) || defined( __CYGWIN32__ ) || defined( sgi )
+#if defined( __CYGWIN__ ) || defined( __CYGWIN32__ ) || defined( sgi ) || defined( _MSC_VER )
     int length;
 #else
     socklen_t length;
@@ -154,7 +162,7 @@ bool FGSocket::open( FGProtocol::fgProtocolDir dir ) {
        // call.  A port of "0" indicates that we want to let the os
        // pick any available port.
        sock = make_server_socket();
-       cout << "socket is connected to port = " << port << endl;
+       FG_LOG( FG_IO, FG_INFO, "socket is connected to port = " << port );
 
        // Specify the maximum length of the connection queue
        listen(sock, FG_MAX_SOCKET_QUEUE);
@@ -231,9 +239,9 @@ int FGSocket::readline( char *buf, int length ) {
        char *buf_ptr = save_buf + save_len;
        result = std::read( sock, buf_ptr, FG_MAX_MSG_SIZE - save_len );
        save_len += result;
-       cout << "current read = " << buf_ptr << endl;
-       cout << "current save_buf = " << save_buf << endl;
-       cout << "save_len = " << save_len << endl;
+       // cout << "current read = " << buf_ptr << endl;
+       // cout << "current save_buf = " << save_buf << endl;
+       // cout << "save_len = " << save_len << endl;
     }
 
     // look for the end of line in save_buf
@@ -243,17 +251,17 @@ int FGSocket::readline( char *buf, int length ) {
        result = i + 1;
     } else {
        // no end of line yet
-       cout << "no eol found" << endl;
+       // cout << "no eol found" << endl;
        return 0;
     }
-    cout << "line length = " << result << endl;
+    // cout << "line length = " << result << endl;
 
     // we found an end of line
 
     // copy to external buffer
     strncpy( buf, save_buf, result );
     buf[result] = '\0';
-    cout << "fg_socket line = " << buf << endl;
+    // cout << "fg_socket line = " << buf << endl;
     
     // shift save buffer
     for ( i = result; i < save_len; ++i ) {