Skip to content
Permalink
Browse files

fix #291756 explicitly-signed char fluid pitchadj

C standards say that "char" may either be a "signed char" or "unsigned char" but that it is up to the compilers implementation or the platform which is followed.  Some non x86 platforms, including PowerPC and ARM, treat unspecified chars as unsigned chars, so it is necessary to explicitly declare them as "signed char" (or to compile with "--signed_chars").

This fix ensures that fluid synth's sample's pitchadj value are correctly read as signed.
  • Loading branch information...
ericfont committed Jul 4, 2019
1 parent 7d0a917 commit 4253d779cf46b9a72e5b170b6f14dcc332c7d0d7
Showing with 3 additions and 3 deletions.
  1. +2 −2 fluid/sfont.cpp
  2. +1 −1 fluid/sfont.h
@@ -831,9 +831,9 @@ unsigned char SFont::READB()
// READC
//---------------------------------------------------------

char SFont::READC()
signed char SFont::READC()
{
char var;
signed char var;
safe_fread(&var, 1);
return var;
}
@@ -93,7 +93,7 @@ class SFont {
void FSKIP(int size) { return safe_fseek(size); }
void FSKIPW();
unsigned char READB();
char READC();
signed char READC();
void READSTR(char*);

void safe_fread(void *buf, int count);

0 comments on commit 4253d77

Please sign in to comment.
You can’t perform that action at this time.