@@ -32,10 +32,10 @@ static void cdfs_determine_sector_size(cdfs_track_t* track)
3232 return ;
3333
3434 /* if this is a CDROM-XA data source, the "CD001" tag will be 25 bytes into the sector */
35- if ( buffer [25 ] == 0x43
35+ if ( buffer [25 ] == 0x43
3636 && buffer [26 ] == 0x44
37- && buffer [27 ] == 0x30
38- && buffer [28 ] == 0x30
37+ && buffer [27 ] == 0x30
38+ && buffer [28 ] == 0x30
3939 && buffer [29 ] == 0x31 )
4040 {
4141 track -> stream_sector_size = 2352 ;
@@ -44,8 +44,8 @@ static void cdfs_determine_sector_size(cdfs_track_t* track)
4444 /* otherwise it should be 17 bytes into the sector */
4545 else if (buffer [17 ] == 0x43
4646 && buffer [18 ] == 0x44
47- && buffer [19 ] == 0x30
48- && buffer [20 ] == 0x30
47+ && buffer [19 ] == 0x30
48+ && buffer [20 ] == 0x30
4949 && buffer [21 ] == 0x31 )
5050 {
5151 track -> stream_sector_size = 2352 ;
@@ -65,7 +65,7 @@ static void cdfs_determine_sector_size(cdfs_track_t* track)
6565 && buffer [ 7 ] == 0xFF
6666 && buffer [ 8 ] == 0xFF
6767 && buffer [ 9 ] == 0xFF
68- && buffer [10 ] == 0xFF
68+ && buffer [10 ] == 0xFF
6969 && buffer [11 ] == 0 )
7070 {
7171 /* if we didn't find a CD001 tag, this format may predate ISO-9660 */
@@ -80,21 +80,21 @@ static void cdfs_determine_sector_size(cdfs_track_t* track)
8080static void cdfs_determine_sector_size_from_file_size (cdfs_track_t * track )
8181{
8282 /* attempt to determine stream_sector_size from file size */
83- size_t size = intfstream_get_size (track -> stream );
83+ size_t _len = intfstream_get_size (track -> stream );
8484
85- if ((size % 2352 ) == 0 )
85+ if ((_len % 2352 ) == 0 )
8686 {
8787 /* raw tracks use all 2352 bytes and have a 24 byte header */
8888 track -> stream_sector_size = 2352 ;
8989 track -> stream_sector_header_size = 24 ;
9090 }
91- else if ((size % 2048 ) == 0 )
91+ else if ((_len % 2048 ) == 0 )
9292 {
9393 /* cooked tracks eliminate all header/footer data */
9494 track -> stream_sector_size = 2048 ;
9595 track -> stream_sector_header_size = 0 ;
9696 }
97- else if ((size % 2336 ) == 0 )
97+ else if ((_len % 2336 ) == 0 )
9898 {
9999 /* MODE 2 format without 16-byte sync data */
100100 track -> stream_sector_size = 2336 ;
@@ -172,7 +172,7 @@ static int cdfs_find_file(cdfs_file_t* file, const char* path)
172172 intfstream_read (file -> track -> stream , buffer , sizeof (buffer ));
173173
174174 /* the directory_record starts at 156 bytes into the sector.
175- * the sector containing the root directory contents is a
175+ * the sector containing the root directory contents is a
176176 * 3 byte value that is 2 bytes into the directory_record. */
177177 offset = 156 + 2 ;
178178 sector = buffer [offset ] | (buffer [offset + 1 ] << 8 ) | (buffer [offset + 2 ] << 16 );
@@ -187,25 +187,25 @@ static int cdfs_find_file(cdfs_file_t* file, const char* path)
187187
188188 while (tmp < buffer + sizeof (buffer ))
189189 {
190- /* The first byte of the record is the length of
190+ /* The first byte of the record is the length of
191191 * the record - if 0, we reached the end of the data */
192192 if (!* tmp )
193193 break ;
194194
195- /* filename is 33 bytes into the record and
195+ /* filename is 33 bytes into the record and
196196 * the format is "FILENAME;version" or "DIRECTORY" */
197- if ( (tmp [33 + path_length ] == ';'
197+ if ( (tmp [33 + path_length ] == ';'
198198 || (tmp [33 + path_length ] == '\0' ))
199199 && strncasecmp ((const char * )(tmp + 33 ), path , path_length ) == 0 )
200200 {
201201 /* the file size is in bytes 10-13 of the record */
202- file -> size =
202+ file -> size =
203203 (tmp [10 ])
204- | (tmp [11 ] << 8 )
205- | (tmp [12 ] << 16 )
204+ | (tmp [11 ] << 8 )
205+ | (tmp [12 ] << 16 )
206206 | (tmp [13 ] << 24 );
207207
208- /* the file contents are in the sector identified
208+ /* the file contents are in the sector identified
209209 * in bytes 2-4 of the record */
210210 sector = tmp [2 ] | (tmp [3 ] << 8 ) | (tmp [4 ] << 16 );
211211 return sector ;
@@ -235,7 +235,7 @@ int cdfs_open_file(cdfs_file_t* file, cdfs_track_t* track, const char* path)
235235 {
236236 file -> first_sector = 0 ;
237237 file -> size = (unsigned int )((intfstream_get_size (
238- file -> track -> stream ) / file -> track -> stream_sector_size )
238+ file -> track -> stream ) / file -> track -> stream_sector_size )
239239 * 2048 );
240240 return 1 ;
241241 }
@@ -319,8 +319,8 @@ int64_t cdfs_read_file(cdfs_file_t* file, void* buffer, uint64_t len)
319319
320320void cdfs_close_file (cdfs_file_t * file )
321321{
322- /* Not really anything to do here, just
323- * clear out the first_sector so
322+ /* Not really anything to do here, just
323+ * clear out the first_sector so
324324 * read() won't do anything */
325325 if (file )
326326 file -> first_sector = -1 ;
@@ -461,7 +461,7 @@ static cdfs_track_t* cdfs_open_cue_track(
461461 while (file_end > file && * file_end != ' ' && * file_end != '\t' )
462462 -- file_end ;
463463
464- if ( file [0 ] == '"'
464+ if ( file [0 ] == '"'
465465 && file_end [-1 ] == '"' )
466466 {
467467 ++ file ;
0 commit comments