Change return type of BasicIo::tell() to size_t.

This commit is contained in:
Kevin Backhouse
2022-06-21 17:05:10 +01:00
parent 7ebf2a184e
commit ad4e13b827
14 changed files with 129 additions and 147 deletions
+6 -8
View File
@@ -198,10 +198,9 @@ class EXIV2API BasicIo {
//@{
/*!
@brief Get the current IO position.
@return Offset from the start of IO if successful;<BR>
-1 if failure;
@return Offset from the start of IO
*/
[[nodiscard]] virtual long tell() const = 0;
[[nodiscard]] virtual size_t tell() const = 0;
/*!
@brief Get the current size of the IO source in bytes.
@return Size of the IO source in bytes;<BR>
@@ -439,10 +438,9 @@ class EXIV2API FileIo : public BasicIo {
//@{
/*!
@brief Get the current file position.
@return Offset from the start of the file if successful;<BR>
-1 if failure;
@return Offset from the start of the file
*/
[[nodiscard]] long tell() const override;
[[nodiscard]] size_t tell() const override;
/*!
@brief Flush any buffered writes and get the current file size
in bytes.
@@ -624,7 +622,7 @@ class EXIV2API MemIo : public BasicIo {
@brief Get the current IO position.
@return Offset from the start of the memory block
*/
[[nodiscard]] long tell() const override;
[[nodiscard]] size_t tell() const override;
/*!
@brief Get the current memory buffer size in bytes.
@return Size of the in memory data in bytes;<BR>
@@ -874,7 +872,7 @@ class EXIV2API RemoteIo : public BasicIo {
@brief Get the current IO position.
@return Offset from the start of the memory block
*/
[[nodiscard]] long tell() const override;
[[nodiscard]] size_t tell() const override;
/*!
@brief Get the current memory buffer size in bytes.
@return Size of the in memory data in bytes;<BR>
+3 -3
View File
@@ -122,13 +122,13 @@ class EXIV2API BmffImage : public Image {
@return address of next box
@warning This function should only be called by readMetadata()
*/
long boxHandler(std::ostream& out, Exiv2::PrintStructureOption option, long pbox_end, int depth);
uint64_t boxHandler(std::ostream& out, Exiv2::PrintStructureOption option, uint64_t pbox_end, int depth);
[[nodiscard]] static std::string indent(int i) {
return std::string(2 * i, ' ');
}
uint32_t fileType_{0};
std::set<uint64_t> visits_;
std::set<size_t> visits_;
uint64_t visits_max_{0};
uint16_t unknownID_{0xffff};
uint16_t exifID_{0xffff};
@@ -140,7 +140,7 @@ class EXIV2API BmffImage : public Image {
/*!
@brief box utilities
*/
static std::string toAscii(long n);
static std::string toAscii(uint32_t n);
std::string boxName(uint32_t box);
static bool superBox(uint32_t box);
static bool fullBox(uint32_t box);
+6 -5
View File
@@ -63,12 +63,13 @@ class EXIV2API WebPImage : public Image {
private:
void doWriteMetadata(BasicIo& outIo);
//! @name NOT Implemented
//@{
static long getHeaderOffset(const byte* data, size_t data_size, const byte* header, size_t header_size);
//! Finds the offset of header in data. Returns std::string::npos if the header isn't found.
static size_t getHeaderOffset(const byte* data, size_t data_size, const byte* header, size_t header_size);
static bool equalsWebPTag(Exiv2::DataBuf& buf, const char* str);
void debugPrintHex(byte* data, long size);
void decodeChunks(long filesize);
void debugPrintHex(byte* data, size_t size);
void decodeChunks(uint32_t filesize);
void inject_VP8X(BasicIo& iIo, bool has_xmp, bool has_exif, bool has_alpha, bool has_icc, int width, int height);
/* Misc. */
static constexpr byte WEBP_PAD_ODD = 0;