[syslinux] [PATCH 07/23] com32/chain: remove redundant rawindex
Michal Soltys
soltys at ziu.info
Mon Nov 5 16:32:41 PST 2012
'index0' provides the same "raw" info, complementing standard 'index'.
Signed-off-by: Michal Soltys <soltys at ziu.info>
---
com32/chain/mangle.c | 4 ++--
com32/chain/partiter.c | 2 --
com32/chain/partiter.h | 5 ++---
3 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/com32/chain/mangle.c b/com32/chain/mangle.c
index fe446b0..89996d0 100644
--- a/com32/chain/mangle.c
+++ b/com32/chain/mangle.c
@@ -545,7 +545,7 @@ int manglepe_hide(struct part_iter *miter)
return -1;
while (!pi_next(iter) && !werr) {
- ridx = iter->rawindex;
+ ridx = iter->index0 + 1;
if (!(opt.hide & 2) && ridx > 4)
break; /* skip when we're constrained to pri only */
@@ -615,7 +615,7 @@ int manglepe_fixchs(struct part_iter *miter)
return -1;
while (!pi_next(iter) && !werr) {
- ridx = iter->rawindex;
+ ridx = iter->index0 + 1;
dp = (struct disk_dos_part_entry *)iter->record;
wb |= mpe_setchs(&iter->di, dp, (uint32_t)iter->start_lba);
diff --git a/com32/chain/partiter.c b/com32/chain/partiter.c
index dffe83f..3ecaecf 100644
--- a/com32/chain/partiter.c
+++ b/com32/chain/partiter.c
@@ -462,7 +462,6 @@ static int pi_dos_next(struct part_iter *iter)
iter->index = -1;
else
iter->index = iter->index0 - iter->dos.skipcnt + 1;
- iter->rawindex = iter->index0 + 1;
iter->start_lba = start_lba;
iter->length = dos_part->length;
iter->record = (char *)dos_part;
@@ -500,7 +499,6 @@ static int pi_gpt_next(struct part_iter *iter)
}
/* gpt_part is guaranteed to be valid here */
iter->index = iter->index0 + 1;
- iter->rawindex = iter->index0 + 1;
iter->start_lba = gpt_part->lba_first;
iter->length = gpt_part->lba_last - gpt_part->lba_first + 1;
iter->record = (char *)gpt_part;
diff --git a/com32/chain/partiter.h b/com32/chain/partiter.h
index f441e46..e9b158b 100644
--- a/com32/chain/partiter.h
+++ b/com32/chain/partiter.h
@@ -68,9 +68,8 @@ struct part_iter {
uint64_t start_lba;
uint64_t length;
int index0; /* including holes, from -1 (disk, then parts from 0) */
- int rawindex; /* including holes, from 0 (disk, then parts from 1) */
- int index; /* excluding holes, from 0 (disk) (-1) means hole, if PIF_STEPALL is set */
- int flags; /* flags, see #defines above */
+ int index; /* excluding holes, from 0 (disk, then parts from 1), -1 means hole, if PIF_STEPALL is set */
+ int flags; /* flags, see #defines above */
int status; /* current status, see #defines above */
struct disk_info di;
union {
--
1.7.10.4
More information about the Syslinux
mailing list