diff options
author | Yi Kong <yikong@google.com> | 2022-01-09 19:41:38 +0800 |
---|---|---|
committer | Yi Kong <yikong@google.com> | 2022-01-10 01:06:07 +0800 |
commit | 39bbd9609c1707d719e0b1f5e180bc20f6d00187 (patch) | |
tree | 9eb388f63d54045209c77cde97685bf08f67cc8b /partition.h | |
parent | edc7205fd74b487db58978949551efd860741e0a (diff) | |
download | mtools-39bbd9609c1707d719e0b1f5e180bc20f6d00187.tar.gz |
Upgrade mtools to 3.0.37android-t-preview-2android-t-preview-1android-t-beta-3android-s-v2-beta-3android-s-qpr3-beta-1android-t-preview-1android-s-v2-beta-3android-s-qpr3-beta-1
This version contains a fix for -Wstring-concatenation error.
Test: presubmit
Bug: 175068488
Change-Id: Id4f2ae49da91a481ab2625fdf17668689b640794
Diffstat (limited to 'partition.h')
-rw-r--r-- | partition.h | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/partition.h b/partition.h index 7d9aa7b..1e0345f 100644 --- a/partition.h +++ b/partition.h @@ -22,12 +22,13 @@ typedef struct hsc { unsigned char cyl; /* starting cylinder */ } hsc; -#define head(x) ((unsigned int)((x).head)) -#define sector(x) ((unsigned int)((x).sector & 0x3f)) -#define cyl(x) ((unsigned int)((x).cyl | (((x).sector & 0xc0)<<2))) +#define head(x) ((uint8_t)((x).head)) +#define sector(x) ((uint8_t)((x).sector & 0x3f)) +#define cyl(x) ((uint16_t)((x).cyl | (((x).sector & 0xc0)<<2))) -#define BEGIN(p) _DWORD((p).start_sect) -#define END(p) (_DWORD((p).start_sect)+(_DWORD((p).nr_sects))) +#define BEGIN(p) _DWORD((p)->start_sect) +#define END(p) (_DWORD((p)->start_sect)+(_DWORD((p)->nr_sects))) +#define PART_SIZE(p) (_DWORD((p)->nr_sects)) struct partition { @@ -41,11 +42,16 @@ struct partition { #define sys_ind end.byte0 int consistencyCheck(struct partition *partTable, int doprint, int verbose, - int *has_activated, unsigned int *last_end, - unsigned int *j, - struct device *used_dev, int target_partition); + int *has_activated, uint32_t tot_sectors, + struct device *used_dev, unsigned int target_partition); void setBeginEnd(struct partition *partTable, - unsigned long begin, unsigned long end, - unsigned int heads, unsigned int sector, - int activate, int type, int fat_bits); + uint32_t begin, uint32_t end, + uint16_t iheads, uint16_t isectors, + int activate, uint8_t type, unsigned int fat_bits); + +Stream_t *OpenPartition(Stream_t *Next, struct device *dev, + char *errmsg, mt_off_t *maxSize); + +unsigned int findOverlap(struct partition *partTable, unsigned int until, + uint32_t start, uint32_t end); |