@All
Have some theoretical question.
I do work on some port of a game, which is C++ and which have such a class:
class Door : public Object
{
public :
...balbalba...
private :
...balbalba...
char _direction;
...balbalba...
};
Now, in the code of the game, depending on the needs, we have set _direction to be 1 or -1. Like this:
void Door::setDirection(core::vector3df ref)
{
if (_doorType == DT_ROTATE_X)
{
if (ref.Z < _rotateCenter->getPosition().Z) _direction = 1;
else _direction = -1;
}
else if (_doorType == DT_ROTATE_Z)
{
if (ref.X < _rotateCenter->getPosition().X) _direction = -1;
else _direction = 1;
}
}
And when I build it for win32 and when puts prints with %d in relevant parts, it prints 1 or -1 when should.
But when I do the same on amigaos4, it prints then 1 and 255 instead of 1 and -1 (i.e. -1 became 255).
I.e. exactly the same code line per line. Just 2 binaries, one for aos4 and one for win32.
I feel it's something trivial, just can't get what. Does it look like signed char become unsigned? Maybe I need specially specify that this is signed? Or maybe some flag to GCC need to be passed, or it just bad code-practice somewhere?
Maybe in win32 pure "char" mean "signed char", but on amigaos4 pure "char" mean "unsigned char" ?:)