From 11ad65226d68aed481fa5533b85cb0a30860a311 Mon Sep 17 00:00:00 2001 From: Jon Trulson Date: Wed, 27 Jun 2018 14:52:33 -0600 Subject: [PATCH] DtSvc/DtCodelibs: remove register keyword --- cde/lib/DtSvc/DtCodelibs/filegen.C | 6 +++--- cde/lib/DtSvc/DtCodelibs/mbschr.C | 4 ++-- cde/lib/DtSvc/DtCodelibs/shellscan.C | 2 +- cde/lib/DtSvc/DtCodelibs/strcase.C | 4 ++-- cde/lib/DtSvc/DtCodelibs/strend.C | 2 +- cde/lib/DtSvc/DtCodelibs/strhash.C | 26 +++++++++++++------------- cde/lib/DtSvc/DtCodelibs/stringio.C | 8 ++++---- cde/lib/DtSvc/DtCodelibs/strtokx.C | 6 +++--- cde/lib/DtSvc/DtCodelibs/strwcmp.C | 24 ++++++++++++------------ 9 files changed, 41 insertions(+), 41 deletions(-) diff --git a/cde/lib/DtSvc/DtCodelibs/filegen.C b/cde/lib/DtSvc/DtCodelibs/filegen.C index 2e9c59b1..e2276dec 100644 --- a/cde/lib/DtSvc/DtCodelibs/filegen.C +++ b/cde/lib/DtSvc/DtCodelibs/filegen.C @@ -279,8 +279,8 @@ _SHXbuf::filegen() for (i = 1; i < vec.size(); i++) { - register char *ref = filebuf; - register char *ptr = &bufptr[long(vec[i])]; + char *ref = filebuf; + char *ptr = &bufptr[long(vec[i])]; while (*ref == *ptr && *ref != '\0' && *ptr != '\0') ref++, ptr++; @@ -292,7 +292,7 @@ _SHXbuf::filegen() // make room. for (i = vec.size(); i > 0; --i) { - register char *val = vec[i - 1]; + char *val = vec[i - 1]; vec[i] = val; } vec[0] = (char *)buf.size(); diff --git a/cde/lib/DtSvc/DtCodelibs/mbschr.C b/cde/lib/DtSvc/DtCodelibs/mbschr.C index f86655ef..4b2b0f26 100644 --- a/cde/lib/DtSvc/DtCodelibs/mbschr.C +++ b/cde/lib/DtSvc/DtCodelibs/mbschr.C @@ -44,8 +44,8 @@ _mb_schr(const char *str, wchar_t ch) #else char * _mb_schr(str, ch) -register unsigned char *str; -register wchar_t ch; +unsigned char *str; +wchar_t ch; #endif { wchar_t __nlh_char[1]; diff --git a/cde/lib/DtSvc/DtCodelibs/shellscan.C b/cde/lib/DtSvc/DtCodelibs/shellscan.C index b43678c5..6dd1a054 100644 --- a/cde/lib/DtSvc/DtCodelibs/shellscan.C +++ b/cde/lib/DtSvc/DtCodelibs/shellscan.C @@ -209,7 +209,7 @@ pushvar(_StringIO &in, char *buff) static boolean pushenv(_StringIO &in, char const *name) { - register char *str = getenv(name); + char *str = getenv(name); if (str == NULL || *str == '\0') return FALSE; else diff --git a/cde/lib/DtSvc/DtCodelibs/strcase.C b/cde/lib/DtSvc/DtCodelibs/strcase.C index ee1802d3..cab1d031 100644 --- a/cde/lib/DtSvc/DtCodelibs/strcase.C +++ b/cde/lib/DtSvc/DtCodelibs/strcase.C @@ -41,7 +41,7 @@ char *strupper(char *str) if (str != NULL) { - for (register char *s = str; *s != '\0'; s++) + for (char *s = str; *s != '\0'; s++) if ((len = mblen(s, MB_CUR_MAX)) > 1) s += len; else @@ -57,7 +57,7 @@ char *strlower(char *str) if (str != NULL) { - for (register char *s = str; *s != '\0'; s++) + for (char *s = str; *s != '\0'; s++) if ((len = mblen(s, MB_CUR_MAX)) > 1) s += len; else diff --git a/cde/lib/DtSvc/DtCodelibs/strend.C b/cde/lib/DtSvc/DtCodelibs/strend.C index 2e1d4a01..cad12ce9 100644 --- a/cde/lib/DtSvc/DtCodelibs/strend.C +++ b/cde/lib/DtSvc/DtCodelibs/strend.C @@ -34,7 +34,7 @@ #include char * -strend(register const char *str) +strend(const char *str) { if (str == NULL) return NULL; diff --git a/cde/lib/DtSvc/DtCodelibs/strhash.C b/cde/lib/DtSvc/DtCodelibs/strhash.C index 863b1007..b04f8fc5 100644 --- a/cde/lib/DtSvc/DtCodelibs/strhash.C +++ b/cde/lib/DtSvc/DtCodelibs/strhash.C @@ -38,9 +38,9 @@ /************************************************** // This is quick but does a pretty crummy job -unsigned strhash(register const unsigned char *key) +unsigned strhash(const unsigned char *key) { - register unsigned hash = 0; + unsigned hash = 0; while (*key != '\0') hash = (hash << 3) + *key++; return hash; @@ -55,10 +55,10 @@ unsigned strhash(register const unsigned char *key) // This is from the "dragon" Compilers book. // It is much better than the above but somewhat slower. // -unsigned strhash(register const char *p) +unsigned strhash(const char *p) { - register unsigned h = 0; - register unsigned g; + unsigned h = 0; + unsigned g; wchar_t __nlh_char[1]; if (p != NULL) @@ -77,10 +77,10 @@ unsigned strhash(register const char *p) // Same as above but case insensitive. Returns the same value as the // above function if there are no upper case letters in the string. // -unsigned strhashi(register const char *p) +unsigned strhashi(const char *p) { - register unsigned h = 0; - register unsigned g; + unsigned h = 0; + unsigned g; wchar_t __nlh_char[1]; if (p != NULL) @@ -110,12 +110,12 @@ unsigned strhashi(register const char *p) unsigned int hashfunc(buf, len) -register unsigned char *buf; -register int len; +unsigned char *buf; +int len; { - register unsigned int in; - register unsigned int xor; - register unsigned int t; + unsigned int in; + unsigned int xor; + unsigned int t; xor = len << 8; in = 0; diff --git a/cde/lib/DtSvc/DtCodelibs/stringio.C b/cde/lib/DtSvc/DtCodelibs/stringio.C index 7c599497..32b215ee 100644 --- a/cde/lib/DtSvc/DtCodelibs/stringio.C +++ b/cde/lib/DtSvc/DtCodelibs/stringio.C @@ -32,11 +32,11 @@ #include "stringio.h" int -_StringIO::doit(register int commit) +_StringIO::doit(int commit) { - register wchar_t ch; - register int cu = curr; - register char *ccp; + wchar_t ch; + int cu = curr; + char *ccp; wchar_t __nlh_char[1]; for (; cu >= 0; cu--) diff --git a/cde/lib/DtSvc/DtCodelibs/strtokx.C b/cde/lib/DtSvc/DtCodelibs/strtokx.C index 67c0ad23..ee608c35 100644 --- a/cde/lib/DtSvc/DtCodelibs/strtokx.C +++ b/cde/lib/DtSvc/DtCodelibs/strtokx.C @@ -36,18 +36,18 @@ #include char * -strtokx(register char *&ptr, register const char *sep) +strtokx(char *&ptr, const char *sep) { if (ptr == NULL) return NULL; // find the beginning of the token - register char *ret = ptr; + char *ret = ptr; while (*ret != '\0' && _mb_schr(sep, *ret) != NULL) ADVANCE(ret); // find the end of the token - register char *end = ret; + char *end = ret; while (*end != '\0' && _mb_schr(sep, *end) == NULL) ADVANCE(end); diff --git a/cde/lib/DtSvc/DtCodelibs/strwcmp.C b/cde/lib/DtSvc/DtCodelibs/strwcmp.C index d2db0097..431051a1 100644 --- a/cde/lib/DtSvc/DtCodelibs/strwcmp.C +++ b/cde/lib/DtSvc/DtCodelibs/strwcmp.C @@ -63,9 +63,9 @@ static int match_class(const char *, char); /* INLINE */ static int -next_char(register const char *pattern, const char **cpp = NULL) +next_char(const char *pattern, const char **cpp = NULL) { - register int ret; + int ret; wchar_t __nlh_char[1]; ret = pattern ? (int)CHARAT(pattern) : '\0'; @@ -98,10 +98,10 @@ strwcmp(const char *pattern, const char *string) // stwpat returns a pointer to the first meta-character if the string // is a pattern, else NULL char * -strwpat(register const char *pattern) +strwpat(const char *pattern) { - register int ch; - register char *prev_pattern = (char *)pattern; + int ch; + char *prev_pattern = (char *)pattern; wchar_t __nlh_char[1]; while ((ch = next_char(pattern, &pattern)) != '\0') @@ -113,7 +113,7 @@ strwpat(register const char *pattern) case '?': return prev_pattern; case '[': { - register const char *eop = next_patt(prev_pattern, 0); + const char *eop = next_patt(prev_pattern, 0); if (CHARAT(eop) == ']') return prev_pattern; break; @@ -131,7 +131,7 @@ strwpat(register const char *pattern) * the beginning of string. */ static int -match(register const char *pattern, register const char *string, int depth) +match(const char *pattern, const char *string, int depth) { #ifdef DEBUG printf("%smatch(\"%s\", \"%s\")\n", TABS, pattern, string); @@ -143,7 +143,7 @@ match(register const char *pattern, register const char *string, int depth) while ((ch = next_char(pattern, &cp)) != '\0') { const char *laststr = string; - register int testchar = (int)CHARADV(string); + int testchar = (int)CHARADV(string); switch (ch) { @@ -184,7 +184,7 @@ match(register const char *pattern, register const char *string, int depth) } static int -match_class(register const char *clss, register char testchar) +match_class(const char *clss, char testchar) /* * pattern is a pointer to the leading [ of * a shell-type class. testchar is the character to match against @@ -195,7 +195,7 @@ match_class(register const char *clss, register char testchar) wchar_t __nlh_char[1]; /* find end of class, ie an un-escaped ']' */ - register const char *eop = next_patt(clss, 0); + const char *eop = next_patt(clss, 0); ADVANCE(clss); if (CHARAT(eop) != ']') @@ -209,7 +209,7 @@ match_class(register const char *clss, register char testchar) while (clss < eop) { - register int ch = next_char(clss, &clss); + int ch = next_char(clss, &clss); char const *clss_end = clss; int sep = next_char(clss_end, &clss_end); int ch2 = next_char(clss_end, &clss_end); @@ -252,7 +252,7 @@ match_class(register const char *clss, register char testchar) } static const char * -next_patt(register const char *pattern, int advance) +next_patt(const char *pattern, int advance) { wchar_t __nlh_char[1]; -- 2.25.1