Permalink
Browse files

SDCardUtil: Replace sector size magic value with relevant named constant

Makes variable use consistent throughout the file.
  • Loading branch information...
lioncash committed May 11, 2018
1 parent e1866d3 commit 5fc18aa63944b247a0daa0cd87b1553a6e3da5a7
Showing with 3 additions and 3 deletions.
  1. +3 −3 Source/Core/Common/SDCardUtil.cpp
@@ -179,14 +179,14 @@ static void fat_init(u8* fat)
static unsigned int write_sector(FILE* file, u8* sector)
{
return fwrite(sector, 1, 512, file) != 512;
return fwrite(sector, 1, BYTES_PER_SECTOR, file) != BYTES_PER_SECTOR;
}
static unsigned int write_empty(FILE* file, u64 count)
{
static u8 empty[64 * 1024];
count *= 512;
count *= BYTES_PER_SECTOR;
while (count > 0)
{
u64 len = sizeof(empty);
@@ -218,7 +218,7 @@ bool SDCardCreate(u64 disk_size /*in MB*/, const std::string& filename)
}
// Pretty unlikely to overflow.
sectors_per_disk = (u32)(disk_size / 512);
sectors_per_disk = (u32)(disk_size / BYTES_PER_SECTOR);
sectors_per_fat = get_sectors_per_fat(disk_size, get_sectors_per_cluster(disk_size));
boot_sector_init(s_boot_sector, s_fsinfo_sector, disk_size, nullptr);

0 comments on commit 5fc18aa

Please sign in to comment.