From 8dc704930be62377549ec47b8929d0237ed25f79 Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Wed, 20 Jun 2018 10:14:40 -0700 Subject: applypatch: {Load,Save}FileContents and ParseSha1 take std::string. Test: mmma -j bootable/recovery Test: Run recovery_component_test on marlin. Change-Id: Ifcf244346a88dac833d91b169a4c2aee1fe677f1 --- applypatch/include/applypatch/applypatch.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'applypatch/include') diff --git a/applypatch/include/applypatch/applypatch.h b/applypatch/include/applypatch/applypatch.h index ef133f290..f074e3681 100644 --- a/applypatch/include/applypatch/applypatch.h +++ b/applypatch/include/applypatch/applypatch.h @@ -50,7 +50,7 @@ int CacheSizeCheck(size_t bytes); // Parses a given string of 40 hex digits into 20-byte array 'digest'. 'str' may contain only the // digest or be of the form ":". Returns 0 on success, or -1 on any error. -int ParseSha1(const char* str, uint8_t* digest); +int ParseSha1(const std::string& str, uint8_t* digest); // Applies binary patches to eMMC target files in a way that is safe (the original file is not // touched until we have the desired replacement for it) and idempotent (it's okay to run this @@ -91,10 +91,10 @@ int applypatch_flash(const char* source_filename, const char* target_filename, // Reads a file into memory; stores the file contents and associated metadata in *file. Returns 0 // on success, or -1 on error. -int LoadFileContents(const char* filename, FileContents* file); +int LoadFileContents(const std::string& filename, FileContents* file); // Saves the given FileContents object to the given filename. Returns 0 on success, or -1 on error. -int SaveFileContents(const char* filename, const FileContents* file); +int SaveFileContents(const std::string& filename, const FileContents* file); // bspatch.cpp -- cgit v1.2.3