From 99a30ae9cc313036a5e8cb076ca6c08950b20074 Mon Sep 17 00:00:00 2001 From: "Ben V. Brown" Date: Tue, 1 Aug 2023 17:57:34 +1000 Subject: [PATCH] stdlib Update dfu_file.c --- tools/blisp/src/file_parsers/bin/bin_file.h | 1 - tools/blisp/src/file_parsers/dfu/dfu_file.c | 5 +++-- tools/blisp/src/file_parsers/dfu/dfu_file.h | 1 - tools/blisp/src/file_parsers/parse_file.h | 1 + 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/blisp/src/file_parsers/bin/bin_file.h b/tools/blisp/src/file_parsers/bin/bin_file.h index de58b63..27b37e2 100644 --- a/tools/blisp/src/file_parsers/bin/bin_file.h +++ b/tools/blisp/src/file_parsers/bin/bin_file.h @@ -5,7 +5,6 @@ #ifndef BLISP_BIN_FILE_H #define BLISP_BIN_FILE_H -#include #include #include #include diff --git a/tools/blisp/src/file_parsers/dfu/dfu_file.c b/tools/blisp/src/file_parsers/dfu/dfu_file.c index 0931fbc..7351902 100644 --- a/tools/blisp/src/file_parsers/dfu/dfu_file.c +++ b/tools/blisp/src/file_parsers/dfu/dfu_file.c @@ -2,6 +2,7 @@ // Created by ralim on 25/09/22. // #include "dfu_file.h" +#include #define DFU_SUFFIX_LENGTH 16 #define LMDFU_PREFIX_LENGTH 8 @@ -125,7 +126,7 @@ ssize_t parse_target(const uint8_t* data, } *out_ealt = data[6]; - uint8_t* tdata = data + 6 + 1 + 4 + 255; + uint8_t* tdata = (uint8_t*)data + 6 + 1 + 4 + 255; uint32_t len_tdata = *((uint32_t*)tdata); tdata += 4; uint32_t num_images = *((uint32_t*)tdata); @@ -243,7 +244,7 @@ struct dfu_file parse_dfu_suffix(const uint8_t* file_contents, output.bcdDevice = (dfu_suffix[1] << 8) + dfu_suffix[0]; checked: - const int res = probe_prefix(&output); + int res = probe_prefix(&output); if (output.size.prefix) { const uint8_t* data = file_contents; diff --git a/tools/blisp/src/file_parsers/dfu/dfu_file.h b/tools/blisp/src/file_parsers/dfu/dfu_file.h index 22faf9a..ef09b5b 100644 --- a/tools/blisp/src/file_parsers/dfu/dfu_file.h +++ b/tools/blisp/src/file_parsers/dfu/dfu_file.h @@ -5,7 +5,6 @@ #ifndef BLISP_DFU_FILE_H #define BLISP_DFU_FILE_H -#include #include #include #include diff --git a/tools/blisp/src/file_parsers/parse_file.h b/tools/blisp/src/file_parsers/parse_file.h index d52e361..0e2c2e9 100644 --- a/tools/blisp/src/file_parsers/parse_file.h +++ b/tools/blisp/src/file_parsers/parse_file.h @@ -1,5 +1,6 @@ #pragma once #include +#include #include "parsed_firmware_file.h" #define PARSED_ERROR_INVALID_FILETYPE -0x1000