From: Eric S. Raymond Date: Fri, 23 Aug 2013 14:44:38 +0000 (-0400) Subject: Use toupper(c) rather than homegrown code. X-Git-Tag: 1.11~39 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=980838dba786028f9386fd2567e905e5b901abfb;p=vms-empire.git Use toupper(c) rather than homegrown code. --- diff --git a/edit.c b/edit.c index 5106e5e..1778efe 100644 --- a/edit.c +++ b/edit.c @@ -134,8 +134,7 @@ e_cursor(loc_t *edit_cursor) e = getch (); } (void) nocrmode (); /* reset terminal */ - if (islower (e)) e = upper (e); - return e; + return toupper(e); } /* @@ -498,7 +497,7 @@ e_piece_info(loc_t edit_cursor, char ab) int type; char *p; - ab = upper (ab); + ab = toupper (ab); p = strchr (type_chars, ab); type = p - type_chars; diff --git a/term.c b/term.c index 86a1775..bdf3142 100644 --- a/term.c +++ b/term.c @@ -278,7 +278,7 @@ get_chx(void) c = get_cq (); if (islower(c)) - return (upper(c)); + return (toupper(c)); else return (c); } diff --git a/util.c b/util.c index 589a73d..8116423 100644 --- a/util.c +++ b/util.c @@ -17,37 +17,10 @@ util.c -- various utility routines. #include "empire.h" #include "extern.h" - -/* -Convert a string to uppercase. -Shirley this is defined elsewhere? -*/ - #include #include #include -void -tupper(char *str) -{ - while (*str) { - if (islower (*str)) *str = upper (*str); - str++; - } -} - -/* -Convert a character to uppercase (if it is lowercase) -*/ - -char -upper(char c) -{ - if (islower (c)) - return toupper (c); - else return c; -} - /* Report a bug. */