#include <vfs.h>
// === PROTOTYPES ===
-tVFS_Node *VFS_MemFile_Create(tVFS_Node *Unused, char *Path);
+tVFS_Node *VFS_MemFile_Create(tVFS_Node *Unused, const char *Path);
void VFS_MemFile_Close(tVFS_Node *Node);
Uint64 VFS_MemFile_Read(tVFS_Node *Node, Uint64 Offset, Uint64 Length, void *Buffer);
Uint64 VFS_MemFile_Write(tVFS_Node *Node, Uint64 Offset, Uint64 Length, void *Buffer);
// === CODE ===
/**
- * \fn tVFS_Node *VFS_MemFile_Create(tVFS_Node *Unused, char *Path)
+ * \fn tVFS_Node *VFS_MemFile_Create(tVFS_Node *Unused, const char *Path)
* \note Treated as finddir by VFS_ParsePath
*/
-tVFS_Node *VFS_MemFile_Create(tVFS_Node *Unused, char *Path)
+tVFS_Node *VFS_MemFile_Create(tVFS_Node *Unused, const char *Path)
{
Uint base, size;
- char *str = Path;
+ const char *str = Path;
tVFS_Node *ret;
str++; // Eat '$'
// Check for NULL byte
if(*str != '\0') return NULL;
- Log(" VFS_MemFile_Create: base=0x%x, size=0x%x", base, size);
-
// Allocate and fill node
ret = malloc(sizeof(tVFS_Node));
memset(ret, 0, sizeof(tVFS_Node));
Length = Node->Size - Offset;
// Copy Data
- memcpy(Buffer, Node->ImplPtr+Offset, Length);
+ memcpy(Buffer, (Uint8*)Node->ImplPtr + Offset, Length);
return Length;
}
Length = Node->Size - Offset;
// Copy Data
- memcpy(Node->ImplPtr+Offset, Buffer, Length);
+ memcpy((Uint8*)Node->ImplPtr + Offset, Buffer, Length);
return Length;
}