mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 10:07:38 -04:00
fat: Fix warning with fat_file_sector_size with (MAX_VARIABLE_LOG_SECTOR && HAVE_MULTIVOLUME)
Change-Id: I9bc7206b8121645688f5901ab448eba4077cba92
This commit is contained in:
parent
9644bb5d9d
commit
5c38669476
3 changed files with 6 additions and 6 deletions
|
@ -199,7 +199,7 @@ file_error:
|
|||
/* Handle syncing all file's streams to the truncation */
|
||||
static void handle_truncate(struct filestr_desc * const file, file_size_t size)
|
||||
{
|
||||
uint16_t sector_size = fat_file_sector_size(file->stream.fatstr.fatfilep);
|
||||
uint16_t sector_size = fat_file_sector_size(IF_MV(file->stream.fatstr.fatfilep));
|
||||
unsigned long filesectors = filesize_sectors(sector_size, size);
|
||||
|
||||
struct filestr_base *s = NULL;
|
||||
|
@ -230,7 +230,7 @@ static int ftruncate_internal(struct filestr_desc *file, file_size_t size,
|
|||
file_size_t cursize = *file->sizep;
|
||||
file_size_t truncsize = MIN(size, cursize);
|
||||
|
||||
uint16_t sector_size = fat_file_sector_size(file->stream.fatstr.fatfilep);
|
||||
uint16_t sector_size = fat_file_sector_size(IF_MV(file->stream.fatstr.fatfilep));
|
||||
|
||||
if (write_now)
|
||||
{
|
||||
|
@ -295,7 +295,7 @@ static int fsync_internal(struct filestr_desc *file)
|
|||
|
||||
file_size_t size = *file->sizep;
|
||||
unsigned int foflags = fileobj_get_flags(&file->stream);
|
||||
uint16_t sector_size = fat_file_sector_size(file->stream.fatstr.fatfilep);
|
||||
uint16_t sector_size = fat_file_sector_size(IF_MV(file->stream.fatstr.fatfilep));
|
||||
|
||||
/* flush sector cache? */
|
||||
struct filestr_cache *const cachep = file->stream.cachep;
|
||||
|
@ -653,7 +653,7 @@ static ssize_t readwrite(struct filestr_desc *file, void *buf, size_t nbyte,
|
|||
|
||||
struct filestr_cache * const cachep = file->stream.cachep;
|
||||
void * const bufstart = buf;
|
||||
uint16_t sector_size = fat_file_sector_size(file->stream.fatstr.fatfilep);
|
||||
uint16_t sector_size = fat_file_sector_size(IF_MV(file->stream.fatstr.fatfilep));
|
||||
|
||||
const unsigned long filesectors = filesize_sectors(sector_size, size);
|
||||
unsigned long sector = file->offset / sector_size;
|
||||
|
|
|
@ -2035,7 +2035,7 @@ static int free_cluster_chain(struct bpb *fat_bpb, long startcluster)
|
|||
/** File entity functions **/
|
||||
|
||||
#if defined(MAX_VARIABLE_LOG_SECTOR)
|
||||
int fat_file_sector_size(const struct fat_file *file)
|
||||
int fat_file_sector_size(IF_MV_NONVOID(const struct fat_file *file))
|
||||
{
|
||||
const struct bpb *fat_bpb = FAT_BPB(file->volume);
|
||||
|
||||
|
|
|
@ -148,7 +148,7 @@ int fat_modtime(struct fat_file *parent, struct fat_file *file,
|
|||
time_t modtime);
|
||||
|
||||
#if defined(MAX_VARIABLE_LOG_SECTOR)
|
||||
int fat_file_sector_size(const struct fat_file *file);
|
||||
int fat_file_sector_size(IF_MV_NONVOID(const struct fat_file *file));
|
||||
#else
|
||||
#define fat_file_sector_size(__file) SECTOR_SIZE
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue