imxtools: Fix several build warnings

Change-Id: Idebf0445d3e861ff27e152730c5bed64c2e4489b
This commit is contained in:
Solomon Peachy 2026-06-17 10:06:42 -04:00
parent db0d7649e0
commit 3403e3cfb9
3 changed files with 5 additions and 3 deletions

View file

@ -31,6 +31,7 @@
const char crypto_key[16] = "SanDiskSlotRadi";
#if 0
static void rsrc_crypt(void *buf, int size)
{
if(size % 16)
@ -42,6 +43,7 @@ static void rsrc_crypt(void *buf, int size)
p[j] ^= crypto_key[j];
}
}
#endif
enum rsrc_error_t rsrc_write_file(struct rsrc_file_t *rsrc, const char *filename)
{
@ -252,4 +254,3 @@ void rsrc_dump(struct rsrc_file_t *file, void *u, rsrc_color_printf cprintf)
#undef printf
#undef print_hex
}

View file

@ -37,7 +37,9 @@
#define PAD_TO_BOUNDARY(x) (((x) + 0x1ff) & ~0x1ff)
/* If you find a firmware that breaks the known format ^^ */
#ifndef assert
#define assert(a) do { if(!(a)) { fprintf(stderr,"Assertion \"%s\" failed in %s() line %d!\n\nPlease send us your firmware!\n",#a,__func__,__LINE__); exit(1); } } while(0)
#endif
#define crypto_cbc(...) \
do { int ret = crypto_cbc(__VA_ARGS__); \
@ -198,4 +200,3 @@ int main(int argc, char **argv)
return 0;
}

View file

@ -488,11 +488,11 @@ enum sb_error_t sb_write_file(struct sb_file_t *sb, const char *filename, void *
if(buf_p - buf != sb_hdr.image_size * BLOCK_SIZE)
{
free(buf);
printf(GREY, "Internal error: SB image buffer was not entirely filled !\n");
printf(GREY, "Internal error: expected %u blocks, got %u\n",
(buf_p - buf) / BLOCK_SIZE, sb_hdr.image_size);
cprintf(u, true, GREY, "Internal error\n");
free(buf);
return SB_ERROR;
}