diff options
author | Tao Bao <tbao@google.com> | 2017-03-28 21:16:31 +0200 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-03-28 21:16:31 +0200 |
commit | 52569ce2eda536219a901ba24bab6c935394db5b (patch) | |
tree | 5f80e6c423b0206e0fceace93827191c965348d9 /applypatch/include | |
parent | Merge "updater: Clean up LoadSrcTgtVersion2()." am: f037b7b535 (diff) | |
parent | applypatch: Change the ssize_t length parameters to size_t. (diff) | |
download | android_bootable_recovery-52569ce2eda536219a901ba24bab6c935394db5b.tar android_bootable_recovery-52569ce2eda536219a901ba24bab6c935394db5b.tar.gz android_bootable_recovery-52569ce2eda536219a901ba24bab6c935394db5b.tar.bz2 android_bootable_recovery-52569ce2eda536219a901ba24bab6c935394db5b.tar.lz android_bootable_recovery-52569ce2eda536219a901ba24bab6c935394db5b.tar.xz android_bootable_recovery-52569ce2eda536219a901ba24bab6c935394db5b.tar.zst android_bootable_recovery-52569ce2eda536219a901ba24bab6c935394db5b.zip |
Diffstat (limited to 'applypatch/include')
-rw-r--r-- | applypatch/include/applypatch/applypatch.h | 18 | ||||
-rw-r--r-- | applypatch/include/applypatch/imgpatch.h | 7 |
2 files changed, 10 insertions, 15 deletions
diff --git a/applypatch/include/applypatch/applypatch.h b/applypatch/include/applypatch/applypatch.h index 4489decb6..52fb58287 100644 --- a/applypatch/include/applypatch/applypatch.h +++ b/applypatch/include/applypatch/applypatch.h @@ -41,7 +41,7 @@ struct FileContents { // and use it as the source instead. #define CACHE_TEMP_SOURCE "/cache/saved.file" -typedef ssize_t (*SinkFn)(const unsigned char*, ssize_t, void*); +using SinkFn = size_t (*)(const unsigned char*, size_t, void*); // applypatch.cpp int ShowLicenses(); @@ -66,18 +66,14 @@ int SaveFileContents(const char* filename, const FileContents* file); // bspatch.cpp void ShowBSDiffLicense(); -int ApplyBSDiffPatch(const unsigned char* old_data, ssize_t old_size, - const Value* patch, ssize_t patch_offset, - SinkFn sink, void* token, SHA_CTX* ctx); -int ApplyBSDiffPatchMem(const unsigned char* old_data, ssize_t old_size, - const Value* patch, ssize_t patch_offset, - std::vector<unsigned char>* new_data); +int ApplyBSDiffPatch(const unsigned char* old_data, size_t old_size, const Value* patch, + size_t patch_offset, SinkFn sink, void* token, SHA_CTX* ctx); +int ApplyBSDiffPatchMem(const unsigned char* old_data, size_t old_size, const Value* patch, + size_t patch_offset, std::vector<unsigned char>* new_data); // imgpatch.cpp -int ApplyImagePatch(const unsigned char* old_data, ssize_t old_size, - const Value* patch, - SinkFn sink, void* token, SHA_CTX* ctx, - const Value* bonus_data); +int ApplyImagePatch(const unsigned char* old_data, size_t old_size, const Value* patch, SinkFn sink, + void* token, SHA_CTX* ctx, const Value* bonus_data); // freecache.cpp int MakeFreeSpaceOnCache(size_t bytes_needed); diff --git a/applypatch/include/applypatch/imgpatch.h b/applypatch/include/applypatch/imgpatch.h index 6549f79f0..16e4c4f57 100644 --- a/applypatch/include/applypatch/imgpatch.h +++ b/applypatch/include/applypatch/imgpatch.h @@ -19,10 +19,9 @@ #include <sys/types.h> -using SinkFn = ssize_t (*)(const unsigned char*, ssize_t, void*); +using SinkFn = size_t (*)(const unsigned char*, size_t, void*); -int ApplyImagePatch(const unsigned char* old_data, ssize_t old_size, - const unsigned char* patch_data, ssize_t patch_size, - SinkFn sink, void* token); +int ApplyImagePatch(const unsigned char* old_data, size_t old_size, const unsigned char* patch_data, + size_t patch_size, SinkFn sink, void* token); #endif // _APPLYPATCH_IMGPATCH_H |