diff options
author | Taylor R Campbell <riastradh@netbsd.org> | 2022-04-04 14:53:48 +0200 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-05-07 18:09:36 +0000 |
commit | 01c0b0365a50a08e69dffe3c63ac62343560b26c (patch) | |
tree | 1b9d75ed332d956f7cd8daf62a2ec0e2d3461076 | |
parent | 794367d1ac396842c0213064ebcfe1f4e2219657 (diff) | |
download | xorg-lib-libXaw-01c0b0365a50a08e69dffe3c63ac62343560b26c.tar.gz |
Fix ctype(3) users.
The API requires "unsigned char" arguments.
Signed-off-by: Thomas Klausner <tk@giga.or.at>
-rw-r--r-- | src/AsciiSrc.c | 8 | ||||
-rw-r--r-- | src/DisplayList.c | 2 | ||||
-rw-r--r-- | src/Panner.c | 6 | ||||
-rw-r--r-- | src/TextAction.c | 8 | ||||
-rw-r--r-- | src/TextSink.c | 2 | ||||
-rw-r--r-- | src/XawIm.c | 8 |
6 files changed, 17 insertions, 17 deletions
diff --git a/src/AsciiSrc.c b/src/AsciiSrc.c index 75ce714..7833514 100644 --- a/src/AsciiSrc.c +++ b/src/AsciiSrc.c @@ -857,8 +857,8 @@ Search(Widget w, register XawTextPosition position, XawTextScanDirection dir, /*CONSTCOND*/ while (1) { if (*ptr++ == c - || (case_sensitive && isalpha(c) && isalpha(ptr[-1]) - && toupper(c) == toupper(ptr[-1]))) { + || (case_sensitive && isalpha((unsigned char)c) && isalpha((unsigned char)ptr[-1]) + && toupper((unsigned char)c) == toupper((unsigned char)ptr[-1]))) { if (++count == text->length) break; c = *++str; @@ -904,8 +904,8 @@ Search(Widget w, register XawTextPosition position, XawTextScanDirection dir, /*CONSTCOND*/ while (1) { if (*ptr-- == c - || (case_sensitive && isalpha(c) && isalpha(ptr[1]) - && toupper(c) == toupper(ptr[1]))) { + || (case_sensitive && isalpha((unsigned char)c) && isalpha((unsigned char)ptr[1]) + && toupper((unsigned char)c) == toupper((unsigned char)ptr[1]))) { if (++count == text->length) break; c = *--str; diff --git a/src/DisplayList.c b/src/DisplayList.c index 1c79035..ae5e7c6 100644 --- a/src/DisplayList.c +++ b/src/DisplayList.c @@ -1941,7 +1941,7 @@ _Xaw_Xlib_ArgsInitProc(String proc_name, String *params, Cardinal *num_params, case EXPOSURES: if (*num_params == 1) { - if (isdigit(params[0][0]) || params[0][0] == '+' || params[0][0] == '-') + if (isdigit((unsigned char)params[0][0]) || params[0][0] == '+' || params[0][0] == '-') retval = (void *)read_int((char *)params[0], NULL); else if (XmuCompareISOLatin1(params[0], "true") == 0 || XmuCompareISOLatin1(params[0], "on") == 0) diff --git a/src/Panner.c b/src/Panner.c index eada8f9..9f32620 100644 --- a/src/Panner.c +++ b/src/Panner.c @@ -575,7 +575,7 @@ parse_page_string(String s, int pagesize, int canvassize, Bool *relative) /* * syntax: spaces [+-] number spaces [pc\0] spaces */ - for (; isascii(*s) && isspace(*s); s++) /* skip white space */ + for (; isascii((unsigned char)*s) && isspace((unsigned char)*s); s++) /* skip white space */ ; if (*s == '+' || *s == '-') { /* deal with signs */ @@ -590,12 +590,12 @@ parse_page_string(String s, int pagesize, int canvassize, Bool *relative) } /* skip over numbers */ - for (cp = s; isascii(*s) && (isdigit(*s) || *s == '.'); s++) + for (cp = s; isascii((unsigned char)*s) && (isdigit((unsigned char)*s) || *s == '.'); s++) ; val *= atof(cp); /* skip blanks */ - for (; isascii(*s) && isspace(*s); s++) + for (; isascii((unsigned char)*s) && isspace((unsigned char)*s); s++) ; if (*s) { /* if units */ diff --git a/src/TextAction.c b/src/TextAction.c index aabeffd..88bf202 100644 --- a/src/TextAction.c +++ b/src/TextAction.c @@ -2607,7 +2607,7 @@ InsertNewLineAndIndent(Widget w, XEvent *event, String *p _X_UNUSED, Cardinal *n strcpy(++ptr, line_to_ip); length++; - while (length && (isspace(*ptr) || (*ptr == XawTAB))) + while (length && (isspace((unsigned char)*ptr) || (*ptr == XawTAB))) ptr++, length--; *ptr = '\0'; text.length = (int)strlen(text.ptr); @@ -3393,7 +3393,7 @@ Numeric(Widget w, XEvent *event, String *params, Cardinal *num_params) long mult = ctx->text.mult; if (*num_params != 1 || strlen(params[0]) != 1 - || (!isdigit(params[0][0]) + || (!isdigit((unsigned char)params[0][0]) && (params[0][0] != '-' || mult != 0))) { char err_buf[256]; @@ -3591,7 +3591,7 @@ StripOutOldCRs(TextWidget ctx, XawTextPosition from, XawTextPosition to, if (!iswspace(((wchar_t*)buf)[i]) || ((periodPos + i) >= to)) break; } - else if (!isspace(buf[i]) || (periodPos + i) >= to) + else if (!isspace((unsigned char)buf[i]) || (periodPos + i) >= to) break; XtFree(buf); @@ -3681,7 +3681,7 @@ InsertNewCRs(TextWidget ctx, XawTextPosition from, XawTextPosition to, if (!iswspace(((wchar_t*)buf)[i])) break; } - else if (!isspace(buf[i])) + else if (!isspace((unsigned char)buf[i])) break; to -= (i - 1); diff --git a/src/TextSink.c b/src/TextSink.c index 40442e9..d9e3f7b 100644 --- a/src/TextSink.c +++ b/src/TextSink.c @@ -1251,7 +1251,7 @@ _XawTextSinkAddProperty(XawTextPropertyList *list, XawTextProperty *property, weight = asterisk; if (property->slant != NULLQUARK) { slant = XrmQuarkToString(property->slant); - if (toupper(*slant) != 'R') + if (toupper((unsigned char)*slant) != 'R') slant = asterisk; /* X defaults to italics, so, don't care in resolving between `I' and `O' */ } diff --git a/src/XawIm.c b/src/XawIm.c index db0f3e8..ebc5ede 100644 --- a/src/XawIm.c +++ b/src/XawIm.c @@ -472,14 +472,14 @@ OpenIM(XawVendorShellExtPart *ve) for(ns=s=ve->im.input_method; ns && *s;) { /* skip any leading blanks */ - while (*s && isspace(*s)) s++; + while (*s && isspace((unsigned char)*s)) s++; if (!*s) break; if ((ns = end = strchr(s, ',')) == NULL) end = s + strlen(s); /* If there is a spurious comma end can be the same as s */ if (end > s) { /* strip any trailing blanks */ - while (isspace(*(end - 1))) end--; + while (isspace((unsigned char)*(end - 1))) end--; strcpy (pbuf, "@im="); strncat (pbuf, s, (size_t)(end - s)); @@ -514,14 +514,14 @@ OpenIM(XawVendorShellExtPart *ve) } found = False; for(ns = s = ve->im.preedit_type; s && !found;) { - while (*s && isspace(*s)) s++; + while (*s && isspace((unsigned char)*s)) s++; if (!*s) break; if ((ns = end = strchr(s, ',')) == NULL) end = s + strlen(s); else ns++; if (end > s) - while (isspace(*(end - 1))) end--; + while (isspace((unsigned char)*(end - 1))) end--; if (!strncmp(s, "OverTheSpot", (size_t)(end - s))) { input_style = (XIMPreeditPosition | XIMStatusArea); |