Updated types

This commit is contained in:
Alex
2022-12-21 00:43:51 +02:00
parent 684b76a1ca
commit a677f3c159
62 changed files with 471 additions and 448 deletions

View File

@ -24,11 +24,11 @@ namespace FileSystem
.Read = USTAR_Read,
};
USTAR::USTAR(uint64_t Address, Virtual *vfs)
USTAR::USTAR(uintptr_t Address, Virtual *vfs)
{
trace("Initializing USTAR with address %#llx", Address);
if (memcmp(((FileHeader *)Address)->signature, "ustar", 5) != 0)
if (memcmp(((FileHeader *)(uintptr_t)Address)->signature, "ustar", 5) != 0)
{
error("ustar signature invalid!");
return;
@ -41,9 +41,9 @@ namespace FileSystem
vfs->CreateRoot(&ustar, "/");
uint64_t errorsallowed = 20;
int ErrorsAllowed = 20;
for (uint64_t i = 0;; i++)
for (size_t i = 0;; i++)
{
FileHeader *header = (FileHeader *)Address;
if (memcmp(((FileHeader *)Address)->signature, "ustar", 5) != 0)
@ -51,7 +51,7 @@ namespace FileSystem
memmove(header->name, header->name + 1, strlen(header->name));
if (header->name[strlen(header->name) - 1] == '/')
header->name[strlen(header->name) - 1] = 0;
uint64_t size = getsize(header->size);
size_t size = getsize(header->size);
FileSystemNode *node = nullptr;
if (!isempty((char *)header->name))
@ -63,9 +63,9 @@ namespace FileSystem
debug("Added node: %s", node->Name);
if (node == nullptr)
{
if (errorsallowed > 0)
if (ErrorsAllowed > 0)
{
errorsallowed--;
ErrorsAllowed--;
goto NextFileAddress;
}
else

View File

@ -133,7 +133,7 @@ namespace FileSystem
FileStatus RemoveChild(FileSystemNode *Parent, const char *Name)
{
vfsdbg("RemoveChild( Parent: \"%s\" Name: \"%s\" )", Parent->Name, Name);
for (uint64_t i = 0; i < Parent->Children.size(); i++)
for (uintptr_t i = 0; i < Parent->Children.size(); i++)
if (strcmp(Parent->Children[i]->Name, Name) == 0)
{
Parent->Children.remove(i);
@ -414,7 +414,7 @@ namespace FileSystem
return file;
}
uint64_t Virtual::Read(FILE *File, uint64_t Offset, uint8_t *Buffer, uint64_t Size)
size_t Virtual::Read(FILE *File, size_t Offset, uint8_t *Buffer, size_t Size)
{
SmartLock(VFSLock);
if (unlikely(!File))
@ -437,7 +437,7 @@ namespace FileSystem
return File->Node->Operator->Read(File->Node, Offset, Size, Buffer);
}
uint64_t Virtual::Write(FILE *File, uint64_t Offset, uint8_t *Buffer, uint64_t Size)
size_t Virtual::Write(FILE *File, size_t Offset, uint8_t *Buffer, size_t Size)
{
SmartLock(VFSLock);
if (unlikely(!File))