HP problems with ACSnet.
========================

This file contains a list of problems found with ACSnet and patches
required to correct the problems.  Some of the problems may be HP-specific
bugs.  The patches are in context form and could be added with Larry Wall's
patch(1) program.




1. The HP9000/300 compiler doesn't sign extend properly in one case.  This
breaks a bit of code that does "if (CRCEXPECTED ^ CRCPRESENT)".  A bug
report has been filed.  A fix for the meantime is below.

*** Orig/Precv.c	Thu Jun 19 10:35:00 1986
--- Precv.c	Thu Nov 13 15:43:48 1986
***************
*** 48,55
  #define	NSIZ		Pkt.pkt_hdr[PKTSIZE0]
  #define	DATASIZE	(((BYTE(SIZ)/*&PKTSIZ_M*/)<<(8/*-PKTSIZ_S*/)) | BYTE(NSIZ))
  #else	PNproto
! #define	CRCEXPECTED	(PprotoT&PT_CRC)
! #define	CRCPRESENT	(HDR&(PKTCHK_M<<PKTCHK_S))
  #endif	PNproto
  #define	CHANNEL		((HDR>>PKTCHN_S)&PKTCHN_M)
  #define	SEQUENCE	((HDR>>PKTSEQ_S)&PKTSEQ_M)

--- 48,55 -----
  #define	NSIZ		Pkt.pkt_hdr[PKTSIZE0]
  #define	DATASIZE	(((BYTE(SIZ)/*&PKTSIZ_M*/)<<(8/*-PKTSIZ_S*/)) | BYTE(NSIZ))
  #else	PNproto
! #define	CRCEXPECTED	((PprotoT&PT_CRC)!=0)
! #define	CRCPRESENT	((HDR&(PKTCHK_M<<PKTCHK_S))!=0)
  #endif	PNproto
  #define	CHANNEL		((HDR>>PKTCHN_S)&PKTCHN_M)
  #define	SEQUENCE	((HDR>>PKTSEQ_S)&PKTSEQ_M)



2. There is a bug in the way enums work on the HP9000/840 (Indigo) that
causes the header files to fail to work as they should.  The problem is
with using enums in declarations.  A program to reproduce this bug is
included, define BUG when you compile.  A bug report about thsi has been
filed.

# This is a shell archive.  Remove anything before this line,
# then unpack it by saving it in a file and typing "sh file".
#
# Wrapped by brian at hpausla on Wed Nov 19 15:57:14 1986
#
# This archive contains:
#	/tmp/tim.c	
#

echo x - /tmp/tim.c
cat >/tmp/tim.c <<'@EOF'
typedef enum {
red, blue, green
} colour;

#ifdef	BUG
typedef struct
{
	char *	hh[(int)blue];
} h;
#endif

main()
{
	printf("%d %d\n", (int)red, (int)blue);
}
@EOF
chmod 664 /tmp/tim.c
exit 0

*** Header/Orig/ftheader.h	Mon Sep  8 14:47:41 1986
--- Header/ftheader.h	Mon Sep  8 15:06:38 1986
***************
*** 38,43
  }
  	FthReason;
  
  #define	NFTHFIELDS	(int)fth_n
  
  typedef struct

--- 38,46 -----
  }
  	FthReason;
  
+ #ifdef	spectrum
+ #define	NFTHFIELDS	4
+ #else
  #define	NFTHFIELDS	(int)fth_n
  #endif
  
***************
*** 39,44
  	FthReason;
  
  #define	NFTHFIELDS	(int)fth_n
  
  typedef struct
  {

--- 42,48 -----
  #define	NFTHFIELDS	4
  #else
  #define	NFTHFIELDS	(int)fth_n
+ #endif
  
  typedef struct
  {


*** Header/Orig/header.h	Mon Sep  8 14:47:42 1986
--- Header/header.h	Mon Sep  8 15:06:38 1986
***************
*** 54,59
  }
  			HdrReason;
  
  #define	NHDRFIELDS	(int)ht_n
  
  typedef struct

--- 54,62 -----
  }
  			HdrReason;
  
+ #ifdef	spectrum
+ #define	NHDRFIELDS	9 /* (int)ht_n - Broken spectrum compiler */
+ #else
  #define	NHDRFIELDS	(int)ht_n
  #endif
  
***************
*** 55,60
  			HdrReason;
  
  #define	NHDRFIELDS	(int)ht_n
  
  typedef struct
  {

--- 58,64 -----
  #define	NHDRFIELDS	9 /* (int)ht_n - Broken spectrum compiler */
  #else
  #define	NHDRFIELDS	(int)ht_n
+ #endif
  
  typedef struct
  {


*** Header/Orig/state.h	Mon Sep  8 14:47:43 1986
--- Header/state.h	Mon Sep  8 15:06:40 1986
***************
*** 126,131
  
  #define	PT_MSG		(int)pt_msg
  #define	PT_CON		(int)pt_con
  #define	PT_N		(int)pt_n
  
  /*

--- 126,134 -----
  
  #define	PT_MSG		(int)pt_msg
  #define	PT_CON		(int)pt_con
+ #ifdef	spectrum
+ #define	PT_N		2
+ #else
  #define	PT_N		(int)pt_n
  #endif
  
***************
*** 127,132
  #define	PT_MSG		(int)pt_msg
  #define	PT_CON		(int)pt_con
  #define	PT_N		(int)pt_n
  
  /*
  **	Enumerate statistics types

--- 130,136 -----
  #define	PT_N		2
  #else
  #define	PT_N		(int)pt_n
+ #endif
  
  /*
  **	Enumerate statistics types
