Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2751d2b8 authored by Tianjie's avatar Tianjie Committed by Tianjie Xu
Browse files

Change the parameter type of offset in read

As we support zip64 in libziparchive, we change the parameter of
the ReadAtOffset() in zip reader from uin32_t to off64_t. So the
derived class needs to be updated as well.

Bug: 150900468
Test: build
Change-Id: Icbfd2dd54b01ff62da988ba8598c1057f9bb6368
parent a3541df2
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1221,7 +1221,7 @@ class FileReader : public zip_archive::Reader {
    FileReader(FILE* fp) : Reader(), fp_(fp), current_offset_(0) {
    }

    bool ReadAtOffset(uint8_t* buf, size_t len, uint32_t offset) const {
    bool ReadAtOffset(uint8_t* buf, size_t len, off64_t offset) const {
        // Data is usually requested sequentially, so this helps avoid pointless
        // fseeks every time we perform a read. There's an impedence mismatch
        // here because the original API was designed around pread and pwrite.
@@ -1244,7 +1244,7 @@ class FileReader : public zip_archive::Reader {

  private:
    FILE* fp_;
    mutable uint32_t current_offset_;
    mutable off64_t current_offset_;
};

// free the memory when you're done