1
0
mirror of https://git.zap.org.au/git/trader.git synced 2024-06-09 19:20:43 +00:00
Commit Graph

118 Commits

Author SHA1 Message Date
John Zaitseff
cc5ee96ceb Update the copyright year to 2024 2024-01-02 12:33:37 +11:00
John Zaitseff
1231c084b8 Update the copyright year to 2022 2022-08-01 04:46:15 +10:00
John Zaitseff
0d2462ef41 Update the copyright year to 2021 2021-01-07 17:07:55 +11:00
John Zaitseff
814ce71842 Update the copyright year to 2020 2020-01-02 08:37:36 +11:00
John Zaitseff
fa0cb153ff Update copyright year to 2019 2019-01-05 08:10:28 +11:00
John Zaitseff
daab2e94da Convert xstrfmon() into a wide-character version xwcsfmon()
Also work around buggy implementations of strfmon() that do not copy
complete multibyte sequences that may be part of a locale's
mon_thousands_sep, thousands_sep, mon_decimal_point or decimal_point.
2018-08-24 13:20:51 +10:00
John Zaitseff
1e0285f6c0 Rename l_strfmon() and rewrite as xstrfmon() to handle POSIX locale better
Current and previous versions of ISO/IEC 9945-1 (POSIX), particularly SUSv3
(2001) and SUSv4 (2008), require strfmon() to return rather meaningless
strings when used with the POSIX "C" locale.  In particular, the standard
POSIX locale does not define a currency symbol, a monetary radix symbol
(decimal point) or a negative sign.  This means strfmon(..., "%n", -123.45)
is supposed to produce "12345" instead of something like "$-123.45"!

The new xstrfmon() overcomes these limitations by using snprintf() as
appropriate.
2018-08-21 21:55:21 +10:00
John Zaitseff
89be55c7c9 Use __attribute__((unused)) to silence GCC with the -Wextra flag 2018-08-09 18:42:10 +10:00
John Zaitseff
eb0ed43ce2 Bug fix: char may be unsigned on some platforms
The function wctob() returns an int that can be -1; a conversion to
unsigned char will make that value 0xFF.  Although the "if" statement
still works in this case, we should be more diligent in our programming.
2018-08-06 13:57:16 +10:00
John Zaitseff
f45986e88d Pedantically type-cast integer comparisons
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.
2018-07-27 18:33:14 +10:00
John Zaitseff
abc9b77bd6 Change all relevant http references to https (secure HTTP) 2018-03-30 12:46:37 +11:00
John Zaitseff
8c6d009611 Update the copyright date to 2018 2018-03-30 11:38:29 +11:00
John Zaitseff
e4d884afc9 Replace U+0060 GRAVE ACCENT with U+0027 APOSTROPHE
In the past, GNU tools used quotes `like this'.  Modern practice is to
use quotes 'like this'.  Update Star Traders to follow this newer
standard, including all PO files.
2017-05-20 09:55:20 +10:00
John Zaitseff
2f79514910 Update the copyright date to 2017 2017-05-14 06:29:44 +10:00
John Zaitseff
a486cd15aa Update the copyright year to 2016 2016-01-05 09:25:51 +11:00
John Zaitseff
f16f78a509 Update the copyright date to 2015 2015-08-18 07:27:22 +10:00
John Zaitseff
9450fed943 Update the copyright year to 2014 2014-05-22 11:05:51 +10:00
John Zaitseff
c25ec91e99 Update the copyright year to 2013, and the version number to 7.5 2013-02-02 10:48:43 +11:00
John Zaitseff
bc3e1a06a1 Update the copyright year to 2012 2012-03-15 02:36:23 +11:00
John Zaitseff
8bbee054ad Change the handling of default value keycodes to be configurable 2011-08-30 12:45:45 +10:00
John Zaitseff
4ca99815b8 Be a little more diligent when it comes to wchar_t vs. wint_t
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.
2011-08-29 14:13:29 +10:00
John Zaitseff
82ca16e110 Bug fix: wchar_t may be smaller than int
On some platforms (eg, Cygwin), wchar_t is smaller than int, so type
promotion requires an appropriate cast for va_arg.
2011-08-29 10:34:27 +10:00
John Zaitseff
1f3be16193 The "%lc" directive requires a wint_t type, not wchar_t
This is essentially only to keep GCC quiet.
2011-08-29 09:34:29 +10:00
John Zaitseff
dffb4c59fe Implement the single-byte equivalent of getwch()
This implementation assembles a wide character from a stream of
multibyte-forming bytes.
2011-08-26 04:51:44 +10:00
John Zaitseff
4c99f9a57f More (slight) code clean-ups 2011-08-26 03:22:25 +10:00
John Zaitseff
cb67513bb9 Correct a minor bug in cursor decrement (cpos_dec) 2011-08-25 22:15:12 +10:00
John Zaitseff
dfab785ba7 Add a couple more places where the character constant is a wide char 2011-08-25 21:55:10 +10:00
John Zaitseff
1c2518a78b Minor clean-up: replace character constants with wide-char versions
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!
2011-08-25 21:34:41 +10:00
John Zaitseff
61411e3416 Rearrange the order of constants, type declarations and macros 2011-08-25 14:49:51 +10:00
John Zaitseff
10815a2803 Move some global variables to intf.c and intf.h
Move the keycode_company, printable_map_val, chtype_map_val,
keycode_game_move, printable_game_move and chtype_game_move global
variables to intf.c and intf.h.
2011-08-25 14:48:31 +10:00
John Zaitseff
20473ae409 Use wide-character functions for input routines and most strings
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!
2011-08-25 13:19:31 +10:00
John Zaitseff
a4cc805a65 Use wchar_t in answer_yesno()
Calls to wgetch(win) do not use wchar_t for the moment.
2011-08-20 15:38:26 +10:00
John Zaitseff
4b8d2529a8 Replace '0' with L'0', just in case 2011-08-20 15:27:22 +10:00
John Zaitseff
0a8e05f4d4 Rearrange the order of the internal mkchstr_XXX functions 2011-08-20 15:24:27 +10:00
John Zaitseff
b5b211313e Move chstrdup() to utils.c and rename it to xchstrdup()
The new name is for consistency with other XXXdup() functions used in
this program.
2011-08-20 15:17:09 +10:00
John Zaitseff
7b544bbd35 Add the functions xwcrtomb() and xmbstowcs()
The xwcrtomb() and xmbstowcs() functions replace illegal characters with
EILSEQ_REPL ('?').  Adjust other functions, particularly mkchstr() and
friends, to suit.
2011-08-20 13:03:40 +10:00
John Zaitseff
336611559b Add the error-checking function xwcsdup() 2011-08-20 10:40:07 +10:00
John Zaitseff
a49c50b4fd Allow mkchstr_conv error strings to be localised 2011-08-19 17:24:28 +10:00
John Zaitseff
6fb62460ca Add some asserts to newtxwin(), just to be on the safe side 2011-08-19 17:20:41 +10:00
John Zaitseff
8a7dfcaf99 Handle multibyte characters correctly in mkchstr()
Internal processing is now done in terms of wide characters (type
wchar_t).
2011-08-19 16:52:27 +10:00
John Zaitseff
4d6f1478e6 Remove the superfluous argument to chstrdup()
This argument is not required: we KNOW that we have initialised chtype
arrays with an ending NUL!
2011-08-18 14:53:03 +10:00
John Zaitseff
6ef7c7b6da Allow localisation of company letters and map moves (choices) 2011-08-18 12:10:33 +10:00
John Zaitseff
75503ab103 Parameterise answer_yesno() so that the input keycodes can be localised 2011-08-17 22:07:31 +10:00
John Zaitseff
1c4cac2ba1 Add a detailed explanation of the help text markup format 2011-08-17 21:41:38 +10:00
John Zaitseff
b674c05d56 Add many comments for translators; use pgettext() where appropriate 2011-08-17 19:13:05 +10:00
John Zaitseff
6c1c272780 Place all output strings within gettext invocations 2011-08-16 21:03:41 +10:00
John Zaitseff
d20cc2b5ec Use chstr-style output functions in gettxline() 2011-08-16 20:45:47 +10:00
John Zaitseff
de6a4e3e66 Remove obsolete old_attrpr, old_center, old_center2 and old_center3 2011-08-16 18:51:56 +10:00
John Zaitseff
135842b87d Bug fix for non-colour mode
If the background has A_REVERSE, then A_NORMAL will have no effect.  For
that reason, specify A_NORMAL as the default background after creating a
new window.
2011-08-16 16:25:28 +10:00
John Zaitseff
82647cf691 Move to the new left/center/right functions; add maxlines parameter 2011-08-15 23:54:44 +10:00