diff --git a/CHANGELOG b/CHANGELOG index 2be5d1f0..9f625a3b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,11 @@ +1.6.0-bacon0 + Contributions: + drbscl + Add 64 bit soundfont support (#211) + + Fixes: + Add 64 bit soundfont support (#211) + 1.5.0-bacon3 Contributions: purelygrey @@ -15,9 +23,9 @@ * instrumentation by clsource simotek - Add color options for Border Play and Mute (#143) + Add color options for Border Play and Mute (#143) * Adds different color for the > play and _ mute indicators - Fix rg35xx mapping (#139) + Fix rg35xx mapping (#139) * rshoulder and lshoulder were the wrong way kompadre @@ -40,7 +48,7 @@ Nudge functionality (#130) * In Project view, select tempo and hold B+LEFT/RIGHT to nudge slower/faster * In Song view, pressing LT+LEFT/RIGHT will do the same - + Printable fx in InstrumentView (#155) * Uses ffmpeg to print reverb to currently selected sample * New sample with fx is created and assigned to the current instrument @@ -63,7 +71,7 @@ Set songview b jumping length to 16 rows in correspondence with LSDJ and M8 Scales no longer affect instrument numbers ([djdiskmachine/LittleGPTracker#172](https://github.com/djdiskmachine/LittleGPTracker/issues/172)) Bug in Variable:SetString [djdiskmachine/LittleGPTracker#169](https://github.com/djdiskmachine/LittleGPTracker/issues/169) - + Issue in deep clone (#135) Was possible to accidentally deep clone position into another position @@ -108,27 +116,27 @@ Fixes: RG35XX no longer segfaults on boot USB MIDI disabled due to missing OS dependencies - + 1.4.0 Adds: Automated build for bittboy, Win32, PSP, Miyoo, Deb32, RG35XX Shoutout to xquader for the initial RG35XX port (https://boosty.to/xquader) License changed from CC-BY-SA-NC to GPL-3 - * MVEL cmd + * MVEL cmd Set step velocity for MIDI instruments https://github.com/democloid/picoTracker/pull/163 - + Author: @maks@fluttercommunity.social Co-authored-by: djdiskmachine * Config option to set major beat color in phrase screen Author: koisignal - + * Deep clone Clones selected chain and the phrases within - + Author: koisignal Co-authored-by: djdiskmachine @@ -190,29 +198,29 @@ 1.3o-beta-1 Pingpong loop now stable - Courtesy of djdiskmachine + Courtesy of djdiskmachine Add ability to change font USAGE: ./mkfont.py FONT_BMP [OUTPUT_FILE] FONT_BMP must be a black/white (#000000, #FFFFFF) 128x64px bmp if OUTPUT_FILE is omitted, will print to stdout - Courtesy of subnixr + Courtesy of subnixr Adds Miyoo mini build Courtesy of Nine-H Changes filter attenuation to attenuation - Adjust volume post scream filter + Adjust volume post scream filter https://github.com/Mdashdotdashn/LittleGPTracker/issues/22 Missing wiki content dumped to repo - Courtesy of Peter Swimm + Courtesy of Peter Swimm 1.3o-alpha-5 Adds native SteamOS build Adds Bittboy/RS97/RG350 builds Merge of Gameblaba, CalebCDE and RafaVicos work - Shoutouts! + Shoutouts! 1.3o-alpha-4 Adds Save As menu item - save a copy of your project with a new name Courtesy of yoyz (https://github.com/yoyz), biggup! diff --git a/README.md b/README.md index ce6d7ee7..a53b7ca7 100644 --- a/README.md +++ b/README.md @@ -44,9 +44,9 @@ Recommended reading to get you started: |-------------|---------------|--------------|------------|--------------------------------------| | PSP | NO | NO | YES | [See notes](projects/resources/PSP/INSTALL_HOW_TO.txt) | | DEB | YES | YES | YES | | -| X64 | YES | YES | NO | | +| X64 | YES | YES | MAYBE | | | X86 | YES | YES | YES | | -| STEAM | YES | YES | NO | | +| STEAM | YES | YES | MAYBE | | | MIYOO | NO | NO | YES | Port by [Nine-H](https://ninethehacker.xyz) | | W32 | YES | YES | YES | Built in VS2008 with love | | RASPI | YES | YES | YES | Versatile platform | @@ -55,10 +55,8 @@ Recommended reading to get you started: | GARLIC | MAYBE | NO | YES | Port by [Simotek](http://simotek.net)| | GARLICPLUS | MAYBE | NO | YES | Port by [Simotek](http://simotek.net)| | RG35XXPLUS | MAYBE | NO | YES | Port by [Simotek](http://simotek.net)| -| MACOS | YES | YES | NO | Port by [clsource](https://genserver.social/clsource) | +| MACOS | YES | YES | MAYBE | Port by [clsource](https://genserver.social/clsource) | - -* **Soundfont library is currently not ported for 64bit OS** * **MIDI functionality __greatly__ depends on kernel support, please feature request your favourite OS maintainer =)** * **Install ffmpeg by following install instructions for your platform [here](https://www.ffmpeg.org/download.html)** * **PrintFX requires full ffmpeg. If marked as TBA, it requires a redesign using [libav](https://trac.ffmpeg.org/wiki/Using%20libav*)** diff --git a/sources/Application/Instruments/SoundFontManager.cpp b/sources/Application/Instruments/SoundFontManager.cpp index 0acec549..d56a4efc 100644 --- a/sources/Application/Instruments/SoundFontManager.cpp +++ b/sources/Application/Instruments/SoundFontManager.cpp @@ -2,10 +2,6 @@ #include "System/System/System.h" #include "System/FileSystem/FileSystem.h" -#ifdef _64BIT -#include -#endif - SoundFontManager::SoundFontManager() { } ; @@ -66,14 +62,11 @@ sfBankID SoundFontManager::LoadBank(const char *path) { current.dwEnd=(current.dwEnd-current.dwStart) ; current.dwStartloop=(current.dwStartloop-current.dwStart) ; current.dwEndloop=(current.dwEndloop-current.dwStart) ; -#ifdef _64BIT - current.dwStart=(intptr_t)buffer ; -#else - current.dwStart=(DWORD)buffer ; -#endif + // ADDR is pointer-sized, works on both 32-bit and 64-bit + current.dwStart = (ADDR)buffer; - sampleData_.push_back(buffer) ; - } + sampleData_.push_back(buffer); + } fin->Close() ; SAFE_DELETE(fin) ; diff --git a/sources/Application/Model/Project.h b/sources/Application/Model/Project.h index f75454d6..4a5d813f 100644 --- a/sources/Application/Model/Project.h +++ b/sources/Application/Model/Project.h @@ -19,8 +19,8 @@ #define VAR_SCALE MAKE_FOURCC('S', 'C', 'A', 'L') #define PROJECT_NUMBER "1" -#define PROJECT_RELEASE "5" -#define BUILD_COUNT "0" +#define PROJECT_RELEASE "6" +#define BUILD_COUNT "0-bacon0" #define MAX_TAP 3 @@ -63,8 +63,7 @@ class Project: public Persistent,public VariableContainer,I_Observer { int midiDeviceListSize_ ; int tempoNudge_ ; unsigned long lastTap_[MAX_TAP] ; - unsigned int tempoTapCount_ ; + unsigned int tempoTapCount_; } ; #endif - diff --git a/sources/Externals/Soundfont/DATATYPE.H b/sources/Externals/Soundfont/DATATYPE.H index ef5bcf23..06d6d6e8 100644 --- a/sources/Externals/Soundfont/DATATYPE.H +++ b/sources/Externals/Soundfont/DATATYPE.H @@ -36,13 +36,25 @@ #include +#if defined(_MSC_VER) && _MSC_VER < 1600 + /* Workaround for MSVC 2008 and earlier */ + typedef signed __int32 int32_t; + typedef unsigned __int32 uint32_t; +#ifdef _WIN64 + typedef unsigned __int64 uintptr_t; +#else + typedef unsigned __int32 uintptr_t; +#endif +#else +#include +#endif -/************ -* Defines -************/ + /************ + * Defines + ************/ -#ifndef __BYTE_INCOHERENT /* Big Endian (IE 680x0) */ -#define __BYTE_COHERENT /* Little Endian (IE 80x86) */ +#ifndef __BYTE_INCOHERENT /* Big Endian (IE 680x0) */ +#define __BYTE_COHERENT /* Little Endian (IE 80x86) */ #endif #ifdef _UNIX_STUB_ @@ -51,90 +63,92 @@ #endif #ifdef EMU_WINDOWS - #include +#include #else - #define _export +#define _export #endif -/* Expected data values */ -#define CHAR_MINVAL -127 -#define CHAR_MAXVAL 127 -#define BYTE_MAXVAL 255 -#define SHRT_MINVAL -32767 -#define SHRT_MAXVAL 32767 -#define LONG_MINVAL -2147483647L -#define LONG_MAXVAL 2147483647L -#define DWORD_MAXVAL 4294967295L + /* Expected data values */ +#define CHAR_MINVAL -127 +#define CHAR_MAXVAL 127 +#define BYTE_MAXVAL 255 +#define SHRT_MINVAL -32767 +#define SHRT_MAXVAL 32767 +#define LONG_MINVAL -2147483647L +#define LONG_MAXVAL 2147483647L +#define DWORD_MAXVAL 4294967295L #ifndef FALSE - #define FALSE 0 +#define FALSE 0 #endif #ifndef TRUE - #define TRUE 1 +#define TRUE 1 #endif #ifndef EMU_WINDOWS // windows.h defines these already -// #define LOBYTE(x) ((x) & 0x00FF) -// #define HIBYTE(x) (((x) & 0xFF00) >> 8) + // #define LOBYTE(x) ((x) & 0x00FF) + // #define HIBYTE(x) (((x) & 0xFF00) >> 8) #endif + /************* + * Typedefs + *************/ -/************* -* Typedefs -*************/ - -typedef char CHAR; /* 8 bit signed value */ -typedef short SHORT; /* 16 bit signed value was: INT */ + typedef char CHAR; /* 8 bit signed value */ + typedef short SHORT; /* 16 bit signed value was: INT */ #ifdef EMU_WINDOWS - /***************************************************************** - * These idiosyncratic pointer definitions for memory allocations - * which are greater than 64K and are Intel-centric compiling - * environment necessities, at least for Windows environments. - * Perhaps, however, Windows NT will eliminate the 'huge' keyword - * requirement altogether. - *****************************************************************/ - typedef BYTE huge* BYTEPTR; - typedef WORD huge* UINTPTR; - typedef DWORD huge* DWORDPTR; - typedef void huge* VOIDPTR; + /***************************************************************** + * These idiosyncratic pointer definitions for memory allocations + * which are greater than 64K and are Intel-centric compiling + * environment necessities, at least for Windows environments. + * Perhaps, however, Windows NT will eliminate the 'huge' keyword + * requirement altogether. + *****************************************************************/ + typedef BYTE huge *BYTEPTR; + typedef WORD huge *UINTPTR; + typedef DWORD huge *DWORDPTR; + typedef void huge *VOIDPTR; + /* Pointer-sized type for runtime memory addresses (32 or 64-bit) */ + typedef uintptr_t ADDR; #else - typedef unsigned char BYTE; /* 8 bit unsigned value */ + typedef unsigned char BYTE; /* 8 bit unsigned value */ #ifndef BOOL - typedef int BOOL; /* 16 bit signed value */ + typedef int BOOL; /* 16 bit signed value */ #endif - typedef unsigned short WORD; /* 16 bit signed value */ - typedef signed long LONG; /* 32 bit signed value */ - typedef unsigned long DWORD; /* 32 bit unsigned value */ - typedef float FLOAT; /* 32 bit floating point value */ - typedef double DOUBLE; /* 64 bit floating point value */ - typedef long double LDOUBLE; /* 80 bit floating point value */ - - typedef BYTE* BYTEPTR; - typedef WORD* UINTPTR; - typedef DWORD* DWORDPTR; - typedef void* VOIDPTR; + typedef unsigned short WORD; /* 16 bit unsigned value */ + typedef int32_t LONG; /* 32 bit signed value (fixed-size) */ + typedef uint32_t DWORD; /* 32 bit unsigned value (fixed-size) */ + typedef float FLOAT; /* 32 bit floating point value */ + typedef double DOUBLE; /* 64 bit floating point value */ + typedef long double LDOUBLE; /* 80 bit floating point value */ + + /* Pointer-sized type for runtime memory addresses (32 or 64-bit) */ + typedef uintptr_t ADDR; + + typedef BYTE *BYTEPTR; + typedef WORD *UINTPTR; + typedef DWORD *DWORDPTR; + typedef void *VOIDPTR; #endif /* EMU_WINDOWS */ -/******************************************************************** -* This 16 bit unsigned value is used for routines which return -* standard E-mu error codes (see emuerrs.h) -********************************************************************/ -typedef unsigned short EMUSTAT; + /******************************************************************** + * This 16 bit unsigned value is used for routines which return + * standard E-mu error codes (see emuerrs.h) + ********************************************************************/ + typedef unsigned short EMUSTAT; #ifdef __BYTE_COHERENT -/******************************************************************** -* Convenient union datatypes to use for byte swapping or extracting -* bytes and/or shorts within a short or long value without using -* bit shifting. -********************************************************************/ -typedef struct twoBytesTag -{ - BYTE by0; - BYTE by1; -} twoBytes; - + /******************************************************************** + * Convenient union datatypes to use for byte swapping or extracting + * bytes and/or shorts within a short or long value without using + * bit shifting. + ********************************************************************/ + typedef struct twoBytesTag { + BYTE by0; + BYTE by1; + } twoBytes; typedef struct fourBytesTag { @@ -153,12 +167,10 @@ typedef struct twoWordsTag #elif defined(__BYTE_INCOHERENT) -typedef struct twoBytesTag -{ - BYTE by1; - BYTE by0; -} twoBytes; - + typedef struct twoBytesTag { + BYTE by1; + BYTE by0; + } twoBytes; typedef struct fourBytesTag { diff --git a/sources/Externals/Soundfont/HYDRA.H b/sources/Externals/Soundfont/HYDRA.H index 23d4672a..3f686570 100644 --- a/sources/Externals/Soundfont/HYDRA.H +++ b/sources/Externals/Soundfont/HYDRA.H @@ -206,10 +206,10 @@ typedef struct sfSampleHdrTag { CHAR achSampleName[SAMPLENAMESIZE]; - DWORD dwStart; // Sample addresses - DWORD dwEnd; - DWORD dwStartloop; - DWORD dwEndloop; + ADDR dwStart; // Sample addresses + ADDR dwEnd; + ADDR dwStartloop; + ADDR dwEndloop; DWORD dwSampleRate; // In Hz, IE 44100, 22050, etc BYTE byOriginalKey; // MIDI Key, 0 to 127 CHAR chFineCorrection; // Tuning correction in cents diff --git a/sources/Externals/Soundfont/RIFF.CPP b/sources/Externals/Soundfont/RIFF.CPP index cc092bd5..494c087e 100644 --- a/sources/Externals/Soundfont/RIFF.CPP +++ b/sources/Externals/Soundfont/RIFF.CPP @@ -235,10 +235,9 @@ WORD RIFFClass::OpenRIFF(CHAR* pName) { byWhereIsRIFFData = RIFF_ONDISK; - if ((RIFFOpen((LONG)pName) != SUCCESS ) || (pFile == NULL)) - { - SetError(errno); // Set inside RIFFOpen - return (uiErrorNdx = RIFF_OPENFILEERROR); + if ((RIFFOpen((ADDR)pName) != SUCCESS) || (pFile == NULL)) { + SetError(errno); // Set inside RIFFOpen + return (uiErrorNdx = RIFF_OPENFILEERROR); } return (InitRIFF()); @@ -253,10 +252,10 @@ WORD RIFFClass::OpenRIFF(CHAR* pName) WORD RIFFClass::OpenRIFF(FSSpec* pSpecifier) { byWhereIsRIFFData = RIFF_ONMACDISK; - - if (RIFFOpen((LONG)pSpecifier) != SUCCESS) - return (RIFF_OPENFILEERROR); - + + if (RIFFOpen((ADDR)pSpecifier) != SUCCESS) + return (RIFF_OPENFILEERROR); + return(InitRIFF()); } #endif // USE_MACINTOSH @@ -443,28 +442,26 @@ DWORD RIFFClass::GetCkFormID(void) { return (dwLastFormID); } // is a pointer to the File System Specifier (FSSpec) // data structure. //*************************************************** -SHORT RIFFClass::RIFFOpen(LONG lPointer) -{ - //*************************************************** - // Keep in mind that whenever a system call is made and - // _no_ error takes place, errno is _not_ set to 0. - // Obviously, this means that any previous system call - // will set errno upon an error, one which is innocuous, - // but will cause fopen to _appear_ as though it failed. - // For example, open a temporary file which might not - // exist: - // - // fopen("tempfile", "wb"); - // - // If it doesn't exist, errno become 2 (in DOS, at - // least). Now call the fopen below for a preexisting - // RIFF file. Guess what! If you didn't reset errno - // to 0, your return value will be 2, an apparent error. - //*************************************************** - errno = 0; - - switch (byWhereIsRIFFData) - { +SHORT RIFFClass::RIFFOpen(ADDR lPointer) { + //*************************************************** + // Keep in mind that whenever a system call is made and + // _no_ error takes place, errno is _not_ set to 0. + // Obviously, this means that any previous system call + // will set errno upon an error, one which is innocuous, + // but will cause fopen to _appear_ as though it failed. + // For example, open a temporary file which might not + // exist: + // + // fopen("tempfile", "wb"); + // + // If it doesn't exist, errno become 2 (in DOS, at + // least). Now call the fopen below for a preexisting + // RIFF file. Guess what! If you didn't reset errno + // to 0, your return value will be 2, an apparent error. + //*************************************************** + errno = 0; + + switch (byWhereIsRIFFData) { case RIFF_ONDISK: pFile = fopen((CHAR *)lPointer, "rb"); return (errno); @@ -476,7 +473,7 @@ SHORT RIFFClass::RIFFOpen(LONG lPointer) default: return (1); - } + } } SHORT RIFFClass::RIFFClose() diff --git a/sources/Externals/Soundfont/RIFF.H b/sources/Externals/Soundfont/RIFF.H index ff12655d..0763b5ec 100644 --- a/sources/Externals/Soundfont/RIFF.H +++ b/sources/Externals/Soundfont/RIFF.H @@ -191,7 +191,7 @@ class RIFFClass DWORD RIFFTell(void); DWORD RIFFTellAbs(void); - SHORT RIFFOpen(LONG); + SHORT RIFFOpen(ADDR); SHORT RIFFClose(void); diff --git a/sources/Externals/Soundfont/SFDATA.H b/sources/Externals/Soundfont/SFDATA.H index 1c4ff1c8..9540f8e3 100644 --- a/sources/Externals/Soundfont/SFDATA.H +++ b/sources/Externals/Soundfont/SFDATA.H @@ -53,10 +53,10 @@ typedef enum sfSampleFlagsTag typedef struct sfDataTag { //// Oscillator //// - DWORD dwStart; //// sample start address - DWORD dwEnd; - DWORD dwStartloop; //// loop start address - DWORD dwEndloop; //// loop end address + ADDR dwStart; //// sample start address (pointer-sized for 64-bit) + ADDR dwEnd; + ADDR dwStartloop; //// loop start address (pointer-sized for 64-bit) + ADDR dwEndloop; //// loop end address (pointer-sized for 64-bit) DWORD dwSampleRate; SHORT shOrigKeyAndCorr; SHORT shSampleModes; diff --git a/sources/Externals/Soundfont/SFNAV.CPP b/sources/Externals/Soundfont/SFNAV.CPP index d16cc892..af023797 100644 --- a/sources/Externals/Soundfont/SFNAV.CPP +++ b/sources/Externals/Soundfont/SFNAV.CPP @@ -468,8 +468,8 @@ void SoundFontNavigator::Navigate(WORD uiSFID, WORD uiKey, WORD uiVel) // This step necessary for Big Endian systems if (uiInstGenOper <= endloopAddrsOffset) - *(LONG*)((BYTE*)&(psfVectorCurrOsc->dwStart) + - soundFontLookup[uiInstGenOper]) = (LONG)iInstGenAmt; + *(ADDR *)((BYTE *)&(psfVectorCurrOsc->dwStart) + + soundFontLookup[uiInstGenOper]) = (ADDR)iInstGenAmt; else *(SHORT*)((BYTE*)&(psfVectorCurrOsc->dwStart) + soundFontLookup[uiInstGenOper]) = iInstGenAmt; @@ -520,8 +520,8 @@ void SoundFontNavigator::Navigate(WORD uiSFID, WORD uiKey, WORD uiVel) // Necessary for 'byte-incoherent' systems if (uiGenOper <= endloopAddrsOffset) - *(LONG*)((BYTE*)&sfCurrPreset.dwStart + - soundFontLookup[uiGenOper]) = (LONG)iGenAmt; + *(ADDR *)((BYTE *)&sfCurrPreset.dwStart + + soundFontLookup[uiGenOper]) = (ADDR)iGenAmt; else *(SHORT*)((BYTE*)&sfCurrPreset.dwStart + soundFontLookup[uiGenOper]) = iGenAmt; @@ -815,8 +815,13 @@ SoundFontNavigator::AddSoundFonts(sfData * sfSoundFontReturned, { uiOffset = (WORD) soundFontLookup[wCount]; - *(SHORT*)((BYTE*)&(sfSoundFontReturned->dwStart) + uiOffset) += - *(SHORT*)((BYTE*)&(sfSFPresetAdd->dwStart) + uiOffset); + if (wCount <= endloopAddrsOffset) { + *(ADDR *)((BYTE *)&(sfSoundFontReturned->dwStart) + uiOffset) += + *(ADDR *)((BYTE *)&(sfSFPresetAdd->dwStart) + uiOffset); + } else { + *(SHORT *)((BYTE *)&(sfSoundFontReturned->dwStart) + uiOffset) += + *(SHORT *)((BYTE *)&(sfSFPresetAdd->dwStart) + uiOffset); + } } } diff --git a/sources/Externals/Soundfont/SFREADER.CPP b/sources/Externals/Soundfont/SFREADER.CPP index 5004ae16..94e4d368 100644 --- a/sources/Externals/Soundfont/SFREADER.CPP +++ b/sources/Externals/Soundfont/SFREADER.CPP @@ -667,11 +667,27 @@ ReadSFBData (CHAR * pchReqdWaveTable) //// Sample Headers //// for (uiCount = 0; uiCount < hf->awStructSize[sampHdr]; uiCount++) { - - tRIFF.SwapDWORD(&hf->pSHdr[uiCount].dwStart); - tRIFF.SwapDWORD(&hf->pSHdr[uiCount].dwEnd); - tRIFF.SwapDWORD(&hf->pSHdr[uiCount].dwStartloop); - tRIFF.SwapDWORD(&hf->pSHdr[uiCount].dwEndloop); + // For ADDR fields, we need to swap using temporary 32-bit variables + // since the file format uses 32-bit values but we store in pointer-sized + // fields + { + DWORD tmp; + tmp = (DWORD)hf->pSHdr[uiCount].dwStart; + tRIFF.SwapDWORD(&tmp); + hf->pSHdr[uiCount].dwStart = tmp; + + tmp = (DWORD)hf->pSHdr[uiCount].dwEnd; + tRIFF.SwapDWORD(&tmp); + hf->pSHdr[uiCount].dwEnd = tmp; + + tmp = (DWORD)hf->pSHdr[uiCount].dwStartloop; + tRIFF.SwapDWORD(&tmp); + hf->pSHdr[uiCount].dwStartloop = tmp; + + tmp = (DWORD)hf->pSHdr[uiCount].dwEndloop; + tRIFF.SwapDWORD(&tmp); + hf->pSHdr[uiCount].dwEndloop = tmp; + } tRIFF.SwapDWORD(&hf->pSHdr[uiCount].dwSampleRate); @@ -794,25 +810,29 @@ WORD mono = monoSample; // Element for element read of data, to serve as an example of a possible // issue with cross platform code. See comments below. // - for(WORD curHdr=0; curHdr < hf->awStructSize[iHydraSymbol]; curHdr++) { + for (WORD curHdr = 0; curHdr < hf->awStructSize[iHydraSymbol]; curHdr++) { + + rcnt = 0; - rcnt = 0; + rcnt += tRIFF.RIFFRead((VOIDPTR) & + ((sfSampleHdr *)pData)[curHdr].achSampleName, + 1, SAMPLENAMESIZE); - rcnt += tRIFF.RIFFRead((VOIDPTR) - &((sfSampleHdr*)pData)[curHdr].achSampleName, - 1, SAMPLENAMESIZE); + // Read 32-bit file values into temporaries, then assign to + // pointer-sized fields + uint32_t tmp_dwStart, tmp_dwEnd, tmp_dwStartloop, tmp_dwEndloop; - rcnt += tRIFF.RIFFRead( &((sfSampleHdr*)pData)[curHdr].dwStart, - 1, sizeof(DWORD)); + rcnt += tRIFF.RIFFRead(&tmp_dwStart, 1, sizeof(uint32_t)); + ((sfSampleHdr *)pData)[curHdr].dwStart = tmp_dwStart; - rcnt += tRIFF.RIFFRead( &((sfSampleHdr*)pData)[curHdr].dwEnd, - 1, sizeof(DWORD)); + rcnt += tRIFF.RIFFRead(&tmp_dwEnd, 1, sizeof(uint32_t)); + ((sfSampleHdr *)pData)[curHdr].dwEnd = tmp_dwEnd; - rcnt += tRIFF.RIFFRead( &((sfSampleHdr*)pData)[curHdr].dwStartloop, - 1, sizeof(DWORD)); + rcnt += tRIFF.RIFFRead(&tmp_dwStartloop, 1, sizeof(uint32_t)); + ((sfSampleHdr *)pData)[curHdr].dwStartloop = tmp_dwStartloop; - rcnt += tRIFF.RIFFRead( &((sfSampleHdr*)pData)[curHdr].dwEndloop, - 1, sizeof(DWORD)); + rcnt += tRIFF.RIFFRead(&tmp_dwEndloop, 1, sizeof(uint32_t)); + ((sfSampleHdr *)pData)[curHdr].dwEndloop = tmp_dwEndloop; rcnt += tRIFF.RIFFRead( &((sfSampleHdr*)pData)[curHdr].dwSampleRate, 1, sizeof(DWORD)); @@ -837,7 +857,7 @@ WORD mono = monoSample; SetError(SF_INVALIDBANK); return (NULL); } - }// end for all elements + } // end for all elements } // do sampleHdr reading, else {