summaryrefslogtreecommitdiffstats
path: root/applypatch/include
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2017-03-28 00:12:48 +0200
committerTao Bao <tbao@google.com>2017-03-28 19:13:38 +0200
commitf7eb760fe76cb66c5d5341b03d6a66cc1f06d795 (patch)
tree150376048a310df4ac1f873bdf487ad9edf15e2d /applypatch/include
parentMerge "updater: Clean up LoadSrcTgtVersion2()." (diff)
downloadandroid_bootable_recovery-f7eb760fe76cb66c5d5341b03d6a66cc1f06d795.tar
android_bootable_recovery-f7eb760fe76cb66c5d5341b03d6a66cc1f06d795.tar.gz
android_bootable_recovery-f7eb760fe76cb66c5d5341b03d6a66cc1f06d795.tar.bz2
android_bootable_recovery-f7eb760fe76cb66c5d5341b03d6a66cc1f06d795.tar.lz
android_bootable_recovery-f7eb760fe76cb66c5d5341b03d6a66cc1f06d795.tar.xz
android_bootable_recovery-f7eb760fe76cb66c5d5341b03d6a66cc1f06d795.tar.zst
android_bootable_recovery-f7eb760fe76cb66c5d5341b03d6a66cc1f06d795.zip
Diffstat (limited to 'applypatch/include')
-rw-r--r--applypatch/include/applypatch/applypatch.h18
-rw-r--r--applypatch/include/applypatch/imgpatch.h7
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