diff --git a/source/SoundStretch/WavFile.cpp b/source/SoundStretch/WavFile.cpp index d73d418..9264b45 100644 --- a/source/SoundStretch/WavFile.cpp +++ b/source/SoundStretch/WavFile.cpp @@ -250,7 +250,7 @@ int WavInFile::read(char *buffer, int maxElems) } assert(buffer); - numBytes = fread(buffer, 1, numBytes, fptr); + numBytes = (int)fread(buffer, 1, numBytes, fptr); dataRead += numBytes; return numBytes; @@ -300,7 +300,7 @@ int WavInFile::read(short *buffer, int maxElems) assert(numBytes >= 0); } - numBytes = fread(buffer, 1, numBytes, fptr); + numBytes = (int)fread(buffer, 1, numBytes, fptr); dataRead += numBytes; numElems = numBytes / 2; @@ -652,7 +652,7 @@ void WavOutFile::writeHeader() // write the supplemented header in the beginning of the file fseek(fptr, 0, SEEK_SET); - res = fwrite(&hdrTemp, sizeof(hdrTemp), 1, fptr); + res = (int)fwrite(&hdrTemp, sizeof(hdrTemp), 1, fptr); if (res != 1) { throw runtime_error("Error while writing to a wav file."); @@ -674,7 +674,7 @@ void WavOutFile::write(const char *buffer, int numElems) } assert(sizeof(char) == 1); - res = fwrite(buffer, 1, numElems, fptr); + res = (int)fwrite(buffer, 1, numElems, fptr); if (res != numElems) { throw runtime_error("Error while writing to a wav file."); @@ -721,7 +721,7 @@ void WavOutFile::write(const short *buffer, int numElems) memcpy(pTemp, buffer, numElems * 2); _swap16Buffer(pTemp, numElems); - res = fwrite(pTemp, 2, numElems, fptr); + res = (int)fwrite(pTemp, 2, numElems, fptr); delete[] pTemp; diff --git a/source/SoundTouch/cpu_detect_x86_win.cpp b/source/SoundTouch/cpu_detect_x86_win.cpp index 98ff022..1ea50ea 100644 --- a/source/SoundTouch/cpu_detect_x86_win.cpp +++ b/source/SoundTouch/cpu_detect_x86_win.cpp @@ -71,7 +71,9 @@ uint detectCPUextensions(void) if (_dwDisabledISA == 0xffffffff) return 0; - _asm +#ifndef _M_X64 + // 32bit compilation, detect CPU capabilities with inline assembler. + __asm { ; check if 'cpuid' instructions is available by toggling eflags bit 21 ; @@ -125,5 +127,13 @@ uint detectCPUextensions(void) mov res, esi } +#else + + // Visual C++ 64bit compilation doesn't support inline assembler. However, + // all x64 compatible CPUs support MMX & SSE extensions. + res = SUPPORT_MMX | SUPPORT_SSE | SUPPORT_SSE2; + +#endif + return res & ~_dwDisabledISA; }