pngwen / xboing

A resurrection of the blockout style game for the x windows system.
Other
1 stars 6 forks source link

Replacing all the preprocessors #11

Open ggonzalez6 opened 2 months ago

ggonzalez6 commented 2 months ago

• In basically all the files, there is a heavy use of preprocessors which are still in use today, however, many modern programming practices and tools have emerged to handle similar tasks in a more structured and safer manner

• For example, in lines 163-166 in the file “bonus.c,” the old-style non-prototype function declaration (void IncNumberBonus()) is no longer necessary and is actually considered bad practice today.

• In this example, and in modern C code, the void should be explicitly specified for functions that take no arguments: void IncNumberBonus(void);

• While these preprocessors serve a good purpose, this pattern would only be necessary if you were writing code that might need to compile on extremely old compilers that don’t support function prototypes (pre-C89).