]> git.mxchange.org Git - simgear.git/blobdiff - simgear/io/lowtest.cxx
Don't use object returned from vector::end()
[simgear.git] / simgear / io / lowtest.cxx
index a808915cff55a9f5bd2b2f15161eb16439a2eab6..eae27f34d42d4f12ad03ff46442f2af27621dd72 100644 (file)
@@ -1,16 +1,16 @@
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
 #include <simgear/compiler.h>
 
-#include STL_IOSTREAM
+#include <iostream>
 #include "lowlevel.hxx"
 
+
 static const int sgEndianTest = 1;
 #define sgIsLittleEndian (*((char *) &sgEndianTest ) != 0)
 #define sgIsBigEndian    (*((char *) &sgEndianTest ) == 0)
 
+using std::cout;
+using std::endl;
+
 
 int main() {
     cout << "This machine is ";
@@ -21,24 +21,26 @@ int main() {
     }
     cout << "endian" << endl;
 
+    cout << "sizeof(short) = " << sizeof(short) << endl;
+
     short s = 1111;
     cout << "short s = " << s << endl;
-    sgEndianSwap((unsigned short *)&s);
+    sgEndianSwap((uint16_t *)&s);
     cout << "short s = " << s << endl;
-    sgEndianSwap((unsigned short *)&s);
+    sgEndianSwap((uint16_t *)&s);
     cout << "short s = " << s << endl;
 
     int i = 1111111;
     cout << "int i = " << i << endl;
-    sgEndianSwap((unsigned int *)&i);
+    sgEndianSwap((uint32_t *)&i);
     cout << "int i = " << i << endl;
-    sgEndianSwap((unsigned int *)&i);
+    sgEndianSwap((uint32_t *)&i);
     cout << "int i = " << i << endl;
 
     double x = 1111111111;
     cout << "double x = " << x << endl;
-    sgEndianSwap((unsigned long long *)&x);
+    sgEndianSwap((uint64_t *)&x);
     cout << "double x = " << x << endl;
-    sgEndianSwap((unsigned long long *)&x);
+    sgEndianSwap((uint64_t *)&x);
     cout << "double x = " << x << endl;
 }