Subversion Repositories freemyipod

Rev

Rev 69 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 69 Rev 70
Line 522... Line 522...
522
     * more data to follow in this call). Do NOT flush here. */
522
     * more data to follow in this call). Do NOT flush here. */
523
 
523
 
524
    /* read/write whole sectors right into/from the supplied buffer */
524
    /* read/write whole sectors right into/from the supplied buffer */
525
    sectors = count / SECTOR_SIZE;
525
    sectors = count / SECTOR_SIZE;
526
    if ( sectors ) {
526
    if ( sectors ) {
527
        if (buf+nread & (CACHEALIGN_SIZE - 1))
527
        if (((uint32_t)buf + nread) & (CACHEALIGN_SIZE - 1))
528
        {
528
        {
529
            if (write) memcpy(file->cache, buf+nread, SECTOR_SIZE);
529
            if (write) memcpy(file->cache, buf+nread, SECTOR_SIZE);
530
            rc = fat_readwrite(&(file->fatfile), sectors, file->cache, write );
530
            rc = fat_readwrite(&(file->fatfile), sectors, file->cache, write );
531
            if (!write) memcpy(buf+nread, file->cache, SECTOR_SIZE);
531
            if (!write) memcpy(buf+nread, file->cache, SECTOR_SIZE);
532
        }
532
        }