hexdump to size_t

This commit is contained in:
Luis Díaz Más 2022-03-07 17:46:12 +01:00
parent 8b1fe379a1
commit 5508e6f466
4 changed files with 7 additions and 8 deletions

View File

@ -571,7 +571,7 @@ namespace Action {
std::cout << std::endl;
Exiv2::DataBuf buf(md.size());
md.copy(buf.data(), pImage->byteOrder());
Exiv2::hexdump(std::cout, buf.c_data(), static_cast<long>(buf.size()));
Exiv2::hexdump(std::cout, buf.c_data(), buf.size());
}
std::cout << std::endl;
return true;

View File

@ -320,7 +320,7 @@ namespace Exiv2 {
stream, prefixed with the position in the buffer adjusted by
offset.
*/
EXIV2API void hexdump(std::ostream& os, const byte* buf, long len, long offset = 0);
EXIV2API void hexdump(std::ostream& os, const byte* buf, size_t len, size_t offset = 0);
/*!
@brief Return true if str is a hex number starting with prefix followed

View File

@ -282,9 +282,8 @@ namespace Exiv2::Internal {
memset(pData_, 0x0, size_);
}
size_ = value->copy(pData_, byteOrder);
assert(size_ == newSize);
setValue(std::move(value));
} // TiffEntryBase::updateValue
}
void TiffEntryBase::setValue(Value::UniquePtr value)
{
@ -294,7 +293,7 @@ namespace Exiv2::Internal {
count_ = value->count();
delete pValue_;
pValue_ = value.release();
} // TiffEntryBase::setValue
}
void TiffDataEntry::setStrips(const Value* pSize,
const byte* pData,

View File

@ -540,13 +540,13 @@ namespace Exiv2 {
return 8;
}
void hexdump(std::ostream& os, const byte* buf, long len, long offset)
void hexdump(std::ostream& os, const byte* buf, size_t len, size_t offset)
{
const std::string::size_type pos = 8 + 16 * 3 + 2;
const std::string align(pos, ' ');
std::ios::fmtflags f( os.flags() );
long i = 0;
size_t i = 0;
while (i < len) {
os << " "
<< std::setw(4) << std::setfill('0') << std::hex
@ -562,7 +562,7 @@ namespace Exiv2 {
}
os << std::dec << std::setfill(' ');
os.flags(f);
} // hexdump
}
bool isHex(const std::string& str, size_t size, const std::string& prefix)
{