Replace references to long with int32_t, fixing several sample decoders on 64 bit platforms

This commit is contained in:
Chris Moeller 2015-08-02 00:20:57 -07:00
parent 961e57d8d0
commit 4bfa73f31a
4 changed files with 9 additions and 9 deletions

View File

@ -22,7 +22,7 @@ void decode_aica(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing,
int i;
int32_t sample_count;
int32_t hist1 = stream->adpcm_history1_16;
unsigned long step_size = stream->adpcm_step_index;
uint32_t step_size = stream->adpcm_step_index;
for (i=first_sample,sample_count=0; i<first_sample+samples_to_do; i++,sample_count+=channelspacing) {
int sample_nibble =

View File

@ -1,14 +1,14 @@
#include "coding.h"
#include "../util.h"
long EA_XA_TABLE[28] = {0,0,240,0,460,-208,0x0188,-220,
int32_t EA_XA_TABLE[28] = {0,0,240,0,460,-208,0x0188,-220,
0x0000,0x0000,0x00F0,0x0000,
0x01CC,0x0000,0x0188,0x0000,
0x0000,0x0000,0x0000,0x0000,
-208,-1,-220,-1,
0x0000,0x0000,0x0000,0x3F70};
long EA_TABLE[20]= { 0x00000000, 0x000000F0, 0x000001CC, 0x00000188,
int32_t EA_TABLE[20]= { 0x00000000, 0x000000F0, 0x000001CC, 0x00000188,
0x00000000, 0x00000000, 0xFFFFFF30, 0xFFFFFF24,
0x00000000, 0x00000001, 0x00000003, 0x00000004,
0x00000007, 0x00000008, 0x0000000A, 0x0000000B,
@ -17,7 +17,7 @@ long EA_TABLE[20]= { 0x00000000, 0x000000F0, 0x000001CC, 0x00000188,
void decode_eaxa(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do,int channel) {
uint8_t frame_info;
int32_t sample_count;
long coef1,coef2;
int32_t coef1,coef2;
int i,shift;
off_t channel_offset=stream->channel_start_offset;
@ -75,7 +75,7 @@ void decode_eaxa(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing,
void decode_ea_adpcm(VGMSTREAM * vgmstream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do,int channel) {
uint8_t frame_info;
int32_t sample_count;
long coef1,coef2;
int32_t coef1,coef2;
int i,shift;
VGMSTREAMCHANNEL *stream = &(vgmstream->ch[channel]);
off_t channel_offset=stream->channel_start_offset;
@ -123,7 +123,7 @@ void decode_ea_adpcm(VGMSTREAM * vgmstream, sample * outbuf, int channelspacing,
void decode_maxis_adpcm(VGMSTREAM * vgmstream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do,int channel) {
uint8_t frame_info;
int32_t sample_count;
long coef1,coef2;
int32_t coef1,coef2;
int i,shift;
int frameSize = channelspacing*15;//mono samples have a frame of 15, stereo files have frames of 30
VGMSTREAMCHANNEL *stream = &(vgmstream->ch[channel]);

View File

@ -30,7 +30,7 @@ void decode_lsf(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing,
for (i=first_sample,sample_count=0; i<first_sample+samples_to_do; i++,sample_count+=channelspacing) {
int sample_byte = read_8bit(framesin*bytes_per_frame+stream->offset+1+i/2,stream->streamfile);
long prediction =
int32_t prediction =
(hist1 * lsf_coefs[coef_idx][0] +
hist2 * lsf_coefs[coef_idx][1]) / 0x40;

View File

@ -7,7 +7,7 @@ double VAG_f[5][2] = { { 0.0 , 0.0 },
{ 115.0 / 64.0 , -52.0 / 64.0 },
{ 98.0 / 64.0 , -55.0 / 64.0 } ,
{ 122.0 / 64.0 , -60.0 / 64.0 } } ;
long VAG_coefs[5][2] = { { 0 , 0 },
int32_t VAG_coefs[5][2] = { { 0 , 0 },
{ 60 , 0 },
{ 115 , -52 },
{ 98 , -55 } ,
@ -145,7 +145,7 @@ void decode_ffxi_adpcm(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelsp
short scale;
int i;
int32_t sample_count;
long predictor;
int32_t predictor;
int framesin = first_sample/16;