fixing some warnings

v0.27.3
Michał Walenciak 8 years ago
parent 41c245963b
commit 1c4026fd56

@ -130,7 +130,7 @@ struct TypeForSize<64>
template<int size> template<int size>
typename TypeForSize<size>::Type byte_swap(const typename TypeForSize<size>::Type& v) typename TypeForSize<size>::Type byte_swap(const typename TypeForSize<size>::Type& v)
{ {
static_assert(size == 16 || size == 32 || size == 64); static_assert(size == 16 || size == 32 || size == 64, "unsupported data size");
typename TypeForSize<size>::Type result = 0; typename TypeForSize<size>::Type result = 0;
if (size == 16) if (size == 16)
@ -153,7 +153,7 @@ typename TypeForSize<size>::Type conditional_byte_swap(const typename TypeForSiz
template<int size> template<int size>
typename TypeForSize<size>::Type conditional_byte_swap_4_array(void* buf, int offset, bool swap) typename TypeForSize<size>::Type conditional_byte_swap_4_array(void* buf, uint64_t offset, bool swap)
{ {
typedef typename TypeForSize<size>::Type Type; typedef typename TypeForSize<size>::Type Type;
@ -252,7 +252,7 @@ void printIFD(Exiv2::BasicIo& io, std::ostream& out, Exiv2::PrintStructureOption
uint64_t entries_raw; uint64_t entries_raw;
io.read(reinterpret_cast<Exiv2::byte *>(&entries_raw), 8); io.read(reinterpret_cast<Exiv2::byte *>(&entries_raw), 8);
const uint16_t entries = conditional_byte_swap_4_array<64>(&entries_raw, 0, bSwap); const uint64_t entries = conditional_byte_swap_4_array<64>(&entries_raw, 0, bSwap);
const bool tooBig = entries > 500; const bool tooBig = entries > 500;
@ -267,7 +267,7 @@ void printIFD(Exiv2::BasicIo& io, std::ostream& out, Exiv2::PrintStructureOption
break; break;
// Read the dictionary // Read the dictionary
for ( int i = 0; i < entries; i ++ ) for ( uint64_t i = 0; i < entries; i ++ )
{ {
if ( bFirst && bPrint ) if ( bFirst && bPrint )
out << indent(depth) out << indent(depth)
@ -287,7 +287,7 @@ void printIFD(Exiv2::BasicIo& io, std::ostream& out, Exiv2::PrintStructureOption
//prepare to print the value //prepare to print the value
// TODO: figure out what's going on with kount // TODO: figure out what's going on with kount
const uint32_t kount = isStringType(type)? (count > 32 ? 32 : count) // restrict long arrays const uint64_t kount = isStringType(type)? (count > 32 ? 32 : count) // restrict long arrays
: count > 5 ? 5 : count > 5 ? 5
: count : count
; ;
@ -309,7 +309,7 @@ void printIFD(Exiv2::BasicIo& io, std::ostream& out, Exiv2::PrintStructureOption
} }
if ( bPrint ) { if ( bPrint ) {
uint32_t address = offset + 2 + i*12 ; uint64_t address = offset + 2 + i*12 ;
out << indent(depth) out << indent(depth)
<< Exiv2::Internal::stringFormat("%8u | %#06x %-25s |%10s |%9u |%10u | " << Exiv2::Internal::stringFormat("%8u | %#06x %-25s |%10s |%9u |%10u | "
,address,tag,tagName(tag,25),typeName(type),count,offset); ,address,tag,tagName(tag,25),typeName(type),count,offset);

Loading…
Cancel
Save