Changeset 51d0ee9 in mainline


Ignore:
Timestamp:
2011-08-27T21:27:24Z (13 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
dc6b148
Parents:
4cf5ed46
Message:

Fix ppc32 build and a possible rounding error.

Location:
uspace/app/mkfat
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/mkfat/fat.h

    r4cf5ed46 r51d0ee9  
    4747#define FAT32   32
    4848
    49 #define FAT_SIZE(a) (((a) == FAT12) ? 1.5 : (((a) == FAT16) ? 2 : 4))
     49#define FAT_CLUSTER_DOUBLE_SIZE(a) ((a) / 4)
    5050
    5151typedef struct fat_bs {
  • uspace/app/mkfat/mkfat.c

    r4cf5ed46 r51d0ee9  
    253253                return ENOSPC;
    254254
    255         fat_bytes = (cfg->total_clusters + 2) * FAT_SIZE(cfg->fat_type);
     255        fat_bytes = div_round_up((cfg->total_clusters + 2) *
     256            FAT_CLUSTER_DOUBLE_SIZE(cfg->fat_type), 2);
    256257        cfg->fat_sectors = div_round_up(fat_bytes, cfg->sector_size);
    257258
Note: See TracChangeset for help on using the changeset viewer.