Commit graph

2761 commits

Author SHA1 Message Date
51165cf3fc Collect the test whether a plane fits on a carrier in one place:
(fit_plane_on_ship, fit_plane_on_land): New.
(pln_oneway_to_carrier_ok, put_plane_on_ship, count_planes)
(put_plane_on_land, count_land_planes): Use them.  No functional
change.
(fit_plane_off_ship, fit_plane_off_land): New.
(take_plane_off_ship, take_plane_off_land): Use them.  This oopses
when the carriers plane counter underflows.

(take_plane_off_ship): Document that carrier's plane counters may be
screwed up.

(take_plane_off_ship, take_plane_off_land): Oops when the plane isn't
on the carrier.

(take_plane_off_ship, take_plane_off_land): Don't fail when the plane
to be taken off can't go on this type of carrier, just take it off.
No error condition left, so return void.  Callers couldn't do anything
useful with the status anyway, and most didn't bother.  Change those
that did.
2007-10-30 07:09:31 +00:00
Ron Koenderink
ac20e65930 (__set_errno): Switch to _MSC_VER define instead of HAVE__SET_ERRNO
define.

(int32_t) [_WIN32]: Remove commented define..
2007-10-29 13:25:05 +00:00
136a313334 (show_bridge, show_tower, show_ship_stats): Simplify, no functional
change.
2007-10-28 07:41:39 +00:00
9868e1b76f (ef_init_srv): Rev. 1.27 set NSC_CONST in all nat_ca[] instead of
cou_ca[] as before.  Fix by not setting it at all.
2007-10-27 17:07:09 +00:00
f2542fcf7e (recvline): Simplify parsing out output ids. Also tighten sanity
check some.
2007-10-27 16:21:26 +00:00
041c71de80 (load): Fix misleading message that assumed that only SCT_CAPIT
sectors can be canals.
2007-10-27 16:13:50 +00:00
588c5b12d5 (dispatch): Oops on bad command return value. Log RET_SYS more
clearly.
2007-10-27 16:06:06 +00:00
9c94a23709 Keep log open, rotate it just like the journal:
(logfd, logopen): New.
(loginit): Set logfd, return success.
(logerror): Use logfd.
(logreopen): New.
(relo, main): Use it.
2007-10-27 15:49:45 +00:00
88b44bffd3 (typed_wu) [_WIN32]: Remove special case, just use writev(). 2007-10-27 14:40:10 +00:00
Ron Koenderink
f1a39e676b (__set_errno) [_WIN32]: Remove CR. 2007-10-25 03:13:18 +00:00
Ron Koenderink
a05649a660 (__set_errno) [_WIN32]: Add macro for __set_errno() for MinGW as it
does not have a _set_errno().
2007-10-25 01:45:51 +00:00
Ron Koenderink
e051b2fea7 (__setstate) [_WIN32]: Make the function prototype match the
function declaration.
2007-10-23 03:10:55 +00:00
Ron Koenderink
ec484e17a7 (main, init_server, emp_server.6): Add -R command line option to set
a seed for the random function.

(nightlybuild.sh): Add the -R 1 for the server.
(nightlybuild.sh): Switch to -R 1 for the fairland as 1 is safer.
Some systems might generate lousy randomness from a
zero seed.

(prng.patch): Not required anymore, -R 1 is used instead.

(main, emp_server.6): Rename -r and -R to -u and -U.  "-R" is now used for random seed.
2007-10-23 03:05:56 +00:00
Ron Koenderink
c115ed1327 (random, srandom) [_WIN32]: Provide random and srandom
POSIX equivalents instead of using the WIN32 rand/srand functions.
The files were derived from GNU libc source.

(empth_threadMain) [_WIN32]: Remove the srandom() as the
POSIX equivalent are not thread specific as the WIN32 functions were.
2007-10-21 15:34:27 +00:00
Ron Koenderink
7241773f60 Update patch for pr.c:1.41 2007-10-21 15:12:49 +00:00
Ron Koenderink
26ef6e5ec0 Update patch for constants.c:1.40 2007-10-21 15:12:25 +00:00
Ron Koenderink
0627deae05 (empth_sleep) [_WIN32]: Remove a change to the random seeding
that accidently got committed in rev 1.65.  Was incorrect in rev 1.66.

(empth_sleep) [_WIN32]: Switch srand() to srandom() to be consistent
with the rest of the empire code.
2007-10-20 12:59:49 +00:00
Ron Koenderink
f449c3f8a4 (empth_sleep) [_WIN32]: Remove a change to the random seeding
that accidently got committed in rev 1.65.
2007-10-20 12:15:45 +00:00
Ron Koenderink
274c3d3a36 (empth_sleep) [_WIN32]: Ensure the thread does not waking up early.
It has been seen which caused an update to be missed.
2007-10-20 11:51:50 +00:00
Ron Koenderink
dbf7f554b1 (empth_sleep) [_WIN32]: Change if to while to ensure the time has
actually been reached.  There has been examples where the time
expired early by one second probably due a resolution error.  This
caused a scheduled update to be missed.  Broken in rev. 1.56.
2007-09-30 15:39:48 +00:00
Ron Koenderink
e218d6b841 (upda): Add linefeed to the 'Please use "show updates".' line. 2007-09-30 15:31:05 +00:00
Ron Koenderink
5cb735f3a7 Fix how tech is factored into power. Broken in 1.31 and almost fixed
in 1.33.
2007-09-20 02:48:52 +00:00
ea80c43573 (distclean): Remove config.h and ipglob.c. 2007-09-09 10:56:46 +00:00
137d327cba Bump version to 4.3.11. 2007-09-09 10:16:59 +00:00
ecb2e7e303 (datarootdir): New; Autoconf 2.60 wants it. 2007-09-06 18:16:45 +00:00
207cbb86ab Final polish for 4.3.10. 2007-09-06 18:02:57 +00:00
4b1fb9b924 Doc fix. 2007-09-06 17:47:42 +00:00
35b6ca46c7 Clarify .NA. 2007-09-06 17:47:32 +00:00
e8e681fd2b 4.3.10 late changes. 2007-09-02 18:05:09 +00:00
fe602d00d6 Comments. 2007-09-02 18:01:15 +00:00
c73f7c207f White-space fix. 2007-09-02 17:59:28 +00:00
0b64ca4bea Require POSIX.1-2001 instead of SUSv2. 2007-09-02 17:58:25 +00:00
Ron Koenderink
2ece63c54a (update_sched): The indefinite sleep when there's no scheduled update
went into a tight loop instead, freezing the server.
2007-09-02 15:04:23 +00:00
808611da87 Rewrite for clarity and correctness. 2007-09-02 12:06:22 +00:00
e68504b3c1 Fix the previous revision. 2007-09-02 11:48:36 +00:00
131bb81df8 (delete_old_announcements): Delete temporary file when it's not used. 2007-09-02 11:32:31 +00:00
8d22c027f7 Fix rev. 1.15. 2007-08-31 05:28:25 +00:00
Ron Koenderink
a7f716b9bc (sys/socket.h) [_WIN32]: Improve the comment to explain the include order
dependencies.
2007-08-30 01:20:59 +00:00
Ron Koenderink
68fd5e0c89 (sys/socket.h) [_WIN32]: Add comment to explain the include order
dependencies.
2007-08-29 23:07:33 +00:00
Ron Koenderink
366f48b6e2 (in.h, inet.h) [_WIN32]: Switch <sys/socket.h> to "sys/socket.h" so all
files in w32 library use a local file access for include files in or under w32.
2007-08-29 23:00:55 +00:00
Ron Koenderink
afedb8c9e2 (posix_accept, posix_bind, posix_listen, posix_setsockopt,
posix_shutdown, posix_socket, socklen_t) [_WIN32]: Move socket
related externs to sys/socket.h.

(inet_ntop) [_WIN32]: Move extern to inet.h.

(tcp_listen): Remove the !WIN32 includes and use the revised
sys/socket.h, netinet/in.h, arpa/inet.h and netdb.h.
2007-08-28 21:06:22 +00:00
Ron Koenderink
2b4fd27b97 (posix_mkdir) [_WIN32]: Change CR/LF to LF. 2007-08-27 00:21:39 +00:00
Ron Koenderink
56642d0415 (posix_mkdir) [_WIN32]: Add function comment. 2007-08-26 23:11:17 +00:00
Ron Koenderink
b65c2dd5ba (posix_close, posix_read, posix_write) [_WIN32]:
Move CANT_REACH() and return -1 into a default case.
Removes warnings for MinGW of potential missing cases.

(posix_accept, posix_socket) [_WIN32]: Switch handle to SOCKET
to match Windows call.  Cast to an int for translation map.
2007-08-26 23:04:14 +00:00
Ron Koenderink
c7546923e9 [_WIN32]: Add io.h for isatty(). Required for MinGW. 2007-08-26 22:54:59 +00:00
Ron Koenderink
65b1f94b3f (abday,day,admon,mon,am_pm) [_WIN32]: Add const to declarations.
Removes warning in MinGW.
2007-08-26 22:53:40 +00:00
Ron Koenderink
2abd68e46e (inet_ntop) [_WIN32]: Improve the error checking for getnameinfo(). 2007-08-24 21:46:32 +00:00
Ron Koenderink
5299580260 (posix_fileno) [_WIN32]: Rename posix_fileno() to fileno().
Remove the extern posix_fileno().

(fileno) [_WIN32]: Replace system fileno() with a function that supports posix
file descriptors.  Move #undef fileno to w32misc.h as the system define
is in stdio.h.

(rea) [_WIN32]: Add stdio.h for fileno() extern declaration and add misc.h
to ensure the WIN32 fixes to stdio.h are included.
2007-08-24 21:05:59 +00:00
Ron Koenderink
d5a1b3c6cd (ssize) [_WIN32]: Switch __W64 to _w64, incorrectly case.
ssize_t declaration  conflicts with MinGW
long declaration for ssize_t so add a #ifdef _MSC_VER
around the ssize_t declaration.
2007-08-24 20:51:00 +00:00
Ron Koenderink
2a0597be8f (snprintf) [_WIN32]: snprintf() should have <stdio.h>. 2007-08-24 20:19:53 +00:00