Commit graph

46 commits

Author SHA1 Message Date
a5b8249e98 (mkdir): Parenthesize macro parameter in expansion. 2005-12-30 17:21:42 +00:00
fa52e6944d Normalize inclusion guards: use NAME_H for name.h. Some headers
lacked them, others used reserved identifiers.
2005-12-29 10:16:01 +00:00
b316861e9d Autoconfigure whether char is unsigned. 2005-12-28 23:10:26 +00:00
686eadad37 (att_mode, xyas, ownxy, prbuf): Get rid of s_char. Users changed.
(ATTRIBUTE): Don't disable use of gcc __attribute__ when s_char is
signed char.  All format strings are now char *.
2005-12-28 22:30:52 +00:00
69150d10fc (EMPTH_LWP, EMPTH_POSIX, EMPTH_W32): Define in config.h instead of
compiler command line.  Don't bother to conditionalize code in .c
files that are only compiled when their thread package is used.

(_EMPTH_LWP, EMPTH_LWP, _EMPTH_POSIX, EMPTH_POSIX, _EMPTH_WIN32)
(EMPTH_W32): Identifiers beginning with an underscore and an uppercase
letter are reserved for any use.  Rename.
2005-12-28 14:27:15 +00:00
b921d3c262 (MAXNOC): Move to config.h. Remove empty options.h. 2005-12-28 13:08:26 +00:00
Ron Koenderink
9dfbf74785 [_WIN32]: Add #ifndef __GNUC__ around the pragma as pragma is not
supported by gcc.
2005-12-26 02:53:23 +00:00
Ron Koenderink
373a08a0e0 (min, max) [_WIN32]: Change WIN32 to use windef.h.
It is present in both MSVC and MinGW environments.

(F_OK, W_OK, R_OK) [_WIN32]: Add #ifndef to allow
to operation in both MSVC and MinGW environments.
2005-12-25 00:59:57 +00:00
320322cda9 (oops): Move declaration to misc.h, to make CANT_HAPPEN() usable
with just misc.h included.
2005-12-05 22:13:35 +00:00
Ron Koenderink
d581485d32 (plurize): Fix the strncat() len parameter to prevent an overflow of buf.
(numstr, esplur, splur, iesplur, plurize): Move the prototype defintions from
misc.h to prototypes.h.  Remove unneccessary headers in plur.c.
2005-11-13 23:18:37 +00:00
Ron Koenderink
fdcbb5912d (budg): Create the capital/city name from the d_name field instead of
hard coding the strings.

(plurize): New.
2005-11-13 21:23:44 +00:00
Ron Koenderink
555de3100c (dchr_ca, packing, empfile): Add packing symbol table.
(sect_ca, ship_ca, land_ca, plague_stages, empfile):
Add plague stages symbol table.

(treaty_ca, loan_ca, agreement_statuses, empfile):
Add agreement status symbol table.
Combine treatystatuses (TS_FREE, TS_SIGNED and TS_PENDING)
and loan statuses (LS_FREE, LS_SIGNED and LS_PENDING)
into a single agreement status.

(pchr_ca, level, empfile): Add packing symbol table.
2005-11-13 12:27:02 +00:00
220ce8f00f Ultrix is no longer supported, remove special case. 2005-10-22 18:24:01 +00:00
09b0b83971 (IO_CONN, io_conn, IOQ_BUFSIZE, MAXIOV, LND_NOTANY, plur)
(techfactfire, reltech, P_DISTING, PLN_MAXDEF, filetruncate, sct_init)
(nxtsctp, AN_SAILDIR, UDTIMES_MAX, BLITZTIME): Unused, remove.
2005-09-30 19:51:32 +00:00
71e164ed30 Document, in particular use of UTF-8. Simplify code in a couple of
places, but no functional changes.
2005-06-13 19:02:49 +00:00
Ron Koenderink
2cc44bb182 Support UTF-8 encoded Unicode for user communications.
(NF_UTF8, togg): New client flag.
(flash, wall): User text input filtering.
(parse, prmptrd): Normal text input filtering.
(uprmptrd, ugetstring): New, to get user text.
(getele, flash, wall): Use them.
(getele): No need to filter out funny characters; input filtering
takes care of them.
(sendmessage, ufindbreak): Work on user text.
(uprnf): New, to print user text.
(rea, gamedown, show_motd): Use it.
(prnf): Unused, remove.
(pr, upr_player): Normal text output filtering (with highlighting).
(pr_flash): User text output filtering.
2005-05-26 01:58:48 +00:00
345ad3dfe0 Update copyright notice. 2005-03-16 22:03:16 +00:00
Ron Koenderink
1f9b34dfdd (log_error) [_WIN32]: Remove ; from the #define for vsnprintf.
This part of the for changes to logerror().
2005-03-12 19:33:18 +00:00
Ron Koenderink
157395fcb2 (log_error) [_WIN32]: Add #define for vsnprintf to pick up
_vsnprintf from the WIN32 library for changes to logerror().

(main) [_WIN32]: Add typedef for pid_t to match WIN32 definition
for getpid().  This is required for the create_pidfile() changes.
2005-03-12 17:52:29 +00:00
09b481b30a [!POSIXSIGNALS]: Thoroughly obsolete, remove. This also gets rid of
an odd case where signals were not catched when debugging.

(main, empth_start): Using sa_handler with SA_SIGINFO is wrong.
Simply don't set SA_SIGINFO; the additional signal information is not
used anyway.
2005-03-12 12:20:50 +00:00
84b8189c13 (daemon, daemonize): Rename to avoid name clash with BSD's daemon().
(daemonize): Supply missing declaration.
2005-03-09 14:45:41 +00:00
0aaf0084aa (as_extend, as_costcomp, gen_power, powcmp): Fix non-portable function
cast.
(qsort_func_t): Unused, remove.
2005-02-24 18:47:26 +00:00
236c29a0c5 Break an inclusion cycle missed by yesterday's change. 2005-02-13 10:37:46 +00:00
Ron Koenderink
99ad950d9c switch comments from // format to /* */ format. 2004-12-21 02:20:26 +00:00
Marc Olzheim
a2284aac8d "(turn): Fix comparing the output of write() to an unsigned sizeof by
casting the sizeof to write's most used return-type (ssize_t). Introduce
a typedef for ssize_t for _WIN32 in include/misc.h."
2004-12-17 15:44:57 +00:00
Ron Koenderink
afc8667d10 (main) [_WIN32]: Switch to Unix style function for access and mkdir.
(info) [_WIN32]: Switch to standard function for strncasecmp.
2004-12-08 13:10:15 +00:00
fac342ed49 Update copyright notice. 2004-09-07 15:07:16 +00:00
f0b4381c98 (ANNO_KEEP_DAYS, anno_keep_days): Replace macro ANNO_KEEP_DAYS by
new configuration key.  Closes #780425.
(delete_old_announcements): Do nothing when anno_keep_days is
negative.
2004-08-28 15:28:54 +00:00
dcfd251f95 caddr_t is obsolete. Replace by void *, except for struct empfile
member cache, which becomes char * to keep pointer arithmetic simple.
2004-08-23 18:29:44 +00:00
4d154753b8 (pchrstr, MAXPRCON): Simplify variable-style storage of constituents.
Store only up to MAXPRCON constituents, not MAXCHRNV; code doesn't
fully support more than three anyway.  Remove member p_nv, use item
type I_NONE for unused slots.  Rename members p_vtype, p_vamt to
p_ctype, p_camt to avoid confusion with variable-style storage.
(pchr): Initializers adapted.
(nullify_objects, materials_cost, materials_charge, prod,
show_sect_capab, grind): Adapt, simplify where possible, protect
against bad item types in pchr[].
(MAXCHRNV): Unused, remove.
2004-08-17 15:19:46 +00:00
48175e9beb (getstring, getstarg): Use plain char * instead of s_char *. 2004-04-08 17:56:12 +00:00
83478bd79e (OFFSET): Remove, use standard offsetof().
(SETOFF): Unused, remove.
2004-04-07 17:38:43 +00:00
47c8a32ae3 (debug): New.
(main): Set it on -d.
(oops, CANT_HAPPEN): New.
2004-04-02 15:40:43 +00:00
d6a2519342 Can't use gcc function attribute `format' when s_char is not plain
char; gcc chokes on it.
2004-03-22 08:51:10 +00:00
e7d75b2279 Use gcc function attribute `format' to catch bad format strings. Fix
them.  From Marc Olzheim.
Type modifier 'l' was missing in many places, probably rendering the
server useless on 64-bit hosts.
(ef_flush, ef_write, ef_extend, lwpCreate, lwpDestroy): Use conversion
specifier 'p' to print pointers.
(check_market): Fix display of loan amount.
(doland): Fix unescaped '%' (undefined behavior).
(ldump, ndump, pdump, sdump): Don't use flag '0' with conversion
specifier 's' (undefined behavior).
(dump, ldump, lost, ndump, pdump, sdump, empth_create, update_sched):
Cast time_t and pthread_t to long for printing.
(lwpStackCheck, lwpStackCheckUsed, finish_sects): Insert cast to fix
argument type on all platforms.
(prod): Remove extra argument.
(perform_mission, airdamage, retreat_land1, lwpReschedule): Format
string missed arguments.
2004-03-09 12:27:40 +00:00
d2e0c8224b Delete dead code, fix indentation, spelling, obvious warning
avoidance, doc fixes.  No functional changes.
2004-02-27 20:13:28 +00:00
237baffca9 Supply prototypes where possible. This uncovered type errors with
thread entrypoints:
(lwpSelect, shutdown_sequence): Parameters didn't match thread entry
point prototype.
(lwpEntryPoint): Arguments didn't match thread entry point prototype.

Change linkage of functions without prototype declaration to static
where possible.

Remove some superflous declarations, replace others by suitable
includes.
2004-02-17 17:59:30 +00:00
4fa84b5cb1 (emp_sig_t): Pre-ISO C compatibility cruft. Just use void. 2004-02-15 21:00:27 +00:00
cbf9d68372 Don't fool around with obsolete strings.h, just include standard
string.h.
2004-02-10 18:17:34 +00:00
32fac041b2 (RESOLVE_IPADDRESS): gethostbyaddr() uses a lot of stack space on some
versions of GNU libc, which can lead to nasty heap smashes (observed
with 2.2.93).  Don't define RESOLVE_IPADDRESS for now, until we
readjust thread stack sizes.
2004-02-06 23:42:36 +00:00
93c4fecfd6 (index, rindex): Obsolete BSDisms; remove. Use standard strchr() and
strrchr() instead.
2004-01-13 10:32:35 +00:00
4ae9c417b3 (bzero, bcopy): Obsolete BSDisms; remove. Remove some calls without
effect.  Replace calls by struct assignment where possible.  Replace
clear buffer, copy string to buffer by strncpy().  Use assignment to
clear when that's clearer.  Replace overlapping copy through bounce
buffer by memmove().  Replace rest by standard memset() and memcpy().
Also use sizeof() instead of literal array sizes for robustness, and
instead of symbolic array sizes for clarity.
2004-01-08 17:54:28 +00:00
d0feb8570a (copy, atopi, same): Remove, use strcpy(), atoi(), strcmp(). Callers
changed.  Remove empty source files.
2004-01-08 10:20:44 +00:00
5dde6b52a9 Remove pragmas that promote certain serious warnings to errors on
windows.  For obvious reasons, such warnings ought to be fixed.
Making compilation abort is the sledgehammer method to force that.
It's a stupid method for us, as we develop on various platforms, and
don't test every single commit under Windows.  It gratuitously breaks
programs that work fine.  Leave them as warnings, and fix them on
sight.
2003-12-14 10:15:03 +00:00
9b7adfbecc Indented with src/scripts/indent-emp. 2003-09-02 20:48:48 +00:00
d8b7fdfae1 Import of Empire 4.2.12 2003-08-23 12:23:04 +00:00