From da9c3bc2d2920a5fd714b829ed7b5a0c10c65c3b Mon Sep 17 00:00:00 2001 From: skimo Date: Tue, 5 Jun 2001 19:57:28 +0000 Subject: [PATCH] adapt KEY_VAL to wchar and fix apparent thinko --- common/gs.h | 6 +++--- common/key.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/common/gs.h b/common/gs.h index e02d9b80..3e3dd137 100644 --- a/common/gs.h +++ b/common/gs.h @@ -6,7 +6,7 @@ * * See the LICENSE file for redistribution information. * - * $Id: gs.h,v 10.50 2000/07/22 17:31:18 skimo Exp $ (Berkeley) $Date: 2000/07/22 17:31:18 $ + * $Id: gs.h,v 10.51 2001/06/05 19:57:28 skimo Exp $ (Berkeley) $Date: 2001/06/05 19:57:28 $ */ #define TEMPORARY_FILE_STRING "/tmp" /* Default temporary file name. */ @@ -108,9 +108,9 @@ struct _gs { } cname[MAX_FAST_KEY + 1]; /* Fast lookup table. */ #define KEY_VAL(sp, ch) \ - ((unsigned char)(ch) <= MAX_FAST_KEY ? \ + ((UCHAR_T)(ch) <= MAX_FAST_KEY ? \ sp->gp->special_key[(unsigned char)ch] : \ - (unsigned char)(ch) > sp->gp->max_special ? 0 : v_key_val(sp,ch)) + (UCHAR_T)(ch) > sp->gp->max_special ? K_NOTUSED : v_key_val(sp,ch)) CHAR_T max_special; /* Max special character. */ u_char /* Fast lookup table. */ special_key[MAX_FAST_KEY + 1]; diff --git a/common/key.c b/common/key.c index 20be2245..9cb5fd4e 100644 --- a/common/key.c +++ b/common/key.c @@ -10,7 +10,7 @@ #include "config.h" #ifndef lint -static const char sccsid[] = "$Id: key.c,v 10.46 2000/07/22 17:31:19 skimo Exp $ (Berkeley) $Date: 2000/07/22 17:31:19 $"; +static const char sccsid[] = "$Id: key.c,v 10.47 2001/06/05 19:57:28 skimo Exp $ (Berkeley) $Date: 2001/06/05 19:57:28 $"; #endif /* not lint */ #include @@ -138,8 +138,8 @@ v_key_init(sp) /* Initialize the fast lookup table. */ for (gp->max_special = 0, kp = keylist, cnt = nkeylist; cnt--; ++kp) { - if (gp->max_special < kp->value) - gp->max_special = kp->value; + if (gp->max_special < kp->ch) + gp->max_special = kp->ch; if (kp->ch <= MAX_FAST_KEY) gp->special_key[kp->ch] = kp->value; } -- 2.11.4.GIT