🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.epoch.misc
Article #25

Corrected epoch patch to buffer.h

#25
From: meissner
Date: Wed, 04 Nov 1992 10:53
36 lines
1779 bytes
I goofed in the last patch I sent, and had the test the wrong way.
The following patch against the original sources does the right thing.

Wed Nov  4 13:55:47 1992  Michael Meissner  (meissner@osf.org)

	* buffer.h (is_control_char, is_meta_char): Use unsigned test for
	doing ranges, which is faster, and causes GCC not to warn about
	'test is always true due to limited range' when given an unsigned
	argument in indent.c and xdispepoch.c.

*** buffer.h.orig	Wed Nov  4 15:50:56 1992
--- buffer.h	Wed Nov  4 15:49:27 1992
***************
*** 284,290 ****
  
  #define BufferSafeFloor(n) (BEGV <= GPT && GPT <= (n) ? GPT : BEGV)
  
! #define is_control_char(c)   (((c) >= 0 && (c) < 040) || (c) == 0177)
! #define is_meta_char(c) ((c) > 0240 && (c) <= 0377)
  
  extern void reset_buffer ();
--- 284,291 ----
  
  #define BufferSafeFloor(n) (BEGV <= GPT && GPT <= (n) ? GPT : BEGV)
  
! #define is_in_range(c,l,h) ((unsigned)((c) - (l)) <= (unsigned)((c) - (h)))
! #define is_control_char(c)   (is_in_range (c, 0, 037) || (c) == 0177)
! #define is_meta_char(c) is_in_range (c, 0241, 0377)
  
  extern void reset_buffer ();

--
Michael Meissner	email: meissner@osf.org		phone: 617-621-8861
Open Software Foundation, 11 Cambridge Center, Cambridge, MA, 02142

You are in a twisty little passage of standards, all conflicting.
Technical Details
Message-ID: <9211042053.AA03220@curley.osf.org>
Path: arc1-ca.pugleaf.net!sparky!uunet!news.univie.ac.at!chx400!ira.uka.de!sol.ctr.columbia.edu!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!osf.ORG!meissner

Show Full Headers
Complete Article Headers
Newsgroups: gnu.epoch.misc
Path: arc1-ca.pugleaf.net!sparky!uunet!news.univie.ac.at!chx400!ira.uka.de!sol.ctr.columbia.edu!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!osf.ORG!meissner
From: meissner@osf.ORG
Subject: Corrected epoch patch to buffer.h
Message-ID: <9211042053.AA03220@curley.osf.org>
Sender: daemon@cis.ohio-state.edu
Organization: GNUs Not Usenet
Distribution: gnu
Date: Wed, 4 Nov 1992 10:53:16 GMT
Lines: 36