Commit graph

32 commits

Author SHA1 Message Date
7e63185007 commands: Rename the command functions
Command functions are traditionally named like the command shortened
to four characters.  When this name collides with a keyword or library
function, we abbreviate more: brea(), rea().  A few are unabbreviated,
e.g.  execute().  A few have different names, e.g. explain(), not
list().

Commit 23726b379 (v4.3.0) suppressed a GCC warning about carg()
colliding with its built-in function.

Ron Koenderink reported Microsoft Visual Studio 2019 fails to link:
"_carg already defined in ucrtd.lib(ucrtbased.dll)".

Time to clean this up: rename the functions to c_FOO(), where FOO is
the unabbreviated name of the command.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-18 06:16:26 +01:00
8fc2c0ffa2 Update copyright notice
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:29 +01:00
4a1ec06364 Update copyright notice
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-05 10:41:28 +01:00
d111522fe8 Update copyright notice
Signed-off-by: Markus Armbruster <armbru@redhat.com>
2018-04-29 10:33:19 +02:00
afe5001a23 Update copyright notice
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-07 09:38:32 +02:00
bae3f5447e Update copyright notice
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-07-02 17:45:44 +02:00
b14f5276ab Update copyright notice
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-02-28 16:21:34 +01:00
bb467c335d Update copyright notice
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2014-01-02 14:33:48 +01:00
df4925d696 Update copyright notice 2013-01-12 17:45:01 +01:00
1118f1c0ca Update copyright notice 2012-06-10 10:52:22 +02:00
7e2008e7f4 License upgrade to GPL version 3 or later
Why upgrade?  I'm not a lawyer, but here's my take on the differences
to version 2:

* Software patents: better protection against abuse of patents to
  prevent users from exercising the rights under the GPL.  I doubt
  we'll get hit with a patent suit, but it's a good move just on
  general principles.

* License compatibility: compatible with more free licenses, i.e. can
  "steal" more free software for use in Empire.  I don't expect to steal
  much, but it's nice to have the option.

* Definition of "source code": modernization of some details for today's
  networked world, to make it easier to distribute the software.  Not
  really relevant to us now, as we normally distribute full source code.

* Tivoization: this is about putting GPL-licensed software in hardware,
  then make the hardware refuse to run modified software.  "Neat" trick
  to effectively deny its users their rights under the GPL.  Abuse was
  "pioneered" by TiVo (popular digital video recorders).  GPLv3 forbids
  it.  Unlikely to become a problem for us.

* Internationalization: more careful wording, to harden the license
  outside the US.  The lawyers tell us it better be done that way.

* License violations: friendlier way to deal with license violations.
  This has come out of past experience enforcing the GPL.

* Additional permissions: Probably not relevant to us.

Also include myself in the list of principal authors.
2011-04-12 21:20:58 +02:00
73e25ff21e Update copyright notice 2010-01-19 08:40:17 +01:00
6ae4eca045 Don't use 0 as null pointer constant, part 3
This part replaces E == 0 by !E, where E has pointer type.
2009-03-24 21:46:01 +01:00
35ef345ecb Update copyright notice 2009-02-08 09:33:18 +01:00
d702068457 Fix trailing whitespace 2008-09-17 21:31:40 -04:00
68f7c0ceda Rework code dealing with struct range fixing many bugs
Change struct range from exclusive to inclusive upper bounds, for
consistency with struct realmstr and the area syntax.  Also fix many
bugs.

real()'s conversion from struct range's exclusive upper bounds to
struct realmstr's inclusive upper bounds could underflow and store -1
in the realms file.  Harmless, because its users didn't mind:
list_realm() and nstr_exec_val() convert back to relative coordinates,
and sarg_getrange() is only used by sarg_area(), which happened to
undo the damage.  The change to inclusive upper bounds gets rid of the
broken conversion.

xyinrange() incorrectly treated the upper bound as inclusive, unless
the bounds were equal.  Impact:

* nxtitem() and nxtitemp() cases NS_AREA and NS_DIST attempted to hack
  around xyinrange()'s lossage(!), but screwed up: sectors on the
  lower bound of of a range spanning the the whole world were skipped.
  This affected all command arguments that support area or distance
  syntax for items.  In sufficiently small worlds, it could also make
  radar miss satellites and ships, sonar miss ships, satellite miss
  ships and land units, nuclear detonations miss ships, planes, land
  units and nukes, automatic supply miss ship and land unit supply
  sources, ships and land units fail to return fire, ships fail to
  fire support.

* draw_map() could draw units sitting just right or just below of the
  mapped area.  No effect, as these parts of the map weren't actually
  shown.

xydist_range() produced an inclusive upper bound when it decided that
the range covers everything in that dimension (which it didn't get
quite right either).  This could make snxtsct_dist() and
snxtitem_dist() initialize the iterator with an incorrect upper bound.
Similar impact as the xyinrange() / nxtitem() lossage.

border() could print the hundreds line unnecessarily.

snxtsct() and snxtsct_all() screwed up for odd WORLD_Y: they failed to
include (WORLD_Y - 1) / 2 in the y-range.  This affected all command
arguments that support "*" syntax for sectors, plus add ... c, power
n, and break.

snxtsct_all() failed to normalize the bounds (presumed harmless).

There were a few correct, but somewhat unclean uses of struct range
with inclusive upper bounds:

* nat_reset() used one internally.

* pathrange() worked with inclusive upper bounds internally, but
  corrected to exclusive upper bounds before passing the range out.

* sarg_getrange() worked with inclusive upper bounds.  Its only caller
  sarg_area() corrected that to exclusive upper bounds.

The change to inclusive upper bounds cleans this up.

unit_map() and xysize_range() had no issues (isn't that amazing?), but
need to be updated for the changed struct range semantics.
2008-08-20 07:40:32 -04:00
f33b96b1d1 Set timestamp automatically on write
Do it in do_write().  Remove the setting of timestamps elsewhere.

This fixes empdump to set timestamps to the current time instead of
zero on import.
2008-03-14 20:25:43 +01:00
db02dda32f Update copyright notice 2008-01-19 10:15:37 +01:00
63bdc89835 Update copyright notice. 2007-01-09 19:09:31 +00:00
e42053d928 Break inclusion cycle: prototypes.h and commands.h included each
other.  Ensure headers in include/ can be included in any order
(except for econfig-spec.h, which is special).  New header types.h to
help avoid inclusion cycles.  Sort include directives.  Remove some
superflous includes.
2006-07-10 06:37:23 +00:00
4515b84c59 COPYING duplicates information from README. Remove. Move GPL from
LICENSE to COPYING, because that's where it usually is.  Update all
the references to these files.
2006-01-21 19:48:41 +00:00
8a3dc2d846 (list_realm): Fix type of parameter curr (broken in rev. 1.9).
Simplify.
2006-01-14 15:30:18 +00:00
8b047abe53 (real): Fix the previous revision. 2006-01-14 15:20:24 +00:00
Ron Koenderink
45adbdb00e Move realms from the nation file into a new realms file:
(boundstr, realmstr): Rename, new members ef_type, r_cnum, r_uid,
r_realm, r_timestamp.
(natstr): Remove member nat_b[].
(EF_REALM, realm_ca): New.
(empfile): Add it.
(ef_open_srv, ef_close_srv, main): Deal with new file.
(getrealm, putrealm): New.
(add, new, real, list_realm, sarg_getrange): Use them.
2006-01-13 13:18:56 +00:00
3e400c018c Update copyright notice. 2006-01-05 13:36:57 +00:00
3aebb68ee7 Include config.h. 2005-12-27 18:04:19 +00:00
345ad3dfe0 Update copyright notice. 2005-03-16 22:03:16 +00:00
fac342ed49 Update copyright notice. 2004-09-07 15:07:16 +00:00
90a61e245f (real): Support argument #' in addition to <NUMBER>' and
`#<NUMBER>'.
2004-08-17 17:12:44 +00:00
e67dca9d29 Indentation fixes; suspect indent-emp is to blame. 2004-02-28 18:06:11 +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