|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The 'load' and 'store' macros were deemed offensive for a number of
reasons; they declared variables, hiding them from casual view, they
hid flow control (switch statements started in one macro, ended in
another), returns from inside macros, some macros were not (and could
not be) bounded by "do{...} while" which means care needed to be taken
with ';' and were very deeply nested, the names chose for the macros
made them look like functions, finally macros are hard to debug, even
with a macro-expanding debugger.
Additionally there were the 'LINE_ACCUM' macros, some of which simply
called the 'load/store' macros directly, which just added another
layer of obfuscation, particularly since these macros were defined in
a different header file. Macros could be nested 4 or 5 levels deep.
This commit finishes removing all but one of the macros, the last
remaining macro has been renamed to upper case to make it clearer that
it is a macro. It can't easily be removed since it depends on the size
of gx_color_index, which is a compile time #define.
The functionality of the macros has either been expanded in line or
replaced with inline functions declared in gsbitops.h. The majority
of the macros have been replaced with functions, even for small functions
where it seemed useful to keep the name as a description of the actual
functionality.
I don't anticipate any differences, but I think this makes the code
easier to understand, easier to debug, and therefore easier to maintain.
|