JetRoff Patch01

JetRoff Mail jetroff at pcrat.UUCP
Tue Oct 4 07:23:16 AEST 1988


JetRoff version 1.3 Patch 01. 10/03/88.

This patch was contributed by Lou Salkind (Thanks, Lou!).
Apply this patch this way:

	cd root_of_JetRoff_source
	patch -p <Patch01

"On a machine that does not sign extend its characters, the code in pk16.c
and makeDESC.c does not work.  Also, I believe the pk_long routines
are not quite right."

Here are the diffs:

*** djet/pk16.c.b	Tue Sep 27 04:49:49 1988
--- djet/pk16.c	Thu Sep 29 01:12:10 1988
***************
*** 134,149 ****
  
  int	pk_loc;
  unsigned char pk_byte() { return (pk[npk]->storage[pk_loc++]); }
! short pk_short()
  {
! 	register short a = pk_byte();
  	return (a*256 + pk_byte());
  }
  long pk_long()
  {
  	register long	a = pk_short();
! 	if (a > 32767) a -= 65536;
! 	return (a*65536 + pk_short());
  }
  
  /*
--- 134,160 ----
  
  int	pk_loc;
  unsigned char pk_byte() { return (pk[npk]->storage[pk_loc++]); }
! 
! pk_sbyte()
  {
! 	register int a = pk_byte();
! 	if (a > 127) a -= 256;
! 	return(a);
! }
! pk_short()
! {
! 	register short a = pk_sbyte();
  	return (a*256 + pk_byte());
  }
+ uint pk_ushort()
+ {
+ 	register ushort a = pk_byte();
+ 	return (a*256 + pk_byte());
+ }
  long pk_long()
  {
  	register long	a = pk_short();
! 	return (a*65536 + pk_ushort());
  }
  
  /*
***************
*** 268,275 ****
  /*			dy = 0;		not used */
  			w = pk_byte();
  			h = pk_byte();
! 			hoff = (char) pk_byte();
! 			voff = (char) pk_byte();
  		}
  		if (cc < 0 || cc > 127)
  			error(1, "character code out of range");
--- 279,286 ----
  /*			dy = 0;		not used */
  			w = pk_byte();
  			h = pk_byte();
! 			hoff = pk_sbyte();
! 			voff = pk_sbyte();
  		}
  		if (cc < 0 || cc > 127)
  			error(1, "character code out of range");

*** font/devjet/makeDESC.c.bak	Tue Sep 27 04:50:00 1988
--- font/devjet/makeDESC.c	Thu Sep 29 01:20:55 1988
***************
*** 120,135 ****
  
  int	pk_loc;
  unsigned char pk_byte() { return (pk[npk]->storage[pk_loc++]); }
! short pk_short()
  {
! 	register short a = pk_byte();
  	return (a*256 + pk_byte());
  }
  long pk_long()
  {
  	register long	a = pk_short();
! 	if (a > 32767) a -= 65536;
! 	return (a*65536 + pk_short());
  }
  
  /*
--- 120,146 ----
  
  int	pk_loc;
  unsigned char pk_byte() { return (pk[npk]->storage[pk_loc++]); }
! 
! pk_sbyte()
  {
! 	register int a = pk_byte();
! 	if (a > 127) a -= 256;
! 	return(a);
! }
! pk_short()
! {
! 	register short a = pk_sbyte();
  	return (a*256 + pk_byte());
  }
+ uint pk_ushort()
+ {
+ 	register ushort a = pk_byte();
+ 	return (a*256 + pk_byte());
+ }
  long pk_long()
  {
  	register long	a = pk_short();
! 	return (a*65536 + pk_ushort());
  }
  
  /*
***************
*** 254,261 ****
  			dy = 0;
  			w = pk_byte();
  			h = pk_byte();
! 			hoff = (char) pk_byte();
! 			voff = (char) pk_byte();
  		}
  		if (cc < 0 || cc > 127)
  			error(1, "character code %d out of range", cc);
--- 265,272 ----
  			dy = 0;
  			w = pk_byte();
  			h = pk_byte();
! 			hoff = pk_sbyte();
! 			voff = pk_sbyte();
  		}
  		if (cc < 0 || cc > 127)
  			error(1, "character code %d out of range", cc);



More information about the Comp.sources.bugs mailing list