amagnasco / xwpe

Upload of an abandoned ncurses-based programming environment
http://www.identicalsoftware.com/xwpe/
GNU General Public License v2.0
29 stars 6 forks source link

Discuss: defined constants #8

Open gbonnema opened 7 years ago

gbonnema commented 7 years ago

Hi Alessandro,

I was debugging the xwpe program, because I want to understand what is happening and I find the code somewhat difficult to interpret. During the debugging I regularly encounter (#define SOMECONSTANT) and when used in an expression I cannot see the value in (c)gdb.

My inclination atm is to gradually replace #defined constants by a const variable. That would make it traceable and visible runtime. Of course every change is dangerous, even if it seems simple (i have learned that the hard way xD).

As C is not my primary language, maybe you already have an opinion. Wat do you think?

Regards, Guus.

amagnasco commented 7 years ago

I agree. This should be done in a phased approach. We should also double-check to see if we can find any recycled variables and figure out what to do with those on a case-by-case basis.