[net.micro.amiga] Possible bug in vt100

stever@videovax.UUCP (Steven E. Rice, P.E.) (10/18/86)

In article <2358@gitpyr.gatech.EDU>, Danny Sharpe (dts@gitpyr.gatech.EDU)
wrote:

> I've been trying to get the vt100 emulator running (V2.1 DBW 860915), and
> I ran across the following line in filename() in window.c:
> 
> 	    if (class=RAWKEY)
> 
> This looks funny to me.  The variable "class" isn't used anywhere else,
> so the assignment seems kinda weird.  Should it be comparison:
>
>           if (class==RAWKEY)
> ?

Is "if (class=RAWKEY)" correct, or is it a bug?  Danny posted his
question a week ago, but it must not have been seen by the right people.
I'm quite interested in the answer (and I'm certain others are, too!)

					Steve Rice

----------------------------------------------------------------------------
{decvax | hplabs | ihnp4 | uw-beaver}!tektronix!videovax!stever

jvkelley@watdragon.UUCP (Jeff Kelley) (10/19/86)

[ Don't you hate massive includes of previous postings?]

The line in window.c " if (class=RAWKEY) " is incorrect.  This was pointed
out way back in V1.0, and I don't know why it has never been fixed by Dave.

To see why it's incorrect, consider the following.  RAWKEY is a constant, so the
result of the condition will be constant.  If it's false, (RAWKEY is 0)
then you can get rid of the body of the 'if' and save some memory.  If
it's true, then get rid of the 'if' and just do "class = RAWKEY;" and go
into the body of the 'if'.  Incidentally, this is not an uncommon mistake
made by beginning C programmers.  (I know!)

So please, Dave, change it to "if (class==RAWKEY) " in your source.

Here's another enhancement to vt100.  The two functions cursoron() and
cursoroff() are identical.  With each new version I delete cursoroff(),
change the name of cursoron() to cursorflip() and change all the
appropriate calls, definitions, etc.  I suspect that the compiler 
wouldn't recognize the two identical functions and do this for me.

	Thanks, Dave for a really useful program.

	Jeff Kelley                      {...!ihnp4!watmath!watdragon!jvkelley}
	Department of Computer Science
	University of Waterloo
	Waterloo, Ontario
	N2L 3G1