9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] Whoops.
@ 2001-04-25 23:07 Dan Cross
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Cross @ 2001-04-25 23:07 UTC (permalink / raw)
  To: 9fans

Argh, I hate doing something stupid.  When setting cheight and
cwidth with the patches I posted earlier, one should, of course,
do the arithmetic in floating point, otherwise, it's kind of
useless.  :-)  My apologies; corrected diffs follow.

	- Dan C.

diff /sys/src/cmd/ssh/cmd/client_messages.c ./cmd/client_messages.c
372,373c372,373
< int	cwidth;
< int	cheight;
---
> float	cwidth;
> float	cheight;
380,382c380,382
< 	if(cwidth == 0){
< 		cwidth = width/cols;
< 		cheight = height/lines;
---
> 	if((long)cwidth == 0){
> 		cwidth = (float)width/cols;
> 		cheight = (float)height/lines;
385a386,393
> static void
> setdefgeom(void)
> {
> 	width = 640;
> 	height = 480;
> 	setdim();
> }
>
393,397d400
< 	/* defaults */
< 	width = 640;
< 	height = 480;
< 	setdim();
<
400c403,404
< 		if(fd < 0)
---
> 		if(fd < 0) {
> 			setdefgeom();
401a406
> 		}
406a412
> 		setdefgeom();
471a478,484
> static long
> round(float val)
> {
>
> 	return((long)(val + 0.5));
> }
>
483,484c496,497
< 	putlong(packet, height/cheight);	/* rows */
< 	putlong(packet, width/cwidth);	/* columns */
---
> 	putlong(packet, round(height/cheight));	/* rows */
> 	putlong(packet, round(width/cwidth));	/* columns */


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [9fans] Whoops
@ 2006-03-19 23:28 SHRIZZA
  0 siblings, 0 replies; 2+ messages in thread
From: SHRIZZA @ 2006-03-19 23:28 UTC (permalink / raw)
  To: Plan 9 Fans

Sorry about that email I just sent. I accidentally sent a draft that
I had composed about 2 or 3 weeks ago but I've had progress since
then. Still can't get it to boot though cause of faulty hardware.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-03-19 23:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-04-25 23:07 [9fans] Whoops Dan Cross
2006-03-19 23:28 SHRIZZA

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).