summaryrefslogtreecommitdiff
path: root/gpt.cc
diff options
context:
space:
mode:
authorRod Smith <rodsmith@rodsbooks.com>2021-03-17 21:57:12 -0400
committerRod Smith <rodsmith@rodsbooks.com>2021-03-17 21:59:18 -0400
commiteae9f7e2e1470ed2d5bc029180aa2adc88fbc4a7 (patch)
treedd82bf5ca410609032f73fe888a56d9f29ee3c93 /gpt.cc
parent80e66b25922ab78cf987f693bf5477e466b1443a (diff)
downloadsgdisk-eae9f7e2e1470ed2d5bc029180aa2adc88fbc4a7.tar.gz
Code cleanup based on 'infer' suggestions; mostly just dead stores.
One forgotten change
Diffstat (limited to 'gpt.cc')
-rw-r--r--gpt.cc6
1 files changed, 2 insertions, 4 deletions
diff --git a/gpt.cc b/gpt.cc
index 842dfb1..51d482c 100644
--- a/gpt.cc
+++ b/gpt.cc
@@ -582,7 +582,7 @@ int GPTData::CheckHeaderCRC(struct GPTHeader* header, int warn) {
// byte order and then undoes that reversal.)
void GPTData::RecomputeCRCs(void) {
uint32_t crc, hSize;
- int littleEndian = 1;
+ int littleEndian;
// If the header size is bigger than the GPT header data structure, reset it;
// otherwise, set both header sizes to whatever the main one is....
@@ -2144,7 +2144,6 @@ int GPTData::Align(uint64_t* sector) {
// Check to see that every sector between the earlier one and the
// requested one is clear, and that it's not too early....
if (earlier >= mainHeader.firstUsableLBA) {
- sectorOK = 1;
testSector = earlier;
do {
sectorOK = IsFree(testSector++);
@@ -2157,7 +2156,6 @@ int GPTData::Align(uint64_t* sector) {
// If couldn't move the sector earlier, try to move it later instead....
if ((sectorOK != 1) && (later <= mainHeader.lastUsableLBA)) {
- sectorOK = 1;
testSector = later;
do {
sectorOK = IsFree(testSector--);
@@ -2454,7 +2452,7 @@ void GPTData::SetAlignment(uint32_t n) {
// is used on big disks (as safety for Advanced Format drives).
// Returns the computed alignment value.
uint32_t GPTData::ComputeAlignment(void) {
- uint32_t i = 0, found, exponent = 31;
+ uint32_t i = 0, found, exponent;
uint32_t align = DEFAULT_ALIGNMENT;
if (blockSize > 0)