Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

debug: Correct most of the sector_t printf()s

The 'll' printf modifier is currently broken. Fortunately all but
one of the uses is printing MB instead of bytes, which means we can
cast the value to a 'unsigned long' without risk of overflow/wraps.

...There's one remaining use ('%llx') which still needs to be sorted
out.

Change-Id: I89f406f6c085be153531d1ec1f2a314ae172b129

+6 -6
+6 -6
apps/debug_menu.c
··· 565 565 // XXX and if mounted, show free info... 566 566 if (selected_item%2) 567 567 { 568 - snprintf(buffer, buffer_len, " T:%x %llu MB", p.type, 569 - (uint64_t)(p.size / ( 2048 / ( SECTOR_SIZE / 512 )))); 568 + snprintf(buffer, buffer_len, " T:%x %lu MB", p.type, 569 + (unsigned long)(p.size / ( 2048 / ( SECTOR_SIZE / 512 )))); 570 570 } 571 571 else 572 572 { 573 - snprintf(buffer, buffer_len, "P%d: S:%llx", partition, (uint64_t)p.start); 573 + snprintf(buffer, buffer_len, "P%d: S:%llx", partition, (unsigned long long)p.start); 574 574 } 575 575 return buffer; 576 576 } ··· 1450 1450 total_sectors *= sector_size; /* Convert to bytes */ 1451 1451 total_sectors /= (1024 * 1024); /* Convert to MB */ 1452 1452 1453 - simplelist_addline("Size: %llu MB", (uint64_t)total_sectors); 1453 + simplelist_addline("Size: %lu MB", (unsigned long)total_sectors); 1454 1454 simplelist_addline("Logical sector size: %lu B", sector_size); 1455 1455 #ifdef MAX_VIRT_SECTOR_SIZE 1456 1456 simplelist_addline("Sector multiplier: %u", disk_get_sector_multiplier()); ··· 1466 1466 sector_t free; 1467 1467 volume_size( IF_MV(0,) NULL, &free ); 1468 1468 simplelist_addline( 1469 - "Free: %llu MB", (uint64_t)(free / 1024)); 1469 + "Free: %lu MB", (unsigned long)(free / 1024)); 1470 1470 #endif 1471 1471 1472 1472 simplelist_addline("SSD detected: %s", ata_disk_isssd() ? "yes" : "no"); ··· 1805 1805 simplelist_addline("Model: %s", info.product); 1806 1806 simplelist_addline("Firmware: %s", info.revision); 1807 1807 simplelist_addline( 1808 - "Size: %llu MB", (uint64_t)(info.num_sectors*(info.sector_size/512)/2048)); 1808 + "Size: %lu MB", (unsigned long)(info.num_sectors*(info.sector_size/512)/2048)); 1809 1809 sector_t free; 1810 1810 volume_size( IF_MV(0,) NULL, &free ); 1811 1811 simplelist_addline(