Modules/FAT - Replaced literal -1 for EOC with GETFATVALUE_EOC
[tpg/acess2.git] / KernelLand / Modules / Filesystems / FAT / fat.c
index f7ebafe..c930497 100644 (file)
@@ -334,7 +334,7 @@ int FAT_int_GetAddress(tVFS_Node *Node, Uint64 Offset, Uint64 *Addr, Uint32 *Clu
                        if(Cluster)     *Cluster = cluster;\r
                        cluster = FAT_int_GetFatValue(disk, cluster);\r
                        // Check for end of cluster chain\r
-                       if(cluster == 0xFFFFFFFF) {     LEAVE('i', 1);  return 1;}\r
+                       if(cluster == GETFATVALUE_EOC) { LEAVE('i', 1); return 1; }\r
                }\r
                if(Cluster)     *Cluster = cluster;\r
        }\r
@@ -417,7 +417,7 @@ size_t FAT_Read(tVFS_Node *Node, off_t Offset, size_t Length, void *Buffer)
        for(i = preSkip; i--; )\r
        {\r
                cluster = FAT_int_GetFatValue(disk, cluster);\r
-               if(cluster == -1) {\r
+               if(cluster == GETFATVALUE_EOC) {\r
                        Log_Warning("FAT", "Offset is past end of cluster chain mark");\r
                        LEAVE('i', 0);\r
                        return 0;\r
@@ -443,7 +443,7 @@ size_t FAT_Read(tVFS_Node *Node, off_t Offset, size_t Length, void *Buffer)
                LOG("pos = %i, Reading the rest of the clusters");\r
                // Get next cluster in the chain\r
                cluster = FAT_int_GetFatValue(disk, cluster);\r
-               if(cluster == -1) {\r
+               if(cluster == GETFATVALUE_EOC) {\r
                        Log_Warning("FAT", "Read past End of Cluster Chain (Align)");\r
                        LEAVE('X', pos);\r
                        return pos;\r
@@ -461,7 +461,7 @@ size_t FAT_Read(tVFS_Node *Node, off_t Offset, size_t Length, void *Buffer)
        // Read the rest of the cluster data\r
        for( ; count; count -- )\r
        {\r
-               if(cluster == -1) {\r
+               if(cluster == GETFATVALUE_EOC) {\r
                        Log_Warning("FAT", "Read past End of Cluster Chain (Bulk)");\r
                        LEAVE('X', pos);\r
                        return pos;\r
@@ -519,7 +519,7 @@ size_t FAT_Write(tVFS_Node *Node, off_t Offset, size_t Length, const void *Buffe
        while( Offset > disk->BytesPerCluster )\r
        {\r
                cluster = FAT_int_GetFatValue( disk, cluster );\r
-               if(cluster == -1) {\r
+               if(cluster == GETFATVALUE_EOC) {\r
                        Log_Warning("FAT", "EOC Unexpectedly Reached");\r
                        LEAVE('i', 0);\r
                        return 0;\r
@@ -565,7 +565,7 @@ size_t FAT_Write(tVFS_Node *Node, off_t Offset, size_t Length, const void *Buffe
                \r
                // Get next cluster (allocating if needed)\r
                tmpCluster = FAT_int_GetFatValue(disk, cluster);\r
-               if(tmpCluster == -1) {\r
+               if(tmpCluster == GETFATVALUE_EOC) {\r
                        tmpCluster = FAT_int_AllocateCluster(disk, cluster);\r
                        if( tmpCluster == 0 )\r
                                goto ret_incomplete;\r
@@ -581,7 +581,7 @@ size_t FAT_Write(tVFS_Node *Node, off_t Offset, size_t Length, const void *Buffe
                \r
                // Get next cluster (allocating if needed)\r
                tmpCluster = FAT_int_GetFatValue(disk, cluster);\r
-               if(tmpCluster == -1) {\r
+               if(tmpCluster == GETFATVALUE_EOC) {\r
                        bNewCluster = 1;\r
                        tmpCluster = FAT_int_AllocateCluster(disk, cluster);\r
                        if( tmpCluster == 0 )\r

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