From 115c1a25d8830ca2e06028dcece1eadec638ebeb Mon Sep 17 00:00:00 2001 From: Peter Howkins Date: Mon, 25 Jun 2018 00:20:55 +0100 Subject: [PATCH] dtwm: In CDE we always build with MULTIBYTE support, disable unused singlebyte only --- cde/programs/dtwm/Imakefile | 2 +- cde/programs/dtwm/README | 4 - cde/programs/dtwm/WmBackdrop.c | 18 --- cde/programs/dtwm/WmCDInfo.c | 29 ---- cde/programs/dtwm/WmGlobal.h | 2 - cde/programs/dtwm/WmMain.c | 5 +- cde/programs/dtwm/WmParse.c | 238 +-------------------------------- cde/programs/dtwm/WmResCvt.c | 30 ----- cde/programs/dtwm/WmResParse.c | 90 +------------ cde/programs/dtwm/WmResource.c | 2 - 10 files changed, 4 insertions(+), 416 deletions(-) diff --git a/cde/programs/dtwm/Imakefile b/cde/programs/dtwm/Imakefile index c7fc608e..3241de39 100644 --- a/cde/programs/dtwm/Imakefile +++ b/cde/programs/dtwm/Imakefile @@ -12,7 +12,7 @@ MWMDEFINES = $(VFORK_DEFINE) -DLARGECURSORS -DR2_COMPAT -DOPAQUE -DSHAPE \ DTWMDEFINES = DEPEND_DEFINES = $(DEPENDDEFINES) -DEFINES = $(MWMDEFINES) $(DTWMDEFINES) -DMULTIBYTE +DEFINES = $(MWMDEFINES) $(DTWMDEFINES) INCLUDES = $(TIRPCINC) DEPLIBS = DepDtClientLibs diff --git a/cde/programs/dtwm/README b/cde/programs/dtwm/README index 7b3be096..3ab2d969 100644 --- a/cde/programs/dtwm/README +++ b/cde/programs/dtwm/README @@ -87,10 +87,6 @@ header file include flags, and macros (e.g. ABS). Vestigal/experimental code to reduce output to feedback window (WmFeedback.c). - NO_MULTIBYTE - If defined, then code to support multibyte character sets is - removed. - NO_OL_COMPAT If defined, then code to read and interpret Open Look window manager hints is removed. diff --git a/cde/programs/dtwm/WmBackdrop.c b/cde/programs/dtwm/WmBackdrop.c index 545a08bc..4cdfac56 100644 --- a/cde/programs/dtwm/WmBackdrop.c +++ b/cde/programs/dtwm/WmBackdrop.c @@ -55,9 +55,7 @@ #include #include #include -#ifndef NO_MULTIBYTE #include -#endif #include "WmIPC.h" /* must be after DtP.h */ /************************************** @@ -191,9 +189,7 @@ ProcessBackdropResources( static String none_string = NULL; static String no_backdrop_string = NULL; Boolean bNone = False; -#ifndef NO_MULTIBYTE unsigned int chlen; -#endif /* NO_MULTIBYTE */ if (callFlags & CHANGE_BACKDROP) { @@ -226,7 +222,6 @@ ProcessBackdropResources( * Strip off leading '@', if any */ pch = (unsigned char *) pWS->backdrop.image; -#ifndef NO_MULTIBYTE chlen = mblen ((char *)pch, MB_CUR_MAX); if (chlen == 1 && *pch++ == '@') { @@ -244,19 +239,6 @@ ProcessBackdropResources( } } } -#else /* NO_MULTIBYTE */ - if (*pch++ == '@' && *pch) - { - int il = 1+strlen ((char *)pch); - unsigned char *pchD = (unsigned char *)pWS->backdrop.image; - - while (il) - { - *pchD++ = *pch++; - il--; - } - } -#endif /* NO_MULTIBYTE */ /* * Use a copy of the string because our parsing routines diff --git a/cde/programs/dtwm/WmCDInfo.c b/cde/programs/dtwm/WmCDInfo.c index f132823c..dbe26d29 100644 --- a/cde/programs/dtwm/WmCDInfo.c +++ b/cde/programs/dtwm/WmCDInfo.c @@ -64,7 +64,6 @@ unsigned int TitleTextHeight (ClientData *pcd) { unsigned int ttextheight; -#ifndef NO_MULTIBYTE if (DECOUPLE_TITLE_APPEARANCE(pcd)) { ttextheight = CLIENT_TITLE_APPEARANCE(pcd).titleHeight; @@ -73,34 +72,6 @@ unsigned int TitleTextHeight (ClientData *pcd) { ttextheight = CLIENT_APPEARANCE(pcd).titleHeight; } -#else - - XFontStruct *font; - - if (DECOUPLE_TITLE_APPEARANCE(pcd)) - { - font = CLIENT_TITLE_APPEARANCE(pcd).font; - } - else - { - font = CLIENT_APPEARANCE(pcd).font; - } - - if (font) - { - ttextheight = TEXT_HEIGHT(font) + WM_TITLE_BAR_PADDING; - } - else - { - /* - * Failed to load any font! (probably due to error in - * font path, toolkit, or resource converter. Set to - * arbitrary value for robustness. - * - */ - ttextheight = 16; - } -#endif return (ttextheight); } diff --git a/cde/programs/dtwm/WmGlobal.h b/cde/programs/dtwm/WmGlobal.h index f9474b08..43c9d5e5 100644 --- a/cde/programs/dtwm/WmGlobal.h +++ b/cde/programs/dtwm/WmGlobal.h @@ -891,9 +891,7 @@ typedef struct _AppearanceData { XmFontList fontList; /* resource */ XFontStruct *font; -#ifndef NO_MULTIBYTE unsigned int titleHeight; /* title bar's height */ -#endif Boolean saveUnder; /* resource */ Pixel background; /* resource */ Pixel foreground; /* resource */ diff --git a/cde/programs/dtwm/WmMain.c b/cde/programs/dtwm/WmMain.c index 84207cbb..bf23693e 100644 --- a/cde/programs/dtwm/WmMain.c +++ b/cde/programs/dtwm/WmMain.c @@ -36,9 +36,7 @@ #include "WmGlobal.h" -#ifndef NO_MULTIBYTE #include -#endif #include
#include
/* @@ -104,7 +102,6 @@ main (int argc, char *argv [], char *environ []) setlocale(LC_ALL, ""); -#ifndef NO_MULTIBYTE /* * Set up environment variables for this HP DT client */ @@ -119,7 +116,7 @@ main (int argc, char *argv [], char *environ []) char * foo = ((char *)GETMESSAGE(44, 1, "")); } XtSetLanguageProc (NULL, (XtLanguageProc)NULL, NULL); -#endif + /* * Get Identity */ diff --git a/cde/programs/dtwm/WmParse.c b/cde/programs/dtwm/WmParse.c index 2ea72d50..955bdca5 100644 --- a/cde/programs/dtwm/WmParse.c +++ b/cde/programs/dtwm/WmParse.c @@ -60,9 +60,7 @@ #include "WmGlobal.h" #include "WmParse.h" #include "WmParseP.h" -#ifdef MULTIBYTE #include -#endif /* MULTIBYTE */ #include /* @@ -271,7 +269,6 @@ _DtWmParseBackUp ( if ((pchTok > pWmPB->pchLine) && (pchTok < (pWmPB->pchLine + pWmPB->cLineSize))) { -#ifdef MULTIBYTE unsigned char *pch; unsigned char *pchLast; int chlen; @@ -317,29 +314,6 @@ _DtWmParseBackUp ( } pWmPB->pchNext = pchLast; -#else /* MULTIBYTE */ - - /* - * Replace preceding NULL with a space. - */ - pchTok--; - - if (*pchTok == '\0') - { - *pchTok = DTWM_CHAR_SPACE; - } - - /* - * Back up to next NULL or beginning of line. - */ - while ((pchTok >= pWmPB->pchLine) && *pchTok) - { - pchTok--; - } - - pWmPB->pchNext = pchTok + 1; - -#endif /* MULTIBYTE */ } return (pWmPB->pchNext); } @@ -374,13 +348,9 @@ _DtWmParseBackUp ( void _DtWmParseSkipWhitespaceC(unsigned char **linePP) { -#ifdef MULTIBYTE while (*linePP && (mblen ((char *)*linePP, MB_CUR_MAX) == 1) && isspace (**linePP)) -#else - while (*linePP && isspace (**linePP)) -#endif { (*linePP)++; } @@ -446,7 +416,6 @@ _DtWmParseNextTokenC ( unsigned char *curP; unsigned char *lnwsP; unsigned int level = 0, checkLev, i, quoteLevel[MAX_QUOTE_DEPTH]; -#ifdef MULTIBYTE int chlen; /* get rid of leading white space */ @@ -560,90 +529,6 @@ _DtWmParseNextTokenC ( } } } -#else /* MULTIBYTE */ - - /* get rid of leading white space */ - ScanWhitespace (&lineP); - - /* Return NULL if line is empty, whitespace, or begins with a comment. */ - if ((lineP == NULL || *lineP == '\0') || - (!SmBehavior && (*lineP == '#'))) - { - *linePP = lineP; - return (NULL); - } - - if (*lineP == '"') - /* Quoted string */ - { - quoteLevel[level] = 1; - /* - * Start beyond double quote and find the end of the quoted string. - * '\' quotes the next character. - * Otherwise, matching double quote or NULL terminates the string. - * - * We use lnwsP to point to the last non-whitespace character in the - * quoted string. When we have found the end of the quoted string, - * increment lnwsP and if lnwsP < endP, write NULL into *lnwsP. - * This removes any trailing whitespace without overwriting the - * matching quote, needed later. If the quoted string was all - * whitespace, then this will write a NULL at the beginning of the - * string that will be returned -- OK. - */ - lnwsP = lineP++; /* lnwsP points to first '"' */ - curP = endP = lineP; /* other pointers point beyond */ - - while ((*endP = *curP) && (*endP != '"')) - /* haven't found matching quote yet */ - { - /* point curP to next character */ - curP++; - if ((*endP == '\\') && (*curP != NULL)) - /* shift quoted nonNULL character down and curP ahead */ - { - if (SmBehavior) - { - /* - * Check to see if this is a quoted quote - if it is - * strip off a level - if not - it's sacred leave it alone - */ - checkLev = PeekAhead((curP - 1), quoteLevel[level]); - if(checkLev > 0) - { - if(quoteLevel[level] >= checkLev) - { - if (level > 0) level--; - } - else if (level < MAX_QUOTE_DEPTH) - { - level++; - quoteLevel[level] = checkLev; - } - - for(i = 0;i < (checkLev - 2);i++) - { - *endP++ = *curP++;curP++; - } - *endP = *curP++; - } - } - else - { - *endP = *curP++; - } - } - if (isspace (*endP)) - /* whitespace character: leave lnwsP unchanged. */ - { - endP++; - } - else - /* non-whitespace character: point lnwsP to it. */ - { - lnwsP = endP++; - } - } -#endif /* MULTIBYTE */ /* * Found matching quote or NULL. @@ -667,7 +552,6 @@ _DtWmParseNextTokenC ( */ curP = endP = lineP; -#ifdef MULTIBYTE while ((*endP = *curP) && ((chlen = mblen ((char *)curP, MB_CUR_MAX)) > 0) && ((chlen > 1) || (!isspace (*curP) && @@ -696,20 +580,6 @@ _DtWmParseNextTokenC ( } } } -#else /* MULTIBYTE */ - while ((*endP = *curP) && !isspace (*endP) && - (SmBehavior || (*endP != '#'))) - { - /* point curP to next character */ - curP++; - if ((*endP == '\\') && (*curP != '\0')) - /* shift quoted nonNULL character down and curP ahead */ - { - *endP = *curP++; - } - endP++; - } -#endif /* MULTIBYTE */ } /* @@ -1040,14 +910,11 @@ _DtWmParseNextLine ( register unsigned char *string; int len; - -#ifdef MULTIBYTE int chlen; wchar_t last; wchar_t wdelim; char delim; int lastlen; -#endif if (cfileP != NULL) /* read fopened file */ @@ -1067,7 +934,6 @@ _DtWmParseNextLine ( (pWmPB->cLineSize)); } #endif /* PARSE_LIB */ -#ifndef NO_MULTIBYTE lastlen = 0; while (*string && @@ -1099,21 +965,6 @@ _DtWmParseNextLine ( while (lastlen == 1 && last == wdelim); } string = line; -#else - len = strlen((char *)string) - 2; - if ((len > 0) && string[len] == '\\') - { - do { - string = &string[len]; - if (fgets((char *)string, - MAXLINE - (string-line), cfileP) == NULL) - break; - len = strlen((char *)string) - 2; - linec++; - } while ((len >= 0) && string[len] == '\\'); - string = line; - } -#endif } } else if ((parseP != NULL) && (*parseP != '\0')) @@ -1132,7 +983,7 @@ _DtWmParseNextLine ( } #endif /* PARSE_LIB */ string = line; -#ifdef MULTIBYTE + while ((*parseP != '\0') && ((chlen = mblen ((char *)parseP, MB_CUR_MAX)) != 0) && (*parseP != '\n')) @@ -1148,13 +999,6 @@ _DtWmParseNextLine ( } } } -#else - while ((*parseP != '\0') && (*parseP != '\n')) - /* copy all but end-of-line and newlines to line buffer */ - { - *(string++) = *(parseP++); - } -#endif *string = '\0'; if (*parseP == '\n') { @@ -1255,19 +1099,12 @@ _DtWmParseNextChar ( unsigned char *pch = NULL; int chlen; -#ifdef MULTIBYTE if (pWmPB && pWmPB->pchNext && (chlen = mblen((char *)pWmPB->pchNext, MB_CUR_MAX) > 0)) { pch = (pWmPB->pchNext += chlen); } -#else /* MULTIBYTE */ - if (pWmPB && pWmPB->pchNext && *pWmPB->pchNext) - { - pch = ++pWmPB->pchNext; - } -#endif /* MULTIBYTE */ return (pch); } @@ -1341,7 +1178,6 @@ _DtWmParseLineNumber ( void _DtWmParseToLower (char *string) { char *pch = string; -#ifdef MULTIBYTE int chlen; while ((chlen = mblen (pch, MB_CUR_MAX)) > 0) @@ -1352,16 +1188,6 @@ void _DtWmParseToLower (char *string) } pch += chlen; } -#else - while (*pch != NULL) - { - if (isupper (*pch)) - { - *pch = tolower(*pch); - } - pch++; - } -#endif } /* END OF FUNCTION _DtWmParseToLower */ @@ -1400,7 +1226,6 @@ unsigned int _DtWmParsePeekAhead(unsigned char *currentChar, { Boolean done = False; unsigned int tmpLev = 1; -#ifdef MULTIBYTE unsigned int chlen; while (((chlen = mblen ((char *)currentChar, MB_CUR_MAX)) > 0) && @@ -1424,26 +1249,6 @@ unsigned int _DtWmParsePeekAhead(unsigned char *currentChar, } } } -#else - while((*currentChar != NULL) && (done == False) && - ((*currentChar == '"') || (*currentChar == '\\'))) - { - currentChar++; - if((*currentChar != NULL) && - ((*currentChar == '"') || (*currentChar == '\\'))) - { - tmpLev++; - if(*currentChar == '"') - { - done = True; - } - else - { - currentChar++; - } - } - } -#endif /*MULTIBYTE*/ /* * Figure out if this is truly a new level of nesting - else ignore it @@ -1658,11 +1463,7 @@ _DtWmParseExpandEnvironmentVariables ( ) { -#ifdef MULTIBYTE int chlen; -#else /* MULTIBYTE */ - int chlen = 1; /* length of character is always '1' */ -#endif /* MULTIBYTE */ unsigned char *pchStart; unsigned char chSave; unsigned char *pchEnvStart; @@ -1699,9 +1500,7 @@ _DtWmParseExpandEnvironmentVariables ( pchStart = pch; lenOriginal = strlen ((char *)pch); -#ifdef MULTIBYTE chlen = mblen ((char *)pch, MB_CUR_MAX); -#endif /* MULTIBYTE */ chSave = '\0'; while (*pch && (chlen > 0)) @@ -1732,18 +1531,14 @@ _DtWmParseExpandEnvironmentVariables ( * The next character is "escaped", skip over it. */ pchStart = pch += chlen; -#ifdef MULTIBYTE chlen = mblen ((char *)pch, MB_CUR_MAX); -#endif /* MULTIBYTE */ break; case DTWM_CHAR_ENVIRONMENT: /* save start of environment variable */ pchEnvStart = pch; pch += chlen; -#ifdef MULTIBYTE chlen = mblen ((char *)pch, MB_CUR_MAX); -#endif /* MULTIBYTE */ /* * Copy up to start of environment variable @@ -1773,9 +1568,7 @@ _DtWmParseExpandEnvironmentVariables ( (*pch == DTWM_CHAR_L_PAREN)) { pch += chlen; -#ifdef MULTIBYTE chlen = mblen ((char *)pch, MB_CUR_MAX); -#endif /* MULTIBYTE */ pchBreak = pchParenBrk; bEatBreak = True; } @@ -1783,9 +1576,7 @@ _DtWmParseExpandEnvironmentVariables ( (*pch == DTWM_CHAR_L_BRACE)) { pch += chlen; -#ifdef MULTIBYTE chlen = mblen ((char *)pch, MB_CUR_MAX); -#endif /* MULTIBYTE */ pchBreak = pchBraceBrk; bEatBreak = True; } @@ -1867,16 +1658,12 @@ _DtWmParseExpandEnvironmentVariables ( */ if (bEatBreak) { -#ifdef MULTIBYTE chlen = mblen ((char *)pchNext, MB_CUR_MAX); -#endif /* MULTIBYTE */ pchNext += chlen; } } pchStart = pch = pchNext; -#ifdef MULTIBYTE chlen = mblen ((char *)pch, MB_CUR_MAX); -#endif /* MULTIBYTE */ /* * We're already pointing at the next character * to process, don't advance again! @@ -1897,18 +1684,14 @@ _DtWmParseExpandEnvironmentVariables ( if (!bAlreadyAdvanced) { pch += chlen; -#ifdef MULTIBYTE chlen = mblen ((char *)pch, MB_CUR_MAX); -#endif /* MULTIBYTE */ } } -#ifdef MULTIBYTE else { pch += chlen; chlen = mblen ((char *)pch, MB_CUR_MAX); } -#endif /* MULTIBYTE */ } if (pchReturn && *pchStart) @@ -1956,9 +1739,7 @@ _DtWmParseMakeQuotedString (unsigned char *pchLine) int iLen0, iLen1; int cSpecial; int i,j; -#ifdef MULTIBYTE int chlen; -#endif iLen0 = strlen ((char *)pchLine); iLen1 = iLen0 + 2; /* for starting, ending quotes */ @@ -1968,7 +1749,6 @@ _DtWmParseMakeQuotedString (unsigned char *pchLine) /* * Count special chars to get estimate of new length */ -#ifdef MULTIBYTE chlen = mblen ((char *) &pchLine[i], MB_CUR_MAX); if ((chlen == 1) && ((pchLine[i] == '\\') || @@ -1984,13 +1764,6 @@ _DtWmParseMakeQuotedString (unsigned char *pchLine) { i += chlen-1; } -#else /* MULTIBYTE */ - if ((pchLine[i] == '\\') || - (pchLine[i] == '"')) - { - iLen1++; - } -#endif /* MULTIBYTE */ } pchRet = (unsigned char *) XtMalloc (1+iLen1); @@ -2003,7 +1776,6 @@ _DtWmParseMakeQuotedString (unsigned char *pchLine) */ for (i=0, j=1; i < iLen0; i++, j++) { -#ifdef MULTIBYTE chlen = mblen ((char *) &pchLine[i], MB_CUR_MAX); if ((chlen == 1) && ((pchLine[i] == '\\') || @@ -2022,14 +1794,6 @@ _DtWmParseMakeQuotedString (unsigned char *pchLine) pchRet[j++] = pchLine[i++]; chlen--; } -#else /* MULTIBYTE */ - if ((pchLine[i] == '\\') || - (pchLine[i] == '"')) - { - /* quote next char */ - pchRet[j++] = '\\'; - } -#endif /* MULTIBYTE */ /* copy char */ pchRet[j] = pchLine[i]; } diff --git a/cde/programs/dtwm/WmResCvt.c b/cde/programs/dtwm/WmResCvt.c index 7253828e..c136c315 100644 --- a/cde/programs/dtwm/WmResCvt.c +++ b/cde/programs/dtwm/WmResCvt.c @@ -39,9 +39,7 @@ #include #include -#ifndef NO_MULTIBYTE #include -#endif #include @@ -1501,7 +1499,6 @@ unsigned char *NextToken (unsigned char *pchIn, int *pLen, unsigned char *pchR = pchIn; register int i; -#ifndef NO_MULTIBYTE register int chlen; for (i = 0; @@ -1516,13 +1513,6 @@ unsigned char *NextToken (unsigned char *pchIn, int *pLen, pchIn += chlen; } -#else - for (i = 0; *pchIn && !isspace (*pchIn); i++, pchIn++) - /* find end of word */ - { - } -#endif - /* skip to next word */ ScanWhitespace (&pchIn); @@ -1571,7 +1561,6 @@ unsigned char *NextToken (unsigned char *pchIn, int *pLen, Boolean StringsAreEqual (unsigned char *pch1, unsigned char *pch2, int len) { -#ifndef NO_MULTIBYTE int chlen1; int chlen2; wchar_t wch1; @@ -1603,15 +1592,6 @@ Boolean StringsAreEqual (unsigned char *pch1, unsigned char *pch2, int len) len--; } -#else - while (len && *pch1 && *pch2 && - ((isupper (*pch1) ? tolower(*pch1++) : *pch1++) == - (isupper (*pch2) ? tolower(*pch2++) : *pch2++))) - { - len--; - } -#endif - return (len == 0); } /* END OF StringsAreEqual */ @@ -1653,26 +1633,16 @@ long DecStrToL (unsigned char *str, unsigned char **ptr) long val = 0; *ptr = str; -#ifndef NO_MULTIBYTE while ((mblen ((char *)str, MB_CUR_MAX) == 1) && isspace (*str)) -#else - while (isspace (*str)) -#endif /* Ignore leading whitespace */ { str++; } /* If we can start, we will reset *ptr */ -#ifndef NO_MULTIBYTE if ((mblen ((char *)str, MB_CUR_MAX) == 1) && isdigit (*str)) { while ((mblen ((char *)str, MB_CUR_MAX) == 1) && isdigit (*str)) -#else - if (isdigit (*str)) - { - while (isdigit (*str)) -#endif { val = val * 10 + (*str - '0'); str++; diff --git a/cde/programs/dtwm/WmResParse.c b/cde/programs/dtwm/WmResParse.c index 22207f3c..12274bea 100644 --- a/cde/programs/dtwm/WmResParse.c +++ b/cde/programs/dtwm/WmResParse.c @@ -66,9 +66,7 @@ #include -#ifndef NO_MULTIBYTE #include -#endif #include /* for XmeGetHomeDirName */ #include @@ -1483,7 +1481,6 @@ unsigned int PeekAhead(unsigned char *currentChar, { Boolean done = False; unsigned int tmpLev = 1; -#ifndef NO_MULTIBYTE unsigned int chlen; while (((chlen = mblen ((char *)currentChar, MB_CUR_MAX)) > 0) && @@ -1506,26 +1503,6 @@ unsigned int PeekAhead(unsigned char *currentChar, } } } -#else - while((*currentChar != NULL) && (done == False) && - ((*currentChar == '"') || (*currentChar == '\\'))) - { - currentChar++; - if((*currentChar != NULL) && - ((*currentChar == '"') || (*currentChar == '\\'))) - { - tmpLev++; - if(*currentChar == '"') - { - done = True; - } - else - { - currentChar++; - } - } - } -#endif /*NO_MULTIBYTE*/ /* * Figure out if this is truly a new level of nesting - else ignore it @@ -2708,7 +2685,6 @@ static void ParseWmMnemonic (unsigned char **linePP, MenuItem *menuItem) lineP++; mnemonic = GetString(&lineP); -#ifndef NO_MULTIBYTE if (menuItem->labelType == XmSTRING && mnemonic != NULL && (ks = XStringToKeysym((char *)mnemonic)) != NoSymbol && @@ -2716,16 +2692,6 @@ static void ParseWmMnemonic (unsigned char **linePP, MenuItem *menuItem) { menuItem->mnemonic = ks; } -#else - if ((mnemonic != NULL) && - (*mnemonic != '\0') && - (menuItem->labelType == XmSTRING) && - (strchr (menuItem->label, *mnemonic) != NULL)) - /* valid mnemonic */ - { - menuItem->mnemonic = *mnemonic; - } -#endif else { PWarning (((char *)GETMESSAGE(60, 14, "Invalid mnemonic specification"))); @@ -3102,13 +3068,11 @@ Boolean ParseWmFuncStrArg (unsigned char **linePP, { unsigned char *string; unsigned int len; -#ifndef NO_MULTIBYTE char *p; wchar_t last; char delim; wchar_t wdelim; int lastlen; -#endif if ((string = GetString (linePP)) != NULL) /* nonNULL string argument */ @@ -3125,7 +3089,6 @@ Boolean ParseWmFuncStrArg (unsigned char **linePP, * Insure that an argument for F_Exec ends in '&' . */ -#ifndef NO_MULTIBYTE if (wmFunction == F_Exec) { lastlen = 0; @@ -3145,13 +3108,6 @@ Boolean ParseWmFuncStrArg (unsigned char **linePP, *p = '\0'; } } -#else - if ((wmFunction == F_Exec) && ((*pArgs)[len - 1] != '&')) - { - (*pArgs)[len] = '&'; - (*pArgs)[len + 1] = '\0'; - } -#endif } else /* NULL string argument */ @@ -4576,14 +4532,11 @@ static Boolean ParseKeySym (unsigned char **linePP, unsigned int closure, unsigned char *startP; char keySymName[MAX_KEYSYM_STRLEN+1]; int len; -#ifndef NO_MULTIBYTE int chlen; -#endif ScanWhitespace (&lineP); startP = lineP; -#ifndef NO_MULTIBYTE while (*lineP && ((chlen = mblen ((char *)lineP, MB_CUR_MAX)) > 0) && ((chlen > 1) || @@ -4592,24 +4545,13 @@ static Boolean ParseKeySym (unsigned char **linePP, unsigned int closure, /* Skip next character */ lineP += chlen; } -#else - while (*lineP && !isspace (*lineP) && *lineP != ',' && *lineP != ':' ) - { - /* Skip next character */ - lineP++; - } -#endif len = min (lineP - startP, MAX_KEYSYM_STRLEN); (void) strncpy (keySymName, (char *)startP, len); keySymName[len] = '\0'; -#ifndef NO_MULTIBYTE if ((*detail = XStringToKeysym(keySymName)) == NoSymbol && (mblen (keySymName, MB_CUR_MAX) == 1)) -#else - if ((*detail = XStringToKeysym(keySymName)) == NoSymbol) -#endif { if (!isdigit (keySymName[0]) || ((*detail = StrToNum ((unsigned char *)&keySymName[0])) == -1)) @@ -4811,7 +4753,6 @@ static unsigned int StrToOct(unsigned char *str) void ScanAlphanumeric (unsigned char **linePP) { -#ifndef NO_MULTIBYTE int chlen; while (*linePP && @@ -4820,13 +4761,6 @@ void ScanAlphanumeric (unsigned char **linePP) { (*linePP) += chlen; } -#else - while (*linePP && isalnum (**linePP)) - { - (*linePP)++; - } -#endif - } /* END OF FUNCTION ScanAlphanumeric */ @@ -4938,9 +4872,7 @@ static void InitKeySubs ( unsigned char *pch0; unsigned char *pch1; int len; -#ifndef NO_MULTIBYTE int chlen; -#endif pch0 = (unsigned char *)GETMESSAGE(60, 40, ""); @@ -4975,7 +4907,6 @@ static void InitKeySubs ( /* get "from" string */ pch1 = pch0; -#ifndef NO_MULTIBYTE while (*pch1 && ((chlen = mblen ((char *)pch1, MB_CUR_MAX)) > 0)) { if ((chlen == 1) && (*pch1 == ' ')) @@ -4984,9 +4915,6 @@ static void InitKeySubs ( } pch1 += chlen; } -#else /* NO_MULTIBYTE */ - while (*pch1 && (*pch1 != ' ')) pch1++; -#endif /* NO_MULTIBYTE */ pKS->lenFrom = pch1 - pch0; if (pKS->lenFrom < 1) { @@ -5003,7 +4931,6 @@ static void InitKeySubs ( ScanWhitespace (&pch1); pch0 = pch1; -#ifndef NO_MULTIBYTE while (*pch1 && ((chlen = mblen ((char *)pch1, MB_CUR_MAX)) > 0)) { if ((chlen == 1) && (*pch1 == ' ')) @@ -5012,9 +4939,6 @@ static void InitKeySubs ( } pch1 += chlen; } -#else /* NO_MULTIBYTE */ - while (*pch1 && (*pch1 != ' ')) pch1++; -#endif /* NO_MULTIBYTE */ len = pch1 - pch0; if (len < 1) @@ -5070,9 +4994,7 @@ static void InitKeySubs ( static void ProcessAccelText (unsigned char *startP, unsigned char *endP, unsigned char *destP) { -#ifndef NO_MULTIBYTE int chlen; -#endif static Boolean bAccelInit = False; static KeySub *pKeySub; static int numKeySubs; @@ -5101,7 +5023,6 @@ static void ProcessAccelText (unsigned char *startP, unsigned char *endP, } pchFirst = startP; -#ifndef NO_MULTIBYTE while (*startP && (((chlen = mblen ((char *)startP, MB_CUR_MAX)) > 1) || isalnum (*startP))) @@ -5111,12 +5032,7 @@ static void ProcessAccelText (unsigned char *startP, unsigned char *endP, startP++; } } -#else - while (isalnum (*startP)) - { - startP++; - } -#endif + /* find substitution */ pchSub = NULL; lenSub = 0; @@ -5155,11 +5071,7 @@ static void ProcessAccelText (unsigned char *startP, unsigned char *endP, startP++; /* skip '<' */ while (*startP != '>') { -#ifndef NO_MULTIBYTE startP += mblen ((char *)startP, MB_CUR_MAX); -#else - startP++; -#endif } startP++; /* skip '>' */ diff --git a/cde/programs/dtwm/WmResource.c b/cde/programs/dtwm/WmResource.c index becbd372..e414e58a 100644 --- a/cde/programs/dtwm/WmResource.c +++ b/cde/programs/dtwm/WmResource.c @@ -4340,13 +4340,11 @@ MakeAppearanceResources (WmScreenData *pSD, AppearanceData *pAData, Boolean make #endif } else { /* got default font successfully, hack was not needed */ -#ifndef NO_MULTIBYTE /* * Calculate title bar's height (using selected font) and store it in pAData. */ pAData->titleHeight = (pAData->font)->ascent + (pAData->font)->descent + WM_TITLE_BAR_PADDING; -#endif } -- 2.25.1