diff --git a/gatb-core/src/gatb/bank/impl/BankComposite.hpp b/gatb-core/src/gatb/bank/impl/BankComposite.hpp index 63c889566..539d5e5e0 100644 --- a/gatb-core/src/gatb/bank/impl/BankComposite.hpp +++ b/gatb-core/src/gatb/bank/impl/BankComposite.hpp @@ -153,7 +153,7 @@ class BankComposite : public AbstractBank size_t getCompositionNb() { return _banks.size(); } /** \return maximum number of files. */ - static const size_t getMaxNbFiles () { return 30; } + static size_t getMaxNbFiles () { return 30; } /** Return the vector of IBank objects. * \return the IBank objects. */ diff --git a/gatb-core/src/gatb/bank/impl/BankFasta.hpp b/gatb-core/src/gatb/bank/impl/BankFasta.hpp index dacb28dbe..7ace0322c 100644 --- a/gatb-core/src/gatb/bank/impl/BankFasta.hpp +++ b/gatb-core/src/gatb/bank/impl/BankFasta.hpp @@ -209,7 +209,7 @@ class BankFasta : public AbstractBank protected: /** \return maximum number of files. */ - static const size_t getMaxNbFiles () { return 1; } + static size_t getMaxNbFiles () { return 1; } friend class Iterator; diff --git a/gatb-core/src/gatb/bank/impl/BankRandom.hpp b/gatb-core/src/gatb/bank/impl/BankRandom.hpp index 6e3206be9..6cb86319a 100644 --- a/gatb-core/src/gatb/bank/impl/BankRandom.hpp +++ b/gatb-core/src/gatb/bank/impl/BankRandom.hpp @@ -81,7 +81,7 @@ class BankRandom : public AbstractBank void estimate (u_int64_t& number, u_int64_t& totalSize, u_int64_t& maxSize); /** \return maximum number of files. */ - static const size_t getMaxNbFiles () { return 0; } + static size_t getMaxNbFiles () { return 0; } /************************************************************/ diff --git a/gatb-core/src/gatb/bank/impl/BankSplitter.hpp b/gatb-core/src/gatb/bank/impl/BankSplitter.hpp index 186bf0dd1..f77a792a0 100644 --- a/gatb-core/src/gatb/bank/impl/BankSplitter.hpp +++ b/gatb-core/src/gatb/bank/impl/BankSplitter.hpp @@ -99,7 +99,7 @@ class BankSplitter : public AbstractBank void estimate (u_int64_t& number, u_int64_t& totalSize, u_int64_t& maxSize); /** \return maximum number of files. */ - static const size_t getMaxNbFiles () { return 0; } + static size_t getMaxNbFiles () { return 0; } /************************************************************/ diff --git a/gatb-core/src/gatb/kmer/impl/CountProcessorHistogram.hpp b/gatb-core/src/gatb/kmer/impl/CountProcessorHistogram.hpp index 43c71c92b..93dcda5ba 100644 --- a/gatb-core/src/gatb/kmer/impl/CountProcessorHistogram.hpp +++ b/gatb-core/src/gatb/kmer/impl/CountProcessorHistogram.hpp @@ -119,7 +119,7 @@ class CountProcessorHistogram : public CountProcessorAbstract fprintf(histo2Dfile,"%5i:\t",ii); for(int jj=0; jj<= _histogram->getLength2(); jj++) { - fprintf(histo2Dfile,"\t%6lli", _histogram->get2D(ii,jj)); + fprintf(histo2Dfile,"\t%6lli", (long long)_histogram->get2D(ii,jj)); } fprintf(histo2Dfile,"\n"); } @@ -134,7 +134,7 @@ class CountProcessorHistogram : public CountProcessorAbstract //output 1D histogram now for(int ii=1; ii<= _histogram->getLength(); ii++) { - fprintf(histo1Dfile,"%i\t%lli",ii,_histogram->get(ii)); + fprintf(histo1Dfile,"%i\t%lli",ii,(long long)_histogram->get(ii)); fprintf(histo1Dfile,"\n"); } diff --git a/gatb-core/src/gatb/tools/compression/HeaderCoder.cpp b/gatb-core/src/gatb/tools/compression/HeaderCoder.cpp index 2bc38adb5..ccbb2ea91 100644 --- a/gatb-core/src/gatb/tools/compression/HeaderCoder.cpp +++ b/gatb-core/src/gatb/tools/compression/HeaderCoder.cpp @@ -25,6 +25,7 @@ #define PRINT_DEBUG_ENCODER #define PRINT_DEBUG_DECODER */ +#include //==================================================================================== @@ -703,13 +704,10 @@ void HeaderDecoder::decodeNumeric(){ u_int64_t value = CompressionUtils::decodeNumeric(_rangeDecoder, _numericModels[_misIndex]); //_currentHeader += CompressionUtils::numberToString(value); - char temp[200]; - snprintf(temp,200,"%llu",value); - _currentHeader += string(temp); - //_currentHeader += to_string(value); // C++11 + _currentHeader += std::to_string(value); #ifdef PRINT_DEBUG_DECODER - cout << "\t\t\tAdding: " << string(temp) << endl; + cout << "\t\t\tAdding: " << std::to_string(value) << endl; #endif } @@ -723,13 +721,10 @@ void HeaderDecoder::decodeDelta(){ value = CompressionUtils::getValueFromDelta(1, _prevFieldValues[_fieldIndex], value); - char temp[200]; - snprintf(temp,200,"%llu",value); - _currentHeader += string(temp); - //_currentHeader += to_string(value); + _currentHeader += std::to_string(value); #ifdef PRINT_DEBUG_DECODER - cout << "\t\t\tAdding: " << string(temp) << endl; + cout << "\t\t\tAdding: " << std::to_string(value) << endl; #endif } @@ -742,13 +737,10 @@ void HeaderDecoder::decodeDelta2(){ u_int64_t value = CompressionUtils::decodeNumeric(_rangeDecoder, _numericModels[_misIndex]); value = CompressionUtils::getValueFromDelta(2, _prevFieldValues[_fieldIndex], value); - char temp[200]; - snprintf(temp,200,"%llu",value); - _currentHeader += string(temp); - //_currentHeader += to_string(value); + _currentHeader += std::to_string(value); #ifdef PRINT_DEBUG_DECODER - cout << "\t\t\tAdding: " << string(temp) << endl; + cout << "\t\t\tAdding: " << std::to_string(value) << endl; #endif } diff --git a/gatb-core/src/gatb/tools/compression/Leon.hpp b/gatb-core/src/gatb/tools/compression/Leon.hpp index 887e8c5d8..949af7a6d 100644 --- a/gatb-core/src/gatb/tools/compression/Leon.hpp +++ b/gatb-core/src/gatb/tools/compression/Leon.hpp @@ -462,7 +462,7 @@ class BankLeon : public AbstractBank void estimate (u_int64_t& number, u_int64_t& totalSize, u_int64_t& maxSize); /** \return maximum number of files. */ - static const size_t getMaxNbFiles () { return 0; } + static size_t getMaxNbFiles () { return 0; } /************************************************************/ diff --git a/gatb-core/src/gatb/tools/math/Integer.hpp b/gatb-core/src/gatb/tools/math/Integer.hpp index 0df83e743..027ba0856 100644 --- a/gatb-core/src/gatb/tools/math/Integer.hpp +++ b/gatb-core/src/gatb/tools/math/Integer.hpp @@ -114,7 +114,7 @@ class IntegerTemplate /** Get the size of an instance of the class used by the variant (ie. one of the Ti template class parameters) * \return the size of an object (in bits). */ - const size_t getSize () { return boost::apply_visitor (Integer_size(), *(*this)); } + size_t getSize () { return boost::apply_visitor (Integer_size(), *(*this)); } /** Get the HDF5 type for the the class used by the variant (ie. one of the Ti template class parameters) * \param[in] isCompound : tells whether the type is composed or not @@ -310,7 +310,7 @@ class IntegerTemplate template const char* operator() (const T& a) const { return a.getName(); }}; struct Integer_size : public boost::static_visitor { - template const size_t operator() (const T& a) const { return a.getSize(); }}; + template size_t operator() (const T& a) const { return a.getSize(); }}; struct Integer_plus : public boost::static_visitor { template IntegerTemplate operator() (const T& a, const T& b) const { return IntegerTemplate(a + b); } diff --git a/gatb-core/src/gatb/tools/math/LargeInt.hpp b/gatb-core/src/gatb/tools/math/LargeInt.hpp index dfeee1c45..8698617ad 100644 --- a/gatb-core/src/gatb/tools/math/LargeInt.hpp +++ b/gatb-core/src/gatb/tools/math/LargeInt.hpp @@ -137,7 +137,7 @@ template class LargeInt /** Get the size of an instance of the class * \return the size of an object (in bits). */ - static const size_t getSize () { return 8*sizeof(u_int64_t)*precision; } + static size_t getSize () { return 8*sizeof(u_int64_t)*precision; } /********************************************************************************/ /** Returns lower 64 bits */ diff --git a/gatb-core/src/gatb/tools/math/LargeInt1.pri b/gatb-core/src/gatb/tools/math/LargeInt1.pri index 7b718b252..da21775c7 100644 --- a/gatb-core/src/gatb/tools/math/LargeInt1.pri +++ b/gatb-core/src/gatb/tools/math/LargeInt1.pri @@ -46,7 +46,7 @@ public: static const char* getName () { return "LargeInt<1>"; } - static const size_t getSize () { return 8*sizeof(u_int64_t); } + static size_t getSize () { return 8*sizeof(u_int64_t); } /** Returns lower 64 bits */ u_int64_t toInt () const { return value; } diff --git a/gatb-core/src/gatb/tools/math/NativeInt64.hpp b/gatb-core/src/gatb/tools/math/NativeInt64.hpp index c06aaab16..ea73d651b 100644 --- a/gatb-core/src/gatb/tools/math/NativeInt64.hpp +++ b/gatb-core/src/gatb/tools/math/NativeInt64.hpp @@ -59,7 +59,7 @@ class NativeInt64 void setVal (u_int64_t c) { value = c; } - static const size_t getSize () { return 8*sizeof(u_int64_t); } + static size_t getSize () { return 8*sizeof(u_int64_t); } NativeInt64 operator+ (const NativeInt64& other) const { return value + other.value; } NativeInt64 operator- (const NativeInt64& other) const { return value - other.value; } diff --git a/gatb-core/src/gatb/tools/math/NativeInt8.hpp b/gatb-core/src/gatb/tools/math/NativeInt8.hpp index 965987407..6689d75aa 100644 --- a/gatb-core/src/gatb/tools/math/NativeInt8.hpp +++ b/gatb-core/src/gatb/tools/math/NativeInt8.hpp @@ -51,7 +51,7 @@ class NativeInt8 : private misc::ArrayData static const char* getName () { return "NativeInt8"; } - static const size_t getSize () { return 8*sizeof(u_int8_t); } + static size_t getSize () { return 8*sizeof(u_int8_t); } operator char () const { return (char) value[0]; } diff --git a/gatb-core/thirdparty/BooPHF/BooPHF.h b/gatb-core/thirdparty/BooPHF/BooPHF.h index 4c716cc30..5b445d578 100644 --- a/gatb-core/thirdparty/BooPHF/BooPHF.h +++ b/gatb-core/thirdparty/BooPHF/BooPHF.h @@ -4,6 +4,7 @@ #pragma once #include +#include #include #include #include @@ -836,7 +837,7 @@ we need this 2-functors scheme because HashFunctors won't work with unordered_ma uint64_t totalsize = totalsizeBitset + _final_hash.size()*42*8 ; // unordered map takes approx 42B per elem [personal test] (42B with uint64_t key, would be larger for other type of elem) - printf("Bitarray %12llu bits (%.2f %%) (array + ranks )\n", + printf("Bitarray %12" PRIu64 " bits (%.2f %%) (array + ranks )\n", totalsizeBitset, 100*(float)totalsizeBitset/totalsize); printf("final hash %12lu bits (%.2f %%) (nb in final hash %lu)\n", _final_hash.size()*42*8, 100*(float)(_final_hash.size()*42*8)/totalsize,