diff options
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]); } |