1
0
mirror of https://github.com/openbsd/src.git synced 2025-01-03 06:45:37 -08:00

Cast to unsigned char after or'ing in the meta bit, so the compiler

doesn't complain when it's implicitly converted to plain char in an
assignment, and to make sure it's not negative when used as an array index.

ok miod@
This commit is contained in:
guenther 2024-08-16 23:09:25 +00:00
parent f06e49141d
commit 3ed9484fbb

View File

@ -1,5 +1,5 @@
/* infomap.h -- description of a keymap in Info and related functions.
$Id: infomap.h,v 1.1.1.4 2006/07/17 16:03:43 espie Exp $
$Id: infomap.h,v 1.2 2024/08/16 23:09:25 guenther Exp $
Copyright (C) 1993, 2001, 2004 Free Software Foundation, Inc.
@ -40,7 +40,7 @@
#define Meta_p(c) (((c) > meta_character_threshold))
#define Control_p(c) ((c) < control_character_threshold)
#define Meta(c) ((c) | (meta_character_bit))
#define Meta(c) ((unsigned char)((c) | (meta_character_bit)))
#define UnMeta(c) ((c) & (~meta_character_bit))
#define Control(c) ((toupper (c)) & (~control_character_bit))
#define UnControl(c) (tolower ((c) | control_character_bit))