Bootloader FAT: remove unused variables
The "longNameValid" variable already indicates if a long name is present and valid, and it is correctly handled, with the short name used as a fallback if the long name is either not present, or not encoded correctly. The "hasLongName" variable is useless since long names are already handled. The "partial" variable indeed indicates a partial read was done. There is nothing to do with that info, the read is already complete at this point and the correct data is read and returned to the caller. So I don't see why we should keep this variable. The "count" variable seems to serve no purpose and is easy to re-add if someone ever has a need for it. Change-Id: Ic7eb7f34a49243ecdb5dd3c6b29c3b90f3bece10 Reviewed-on: https://review.haiku-os.org/c/haiku/+/6739 Reviewed-by: Fredrik Holmqvist <[email protected]>
This commit is contained in:
@@ -554,7 +554,6 @@ Directory::GetNextEntry(void *cookie, uint8 mask, uint8 match)
|
|||||||
TRACE(("FASFS::Directory::%s(, %02x, %02x)\n", __FUNCTION__, mask, match));
|
TRACE(("FASFS::Directory::%s(, %02x, %02x)\n", __FUNCTION__, mask, match));
|
||||||
struct dir_cookie *c = (struct dir_cookie *)cookie;
|
struct dir_cookie *c = (struct dir_cookie *)cookie;
|
||||||
|
|
||||||
bool hasLongName = false;
|
|
||||||
bool longNameValid = false;
|
bool longNameValid = false;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
@@ -574,7 +573,6 @@ Directory::GetNextEntry(void *cookie, uint8 mask, uint8 match)
|
|||||||
uint8* nameEntry = (uint8*)&c->entry;
|
uint8* nameEntry = (uint8*)&c->entry;
|
||||||
if ((*nameEntry & 0x40) != 0) {
|
if ((*nameEntry & 0x40) != 0) {
|
||||||
c->ResetName();
|
c->ResetName();
|
||||||
hasLongName = true;
|
|
||||||
longNameValid = true;
|
longNameValid = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -126,10 +126,7 @@ Stream::_FindCluster(off_t pos, uint32& _cluster)
|
|||||||
}
|
}
|
||||||
if (!found) {
|
if (!found) {
|
||||||
#if 1
|
#if 1
|
||||||
uint32 count = (fSize + fVolume.ClusterSize() - 1) / fVolume.ClusterSize();
|
|
||||||
cluster = fFirstCluster;
|
cluster = fFirstCluster;
|
||||||
if (fSize == UINT32_MAX) // it's a directory, try a large enough value
|
|
||||||
count = 10;
|
|
||||||
for (i = 0; i < index && fVolume.IsValidCluster(cluster); i++) {
|
for (i = 0; i < index && fVolume.IsValidCluster(cluster); i++) {
|
||||||
if (fVolume.IsLastCluster(cluster))
|
if (fVolume.IsLastCluster(cluster))
|
||||||
break;
|
break;
|
||||||
@@ -308,8 +305,6 @@ Stream::ReadAt(off_t pos, void *_buffer, size_t *_length, off_t *diskOffset)
|
|||||||
// read the following complete blocks using cached_read(),
|
// read the following complete blocks using cached_read(),
|
||||||
// the last partial block is read using the generic Cache class
|
// the last partial block is read using the generic Cache class
|
||||||
|
|
||||||
bool partial = false;
|
|
||||||
|
|
||||||
while (length > 0) {
|
while (length > 0) {
|
||||||
// offset is the offset to the current pos in the block_run
|
// offset is the offset to the current pos in the block_run
|
||||||
|
|
||||||
@@ -321,7 +316,6 @@ Stream::ReadAt(off_t pos, void *_buffer, size_t *_length, off_t *diskOffset)
|
|||||||
}
|
}
|
||||||
memcpy(buffer + bytesRead, block, length);
|
memcpy(buffer + bytesRead, block, length);
|
||||||
bytesRead += length;
|
bytesRead += length;
|
||||||
partial = true;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user