diff --git a/decoder.cc b/decoder.cc index f5cb101..da25d5f 100644 --- a/decoder.cc +++ b/decoder.cc @@ -16,6 +16,7 @@ */ #define _FILE_OFFSET_BITS 64 +#define __STDC_FORMAT_MACROS #include #include @@ -24,7 +25,7 @@ #include #include #include -#include +#include #include "lzip.h" #include "decoder.h" @@ -106,7 +107,7 @@ bool LZ_decoder::verify_trailer( const Pretty_print & pp ) const { if( trailer.data_size() >= 0 ) { pp(); - std::fprintf( stderr, "data size mismatch; trailer says %lld, data size is %lld.\n", + std::fprintf( stderr, "data size mismatch; trailer says %"PRId64", data size is %"PRId64".\n", trailer.data_size(), data_position() ); } else pp( "member trailer is corrupt" ); } @@ -118,13 +119,13 @@ bool LZ_decoder::verify_trailer( const Pretty_print & pp ) const { if( trailer.member_size() >= 0 ) { pp(); - std::fprintf( stderr, "member size mismatch; trailer says %lld, member size is %lld.\n", + std::fprintf( stderr, "member size mismatch; trailer says %"PRId64", member size is %"PRId64".\n", trailer.member_size(), member_position() ); } else pp( "member trailer is corrupt" ); } } if( !error && verbosity >= 3 ) - std::fprintf( stderr, "data crc %08X, data size %8lld, member size %8lld. ", + std::fprintf( stderr, "data crc %08X, data size %8"PRId64", member size %8"PRId64". ", (unsigned int)trailer.data_crc(), trailer.data_size(), trailer.member_size() ); return !error; diff --git a/lziprecover.cc b/lziprecover.cc index e8803d7..ce85e0b 100644 --- a/lziprecover.cc +++ b/lziprecover.cc @@ -22,6 +22,7 @@ */ #define _FILE_OFFSET_BITS 64 +#define __STDC_FORMAT_MACROS #include #include diff --git a/main.cc b/main.cc index 6304ee0..11c0c00 100644 --- a/main.cc +++ b/main.cc @@ -22,6 +22,7 @@ */ #define _FILE_OFFSET_BITS 64 +#define __STDC_FORMAT_MACROS #include #include @@ -33,7 +34,7 @@ #include #include #include -#include +#include #include #include #include @@ -141,7 +142,7 @@ const char * format_num( long long num, long long limit = 9999, for( int i = 0; i < 8 && ( llabs( num ) > limit || ( llabs( num ) >= factor && num % factor == 0 ) ); ++i ) { num /= factor; p = prefix[i]; } - snprintf( buf, sizeof buf, "%lld %s", num, p ); + snprintf( buf, sizeof buf, "%"PRId64" %s", num, p ); return buf; } @@ -447,7 +448,7 @@ int compress( const long long member_size, const long long volume_size, std::fprintf( stderr, "no data compressed.\n" ); else std::fprintf( stderr, "%6.3f:1, %6.3f bits/byte, " - "%5.2f%% saved, %lld in, %lld out.\n", + "%5.2f%% saved, %"PRId64" in, %"PRId64" out.\n", (double)in_size / out_size, ( 8.0 * out_size ) / in_size, 100.0 * ( 1.0 - ( (double)out_size / in_size ) ), @@ -519,10 +520,10 @@ int decompress( const int inhandle, const Pretty_print & pp, { pp(); if( result == 2 ) - std::fprintf( stderr, "file ends unexpectedly at pos %lld\n", + std::fprintf( stderr, "file ends unexpectedly at pos %"PRId64"\n", partial_file_pos ); else - std::fprintf( stderr, "decoder error at pos %lld\n", + std::fprintf( stderr, "decoder error at pos %"PRId64"\n", partial_file_pos ); } return 2; -- 1.6.4.13.ge6580.dirty