| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
This allows us to detect unused functions and variables and allows the
compiler to do a better job at optimisation.
|
|
|
|
|
|
|
|
|
| |
- 'now' only contains current time readings
- delay is only used as parameter to nanosleep
- prev_sec contains the time_t of the previous loop iteration
Submitted by: bde
MFC after: 2 weeks
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The previous revision was flawed in numerous ways:
- the if condition would depend on garbage stack values
- grdc(6) would loop n times, not n seconds. This only makes
a difference if it takes more than 1 second to recalculate/redraw
the display.
- style(9) violations
The following change adds argument checking and tracks the elapsed time
between loops explicitly and will exit after roughly n seconds.
While here sort headers and remove bogus #ifndef
Submitted by: bde
MFC after: 2 weeks
|
|
|
|
|
|
|
|
|
| |
- Keep timespec 'now' and 'delay' separate to avoid confusion
- Increase user-supplied n to run _at least_ n seconds, not max n
PR: bin/149130 (based on)
Submitted by: Andy Farkas
MFC after: 2 weeks
|
|
|
|
|
|
| |
This also bumps factor, fortune, primes, and random to WARNS=6.
Approved by: ed (Co-mentor)
|
|
|
|
| |
Approved by: ed (Co-mentor)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
hour to 12 so the time reads "12:00-12:59 AM".
|
|
|
|
| |
Approved by: re (blanket)
|
|
|
|
| |
Submitted by: Samy Al Bahra <samy@kerneled.com>
|
|
|
|
|
|
|
| |
necessary nowadays, but is documented as "required", and may
become so again in the future.
Approved by: re
|
|
|
|
|
|
|
|
|
|
|
| |
- Use getopt() to parse command line.
- Add usage().
- WARNSify.
- Convert manpage to mdoc(7).
PR: bin/30641
Submitted by: Andrey Simonenko <simon@simon.org.ua>, ru
MFC after: 1 week
|
|
|
|
| |
- MAN[1-9] -> MAN.
|
| |
|
| |
|
| |
|
|
|
|
| |
add $FreeBSD$ so I can commit this.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Reviewed by: maybe@yes.no
Obtained from: OpenBSD (mostly deraadt@openbsd.org)
|
| |
|
|
|
|
|
|
|
|
| |
This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.
Boy, I'm glad we're not using sup anymore. This update would have been
insane otherwise.
|
| |
|
| |
|
|
|