Re: Strange syntax error problem with mmorpg-framework

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Alex,

The problem is probably in the expansion of the macros.

>From the macros visible in the trunk/src/game/Player.cpp [5122:5445] diff,
it is not apparent what the problem is, since not all macros involved are
available in that diff.

It appears that someone tried to make accessing the "value index" more
regular, by introducing a PLAYER_SKILL_VALUE_INDEX macro function.  Perhaps
a glitch was introduced as well.

In general, for C++, I strongly recommend avoiding macro functions and macro
constants.  Instead, use the C++ facilities of inline functions and const
identifiers.

There are a few exceptions to my C++ rule-of-thumb, such as assert macro
functions.  But the exceptions to the rule are very few.

My advice is probably too late for the developers to adopt.  Alas.

You may be able to identify the problem if you compile that .cpp file with
the g++ -E switch, and look at the post-preprocessed output.

Sincerely,
--Eljay


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux