Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 8 Mar 2011 13:10:08 GMT
From:      Andy Farkas <chuzzwassa@gmail.com>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: bin/151663: games/grdc: -s does not scroll
Message-ID:  <201103081310.p28DA8CB028804@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

The following reply was made to PR bin/151663; it has been noted by GNATS.

From: Andy Farkas <chuzzwassa@gmail.com>
To: bug-followup@FreeBSD.org, anatoly.borodin@gmail.com
Cc: =?ISO-8859-1?Q?Ulrich_Sp=F6rlein?= <uqs@freebsd.org>, 
	Bruce Evans <brde@optusnet.com.au>
Subject: Re: bin/151663: games/grdc: -s does not scroll
Date: Tue, 8 Mar 2011 22:41:39 +1000

 On Sun, Oct 24, 2010 at 1:27 AM, Anatoly Borodin
 <anatoly.borodin@gmail.com> wrote:
 
 > grdc -s should scroll the digits, the manual says. But "grdc" and "grdc -s" look just the same.
 
 It *is* scrolling, just too fast for the eye to see.
 
 If you add delays, it scrolls just fine:
 
 %%%
 --- /usr/src/games/grdc/grdc.c	2010-08-28 13:04:04.000000000 +1000
 +++ ./scrolling-grdc.c	2011-03-08 18:47:50.000000000 +1000
 @@ -54,7 +54,7 @@
  int
  main(int argc, char *argv[])
  {
 -	struct timespec delay;
 +	struct timespec delay, scrold;
  	time_t prev_sec;
  	long t, a;
  	int i, j, s, k;
 @@ -69,6 +69,8 @@
  	switch (ch) {
  	case 's':
  		scrol = 1;
 +		scrold.tv_sec = 0;
 +		scrold.tv_nsec = 40000000;
  		break;
  	case 't':
  		t12 = 1;
 @@ -191,6 +193,7 @@
  				}
  				if(!s) {
  					refresh();
 +					nanosleep(&scrold, NULL);
  				}
  			}
  		}
 %%%
 
 If you increase scrold.tv_nsec though, it seems to break the timing loop
 and grdc doesn't seem to DTRT.
 
 I have submitted a new PR (bin/155374) that fixes the problem once and for all.
 
 -andyf



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201103081310.p28DA8CB028804>