DiskTook - Linked to AcessNative's nativefs, cleared up some warnings
authorJohn Hodge <[email protected]>
Mon, 9 Jul 2012 04:45:26 +0000 (12:45 +0800)
committerJohn Hodge <[email protected]>
Mon, 9 Jul 2012 04:45:26 +0000 (12:45 +0800)
AcessNative/acesskernel_src/nativefs.c
Tools/DiskTool/src/nativefs.c [changed from file to symlink]

index 4f1b377..835fce9 100644 (file)
@@ -32,7 +32,7 @@ tVFS_Node     *NativeFS_Mount(const char *Device, const char **Arguments);
 void   NativeFS_Unmount(tVFS_Node *Node);\r
 tVFS_Node      *NativeFS_FindDir(tVFS_Node *Node, const char *Name);\r
 char   *NativeFS_ReadDir(tVFS_Node *Node, int Position);\r
-Uint64 NativeFS_Read(tVFS_Node *Node, Uint64 Offset, Uint64 Length, void *Buffer);\r
+size_t NativeFS_Read(tVFS_Node *Node, off_t Offset, size_t Length, void *Buffer);\r
 \r
 // === GLOBALS ===\r
 tVFS_NodeType  gNativeFS_FileNodeType = {\r
@@ -78,7 +78,7 @@ tVFS_Node *NativeFS_Mount(const char *Device, const char **Arguments)
        ret->Data = strdup(Device);\r
        ret->ImplInt = strlen(ret->Data);\r
        ret->ImplPtr = info;\r
-       ret->Inode = (Uint64)dp;\r
+       ret->Inode = (Uint64)(tVAddr)dp;\r
        ret->Flags = VFS_FFLAG_DIRECTORY;\r
 \r
        ret->Type = &gNativeFS_DirNodeType;     \r
@@ -90,7 +90,7 @@ void NativeFS_Unmount(tVFS_Node *Node)
 {\r
        tNativeFS       *info = Node->ImplPtr;\r
        Inode_ClearCache( info->InodeHandle );\r
-       closedir( (void *)Node->Inode );\r
+       closedir( (void *)(tVAddr)Node->Inode );\r
        free(Node->Data);\r
        free(Node);\r
        free(info);\r
@@ -132,7 +132,7 @@ tVFS_Node *NativeFS_FindDir(tVFS_Node *Node, const char *Name)
        if( S_ISDIR(statbuf.st_mode) )\r
        {\r
                LOG("Directory");\r
-               baseRet.Inode = (Uint64) opendir(path);\r
+               baseRet.Inode = (Uint64)(tVAddr) opendir(path);\r
                baseRet.Type = &gNativeFS_DirNodeType;\r
                baseRet.Flags |= VFS_FFLAG_DIRECTORY;\r
                baseRet.Size = -1;\r
@@ -140,7 +140,7 @@ tVFS_Node *NativeFS_FindDir(tVFS_Node *Node, const char *Name)
        else\r
        {\r
                LOG("File");\r
-               baseRet.Inode = (Uint64) fopen(path, "r+");\r
+               baseRet.Inode = (Uint64)(tVAddr) fopen(path, "r+");\r
                baseRet.Type = &gNativeFS_FileNodeType;\r
                \r
                fseek( (FILE*)(tVAddr)baseRet.Inode, 0, SEEK_END );\r
@@ -184,14 +184,14 @@ char *NativeFS_ReadDir(tVFS_Node *Node, int Position)
        return ret;\r
 }\r
 \r
-Uint64 NativeFS_Read(tVFS_Node *Node, Uint64 Offset, Uint64 Length, void *Buffer)\r
+size_t NativeFS_Read(tVFS_Node *Node, off_t Offset, size_t Length, void *Buffer)\r
 {\r
-       ENTER("pNode XOffset XLength pBuffer", Node, Offset, Length, Buffer);\r
-       if( fseek( (void *)Node->Inode, Offset, SEEK_SET ) != 0 )\r
+       ENTER("pNode XOffset xLength pBuffer", Node, Offset, Length, Buffer);\r
+       if( fseek( (void *)(tVAddr)Node->Inode, Offset, SEEK_SET ) != 0 )\r
        {\r
                LEAVE('i', 0);\r
                return 0;\r
        }\r
        LEAVE('-');\r
-       return fread( Buffer, 1, Length, (void *)Node->Inode );\r
+       return fread( Buffer, 1, Length, (void *)(tVAddr)Node->Inode );\r
 }\r
deleted file mode 100644 (file)
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000
new file mode 120000 (symlink)
index 0000000000000000000000000000000000000000..164ccfc9abc3d1021c1f06d001ea3dd22b211b65
--- /dev/null
@@ -0,0 +1 @@
+../../../AcessNative/acesskernel_src/nativefs.c
\ No newline at end of file

UCC git Repository :: git.ucc.asn.au