diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-04-11 17:51:19 +0200 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2025-04-11 17:51:19 +0200 |
| commit | c3856eddb5a8146751dac82ad1ba4433f5ca6d6d (patch) | |
| tree | a74bdf6f87d07a24496effbc157f74d379d25007 /dev/kernel/src/FS | |
| parent | 9da6a352ecf70a1f5be99058a880b20db1b57940 (diff) | |
tweak kernel, boot: use -Wall, -Werror, -Wpedantic now.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'dev/kernel/src/FS')
| -rw-r--r-- | dev/kernel/src/FS/NeFS+FileMgr.cc | 4 | ||||
| -rw-r--r-- | dev/kernel/src/FS/NeFS.cc | 77 |
2 files changed, 37 insertions, 44 deletions
diff --git a/dev/kernel/src/FS/NeFS+FileMgr.cc b/dev/kernel/src/FS/NeFS+FileMgr.cc index fec88fae..0107bd9e 100644 --- a/dev/kernel/src/FS/NeFS+FileMgr.cc +++ b/dev/kernel/src/FS/NeFS+FileMgr.cc @@ -92,14 +92,14 @@ namespace Kernel /// @brief Gets the separator character. /// @return - const Char NeFileSystemHelper::Separator() + Char NeFileSystemHelper::Separator() { return kNeFSSeparator; } /// @brief Gets the metafile character. /// @return - const Char NeFileSystemHelper::MetaFile() + Char NeFileSystemHelper::MetaFile() { return kNeFSMetaFilePrefix; } diff --git a/dev/kernel/src/FS/NeFS.cc b/dev/kernel/src/FS/NeFS.cc index 7bc02b39..c98841ee 100644 --- a/dev/kernel/src/FS/NeFS.cc +++ b/dev/kernel/src/FS/NeFS.cc @@ -73,7 +73,7 @@ _Output BOOL NeFileSystemParser::CreateFork(_Input NEFS_FORK_STRUCT& the_fork) Lba lba = catalog->DataFork; - kout << "Fork LBA: " << hex_number(lba) << kendl; + (void)(kout << "Fork LBA: " << hex_number(lba) << kendl); if (lba < kNeFSCatalogStartAddress) return NO; @@ -94,7 +94,7 @@ _Output BOOL NeFileSystemParser::CreateFork(_Input NEFS_FORK_STRUCT& the_fork) drv.fInput(drv.fPacket); - kout << "Next fork: " << hex_number(cur_fork.NextSibling) << kendl; + (void)(kout << "Next fork: " << hex_number(cur_fork.NextSibling) << kendl); if (cur_fork.Flags & kNeFSFlagCreated) { @@ -139,17 +139,15 @@ _Output BOOL NeFileSystemParser::CreateFork(_Input NEFS_FORK_STRUCT& the_fork) drv.fPacket.fPacketSize = sizeof(NEFS_FORK_STRUCT); drv.fPacket.fPacketContent = &the_fork; - kout << "Allocating fork block...\r"; - - // drv.fOutput(drv.fPacket); + drv.fOutput(drv.fPacket); fs_ifs_write(&kMountpoint, drv, MountpointInterface::kDriveIndexA); /// log what we have now. - kout << "Fork offset is at: " << hex_number(the_fork.DataOffset) - << kendl; + (void)(kout << "Fork offset is at: " << hex_number(the_fork.DataOffset) + << kendl); - kout << "Wrote fork metadata at: " << hex_number(lba) << kendl; + (void)(kout << "Wrote fork metadata at: " << hex_number(lba) << kendl); return YES; } @@ -427,11 +425,6 @@ _Output NEFS_CATALOG_STRUCT* NeFileSystemParser::CreateCatalog(_Input const Char drive.fOutput(drive.fPacket); - kout << "Create new catalog with flags: " - << hex_number(child_catalog->Flags) << kendl; - kout << "Create new catalog with name: " << child_catalog->Name - << kendl; - delete catalog; catalog = nullptr; @@ -577,8 +570,6 @@ bool NeFileSystemParser::Format(_Input _Output DriveTrait* drive, _Input const L rt_copy_memory((VoidPtr)kNeFSUntitledHD, (VoidPtr)part_block->PartitionName, rt_string_len(kNeFSUntitledHD)); - SizeT catalogCount = 0UL; - SizeT sectorCount = drv_get_sector_count(); SizeT diskSize = drv_get_size(); @@ -597,14 +588,14 @@ bool NeFileSystemParser::Format(_Input _Output DriveTrait* drive, _Input const L drive->fOutput(drive->fPacket); - kout << "drive kind: " << drive->fProtocol() << kendl; + (void)(kout << "drive kind: " << drive->fProtocol() << kendl); - kout << "partition name: " << part_block->PartitionName << kendl; - kout << "start: " << hex_number(part_block->StartCatalog) << kendl; - kout << "number of catalogs: " << hex_number(part_block->CatalogCount) << kendl; - kout << "free catalog: " << hex_number(part_block->FreeCatalog) << kendl; - kout << "free sectors: " << hex_number(part_block->FreeSectors) << kendl; - kout << "sector size: " << hex_number(part_block->SectorSize) << kendl; + (void)(kout << "partition name: " << part_block->PartitionName << kendl); + (void)(kout << "start: " << hex_number(part_block->StartCatalog) << kendl); + (void)(kout << "number of catalogs: " << hex_number(part_block->CatalogCount) << kendl); + (void)(kout << "free catalog: " << hex_number(part_block->FreeCatalog) << kendl); + (void)(kout << "free sectors: " << hex_number(part_block->FreeSectors) << kendl); + (void)(kout << "sector size: " << hex_number(part_block->SectorSize) << kendl); // write the root catalog. this->CreateCatalog(kNeFSRoot, 0, kNeFSCatalogKindDir); @@ -663,7 +654,7 @@ bool NeFileSystemParser::WriteCatalog(_Input const Char* catalog_name, Bool is_r NEFS_FORK_STRUCT* fork_data_input = new NEFS_FORK_STRUCT(); NEFS_FORK_STRUCT prev_fork{}; - kout << hex_number(startFork) << kendl; + (void)(kout << hex_number(startFork) << kendl); // sanity check of the fork position as the condition to run the loop. while (startFork >= kNeFSCatalogStartAddress) @@ -674,13 +665,13 @@ bool NeFileSystemParser::WriteCatalog(_Input const Char* catalog_name, Bool is_r drive.fInput(drive.fPacket); - kout << hex_number(fork_data_input->DataSize) << kendl; - kout << hex_number(size_of_data) << kendl; - kout << hex_number(fork_data_input->Flags) << kendl; - kout << fork_name << kendl; - kout << fork_data_input->ForkName << kendl; - kout << fork_data_input->CatalogName << kendl; - kout << catalog_name << kendl; + (void)(kout << hex_number(fork_data_input->DataSize) << kendl); + (void)(kout << hex_number(size_of_data) << kendl); + (void)(kout << hex_number(fork_data_input->Flags) << kendl); + (void)(kout << fork_name << kendl); + (void)(kout << fork_data_input->ForkName << kendl); + (void)(kout << fork_data_input->CatalogName << kendl); + (void)(kout << catalog_name << kendl); if ((fork_data_input->Flags & kNeFSFlagCreated) && KStringBuilder::Equals(fork_data_input->ForkName, fork_name) && @@ -695,11 +686,11 @@ bool NeFileSystemParser::WriteCatalog(_Input const Char* catalog_name, Bool is_r drive.fPacket.fPacketSize = size_of_data; drive.fPacket.fPacketLba = fork_data_input->DataOffset; - kout << "data offset: " << hex_number(fork_data_input->DataOffset) << kendl; + (void)(kout << "data offset: " << hex_number(fork_data_input->DataOffset) << kendl); drive.fOutput(drive.fPacket); - kout << "wrote data at offset: " << hex_number(fork_data_input->DataOffset) << kendl; + (void)(kout << "wrote data at offset: " << hex_number(fork_data_input->DataOffset) << kendl); delete fork_data_input; delete[] buf; @@ -732,7 +723,7 @@ _Output NEFS_CATALOG_STRUCT* NeFileSystemParser::FindCatalog(_Input const Char* *catalog_name == 0) return nullptr; - NEFS_ROOT_PARTITION_BLOCK part{0}; + NEFS_ROOT_PARTITION_BLOCK part{}; auto& drive = kMountpoint.A(); rt_copy_memory((VoidPtr) "fs/nefs-packet", drive.fPacket.fPacketMime, @@ -745,7 +736,6 @@ _Output NEFS_CATALOG_STRUCT* NeFileSystemParser::FindCatalog(_Input const Char* drive.fInput(drive.fPacket); auto start_catalog_lba = kNeFSCatalogStartAddress; - const auto kStartCatalogList = start_catalog_lba; if (!KStringBuilder::Equals(catalog_name, NeFileSystemHelper::Root()) && local_search) { @@ -839,8 +829,8 @@ kNeFSSearchThroughCatalogList: goto NeFSContinueSearch; } - kout << "Found available catalog at: " << hex_number(start_catalog_lba) << kendl; - kout << "Found available catalog at: " << temporary_catalog.Name << kendl; + (void)(kout << "Found available catalog at: " << hex_number(start_catalog_lba) << kendl); + (void)(kout << "Found available catalog at: " << temporary_catalog.Name << kendl); NEFS_CATALOG_STRUCT* catalog_ptr = new NEFS_CATALOG_STRUCT(); rt_copy_memory(&temporary_catalog, catalog_ptr, sizeof(NEFS_CATALOG_STRUCT)); @@ -974,11 +964,9 @@ VoidPtr NeFileSystemParser::ReadCatalog(_Input _Output NEFS_CATALOG_STRUCT* cata return nullptr; } - Lba dataForkLba = (!is_rsrc_fork) ? catalog->DataFork : catalog->ResourceFork; - Size dataForkSize = (!is_rsrc_fork) ? catalog->DataForkSize : catalog->ResourceForkSize; + NE_UNUSED(dataSz); - kout << "catalog " << catalog->Name - << ", fork: " << hex_number(dataForkLba) << kendl; + Lba dataForkLba = (!is_rsrc_fork) ? catalog->DataFork : catalog->ResourceFork; NEFS_FORK_STRUCT* fs_buf = new NEFS_FORK_STRUCT(); auto& drive = kMountpoint.A(); @@ -998,8 +986,8 @@ VoidPtr NeFileSystemParser::ReadCatalog(_Input _Output NEFS_CATALOG_STRUCT* cata fs_fork_data = fs_buf; - kout << "ForkName: " << fs_fork_data->ForkName << kendl; - kout << "CatalogName: " << fs_fork_data->CatalogName << kendl; + (void)(kout << "ForkName: " << fs_fork_data->ForkName << kendl); + (void)(kout << "CatalogName: " << fs_fork_data->CatalogName << kendl); if (KStringBuilder::Equals(forkName, fs_fork_data->ForkName) && KStringBuilder::Equals(catalog->Name, fs_fork_data->CatalogName)) @@ -1026,6 +1014,9 @@ VoidPtr NeFileSystemParser::ReadCatalog(_Input _Output NEFS_CATALOG_STRUCT* cata bool NeFileSystemParser::Seek(_Input _Output NEFS_CATALOG_STRUCT* catalog, SizeT off) { + NE_UNUSED(catalog); + NE_UNUSED(off); + err_global_get() = kErrorUnimplemented; return false; } @@ -1038,6 +1029,8 @@ bool NeFileSystemParser::Seek(_Input _Output NEFS_CATALOG_STRUCT* catalog, SizeT SizeT NeFileSystemParser::Tell(_Input _Output NEFS_CATALOG_STRUCT* catalog) { + NE_UNUSED(catalog); + err_global_get() = kErrorUnimplemented; return 0; } |
