aboutsummaryrefslogtreecommitdiffstats
path: root/applypatch
diff options
context:
space:
mode:
authorMark Salyzyn <salyzyn@google.com>2014-03-14 20:59:56 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-03-14 20:59:56 +0000
commit4b6de1ba1ce0fff95c18a8abb7ba6e5762006d49 (patch)
tree8fa1fa41069b4c6991157ac484069121caab9767 /applypatch
parent239fb930e4d91de5d3a66997d32d43414055d40e (diff)
parent026ebe0214d6c1c9b3ddc22c35e9ac37e5f622bc (diff)
downloadbootable_recovery-4b6de1ba1ce0fff95c18a8abb7ba6e5762006d49.zip
bootable_recovery-4b6de1ba1ce0fff95c18a8abb7ba6e5762006d49.tar.gz
bootable_recovery-4b6de1ba1ce0fff95c18a8abb7ba6e5762006d49.tar.bz2
am 026ebe02: Merge "Recovery 64-bit compile issues"
* commit '026ebe0214d6c1c9b3ddc22c35e9ac37e5f622bc': Recovery 64-bit compile issues
Diffstat (limited to 'applypatch')
-rw-r--r--applypatch/applypatch.c12
-rw-r--r--applypatch/imgpatch.c7
2 files changed, 10 insertions, 9 deletions
diff --git a/applypatch/applypatch.c b/applypatch/applypatch.c
index cb9bc23..9e631dd 100644
--- a/applypatch/applypatch.c
+++ b/applypatch/applypatch.c
@@ -247,7 +247,7 @@ static int LoadPartitionContents(const char* filename, FileContents* file) {
break;
}
if (next != read) {
- printf("short read (%d bytes of %d) for partition \"%s\"\n",
+ printf("short read (%zu bytes of %zu) for partition \"%s\"\n",
read, next, partition);
free(file->data);
file->data = NULL;
@@ -274,7 +274,7 @@ static int LoadPartitionContents(const char* filename, FileContents* file) {
if (memcmp(sha_so_far, parsed_sha, SHA_DIGEST_SIZE) == 0) {
// we have a match. stop reading the partition; we'll return
// the data we've read so far.
- printf("partition read matched size %d sha %s\n",
+ printf("partition read matched size %zu sha %s\n",
size[index[i]], sha1sum[index[i]]);
break;
}
@@ -402,7 +402,7 @@ int WriteToPartition(unsigned char* data, size_t len,
size_t written = mtd_write_data(ctx, (char*)data, len);
if (written != len) {
- printf("only wrote %d of %d bytes to MTD %s\n",
+ printf("only wrote %zu of %zu bytes to MTD %s\n",
written, len, partition);
mtd_write_close(ctx);
return -1;
@@ -476,20 +476,20 @@ int WriteToPartition(unsigned char* data, size_t len,
if (errno == EINTR) {
read_count = 0;
} else {
- printf("verify read error %s at %d: %s\n",
+ printf("verify read error %s at %zu: %s\n",
partition, p, strerror(errno));
return -1;
}
}
if ((size_t)read_count < to_read) {
- printf("short verify read %s at %d: %d %d %s\n",
+ printf("short verify read %s at %zu: %zd %zu %s\n",
partition, p, read_count, to_read, strerror(errno));
}
so_far += read_count;
}
if (memcmp(buffer, data+p, to_read)) {
- printf("verification failed starting at %d\n", p);
+ printf("verification failed starting at %zu\n", p);
start = p;
break;
}
diff --git a/applypatch/imgpatch.c b/applypatch/imgpatch.c
index 3a1df38..af4d072 100644
--- a/applypatch/imgpatch.c
+++ b/applypatch/imgpatch.c
@@ -18,6 +18,7 @@
// format.
#include <stdio.h>
+#include <sys/cdefs.h>
#include <sys/stat.h>
#include <errno.h>
#include <unistd.h>
@@ -35,7 +36,7 @@
* file, and update the SHA context with the output data as well.
* Return 0 on success.
*/
-int ApplyImagePatch(const unsigned char* old_data, ssize_t old_size,
+int ApplyImagePatch(const unsigned char* old_data, ssize_t old_size __unused,
const Value* patch,
SinkFn sink, void* token, SHA_CTX* ctx,
const Value* bonus_data) {
@@ -132,7 +133,7 @@ int ApplyImagePatch(const unsigned char* old_data, ssize_t old_size,
unsigned char* expanded_source = malloc(expanded_len);
if (expanded_source == NULL) {
- printf("failed to allocate %d bytes for expanded_source\n",
+ printf("failed to allocate %zu bytes for expanded_source\n",
expanded_len);
return -1;
}
@@ -163,7 +164,7 @@ int ApplyImagePatch(const unsigned char* old_data, ssize_t old_size,
// We should have filled the output buffer exactly, except
// for the bonus_size.
if (strm.avail_out != bonus_size) {
- printf("source inflation short by %d bytes\n", strm.avail_out-bonus_size);
+ printf("source inflation short by %zu bytes\n", strm.avail_out-bonus_size);
return -1;
}
inflateEnd(&strm);