From 144542634060e6e63886b3def7218a47a56c5b21 Mon Sep 17 00:00:00 2001 From: Matt Jacob Date: Thu, 27 Jan 2000 05:46:58 +0000 Subject: [PATCH] Fix ctags from core dumping on alpha. Let the diffs out to review, but I timed out. Added FreeBSD CVS header. --- usr.bin/ctags/ctags.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/usr.bin/ctags/ctags.h b/usr.bin/ctags/ctags.h index a42c68a69aca..8ddec91332a6 100644 --- a/usr.bin/ctags/ctags.h +++ b/usr.bin/ctags/ctags.h @@ -1,3 +1,4 @@ +/* $FreeBSD$ */ /* * Copyright (c) 1987, 1993, 1994 * The Regents of the University of California. All rights reserved. @@ -45,11 +46,14 @@ #define SETLINE {++lineno;lineftell = ftell(inf);} #define GETC(op,exp) ((c = getc(inf)) op (int)exp) -#define iswhite(arg) (_wht[(unsigned)arg]) /* T if char is white */ -#define begtoken(arg) (_btk[(unsigned)arg]) /* T if char can start token */ -#define intoken(arg) (_itk[(unsigned)arg]) /* T if char can be in token */ -#define endtoken(arg) (_etk[(unsigned)arg]) /* T if char ends tokens */ -#define isgood(arg) (_gd[(unsigned)arg]) /* T if char can be after ')' */ +#define _egrd(idx, array) \ + (((int)idx < 0)? NO : array [ (int) idx ]) + +#define iswhite(arg) _egrd(arg, _wht) /* T if char is white */ +#define begtoken(arg) _egrd(arg, _btk) /* T if char can start token */ +#define intoken(arg) _egrd(arg, _itk) /* T if char can be in token */ +#define endtoken(arg) _egrd(arg, _etk) /* T if char ends tokens */ +#define isgood(arg) _egrd(arg, _gd) /* T if char can be after ')' */ typedef struct nd_st { /* sorting structure */ struct nd_st *left,