]> git.tdb.fi Git - libs/datafile.git/commitdiff
Change remaining fixed-size integers to standard types
authorMikko Rasa <tdb@tdb.fi>
Tue, 5 Oct 2021 22:08:46 +0000 (01:08 +0300)
committerMikko Rasa <tdb@tdb.fi>
Tue, 5 Oct 2021 22:09:08 +0000 (01:09 +0300)
source/binaryparser.cpp
source/binarywriter.cpp
source/type.h

index a8b350df0e1b1ee22f5f0a86596a2b76f62936ce..e105393f3d02c16f1fbb21ff5a5922f365e8534b 100644 (file)
@@ -200,7 +200,7 @@ IntType::Store BinaryParser::parse_int()
 
 FloatType::Store BinaryParser::parse_float()
 {
-       UInt64 encoded = 0;
+       uint64_t encoded = 0;
        for(unsigned i=0; i<float_precision; i+=8)
        {
                int c = in.get();
index be548446f2f1fca9fb564661d17bec4d686d6d97..59ceffecf28b89f405af90c4e6ed559ee12f8aba 100644 (file)
@@ -167,7 +167,7 @@ void BinaryWriter::write_float(FloatType::Store f)
                }
        }
 
-       UInt64 encoded = bf.compose(float_precision);
+       uint64_t encoded = bf.compose(float_precision);
        for(unsigned i=float_precision/8; i--; )
                out.put((encoded>>(i*8))&0xFF);
 }
index fdd040d81adccd82b53b9e9509b48b4348b70ed8..151f2ca96624f1da495d41c4f1179c8b597599d1 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef MSP_DATAFILE_TYPE_H_
 #define MSP_DATAFILE_TYPE_H_
 
-#include <msp/core/inttypes.h>
+#include <cstdint>
 #include <msp/core/meta.h>
 #include <msp/strings/lexicalcast.h>
 
@@ -23,7 +23,7 @@ struct Symbol
 struct IntType
 {
        static const char signature = 'i';
-       typedef Int64 Store;
+       typedef std::int64_t Store;
        typedef Store Load;
 };
 
@@ -96,19 +96,11 @@ struct TypeInfo<long int, false>: IntType { };
 template<>
 struct TypeInfo<unsigned long int, false>: IntType { };
 
-#if defined(_MSC_VER)
-template<>
-struct TypeInfo<__int64, false>: IntType { };
-
-template<>
-struct TypeInfo<unsigned __int64, false>: IntType { };
-#elif defined(__GNUC__)
 template<>
 struct TypeInfo<long long int, false>: IntType { };
 
 template<>
 struct TypeInfo<unsigned long long int, false>: IntType { };
-#endif
 
 template<>
 struct TypeInfo<float, false>: FloatType { };