From a102ee9a1a3b95f533bb08d80c93a95fe6b33b8b Mon Sep 17 00:00:00 2001 From: PatR Date: Sat, 28 May 2016 17:18:51 -0700 Subject: [PATCH] ctype tweaks None of these explains the Windows assertion failure. end.c - post-3.6.0 options.c - in #else block of #if win32 winmenu.c - X11 --- src/end.c | 2 +- src/options.c | 15 +++++++-------- win/X11/winmenu.c | 3 +-- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/end.c b/src/end.c index 437b9072d..57f8425bc 100644 --- a/src/end.c +++ b/src/end.c @@ -1678,7 +1678,7 @@ boolean ask; pfx = !strncmpi(buf, "the ", 3) ? 0 : !strncmpi(buf, "an ", 3) ? 1 : !strncmpi(buf, "a ", 2) ? 2 - : !isdigit(buf[2]) ? 4 : 0; + : !digit(buf[2]) ? 4 : 0; if (class_header) ++pfx; Sprintf(buftoo, "%*s%s", pfx, "", buf); diff --git a/src/options.c b/src/options.c index 3f35583b5..69db5926f 100644 --- a/src/options.c +++ b/src/options.c @@ -2207,12 +2207,13 @@ boolean tinitial, tfrom_file; bad_negation(fullname, TRUE); return; } + #ifdef CHANGE_COLOR if (match_optname(opts, "palette", 3, TRUE) #ifdef MAC || match_optname(opts, "hicolor", 3, TRUE) #endif - ) { + ) { int color_number, color_incr; #ifndef WIN32 @@ -2227,17 +2228,16 @@ boolean tinitial, tfrom_file; } color_number = CLR_MAX + 4; /* HARDCODED inverse number */ color_incr = -1; - } else { + } else #endif + { if (negated) { bad_negation("palette", FALSE); return; } color_number = 0; color_incr = 1; -#ifdef MAC } -#endif #ifdef WIN32 op = string_for_opt(opts, TRUE); if (!alternative_palette(op)) @@ -2264,8 +2264,8 @@ boolean tinitial, tfrom_file; #else rgb <<= 8; #endif - tmp = *(pt++); - if (isalpha(tmp)) { + tmp = *pt++; + if (isalpha((uchar) tmp)) { tmp = (tmp + 9) & 0xf; /* Assumes ASCII... */ } else { tmp &= 0xf; /* Digits in ASCII too... */ @@ -2277,9 +2277,8 @@ boolean tinitial, tfrom_file; rgb += tmp; } } - if (*pt == '/') { + if (*pt == '/') pt++; - } change_color(color_number, rgb, reverse); color_number += color_incr; } diff --git a/win/X11/winmenu.c b/win/X11/winmenu.c index 97f8592a4..75c99b57a 100644 --- a/win/X11/winmenu.c +++ b/win/X11/winmenu.c @@ -38,7 +38,6 @@ #include "hack.h" #include "winX.h" -#include static void FDECL(menu_select, (Widget, XtPointer, XtPointer)); static void FDECL(invert_line, (struct xwindow *, x11_menu_item *, int, long)); @@ -251,7 +250,7 @@ Cardinal *num_params; select_none(wp); } else if (ch == '\n' || ch == '\r') { ; /* accept */ - } else if (isdigit(ch)) { + } else if (digit(ch)) { /* special case: '0' is also the default ball class */ if (ch == '0' && !menu_info->counting && index(menu_info->curr_menu.gacc, ch)) -- 2.50.1