1
0
mirror of https://git.zap.org.au/git/trader.git synced 2024-10-27 18:20:13 -04:00
Commit Graph

330 Commits

Author SHA1 Message Date
John Zaitseff
814ce71842 Update the copyright year to 2020 2020-01-02 08:37:36 +11:00
John Zaitseff
7c9b6be6b1 Add a comment for translators about "[Y/N]" in strings
Thanks to Rafael Fontenelle for suggesting this change, as otherwise
translators may well miss the need to localise the "Y" and "N".
2019-11-19 21:50:03 +11:00
John Zaitseff
52997c5860 Remove hyphen from all occurrences of "e-mail"
Because spelling it "e-mail" is so last decade and even century...
2019-04-12 05:13:41 +10:00
John Zaitseff
9414aa7ad6 Convert all text files to reStructuredText (ReST) format
The reStructuredText (ReST) format is still quite readable as raw text,
and is much more capable than the myriad all-slightly-incompatible
variants of Markdown.
2019-04-12 05:04:24 +10:00
John Zaitseff
fa0cb153ff Update copyright year to 2019 2019-01-05 08:10:28 +11:00
John Zaitseff
d553aca98c Rename ret to n for consistency with other utility functions 2018-08-24 14:53:18 +10:00
John Zaitseff
aed5e8a46d Correct comments about locale 2018-08-24 14:11:21 +10:00
John Zaitseff
98696aa91c Use the wide-character version of EILSEQ_REPL 2018-08-24 13:32:32 +10:00
John Zaitseff
7647561a92 Use the more common post-increment form 2018-08-24 13:21:20 +10: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
6ec3beab75 Minor aesthetic cleanup 2018-08-24 10:46:13 +10:00
John Zaitseff
74218edb89 Bug fix: preincrement index when storing EILSEQ_REPL 2018-08-24 10:45:31 +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
2032f6de8a Move redefinition of _XOPEN_SOURCE into its own Autoconf macro and header
This makes the main source code look a little cleaner, at the expense of
background magic happening in the configure-generated config.h.  But this
magic was already happening for _GNU_SOURCE, __EXTENSIONS__ and the like.

The only wrinkle is that newer versions of NcursesW cause ./configure to
include "-D_XOPEN_SOURCE=600" as part of the compilation command line--on
systems that support _XOPEN_SOURCE=700.  The AC_DEFINE/AC_DEFINE_UNQUOTED
macros automatically comment out any "#undef" lines in config.h, so the
file lib/xopen_source.h works around this limitation.  It is
automatically included by config.h.
2018-08-09 18:05:39 +10:00
John Zaitseff
e578802ac6 Use the Gnulib extensions module to define _GNU_SOURCE and __EXTENSIONS__ 2018-08-09 14:11:38 +10:00
John Zaitseff
1f734e960b Replace spaces with tabs and vice versa
For Star Traders, all text files use spaces only (no tabs); for C source
code files, tabs are used, except in comments, where spaces only are used.
2018-08-08 14:55:58 +10:00
John Zaitseff
097c9b0e5b Avoid a Clang warning about a comparison that is always false
Rewrite a check that unscramble_table[] is of the right size as an
assertion, which prevents Clang from issuing a warning that the "result
of comparison of constant 256 with expression of type 'const unsigned
char' is always false".

Oh for the day that C11's _Static_assert can be used amongst all
compilers!  But perhaps Gnulib's assert-h module can be used instead...
2018-08-08 13:50:15 +10:00
John Zaitseff
0e656681bc Correct spelling or grammatical mistakes in various comments 2018-08-06 22:09:20 +10:00
John Zaitseff
5caf1ef165 Keep the Intel C compiler quiet
By default, the Intel C compiler warns "enumerated type mixed with
another type" when compiling this code.  Explicit casts keep it quiet.
2018-08-06 13:59:25 +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
1c3afc571b Minor whitespace cleanup in #define statements 2018-08-04 22:14:03 +10:00
John Zaitseff
192b749018 Use a better check for Solaris (SunOS 5.x)
The __sun__ macro is not always defined by Oracle Solaris Studio, but
__sun is, as it is in GCC and Clang.  By itself, __sun__ also matches the
very obsolete SunOS 4.x BSD-based operating system, hence the need for
__SVR4 as well.

See https://web.archive.org/web/20180221212835/http://nadeausoftware.com/articles/2012/01/c_c_tip_how_use_compiler_predefined_macros_detect_operating_system
for more information on operating system macro checks.
2018-08-04 18:03:33 +10:00
John Zaitseff
2d6a339fb1 Define _XOPEN_SOURCE correctly for Solaris systems 2018-08-04 16:48:29 +10:00
John Zaitseff
de6f113d12 Change parameters of apply_xor() from void * to char *
Arithmetic on void * pointers is undefined, according to Section 6.5.6
Paragraph 2, Section 6.2.5 Paragraph 1 and Section 6.2.5 Paragraph 19 of
the ISO/IEC 9899:1999 C99 standard: the void type is incomplete and thus
its size cannot be determined.

GCC allows pointer arithmetic on void * as an extension (and only warns
if "-Wpointer-arith" is given); the Oracle Developer Studio C compiler
issues a warning by default.
2018-08-04 14:31:45 +10:00
John Zaitseff
a47e8528dc Force redefinition of _XOPEN_SOURCE if required
Newer versions of libncurses/libncursesw "#define _XOPEN_SOURCE 600" in
their pkg-config file.  This change forces _XOPEN_SOURCE to be redefined
to 700 in that case.
2018-07-27 18:39:18 +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
c550549783 Correct spelling mistake in utils.c 2018-07-24 18:41:59 +10:00
John Zaitseff
1427eb683f Change label from "New Stock:" to "New stock:" for consistency
This inconsistency (between the "Old stock:" and "New Stock:" labels) has
been present since August 2011!
2018-03-30 14:50:47 +11: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
d0e1141355 utils.c: Rename the variable from "signed char c" to "int v" 2017-06-18 05:47:25 +10:00
John Zaitseff
6433c44dee Bug fix: if "char" is unsigned (as on some architectures), b64decode() fails 2017-06-15 11:40:24 +10:00
John Zaitseff
24ec66e00e Change "prints" to imperative "print" in a translator comment in help.c 2017-05-24 20:38:32 +10:00
John Zaitseff
e226e6e676 Tweak global game constants for more dynamic play 2017-05-24 07:10:17 +10:00
John Zaitseff
ecf1cfc983 Revise the comments for global game constants 2017-05-24 06:43:49 +10: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
bb06d81534 Update ax_with_curses.m4 to latest version from the GNU Autoconf archive
This version changes CURSES_LIB to the plural CURSES_LIBS, and adds the
CURSES_CFLAGS variable.  It also uses pkg-config(1) if that is available.
2017-05-17 09:21:30 +10:00
John Zaitseff
e6493b4184 Fix an off-by-one bug in the macros GALAXY_MAP_RIGHT and GALAXY_MAP_DOWN
This bug has been present since commit e2dbe549b2
dated Sat Jul 16 13:34:13 2011 +1000: almost six years ago!
2017-05-17 09:12:52 +10:00
John Zaitseff
2f79514910 Update the copyright date to 2017 2017-05-14 06:29:44 +10:00
John Zaitseff
5edd10177c Ensure no label has to start with a new-line character 2016-04-16 07:39:51 +10:00
John Zaitseff
a486cd15aa Update the copyright year to 2016 2016-01-05 09:25:51 +11:00
John Zaitseff
09e1db13b0 Allow right-hand column labels in the Exchange window to be wider
In particular, these column labels may now be more than 18 characters
long.  This will only work if the left-hand side is not too wide.
2015-08-26 21:26:39 +10:00
John Zaitseff
f02dba9fad Change "Gemeni Inc" to "Gemini Inc"
This spelling mistake has been present from at least 1990!
2015-08-26 19:11:14 +10:00
John Zaitseff
bd11c1cd9d Update the copyright date to 2015 2015-08-18 08:19:56 +10:00
John Zaitseff
f16f78a509 Update the copyright date to 2015 2015-08-18 07:27:22 +10:00
John Zaitseff
bad1e27f8f Update a translator comment and regenerate the PO files 2014-10-03 09:17:05 +10:00
John Zaitseff
cbb6f58afb Minor change to the translator comment 2014-10-03 08:41:40 +10:00
John Zaitseff
a846f48904 Automatically select between left and right justification of the prompt 2014-10-03 08:38:21 +10:00
John Zaitseff
4ef0578792 Change minimum and maximum share return percentages to -15% and 25% 2014-08-13 11:32:27 +10:00