From 3fd1854b8adfc5cb21732e382fb92ae566ec6ec9 Mon Sep 17 00:00:00 2001 From: Chris Date: Sun, 17 Jun 2018 12:55:09 +0200 Subject: [PATCH] chg: from offical --- client/flash.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/client/flash.c b/client/flash.c index 43052d894..ed58c1153 100644 --- a/client/flash.c +++ b/client/flash.c @@ -38,7 +38,7 @@ static const uint8_t elf_ident[] = { // Turn PHDRs into flasher segments, checking for PHDR sanity and merging adjacent // unaligned segments if needed -static int build_segs_from_phdrs(flash_file_t *ctx, FILE *fd, Elf32_Phdr *phdrs, int num_phdrs) { +static int build_segs_from_phdrs(flash_file_t *ctx, FILE *fd, Elf32_Phdr *phdrs, uint16_t num_phdrs) { Elf32_Phdr *phdr = phdrs; flash_seg_t *seg; uint32_t last_end = 0; @@ -187,7 +187,7 @@ int flash_load(flash_file_t *ctx, const char *name, int can_write_bl) { FILE *fd = NULL; Elf32_Ehdr ehdr; Elf32_Phdr *phdrs = NULL; - int num_phdrs; + uint16_t num_phdrs; int res; fd = fopen(name, "rb"); @@ -342,7 +342,10 @@ static int wait_for_ack(UsbCommand *ack) { ReceiveCommand(ack); if (ack->cmd != CMD_ACK) { - printf("Error: Unexpected reply 0x%04" PRIx64 " %s (expected ACK)\n", ack->cmd, (ack->cmd == CMD_NACK) ? "NACK" : ""); + printf("Error: Unexpected reply 0x%04" PRIx64 " %s (expected ACK)\n", + ack->cmd, + (ack->cmd == CMD_NACK) ? "NACK" : "" + ); return -1; } return 0;