diff options
author | Doug Zongker <dougz@android.com> | 2010-02-22 23:46:32 +0100 |
---|---|---|
committer | Doug Zongker <dougz@android.com> | 2010-02-23 00:30:33 +0100 |
commit | c4351c791052ad529a4e83c600b1aa6e6420ea86 (patch) | |
tree | cdc534868eb58ea980bcca2fbc8e04b68fd9936c /applypatch/utils.c | |
parent | add missing includes to fix mac build (maybe) (diff) | |
download | android_bootable_recovery-c4351c791052ad529a4e83c600b1aa6e6420ea86.tar android_bootable_recovery-c4351c791052ad529a4e83c600b1aa6e6420ea86.tar.gz android_bootable_recovery-c4351c791052ad529a4e83c600b1aa6e6420ea86.tar.bz2 android_bootable_recovery-c4351c791052ad529a4e83c600b1aa6e6420ea86.tar.lz android_bootable_recovery-c4351c791052ad529a4e83c600b1aa6e6420ea86.tar.xz android_bootable_recovery-c4351c791052ad529a4e83c600b1aa6e6420ea86.tar.zst android_bootable_recovery-c4351c791052ad529a4e83c600b1aa6e6420ea86.zip |
Diffstat (limited to '')
-rw-r--r-- | applypatch/utils.c | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/applypatch/utils.c b/applypatch/utils.c index 912229bcf..41ff676dc 100644 --- a/applypatch/utils.c +++ b/applypatch/utils.c @@ -38,25 +38,28 @@ void Write8(long long value, FILE* f) { fputc((value >> 56) & 0xff, f); } -int Read2(unsigned char* p) { - return (int)(((unsigned int)p[1] << 8) | - (unsigned int)p[0]); +int Read2(void* pv) { + unsigned char* p = pv; + return (int)(((unsigned int)p[1] << 8) | + (unsigned int)p[0]); } -int Read4(unsigned char* p) { - return (int)(((unsigned int)p[3] << 24) | - ((unsigned int)p[2] << 16) | - ((unsigned int)p[1] << 8) | - (unsigned int)p[0]); +int Read4(void* pv) { + unsigned char* p = pv; + return (int)(((unsigned int)p[3] << 24) | + ((unsigned int)p[2] << 16) | + ((unsigned int)p[1] << 8) | + (unsigned int)p[0]); } -long long Read8(unsigned char* p) { - return (long long)(((unsigned long long)p[7] << 56) | - ((unsigned long long)p[6] << 48) | - ((unsigned long long)p[5] << 40) | - ((unsigned long long)p[4] << 32) | - ((unsigned long long)p[3] << 24) | - ((unsigned long long)p[2] << 16) | - ((unsigned long long)p[1] << 8) | - (unsigned long long)p[0]); +long long Read8(void* pv) { + unsigned char* p = pv; + return (long long)(((unsigned long long)p[7] << 56) | + ((unsigned long long)p[6] << 48) | + ((unsigned long long)p[5] << 40) | + ((unsigned long long)p[4] << 32) | + ((unsigned long long)p[3] << 24) | + ((unsigned long long)p[2] << 16) | + ((unsigned long long)p[1] << 8) | + (unsigned long long)p[0]); } |