From aced5d9e4e438ba478ce54f9217166b8ab7cc24f Mon Sep 17 00:00:00 2001 From: Tianjie Xu Date: Wed, 12 Oct 2016 10:55:04 -0700 Subject: Change StringValue to use std::string Changing the field of 'Value' in edify to std::string from char*. Meanwhile cleaning up the users of 'Value' and switching them to cpp style. Test: compontent tests passed. Bug: 31713288 Change-Id: Iec5a7d601b1e4ca40935bf1c70d325dafecec235 --- applypatch/utils.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'applypatch/utils.cpp') diff --git a/applypatch/utils.cpp b/applypatch/utils.cpp index fef250f01..450dc8d76 100644 --- a/applypatch/utils.cpp +++ b/applypatch/utils.cpp @@ -38,22 +38,22 @@ void Write8(int64_t value, FILE* f) { fputc((value >> 56) & 0xff, f); } -int Read2(void* pv) { - unsigned char* p = reinterpret_cast(pv); +int Read2(const void* pv) { + const unsigned char* p = reinterpret_cast(pv); return (int)(((unsigned int)p[1] << 8) | (unsigned int)p[0]); } -int Read4(void* pv) { - unsigned char* p = reinterpret_cast(pv); +int Read4(const void* pv) { + const unsigned char* p = reinterpret_cast(pv); return (int)(((unsigned int)p[3] << 24) | ((unsigned int)p[2] << 16) | ((unsigned int)p[1] << 8) | (unsigned int)p[0]); } -int64_t Read8(void* pv) { - unsigned char* p = reinterpret_cast(pv); +int64_t Read8(const void* pv) { + const unsigned char* p = reinterpret_cast(pv); return (int64_t)(((uint64_t)p[7] << 56) | ((uint64_t)p[6] << 48) | ((uint64_t)p[5] << 40) | -- cgit v1.2.3