Code cleanup based on 'infer' suggestions; mostly just dead stores.

One forgotten change
This commit is contained in:
Rod Smith
2021-03-17 21:57:12 -04:00
parent 80e66b2592
commit eae9f7e2e1
7 changed files with 13 additions and 16 deletions

6
gpt.cc
View File

@@ -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)