Add const keyword to file url and cast to free().
Make size an ssize_t and chase all format strings that use it.
if ((ERROR_OK == retval) && (duration_measure(&bench) == ERROR_OK))
{
- command_print(cmd_ctx, "wrote %lld byte from file %s to flash bank %u"
+ command_print(cmd_ctx, "wrote %zu byte from file %s to flash bank %u"
" at offset 0x%8.8" PRIx32 " in %fs (%0.3f kb/s)",
fileio.size, args[1], p->bank_number, offset,
duration_elapsed(&bench), duration_kbps(&bench, fileio.size));
if (duration_measure(&bench) == ERROR_OK)
{
- command_print(cmd_ctx, "wrote %lli byte from file %s "
+ command_print(cmd_ctx, "wrote %zu byte from file %s "
"in %fs (%0.3f kB/s)", fileio.size, args[1],
duration_elapsed(&bench), duration_kbps(&bench, fileio.size));
}
if (nand_fileio_finish(&s) == ERROR_OK)
{
- command_print(cmd_ctx, "dumped %lld byte in %fs (%0.3f kb/s)",
+ command_print(cmd_ctx, "dumped %zu bytes in %fs (%0.3f kb/s)",
s.fileio.size, duration_elapsed(&s.bench),
duration_kbps(&s.bench, s.fileio.size));
}
retval = fileio_close_local(fileio);
- free(fileio->url);
+ free((void*)fileio->url);
fileio->url = NULL;
return retval;
};
struct fileio {
- char *url;
- long long size;
+ const char *url;
+ ssize_t size;
enum fileio_type type;
enum fileio_access access;
FILE *file;
if ((ERROR_OK == retval) && (duration_measure(&bench) == ERROR_OK))
{
command_print(cmd_ctx,
- "dumped %lld bytes in %fs (%0.3f kb/s)", fileio.size,
+ "dumped %zu bytes in %fs (%0.3f kb/s)", fileio.size,
duration_elapsed(&bench), duration_kbps(&bench, fileio.size));
}