- Timestamp:
- Dec 13, 2008, 2:20:06 PM (17 years ago)
- Author:
- KO Myung-Hun
- Message:
-
Changed Cluster2Sector() and Sector2Cluster() marcros to accept 'pVolInfo' as a parameter as well
- File:
-
- 1 edited
- branches/fat32-0.9/src/ifscache.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/fat32-0.9/src/ifscache.c
r81 r83 266 266 267 267 268 #define Cluster2Sector( ulCluster ) (( ULONG )( pVolInfo->ulStartOfData + \ 269 (( ULONG )( ulCluster ) - 2) * pVolInfo->BootSect.bpb.SectorsPerCluster )) 270 271 #define Sector2Cluster( ulSector ) (( ULONG )((( ULONG )( ulSector ) - pVolInfo->ulStartOfData ) / \ 272 pVolInfo->BootSect.bpb.SectorsPerCluster + 2 )) 268 #define Cluster2Sector( pVolInfo, ulCluster ) \ 269 (( ULONG )(( pVolInfo )->ulStartOfData + \ 270 (( ULONG )( ulCluster ) - 2) * ( pVolInfo )->BootSect.bpb.SectorsPerCluster )) 271 272 #define Sector2Cluster( pVolInfo, ulSector ) \ 273 (( ULONG )((( ULONG )( ulSector ) - ( pVolInfo )->ulStartOfData ) / \ 274 ( pVolInfo )->BootSect.bpb.SectorsPerCluster + 2 )) 273 275 274 276 /****************************************************************** … … 341 343 if( ulSector >= pVolInfo->ulStartOfData ) 342 344 { 343 ULONG ulStartCluster = Sector2Cluster( (削除) (削除ここまで)ulSector );344 ULONG ulEndCluster = Sector2Cluster( (削除) (削除ここまで)ulSector + usSectors - 1 );345 ULONG ulStartCluster = Sector2Cluster( (追記) pVolInfo, (追記ここまで)ulSector ); 346 ULONG ulEndCluster = Sector2Cluster( (追記) pVolInfo, (追記ここまで)ulSector + usSectors - 1 ); 345 347 ULONG ulNextCluster = 0; 346 348 ULONG ulCluster; … … 356 358 { 357 359 usSectors = ( ulStartCluster != ulCluster ) ? 358 ( min(( USHORT )( Cluster2Sector( (削除) (削除ここまで)ulCluster ) - ulSector ), usSectors )) : 0;360 ( min(( USHORT )( Cluster2Sector( (追記) pVolInfo, (追記ここまで)ulCluster ) - ulSector ), usSectors )) : 0; 359 361 } 360 362 }
Note:
See TracChangeset
for help on using the changeset viewer.