Add const qualifiers to function parameters and local variables for improved type safety

This commit is contained in:
2025-10-01 02:34:42 +01:00
parent f1811e6b3c
commit a7434322ea
23 changed files with 106 additions and 97 deletions

View File

@@ -110,9 +110,9 @@ int cli_compare(const char *path1, const char *path2)
read_result2 = aaruf_read_sector(ctx2, sector, buffer2, &buffer2_length);
// Handle read errors or missing sectors
bool sector1_available = (read_result1 == AARUF_STATUS_OK);
bool sector2_available = (read_result2 == AARUF_STATUS_OK);
bool sectors_different = false;
const bool sector1_available = (read_result1 == AARUF_STATUS_OK);
const bool sector2_available = (read_result2 == AARUF_STATUS_OK);
bool sectors_different = false;
if(!sector1_available && !sector2_available)
{
@@ -149,7 +149,7 @@ int cli_compare(const char *path1, const char *path2)
// Update progress every 1000 sectors or at the end
if(sectors_processed % 1000 == 0 || sector == total_sectors - 1)
{
int progress = (int)((sectors_processed * 100) / total_sectors);
const int progress = (int)((sectors_processed * 100) / total_sectors);
printf("Progress: %d%% (%llu/%llu sectors)\r", progress, (unsigned long long)sectors_processed,
(unsigned long long)total_sectors);
fflush(stdout);