/[svn]/libgig/trunk/src/Akai.cpp
ViewVC logotype

Diff of /libgig/trunk/src/Akai.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2573 by schoenebeck, Thu May 22 15:17:09 2014 UTC revision 2574 by schoenebeck, Thu May 22 15:54:02 2014 UTC
# Line 26  Line 26 
26  #include <string.h>  #include <string.h>
27  #include <unistd.h>  #include <unistd.h>
28  #include <fcntl.h>  #include <fcntl.h>
29  #include <sys/ioctl.h>  #if defined(_CARBON_) || defined(__APPLE__)
30  #if defined (__GNUC__) && (__GNUC__ >= 4)  # if defined (__GNUC__) && (__GNUC__ >= 4)
31  #include <sys/disk.h>  #  include <sys/disk.h>
32  #else  # else
33  #include <dev/disk.h>  #  include <dev/disk.h>
34    # endif
35  #endif  #endif
36  #include <sys/types.h>  #include <sys/types.h>
37  #include <sys/stat.h>  #include <sys/stat.h>
38  #include <errno.h>  #include <errno.h>
 #include <paths.h>  
39  #if defined(_CARBON_) || defined(__APPLE__)  #if defined(_CARBON_) || defined(__APPLE__)
40    #include <paths.h>
41    #include <sys/ioctl.h>
42  #include <sys/param.h>  #include <sys/param.h>
43  #include <IOKit/IOKitLib.h>  #include <IOKit/IOKitLib.h>
44  #include <IOKit/IOBSD.h>  #include <IOKit/IOBSD.h>
# Line 1667  int DiskImage::Read(void* pData, uint Wo Line 1669  int DiskImage::Read(void* pData, uint Wo
1669  #ifdef WIN32  #ifdef WIN32
1670        if (mCluster * mClusterSize != SetFilePointer(mFile, mCluster * mClusterSize, NULL, FILE_BEGIN)) {        if (mCluster * mClusterSize != SetFilePointer(mFile, mCluster * mClusterSize, NULL, FILE_BEGIN)) {
1671          printf("ERROR: couldn't seek device!\n");          printf("ERROR: couldn't seek device!\n");
1672    #if 0 // FIXME: endian correction is missing correct detection
1673          if ((readbytes > 0) && (mEndian != eEndianNative)) {          if ((readbytes > 0) && (mEndian != eEndianNative)) {
1674            switch (WordSize) {            switch (WordSize) {
1675              case 2: bswap_16_s ((uint16*)pData, readbytes); break;              case 2: bswap_16_s ((uint16*)pData, readbytes); break;
# Line 1674  int DiskImage::Read(void* pData, uint Wo Line 1677  int DiskImage::Read(void* pData, uint Wo
1677              case 8: bswap_64_s ((uint64*)pData, readbytes); break;              case 8: bswap_64_s ((uint64*)pData, readbytes); break;
1678            }            }
1679          }          }
1680    #endif
1681          return readbytes / WordSize;          return readbytes / WordSize;
1682        }        }
1683        DWORD size;        DWORD size;
# Line 1701  int DiskImage::Read(void* pData, uint Wo Line 1705  int DiskImage::Read(void* pData, uint Wo
1705  //      printf("new pos %d\n",mPos);  //      printf("new pos %d\n",mPos);
1706    }    }
1707    
1708  #if 0  #if 0 // FIXME: endian correction is missing correct detection
1709    if ((readbytes > 0) && (mEndian != eEndianNative))    if ((readbytes > 0) && (mEndian != eEndianNative))
1710      switch (WordSize)      switch (WordSize)
1711      {      {
# Line 1888  bool DiskImage::WriteImage(const char* p Line 1892  bool DiskImage::WriteImage(const char* p
1892    close(fOut);    close(fOut);
1893    return true;    return true;
1894  #endif // _CARBON_ || LINUX  #endif // _CARBON_ || LINUX
1895      return false;
1896  }  }
1897    
1898  inline void DiskImage::swapBytes_16(void* Word) {  inline void DiskImage::swapBytes_16(void* Word) {

Legend:
Removed from v.2573  
changed lines
  Added in v.2574

  ViewVC Help
Powered by ViewVC