software: Fix picolibc compilation warnings.

This commit is contained in:
Florent Kermarrec 2021-09-30 19:24:58 +02:00
parent 841732f38f
commit 77283d3d8d
4 changed files with 12 additions and 12 deletions

View File

@ -681,11 +681,11 @@ static int copy_file_from_sdcard_to_ram(const char * filename, unsigned long ram
}
length = f_size(&file);
printf("Copying %s to 0x%08lx (%d bytes)...\n", filename, ram_address, length);
printf("Copying %s to 0x%08lx (%ld bytes)...\n", filename, ram_address, length);
init_progression_bar(length);
offset = 0;
for (;;) {
fr = f_read(&file, (void*) ram_address + offset, 0x8000, &br);
fr = f_read(&file, (void*) ram_address + offset, 0x8000, (UINT *)&br);
if (fr != FR_OK) {
printf("file read error.\n");
f_close(&file);
@ -741,7 +741,7 @@ static void sdcardboot_from_json(const char * filename)
return;
}
fr = f_read(&file, json_buffer, sizeof(json_buffer), &length);
fr = f_read(&file, json_buffer, sizeof(json_buffer), (UINT *) &length);
/* Close JSON file */
f_close(&file);
@ -856,11 +856,11 @@ static int copy_file_from_sata_to_ram(const char * filename, unsigned long ram_a
}
length = f_size(&file);
printf("Copying %s to 0x%08lx (%d bytes)...\n", filename, ram_address, length);
printf("Copying %s to 0x%08lx (%ld bytes)...\n", filename, ram_address, length);
init_progression_bar(length);
offset = 0;
for (;;) {
fr = f_read(&file, (void*) ram_address + offset, 0x8000, &br);
fr = f_read(&file, (void*) ram_address + offset, 0x8000, (UINT *) &br);
if (fr != FR_OK) {
printf("file read error.\n");
f_close(&file);
@ -916,7 +916,7 @@ static void sataboot_from_json(const char * filename)
return;
}
fr = f_read(&file, json_buffer, sizeof(json_buffer), &length);
fr = f_read(&file, json_buffer, sizeof(json_buffer), (UINT *) &length);
/* Close JSON file */
f_close(&file);

View File

@ -54,7 +54,7 @@ static void sata_read_handler(int nb_params, char **params)
}
sata_read(sector, 1, buf);
dump_bytes((uint32_t *)buf, 512, (unsigned long) buf);
dump_bytes((unsigned int *)buf, 512, (unsigned long) buf);
}
define_command(sata_read, sata_read_handler, "Read SATA sector", LITESATA_CMDS);
@ -94,7 +94,7 @@ static void sata_write_handler(int nb_params, char **params)
}
}
}
dump_bytes((uint32_t *)buf, 512, (unsigned long) buf);
dump_bytes((unsigned int *)buf, 512, (unsigned long) buf);
sata_write(sector, 1, buf);
}

View File

@ -98,7 +98,7 @@ static void sdcard_read_handler(int nb_params, char **params)
}
sdcard_read(block, 1, buf);
dump_bytes((uint32_t *)buf, 512, (unsigned long) buf);
dump_bytes((unsigned int *)buf, 512, (unsigned long) buf);
}
define_command(sdcard_read, sdcard_read_handler, "Read SDCard block", LITESDCARD_CMDS);
@ -138,7 +138,7 @@ static void sdcard_write_handler(int nb_params, char **params)
}
}
}
dump_bytes((uint32_t *)buf, 512, (unsigned long) buf);
dump_bytes((unsigned int *)buf, 512, (unsigned long) buf);
sdcard_write(block, 1, buf);
}

View File

@ -117,9 +117,9 @@ void sdcard_set_clk_freq(uint32_t clk_freq, int show) {
clk_freq = CONFIG_CLOCK_FREQUENCY/divider;
printf("Setting SDCard clk freq to ");
if (clk_freq > 1000000)
printf("%d MHz\n", clk_freq/1000000);
printf("%ld MHz\n", clk_freq/1000000);
else
printf("%d KHz\n", clk_freq/1000);
printf("%ld KHz\n", clk_freq/1000);
}
sdphy_clocker_divider_write(divider);
}