Commit Graph

1042 Commits

Author SHA1 Message Date
dougb
96f7f6794f Taken from actual police videos ... 2010-06-26 07:02:31 +00:00
uqs
da0290f8d3 random(6): avoid dead assignments
Found by:	clang static analyzer
2010-06-14 13:03:25 +00:00
uqs
d88f969fdd mdoc cleanup
Garbage collect unused sections, macros and arguments. Fix prologue and
remove empty lines.

Found by: mdocml
2010-06-02 10:20:23 +00:00
uqs
b9a504725e Sync fortunes with other *BSDs
- Spelling errors
- Typographical fixes
- Consistent attributions
- Use Jr. more consistently
- Capitalization of dictionary-like entries
- Sorting using tools/do_sort
- Remove duplicate fortunes
- Style according to the Notes file
- Reflect correct default fortune name in Notes
- Remove some no longer needed spelling hints
- Drop latin1 characters (sorry Mårten)

This is a partial sync against the DragonflyBSD sources, where a lot of
fixes from Free, Net and OpenBSD were merged previously. Only about 50%
of the changes originate from there, the rest was done by dougb and
yours truly.

Partial review by:	wilko (earlier version), ed (dito)
In collaboration with:	dougb
Approved by:		ed (co-mentor)
2010-03-31 18:21:25 +00:00
uqs
8f141f1a13 Fix several typos in macros or macro misusage.
Found by:	make manlint
Reviewed by:	ru
Approved by:	philip (mentor)
2010-03-12 10:01:06 +00:00
wilko
2c2b4cb0e3 s/all ready/already/
Submitted by:	ru@, gj@
2010-02-26 16:27:11 +00:00
wilko
709c06294d On the (non)sense of legal disclaimers in emails. 2010-02-25 15:03:57 +00:00
uqs
74cf8088e7 Prefer exit(0) from main over return(0).
Although not explicitly mentioned in style(9), it allows for easier
grepping of exit points. This reverts part of r203926.

Requested by:	des
Approved by:	philip (mentor)
2010-02-21 21:03:15 +00:00
imp
7c458552b0 Remove the third clause for the Berkeley parts of games, per the
letter in /COPYRIGHT.
2010-02-15 18:46:02 +00:00
uqs
6dbf26d197 fortune(6) switch to 3-clause BSDL; style(9)
This reduces the diff to other *BSD and makes it possible to actually
see the code differences.

Approved by:	ed (Co-mentor)
2010-02-15 15:10:21 +00:00
uqs
23cb4f332d games: make WARNS=6 the default, remove overrides
This also bumps factor, fortune, primes, and random to WARNS=6.

Approved by:	ed (Co-mentor)
2010-02-15 14:32:00 +00:00
uqs
9dc5fb429a fortune(6) make WARNS=6 clean
Fixes taken mostly from DragonflyBSD.

Approved by:	ed (Co-mentor)
2010-02-15 14:31:30 +00:00
uqs
925af540e5 morse(6) make WARNS=6 clean
Approved by:	ed (Co-mentor)
2010-02-15 14:31:05 +00:00
uqs
a3f626e47d grdc(6) make WARNS=6 clean and bump accordingly
Approved by:		ed (Co-mentor)
2010-02-15 14:30:37 +00:00
delphij
3e4cd4ab75 Improve time precision for grdc(6):
Traditionally, grdc would obtain time through time(3) which in turn gets
only the second part of clock (CLOCK_SECOND), and sleep for 1 second after
each screen refresh.

This approach would have two problems.  First, we are not guaranteed to
be waken up at the beginning of a whole second, which will typically
exhibit as a "lag" on second number.  Second, because we sleep for whole
second, and the refresh process would take some time, the error would
accumulate from time to time, making the lag variable.

Make grdc(6) to use time(3) to get time only at the beginning, and sample
time in CLOCK_REALTIME_FAST granularity after refreshing, and use the
nanosecond part to caculate how much time we want to sleep.

PR:		bin/120813
MFC after:	1 month
2010-02-10 18:20:20 +00:00
gnn
a98b1b2040 Add the definition of Mistakeholder 2010-02-09 14:51:39 +00:00
imp
205d2929b8 Always compile in the speaker code. There's little savings by
omitting it, and other platforms may implement /dev/speaker in the
future.
2010-02-04 07:08:06 +00:00
gavin
191eb488de Our standard "xterm" termcap entry supports colour, so this tip is redundant.
As it happens, "xterm-color" has just been an alias for "xterm" since
src/share/termcap/termcap.src 1.131 in September 2002.

PR:		docs/132959
Approved by:	ed (mentor)
2010-01-11 21:17:49 +00:00
dougb
2be9e943a9 For the now-infamous Rumsfeld quote:
Change "there're" to "there are" which is consistent with the vast
majority of on line references.

Remove a spurious trailing "

Update the citation text with a suggestion from des.
2010-01-07 23:30:10 +00:00
delphij
ac4932bfb5 Fix build: getopt() returns int so use an integer to get the value. 2010-01-06 00:20:37 +00:00
stas
a3ff55adf7 - Move potentially offensive quotes I committed recently to fortunes-o.
- Reference date.
- Be more clear on context.

Suggested by:	dougb
2010-01-05 23:35:43 +00:00
edwin
c309e354e0 Be able to specify a certain date and/or time for which to calculate
the phase of the moon.
While not worlds best improvements, it will help calendar(1) later on.
2010-01-05 21:14:48 +00:00
dougb
633e4d704e Remove more duplicates
Minor reformatting on a few
2010-01-05 19:40:32 +00:00
stas
05cd6c9186 - Add two particulary interesting quotes from the past decade. 2010-01-04 09:16:35 +00:00
ed
ef9c2d0d56 Use ANSI C function declarations. 2009-12-29 08:43:32 +00:00
ed
b90af5ae21 Use ANSI C function declarations. 2009-12-29 08:42:58 +00:00
fanf
62d1f26939 Fix a performance bug in factor(6).
Check if large factor is prime before applying Pollard's algorithm;
fixes "factor 2147483647111311".  Increase base if p-1 algorithm
reaches 1; fixes "factor 99999999999991".

Testcases from David A Bagley <bagleyd@tux.org>.
Fixes from Joseph Myers <jsm@NetBSD.org>.
Problem rediscovered by an attempt to factor my phone number.

A few other incidental fixes: correct a couple of factually incorrect
comments; use ident string macros; move from 4-clause to 3-clause
BSD licence (University of California copyright).

Obtained from:	NetBSD
2009-11-26 00:38:13 +00:00
dougb
fd872f39d3 Properly sort a math fortune after the changes in r193486
Properly sort fortunes added in r174879 and r174959
2009-11-07 22:13:29 +00:00
dougb
66c17d4f6c Move Warner's very funny comparison of VCS to anal sex into fortunes-o 2009-11-07 21:28:21 +00:00
dougb
b115416644 Remove the svn:executable property from this file 2009-11-07 21:02:40 +00:00
dougb
838964588b Fix not only the grammar, but also the formatting that makes the gag 2009-11-04 18:40:05 +00:00
ed
7958ef6a18 Make number(6) build with WARNS=6. 2009-10-13 06:25:53 +00:00
dougb
3ebab44f62 "Potluck Pogo" was a collection of Walt Kelly's "Pogo" cartoons
first published in 1955. "Putluck Pogo" seems to be a typo.
2009-10-06 02:13:32 +00:00
dougb
bfbc302bca Fix several instances of spaces before commas, and one of a space
before a ).

PR:		docs/136723
Submitted by:	Ulrich Sporlein <uqs@spoerlein.net>
Approved by:	re (kib)
2009-07-16 20:29:36 +00:00
edwin
c284a3411a Misc fixed to fortunes
PR:		conf/112024
Submitted by:	Niclas Zeising <niclas.zeising@gmail.com>
MFC after:	2 days
2009-06-05 07:57:10 +00:00
edwin
918be43d84 [patch] fortune(6): George Bernard Shaw quote fix
From the original PR:

    s/milestones/millstones/
    and less important..
    s/man/Man/
    Not every source I've seen capitalizes 'Man', but it seems
    right. Uncapitalized 'man' would usually be preceded by
    an 'a'. But I haven't seen any reference cite the orignal
    source yet, so I can't say for sure.

http://quotationsbook.com/quote/31568/

PR:		conf/131469
Submitted by:	John Hein <jhein@timing.com>
MFC after:	2 days
2009-06-04 22:01:50 +00:00
edwin
9fb430ebd0 [patch] fortune(6): file not Y2.01K compliant
Update the time in the fortune to make the joke a little bit more
realistic again: Bump year from 2009 to 2039.

PR:		conf/129860
Submitted by:	Alan Amesbury <amesbury@umn.edu>
MFC after:	2 days
2009-06-04 21:55:07 +00:00
phk
18d3f8ff52 Too good to pass. 2009-03-06 13:24:54 +00:00
simon
8ccecdd30b netcat is "now" in base, so point people at nc(1) instead of the port.
MFC after:	1 week
2009-01-12 19:17:43 +00:00
phk
8bdcb17f53 Another good day for historical quotes, Oliver Wendell Holmes brought to
you by Thomas L. Friedman.

 (http://www.nytimes.com/2008/10/08/opinion/08friedman.html?ref=opinion)
2008-10-08 19:39:22 +00:00
phk
c4a12279db A Wittgenstein quote according to David Ignatius
http://voices.washingtonpost.com/postpartisan/2008/10/the_town_hall_debate_in_praise.html
2008-10-08 06:39:05 +00:00
ache
2e0fd6b4c3 Suggections from bde@
1) Split too long source lines
2) Portable code should not assume that null pointer == all-bits-0,
so back out prev. calloc() change.

Submitted by:   bde
2008-08-11 23:24:42 +00:00
ache
7b638af8ac All cosmetic.
1) Rename RANDOM_MAX to RANDOM_MAX_PLUS1 to not confuse with random()'s max
2) Use calloc() instead of zeroing fields explicitly
3) "too many lines" -> "too many delimiters" for err()
2008-08-10 11:31:56 +00:00
ache
42825e9561 1) Fix longstanding math bug with denominator > 1 (wrong probability).
Test case:
	random -f some_small_file 10000
(in most cases must be no output)
2) Prevent number of lines > RANDOM_MAX (overflow or nothing may be
choosed) with EFBIG err()
3) After line is found, terminate list loop for -U case too,
since nothing to do in the rest of the loop left.
2008-08-08 02:46:47 +00:00
ache
823689b09c I was confused a bit by the wrong construction with RAND_MAX
used in randomize_fd.c.
Although the max value is the same currently, RAND_MAX is for rand(),
not for random().
So move RANDOM_MAX const to the common file now, make it UL and
use in randomize_fd.c too.
(in any case its old value was 1 less then must be, as noted in
the prev. commit)
2008-08-08 01:42:17 +00:00
ache
c14ceb129d 1) Replace hardcoded RANDOM_MAX macro with wrong (1 less than must be)
value with ((double)RAND_MAX + 1)
2) For exit code increase valid denominator upper range from 255 to 256
since returned value is [0 .. denom - 1]
2008-08-08 01:02:30 +00:00
ache
47725620b7 Use __FreeBSD_version check since it is bootstrap tool 2008-08-07 21:36:09 +00:00
ache
33d0c4b593 Add reference to arc4random_uniform(3) 2008-08-07 20:07:30 +00:00
ache
e1d97badbc Use arc4random_uniform(3) 2008-08-07 20:05:51 +00:00
ache
61c55e8d27 Use arc4random_uniform(3)
Obtained from:  OpenBSD
2008-08-07 20:02:42 +00:00