fundamental wrote: Unless I am mistaken, not too much of that has been translated back to the official copy.
fundamental wrote: >balks at the functions in math.h
If I recall, a good number of those functions should be referenced through cmath, which should have a better ability to distinguish between types.
The codebase is a bit of a mix though.
Guineh wrote: I don't know why MSVC had such a hard time finding the proper overload
It finds ambiguities:
'pow' has 6 overloads:
Code: Select all
long double pow(long double, int)
long double pow(long double, long double)
float pow(float, int)
float pow(float, float)
double pow(double, int)
double pow(double, double)
Code: Select all
tmpgain = pow(gain, 1.0 / (stages + 1));Code: Select all
float pow(float, int)
float pow(float, float)
Code: Select all
float pow(float, double)
replacing every fabs, sqrt, exp, log, pow, fmod
with FABS, SQRT, EXP, LOG, POW, FMOD
and defining the following in 'globals.h':
Code: Select all
#define FABS(a) fabs((REALTYPE)(a))
#define SQRT(a) sqrt((REALTYPE)(a))
#define EXP(a) exp((REALTYPE)(a))
#define LOG(a) log((REALTYPE)(a))
#define POW(a, b) pow((REALTYPE)(a), (REALTYPE)(b))
#define FMOD(a, b) fmod((REALTYPE)(a), (REALTYPE)(b))
Guineh wrote: There was an instance of a case statement that used ranges, rather than single values.
MSVC doesn't allow ranges in case statements,
fundamental wrote: I remember comming across some of those.
As far as I can tell, it is a gnu C/C++ extension that should not be in
'portable' code.
it's in 'MIDIFile.cpp'.
This could be translated in the original copy like this
'switch (msg)' turns into 'switch (msg & 0xF0)'
and
'case 0x80 ... 0x8F:' turns into 'case 0x80:' and so on.
To make the original copy a little more portable, if i remember,
there's also a 'not' keyword that should be translated into '!'

This is exactly how I got it. The guy who gave it to me says all the parts are there but it didn't work when he took it apart. He gave it to me because it is based on a Z-80 processor, and I spent many years writing Z-80 assembly code.