summaryrefslogtreecommitdiffstats
path: root/applypatch/applypatch.cpp
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2016-11-01 22:37:21 +0100
committerandroid-build-merger <android-build-merger@google.com>2016-11-01 22:37:21 +0100
commit2f9b98c99f2363714f3e2684d3279d387992f00e (patch)
tree0c75340e320034812743b58e9a3edbd09768bded /applypatch/applypatch.cpp
parentDO NOT MERGE ANYWHERE init: move healthd to late-init am: 195ff7f79e -s ours am: 7ceb371048 -s ours am: b8c1788e7b -s ours am: 8837b0d25d -s ours am: 3fdf1fd515 -s ours am: 67bc0b9573 -s ours am: 9ab6af5a61 -s ours (diff)
parentMerge "applypatch: Switch the parameter of Value** to std::vector." am: 3f4030e0ef am: bc48de6bf0 (diff)
downloadandroid_bootable_recovery-2f9b98c99f2363714f3e2684d3279d387992f00e.tar
android_bootable_recovery-2f9b98c99f2363714f3e2684d3279d387992f00e.tar.gz
android_bootable_recovery-2f9b98c99f2363714f3e2684d3279d387992f00e.tar.bz2
android_bootable_recovery-2f9b98c99f2363714f3e2684d3279d387992f00e.tar.lz
android_bootable_recovery-2f9b98c99f2363714f3e2684d3279d387992f00e.tar.xz
android_bootable_recovery-2f9b98c99f2363714f3e2684d3279d387992f00e.tar.zst
android_bootable_recovery-2f9b98c99f2363714f3e2684d3279d387992f00e.zip
Diffstat (limited to 'applypatch/applypatch.cpp')
-rw-r--r--applypatch/applypatch.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/applypatch/applypatch.cpp b/applypatch/applypatch.cpp
index 48e4c8386..9d505f9f6 100644
--- a/applypatch/applypatch.cpp
+++ b/applypatch/applypatch.cpp
@@ -530,8 +530,8 @@ int applypatch(const char* source_filename,
const char* target_sha1_str,
size_t target_size,
const std::vector<std::string>& patch_sha1_str,
- Value** patch_data,
- Value* bonus_data) {
+ const std::vector<std::unique_ptr<Value>>& patch_data,
+ const Value* bonus_data) {
printf("patch %s: ", source_filename);
if (target_filename[0] == '-' && target_filename[1] == '\0') {
@@ -546,8 +546,8 @@ int applypatch(const char* source_filename,
FileContents copy_file;
FileContents source_file;
- const Value* source_patch_value = NULL;
- const Value* copy_patch_value = NULL;
+ const Value* source_patch_value = nullptr;
+ const Value* copy_patch_value = nullptr;
// We try to load the target file into the source_file object.
if (LoadFileContents(target_filename, &source_file) == 0) {
@@ -571,11 +571,11 @@ int applypatch(const char* source_filename,
if (!source_file.data.empty()) {
int to_use = FindMatchingPatch(source_file.sha1, patch_sha1_str);
if (to_use >= 0) {
- source_patch_value = patch_data[to_use];
+ source_patch_value = patch_data[to_use].get();
}
}
- if (source_patch_value == NULL) {
+ if (source_patch_value == nullptr) {
source_file.data.clear();
printf("source file is bad; trying copy\n");
@@ -587,10 +587,10 @@ int applypatch(const char* source_filename,
int to_use = FindMatchingPatch(copy_file.sha1, patch_sha1_str);
if (to_use >= 0) {
- copy_patch_value = patch_data[to_use];
+ copy_patch_value = patch_data[to_use].get();
}
- if (copy_patch_value == NULL) {
+ if (copy_patch_value == nullptr) {
// fail.
printf("copy file doesn't match source SHA-1s either\n");
return 1;