diff options
author | Michal Soltys <soltys@ziu.info> | 2013-02-14 16:51:45 +0100 |
---|---|---|
committer | Michal Soltys <soltys@ziu.info> | 2013-02-14 16:53:04 +0100 |
commit | 845daa7e0945f11f8697c9d749148b92433342ed (patch) | |
tree | 42ca7615ec819464c51d93f89df2bcb88a44314d | |
parent | ef9308f5b855b4b5c6484bd959c0334111908a44 (diff) | |
download | syslinux-845daa7e0945f11f8697c9d749148b92433342ed.tar.gz syslinux-845daa7e0945f11f8697c9d749148b92433342ed.tar.xz syslinux-845daa7e0945f11f8697c9d749148b92433342ed.zip |
com32/chain: cleaner variable names
Signed-off-by: Michal Soltys <soltys@ziu.info>
-rw-r--r-- | com32/chain/partiter.c | 23 | ||||
-rw-r--r-- | com32/chain/partiter.h | 7 |
2 files changed, 14 insertions, 16 deletions
diff --git a/com32/chain/partiter.c b/com32/chain/partiter.c index 2a14ef7a..c928f350 100644 --- a/com32/chain/partiter.c +++ b/com32/chain/partiter.c @@ -177,7 +177,7 @@ static int notsane_logical(const struct part_iter *iter) if (!dp[0].start_lba || !dp[0].length || !sane(dp[0].start_lba, dp[0].length) || - end_log > iter->dos.ebr_size) { + end_log > iter->dos.nebr_siz) { error("Logical partition (in EBR) with invalid offset and/or length.\n"); return -1; @@ -213,7 +213,7 @@ static int notsane_extended(const struct part_iter *iter) if (!dp[1].start_lba || !dp[1].length || !sane(dp[1].start_lba, dp[1].length) || - end_ebr > iter->dos.bebr_size) { + end_ebr > iter->dos.bebr_siz) { error("Extended partition (EBR) with invalid offset and/or length.\n"); return -1; @@ -302,16 +302,14 @@ static int prep_base_ebr(struct part_iter *iter) if (iter->dos.bebr_index0 < 0) /* if we don't have base extended partition at all */ return -1; - else if (!iter->dos.bebr_start) { /* if not initialized yet */ + else if (!iter->dos.bebr_lba) { /* if not initialized yet */ dp = ((struct disk_dos_mbr *)iter->data)->table + iter->dos.bebr_index0; - iter->dos.bebr_start = dp->start_lba; - iter->dos.bebr_size = dp->length; + iter->dos.bebr_lba = dp->start_lba; + iter->dos.bebr_siz = dp->length; - iter->dos.ebr_size = iter->dos.bebr_size; - - iter->dos.cebr_lba = 0; - iter->dos.nebr_lba = iter->dos.bebr_start; + iter->dos.nebr_lba = dp->start_lba; + iter->dos.nebr_siz = dp->length; iter->index0--; } @@ -337,6 +335,7 @@ static int dos_next_ebr(struct part_iter *iter, uint32_t *lba, return -1; } + /* check sanity of loaded data */ if (notsane_logical(iter) || notsane_extended(iter)) { iter->status = PI_INSANE; return -1; @@ -348,11 +347,11 @@ static int dos_next_ebr(struct part_iter *iter, uint32_t *lba, /* setup next frame values */ if (dp[1].ostype) { - iter->dos.ebr_size = dp[1].length; - iter->dos.nebr_lba = iter->dos.bebr_start + dp[1].start_lba; + iter->dos.nebr_lba = iter->dos.bebr_lba + dp[1].start_lba; + iter->dos.nebr_siz = dp[1].length; } else { - iter->dos.ebr_size = 0; iter->dos.nebr_lba = 0; + iter->dos.nebr_siz = 0; } if (!dp[0].ostype) diff --git a/com32/chain/partiter.h b/com32/chain/partiter.h index 813b9e63..63dc6dac 100644 --- a/com32/chain/partiter.h +++ b/com32/chain/partiter.h @@ -73,13 +73,12 @@ struct part_iter { struct { uint32_t disk_sig; /* 32bit disk signature as stored in MBR */ - uint32_t bebr_start; /* abs lba of base extended partition */ - uint32_t bebr_size; /* size of base extended partition */ + uint32_t bebr_lba; /* absolute lba of base extended partition */ + uint32_t bebr_siz; /* size of base extended partition */ uint32_t cebr_lba; /* absolute lba of curr ext. partition */ uint32_t nebr_lba; /* absolute lba of next ext. partition */ - - uint32_t ebr_size; /* size of next extended partition */ + uint32_t nebr_siz; /* size of next ext. partition */ int bebr_index0; /* index of (0-3) of base ext. part., -1 if not present in MBR */ int skipcnt; /* how many logical holes were skipped */ |