The latest versions of the GNU Compiler Collection complain about signed
and unsigned integer comparisons when run with the "-Wextra" flag. Keep
those compilers happy.
In summary: share returns can now be negative, decreasing a player's
income; the bank interest rate now has a minimum; algorithms for changing
share price, share return and bank interest rate are much "smoother" (as
modelled with Gnuplot!); many minimum, maximum and typical values have
been revised.
In particular, bankruptcy affects both players and companies, and the
strings may need to be translated differently. Also update PO files
appropriately.
Firstly, Ncurses addchstr() and family do not work, it seems, with
multibyte strings, so use addch() instead. Secondly, PRINTABLE_MAP_VAL
returns a wchar_t wide character, not a byte-sized char.
The %lc format is actually of type wint_t, according to printf(3), not
wchar_t, even though these are of the same underlying type on most (all?)
platforms.
Wide-char character constants is not strictly needed for most (all?)
modern C compilers, as ASCII maps to wchar_t directly (as long as
__STDC_ISO_10646__ is defined). However, it doesn't hurt to be pedantic!
Convert all input routines, and most internal strings, to use
wide-character functions. All extended characters are supported,
including those having column widths of zero (eg, combining characters),
one (eg, normal Western characters) and two (eg, many East Asian
characters). This was quite a major undertaking!
Rename prepstr, vprepstr, chbufdup, center, center2, center3 and attrpr
to mkchstr, vmkchstr, chstrdup, old_center, old_center2, old_center3 and
old_attrpr respectively.
Rework the signal handler to be somewhat more unsafe, but conceptually
cleaner, in operation. It now ends the use of Curses, then reraises the
signal. Remove almost all references to abort_game.
Add a signal handler for SIGINT and SIGTERM, as well as sprinklings of
checks to abort_game. Although Ncurses DOES define handlers for SIGINT
and SIGTERM, they do not always seem to work correctly under many
operating systems.