mirror of https://github.com/thesofproject/sof.git
sof-ctl: Fix -Wformat,-Wsometimes-uninitialized
* Use %z specifier for size types to avoid format specifier warnings on arm32 * in ctl_dump(), size_t n may be used uninitialized if ctl_data->out_fd > 0 and !ctl_data->binary. Signed-off-by: Li-Yu Yu <aaronyu@google.com>
This commit is contained in:
parent
0d5e731b19
commit
5cfc37040b
|
@ -202,7 +202,7 @@ static void hex_data_dump(struct ctl_data *ctl_data)
|
|||
/* Print out in 16bit hex format */
|
||||
for (i = 0; i < n; i++) {
|
||||
if (!(i % 8))
|
||||
fprintf(stdout, "%08lx ",
|
||||
fprintf(stdout, "%08zx ",
|
||||
i * sizeof(uint16_t));
|
||||
fprintf(stdout, "%04x ", config[i]);
|
||||
if ((i % 8) == 7)
|
||||
|
@ -410,7 +410,7 @@ static void ctl_dump(struct ctl_data *ctl_data)
|
|||
{
|
||||
FILE *fh;
|
||||
int offset = 0;
|
||||
size_t n;/* in bytes */
|
||||
size_t n = 0;/* in bytes */
|
||||
|
||||
if (ctl_data->out_fd > 0) {
|
||||
if (ctl_data->binary) {
|
||||
|
@ -441,7 +441,7 @@ static void ctl_dump(struct ctl_data *ctl_data)
|
|||
csv_data_dump(ctl_data, fh);
|
||||
}
|
||||
|
||||
fprintf(stdout, "%ld bytes written to file.\n", n);
|
||||
fprintf(stdout, "%zd bytes written to file.\n", n);
|
||||
fclose(fh);
|
||||
} else {
|
||||
/* dump to stdout */
|
||||
|
|
Loading…
Reference in New Issue