[net.micro.amiga] Updated Diffs for vt100 version 2.2

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

In article <2003@videovax.UUCP>, I posted a list of diffs for vt100 version
2.2.  Since then, Dave Wecker has posted (in article <6022@decwrl.DEC.COM>)
a revised list of corrections.  Thanks, Dave, for keeping us up-to-date!

I have kept a running list of changes and updates to Dave Wecker's vt100.
The following diffs are for version 2.2.  The diff to init.c corrects a
problem pointed out by Dawn Banks in article <4625@decwrl.DEC.COM>
(posted on August 4th).  Lattice C is unable to cope with the construct
[n+1].  To avoid problems, all occurrences of [n+1] are replaced by
[nplus1], which is defined as an int and set equal to n+1 (surprise!).
(This change should not cause any problems for the Manx compiler.)

The diffs to kermit.c and script.c are taken from a very recent article
by Dave Wecker (<5980@decwrl.DEC.COM>).  These correct problems that
he found.  Dave also mentioned the need to remove a couple of lines
from vt100.h, but this was apparently done by the mod.amiga.sources
moderator.

The newest corrections (from article <6022@decwrl.DEC.COM>) are to
window.c.  These correct the "if (class=RAWKEY)" statement (first pointed
out by Danny Sharpe in article <2358@gitpyr.gatech.EDU>), and a bug in
the wrap mode logic.

					Steve Rice

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


============================================================================

*** init.c.orig	Thu Oct 16 11:12:11 1986
--- init.c	Fri Oct 17 18:25:03 1986
***************
*** 349,355
  /*****************************************************************/
  void InitFileItems()
  {
! int n;
  
  /* initialize each menu item and IntuiText with loop */
  for( n=0; n<FILEMAX; n++ )

--- 349,355 -----
  /*****************************************************************/
  void InitFileItems()
  {
! int n, nplus1;
  
  /* initialize each menu item and IntuiText with loop */
  for( n=0; n<FILEMAX; n++ )
***************
*** 354,360
  /* initialize each menu item and IntuiText with loop */
  for( n=0; n<FILEMAX; n++ )
     {
!    FileItem[n].NextItem = &FileItem[n+1];
     FileItem[n].LeftEdge = 0;
     FileItem[n].TopEdge = 10 * n;
     FileItem[n].Width = 120;

--- 354,361 -----
  /* initialize each menu item and IntuiText with loop */
  for( n=0; n<FILEMAX; n++ )
     {
!    nplus1 = n+1;
!    FileItem[n].NextItem = &FileItem[nplus1];
     FileItem[n].LeftEdge = 0;
     FileItem[n].TopEdge = 10 * n;
     FileItem[n].Width = 120;
***************
*** 395,401
  /************************************************************************/
  void InitCommItems()
  {
! int n;
                                  
  /* initialize each menu item and IntuiText with loop */
  for( n=0; n<COMMAX; n++ )

--- 396,402 -----
  /************************************************************************/
  void InitCommItems()
  {
! int n, nplus1;
                                  
  /* initialize each menu item and IntuiText with loop */
  for( n=0; n<COMMAX; n++ )
***************
*** 400,406
  /* initialize each menu item and IntuiText with loop */
  for( n=0; n<COMMAX; n++ )
     {
!    CommItem[n].NextItem = &CommItem[n+1];
     CommItem[n].LeftEdge = 0;
     CommItem[n].TopEdge = 10 * n;
     CommItem[n].Width = 88;

--- 401,408 -----
  /* initialize each menu item and IntuiText with loop */
  for( n=0; n<COMMAX; n++ )
     {
!    nplus1 = n+1;
!    CommItem[n].NextItem = &CommItem[nplus1];
     CommItem[n].LeftEdge = 0;
     CommItem[n].TopEdge = 10 * n;
     CommItem[n].Width = 88;
***************
*** 436,442
  
  for( n=0; n<RSMAX; n++ )
     {
!    RSItem[n].NextItem = &RSItem[n+1];
     RSItem[n].LeftEdge = 75;
     RSItem[n].TopEdge = 10 * n;
     RSItem[n].Width = 56;

--- 438,445 -----
  
  for( n=0; n<RSMAX; n++ )
     {
!    nplus1 = n+1;
!    RSItem[n].NextItem = &RSItem[nplus1];
     RSItem[n].LeftEdge = 75;
     RSItem[n].TopEdge = 10 * n;
     RSItem[n].Width = 56;
***************
*** 484,490
  
  for( n=0; n<PARMAX; n++ )
     {
!    ParItem[n].NextItem = &ParItem[n+1];
     ParItem[n].LeftEdge = 75;
     ParItem[n].TopEdge = 10 * n;
     ParItem[n].Width = 56;

--- 487,494 -----
  
  for( n=0; n<PARMAX; n++ )
     {
!    nplus1 = n+1;
!    ParItem[n].NextItem = &ParItem[nplus1];
     ParItem[n].LeftEdge = 75;
     ParItem[n].TopEdge = 10 * n;
     ParItem[n].Width = 56;
***************
*** 525,531
  /* initialize each menu item and IntuiText with loop */
  for( n=0; n<XFMAX; n++ )
     {
!    XFItem[n].NextItem = &XFItem[n+1];
     XFItem[n].LeftEdge = 75;
     XFItem[n].TopEdge = 10 * n;
     XFItem[n].Width = 80;

--- 529,536 -----
  /* initialize each menu item and IntuiText with loop */
  for( n=0; n<XFMAX; n++ )
     {
!    nplus1 = n+1;
!    XFItem[n].NextItem = &XFItem[nplus1];
     XFItem[n].LeftEdge = 75;
     XFItem[n].TopEdge = 10 * n;
     XFItem[n].Width = 80;
***************
*** 563,569
  /*****************************************************************/
  void InitScriptItems()
  {
! int n;
  
  /* initialize each menu item and IntuiText with loop */
  for( n=0; n<SCRIPTMAX; n++ )

--- 568,574 -----
  /*****************************************************************/
  void InitScriptItems()
  {
! int n, nplus1;
  
  /* initialize each menu item and IntuiText with loop */
  for( n=0; n<SCRIPTMAX; n++ )
***************
*** 568,574
  /* initialize each menu item and IntuiText with loop */
  for( n=0; n<SCRIPTMAX; n++ )
     {
!    ScriptItem[n].NextItem = &ScriptItem[n+1];
     ScriptItem[n].LeftEdge = 0;
     ScriptItem[n].TopEdge = 10 * n;
     ScriptItem[n].Width = 128;

--- 573,580 -----
  /* initialize each menu item and IntuiText with loop */
  for( n=0; n<SCRIPTMAX; n++ )
     {
!    nplus1 = n+1;
!    ScriptItem[n].NextItem = &ScriptItem[nplus1];
     ScriptItem[n].LeftEdge = 0;
     ScriptItem[n].TopEdge = 10 * n;
     ScriptItem[n].Width = 128;
***************
*** 602,608
  /*****************************************************************/
  void InitUtilItems()
  {
! int n;
  
  /* initialize each menu item and IntuiText with loop */
  for( n=0; n<UTILMAX; n++ )

--- 608,614 -----
  /*****************************************************************/
  void InitUtilItems()
  {
! int n, nplus1;
  
  /* initialize each menu item and IntuiText with loop */
  for( n=0; n<UTILMAX; n++ )
***************
*** 607,613
  /* initialize each menu item and IntuiText with loop */
  for( n=0; n<UTILMAX; n++ )
     {
!     UtilItem[n].NextItem = &UtilItem[n+1];
      UtilItem[n].LeftEdge = 0;
      UtilItem[n].TopEdge = 10 * n;
      UtilItem[n].Width = 88;

--- 613,620 -----
  /* initialize each menu item and IntuiText with loop */
  for( n=0; n<UTILMAX; n++ )
     {
!     nplus1 = n+1;
!     UtilItem[n].NextItem = &UtilItem[nplus1];
      UtilItem[n].LeftEdge = 0;
      UtilItem[n].TopEdge = 10 * n;
      UtilItem[n].Width = 88;


============================================================================


*** kermit.c.orig	Sat Oct 18 02:09:46 1986
--- kermit.c	Sat Oct 18 02:14:22 1986
***************
*** 784,790
     data[3] = ctl(MYPCHAR);
     data[4] = tochar(MYEOL);
     data[5] = MYQUOTE;
!    if ((p_parity >= 0) || ebqflg) {         /* 8-bit quoting... */
  	data[6] = MYEBQ;                     /* If parity or flag on, send &. */
  	if ((ebq > 0040 && ebq < 0100) ||   /* If flag off, then turn it on  */
  	   (ebq > 0140 && ebq < 0177) ||   /* if other side has asked us to */

--- 784,790 -----
     data[3] = ctl(MYPCHAR);
     data[4] = tochar(MYEOL);
     data[5] = MYQUOTE;
!    if ((p_parity > 0) || ebqflg) {            /* 8-bit quoting... */
  	data[6] = MYEBQ;                     /* If parity or flag on, send &. */
  	if ((ebq > 0040 && ebq < 0100) ||   /* If flag off, then turn it on  */
  	   (ebq > 0140 && ebq < 0177) ||   /* if other side has asked us to */
***************
*** 811,817
      if (data[6] == 0) return;
      ebq = data[6];
      if ((ebq > 040 && ebq < 0100) || (ebq > 0140 && ebq < 0177)) ebqflg = 1;
!     else if (((p_parity >= 0) || ebqflg) && (ebq == 'Y')) {
  	ebqflg = 1;
  	ebq = '&';
  	}

--- 811,817 -----
      if (data[6] == 0) return;
      ebq = data[6];
      if ((ebq > 040 && ebq < 0100) || (ebq > 0140 && ebq < 0177)) ebqflg = 1;
!     else if (((p_parity > 0) || ebqflg) && (ebq == 'Y')) {
  	ebqflg = 1;
  	ebq = '&';
  	}


============================================================================


*** script.c.orig	Sat Oct 18 02:05:58 1986
--- script.c	Sat Oct 18 02:09:32 1986
***************
*** 339,344
  	exit_script();
  	script_start(p);
  	}
      }
  
  void cmd_ks(file)

--- 339,345 -----
  	exit_script();
  	script_start(p);
  	}
+     else exit_script();
      }
  
  void cmd_ks(file)


============================================================================


*** window.c.orig	Mon Oct 20 11:08:36 1986
--- window.c	Mon Oct 20 11:11:22 1986
***************
*** 48,54
  	    class = NewMessage->Class;
  	    code = NewMessage->Code;
  	    ReplyMsg( NewMessage );
! 	    if (class=RAWKEY)
  		{
  		c = toasc(code,1);
  		name[i]=c;

--- 48,54 -----
  	    class = NewMessage->Class;
  	    code = NewMessage->Code;
  	    ReplyMsg( NewMessage );
! 	    if (class==RAWKEY)
  		{
  		c = toasc(code,1);
  		name[i]=c;
***************
*** 152,158
  
  	default:
  	if (c < ' ' || c > '~') break;
! 	if (p_wrap && wrap_flag) {
  	    x = MINX;
  	    y += 8;
  	    if (y > MAXY) {

--- 152,158 -----
  
  	default:
  	if (c < ' ' || c > '~') break;
! 	if (p_wrap && wrap_flag && x >= MAXX) {
  	    x = MINX;
  	    y += 8;
  	    if (y > MAXY) {


============================================================================

mwm@eris.berkeley.edu (Mike (Don't have strength to leave) Meyer) (10/23/86)

Would someone please explain this to me?

In article <2009@videovax.UUCP> stever@videovax.UUCP (Steven E. Rice, P.E.) writes:
>Lattice C is unable to cope with the construct [n+1].

>***************
>*** 354,360
>  /* initialize each menu item and IntuiText with loop */
>  for( n=0; n<FILEMAX; n++ )
>     {
>!    FileItem[n].NextItem = &FileItem[n+1];
>     FileItem[n].LeftEdge = 0;
>     FileItem[n].TopEdge = 10 * n;
>     FileItem[n].Width = 120;
>
>--- 354,361 -----
>  /* initialize each menu item and IntuiText with loop */
>  for( n=0; n<FILEMAX; n++ )
>     {
>!    nplus1 = n+1;
>!    FileItem[n].NextItem = &FileItem[nplus1];
>     FileItem[n].LeftEdge = 0;
>     FileItem[n].TopEdge = 10 * n;
>     FileItem[n].Width = 120;

This looks like utter bilge to me. I'm currently running v2.2 WITHOUT
this patch (though it has the patches posted by DBW), and the menus
look exactly like the code makes me expect them to. Ditto for all the
things I've written that use this technic for setting up menus, etc.

I'm using 3.03. If 3.04 Beta has this problem, then I pray that 1) it
gets fixed before the release, and 2) DBW won't pick up that
particular piece of uglyness just so the Beta software will work.

	<mike