hxcmod-player: Avoid playback error on platforms where char is unsigned

This commit is contained in:
Matthias Ringwald 2017-08-09 22:08:16 +02:00
parent 8a7f815b85
commit afc6fe184c
2 changed files with 5 additions and 4 deletions

View File

@ -231,7 +231,7 @@ static void worknote( note * nptr, hxcmod_channel * cptr,char t,modcontext * mod
if( period || _sample )
{
cptr->sampdata =(char *) mod->sampledata[cptr->sampnum];
cptr->sampdata = mod->sampledata[cptr->sampnum];
cptr->length = mod->song.samples[cptr->sampnum].length;
cptr->reppnt = mod->song.samples[cptr->sampnum].reppnt;
cptr->replen = mod->song.samples[cptr->sampnum].replen;
@ -984,7 +984,7 @@ int hxcmod_load( modcontext * modctx, void * mod_data, int mod_data_size )
if (sptr->length == 0) continue;
modctx->sampledata[i] = (char*)modmemory;
modctx->sampledata[i] = (mchar*)modmemory;
modmemory += sptr->length;
if (sptr->replen + sptr->reppnt > sptr->length)

View File

@ -30,6 +30,7 @@ extern "C" {
// Basic type
typedef unsigned char muchar;
typedef signed char mchar;
typedef unsigned short muint;
typedef short mint;
typedef unsigned long mulong;
@ -75,7 +76,7 @@ typedef struct {
// HxCMod Internal structures
//
typedef struct {
char * sampdata;
mchar * sampdata;
muint sampnum;
muint length;
muint reppnt;
@ -112,7 +113,7 @@ typedef struct {
typedef struct {
module song;
char * sampledata[31];
mchar * sampledata[31];
note * patterndata[128];
mulong playrate;