Commit Graph

167285 Commits

Author SHA1 Message Date
dholland 8392979dd5 Dividing by a time_t makes the result time_t, so it should be cast to long
when being printf'd as a long.
2008-02-24 05:20:17 +00:00
dholland fe5990acd7 Print time_t as long long, not long. 2008-02-24 05:16:46 +00:00
dholland 6dc3dcbc38 Use strtoll rather than strtol to read the -r argument, so it will work
for wider time_t. Also mark a timed-related y2038 lossage for whenever
someone figures out the best way to shoot timed.
2008-02-24 04:49:45 +00:00
christos dc11f84d61 fix some lint 2008-02-24 03:56:48 +00:00
christos 7cafbb8e59 need errno.h 2008-02-24 03:52:09 +00:00
dholland aab0bc87a0 Update for today's changes: 1-player games are not allowed, and cards.pck
no longer appears.
2008-02-24 03:50:07 +00:00
dholland 8015839b21 Fix the OpenBSD housing shortage code. 2008-02-24 03:26:26 +00:00
isaki ea32b7cc13 options<space><tab> 2008-02-24 03:13:47 +00:00
dholland 15d2107a88 ret_card(), which I moved earlier, was consequently filed under the wrong
source file name. fix.
2008-02-24 03:01:13 +00:00
dholland ad6f43e622 We do not need special code for pdp11. Also, because random() returns all
good bits (unlike rand()) we can simplify this.
2008-02-24 02:58:33 +00:00
dholland c303095d59 Typo patrol 2008-02-24 02:55:20 +00:00
dholland 295acf7fa6 This file is also no longer used. 2008-02-24 02:53:18 +00:00
dholland d23f8089df Note that I broke compat for the save files of monop(6). 2008-02-24 02:51:54 +00:00
dholland e8adaaa5e1 /usr/share/games/cards.pck is toast. 2008-02-24 02:46:40 +00:00
dholland 97464386e1 Abolish the initdeck program and the weird little binary file it generates.
The card deck data is now compiled in. (And it always should have been,
even back when memory usage counted. It's small.)

This changes the save format slightly. (I am riding the previous
breakage an hour ago and not providing compat. There should be no
further breakage.)
2008-02-24 02:43:18 +00:00
dholland b51259daf4 Source files should be named *.c or *.h, not random other things.
Fold monop.ext (which was extern data decls) into monop.h and deck.h.
Fold monop.def (which had definitions for the extern data) into monop.c.
Fold brd.dat/mon.dat/prop.dat (which were array initializers for some of
the data) into monop.c.

Rearrange includes accordingly. No functional change.
2008-02-24 01:57:34 +00:00
dholland a6c98779b0 Remove last traces of old save/load code. We no longer need a private
copy of malloc.
2008-02-24 01:41:14 +00:00
dholland 67021c2ac7 Sort out the memory leak fix properly. 2008-02-24 01:37:57 +00:00
dholland fe527d1ba8 New save/load code. Related to (but not the same as) the new save/load
code in OpenBSD.

Note: this breaks compatibility with old save files. However, the old
save files were missing critical information, had a completely insane
format, and didn't work anyway.

I will be riding this breakage with another breakage within a day or
two when I fix the insanity in the card deck handling.
2008-02-24 01:30:56 +00:00
christos 3a24c02f26 cleanup fsck error handling:
1. explain what each error means
2. remove 130 (128 + 2) which was presumably there because fsck_msdos did
   not handle SIGINT properly
2008-02-24 01:05:35 +00:00
christos 358764c860 Catch signals and exit with the proper error code like all the other fsck
programs.
2008-02-24 00:59:03 +00:00
reed baa9962260 Fix typo. 2008-02-24 00:34:51 +00:00
dsl e16564a11e Remove a 9 from the stuttered example in order to match the only
possible reality.
2008-02-24 00:05:31 +00:00
dsl 2791dfc743 When converting fp values to integer, use floor(x) so that we get
consistent convertions not the 'round to even'.
This means that it is possibly to generate the 'stuttered' sequence
4 4 3 3 2 2 1 1 0 0 -1 -1.
2008-02-24 00:04:00 +00:00
dsl 9d6613d400 Rename 's' to 'step', allow a precision of 0 to be specified (overriding
the value determined from 'begin' and 'end').
2008-02-23 23:59:59 +00:00
elad 2ef031e659 Adapt to secmodel_securelevel. 2008-02-23 23:32:30 +00:00
dsl a357ac4921 If we are doing a random integer (or character) format, then increase the
range by 1 so that the quoted upper and lower values both appear, and
with the same frequency as the intermediate values.
This reverts the change from rev 1.13, and fixes it properly!
Also fixes 'jot -r -c - 97 98' as reported to netbsd-bugs (but not as a PR!).
2008-02-23 22:46:10 +00:00
uwe f9a91c1634 Set curlwp and curpcb in cpu_switchto instead of cpu_switch_prepare.
We can now skip cpu_switch_prepare for the "fast" switch case (when
"returning" is true) which we will need for fast soft interrupts.
2008-02-23 22:30:46 +00:00
dholland 98e588be9a Fixes from OpenBSD.
- If a player goes bankrupt buying a property (which shouldn't be
allowed, but I guess it is), don't cause them to resign to themselves.
   - Use "NULL", not "0", for pointers.
   - Avoid undefined behavior adjusting the current player after resigning.
   - Don't leak the memory used to store player names.

The last of these is disabled for the moment because we have the pointers
in question tagged const. Will see to this when I'm finished merging.
2008-02-23 22:28:46 +00:00
dsl c4d8b28d09 Remove some pointless indirections and add {} around some long single
statements.
2008-02-23 22:26:41 +00:00
dholland 693812a822 Fix from OpenBSD: don't say "1 houses". 2008-02-23 22:20:35 +00:00
dholland 4e54ceffce Bug fixes from OpenBSD:
- don't truncate unreasonably long player names when bidding;
   - don't allow players to bid more cash than they have.
2008-02-23 22:17:02 +00:00
dholland 7913f644df Bug fix: having $0 does not mean you need to mortgage something. Plus some
tidyup.
From OpenBSD.
2008-02-23 22:06:30 +00:00
dholland d49f907ead More fixes from OpenBSD:
- initialize in the proper order
  - don't allow 1-player games
  - make the check for players named "done" work properly
  - a couple other minor things
2008-02-23 21:48:46 +00:00
christos 742b48d55e Make sure that the exit values are always sane, and use symbolic instead
of magic constants. Reviewed by go@
2008-02-23 21:41:47 +00:00
dholland 5ed7a7102f Sanity fixes for input handling. Suggested by OpenBSD, but different code. 2008-02-23 21:35:13 +00:00
phx cb8c72e1d4 Added scsibus at umass for USB keys and ADOSFS for mounting Amiga file systems
on Pegasos computers.
Approved by garbled.
2008-02-23 21:16:05 +00:00
phx 1ed426bc21 On the Pegasos2, we must never run PCI-configure for the MV64361 host bridge,
otherwise the devices on that bus might no longer work correctly (e.g.
interrupt flood).
Approved by garbled.
2008-02-23 21:11:22 +00:00
christos c74c62426e - sizeof(type) -> sizeof(variable)
- add a missing memset()
- process unlimited length lines
2008-02-23 21:10:54 +00:00
dholland 52f0089409 A first stab at supporting the housing shortage rules. From OpenBSD.
(note: this is not fully correct - I will fix it when I finish merging)
2008-02-23 21:07:52 +00:00
christos 1fe4bceb66 Say what our exit values mean (this is not correct right now, because not
all fsck programs have been fixed but it will be soon).
2008-02-23 20:38:53 +00:00
dholland c844dfca6b Don't increment booleans. From OpenBSD 2008-02-23 20:18:46 +00:00
dholland ff1acb6483 Sanity fixes for input buffer handling. From OpenBSD 2008-02-23 20:12:15 +00:00
oster eb54cecf5a maxcols and DEFCOLS are column counts, not "how much space to
allocate" values.  Thus, if we multiply DEFCOLSL by sizeof(char *) we
should do likewise for maxcols (and not just add maxcols to the "how
much space to allocate" parameter!!)

Fixes the 'jot 33 1 > J33 ; paste -s J33 | column -t' SegFault
lossage reported by Jeremy Reed on tech-misc.
2008-02-23 19:58:06 +00:00
matt beb8ce1f63 Add rw_enter/rw_tryenter/rw_exit stubs (untested). 2008-02-23 19:56:10 +00:00
matt f0df2a688a Add some 440 definitions 2008-02-23 19:54:54 +00:00
dholland 61715c12c2 Improve the behavior of get-out-of-jail-free cards by returning them to
the bottom of the deck when used. There are still a few other problems.
From OpenBSD.
2008-02-23 19:54:06 +00:00
matt 27907c4e8a Use BAT_VA2IDX() 2008-02-23 19:50:41 +00:00
dholland 82ff30a443 Rename ->last_card to ->top_card to match OpenBSD (and also to make
somewhat more sense...)
2008-02-23 19:49:21 +00:00
matt 7aa9230dd8 Add BAT_VA2IDX to abstract out the va to index calculation. 2008-02-23 19:48:43 +00:00