diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2023-07-03 11:30:15 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2023-07-03 11:30:15 +0000 |
commit | 5ca62157fcee28e57e23a067b1587d754d9a0cf9 (patch) | |
tree | 0aa33e51a6eb4c9327b1cf0460127ab27afc495b /lib/libXaw/src | |
parent | 9f43921a41ec8743591be302cad954879804774e (diff) |
Update libXaw to version 1.0.15
Diffstat (limited to 'lib/libXaw/src')
28 files changed, 134 insertions, 131 deletions
diff --git a/lib/libXaw/src/Actions.c b/lib/libXaw/src/Actions.c index eceb1f92e..ae330d5b2 100644 --- a/lib/libXaw/src/Actions.c +++ b/lib/libXaw/src/Actions.c @@ -149,7 +149,7 @@ static Cardinal num_variable_list; * Start of Boolean Expression Evaluation Implementation Code */ Bool -XawParseBoolean(Widget w, String param, XEvent *event, Bool *succed) +XawParseBoolean(Widget w, String param, XEvent *event, Bool *succeed) { char *tmp = (char *)param; int value; @@ -179,7 +179,7 @@ XawParseBoolean(Widget w, String param, XEvent *event, Bool *succed) else if (XmuCompareISOLatin1(param, "faked") == 0) return (event->xany.send_event != 0); else - *succed = False; + *succeed = False; return (False); } @@ -246,7 +246,7 @@ get_token(XawEvalInfo *info) /* It's a symbol name, resolve it. */ if (ch == XAW_PRIV_VAR_PREFIX || isalnum(ch) || ch == '_' || ch == '\\') { - Bool succed = True; + Bool succeed = True; p = info->cp - 1; @@ -262,13 +262,13 @@ get_token(XawEvalInfo *info) String value = XawConvertActionVar(info->vlist, name); info->value = info->parse_proc(info->widget, value, info->event, - &succed) & 1; + &succeed) & 1; } else { info->value = info->parse_proc(info->widget, name, info->event, - &succed) & 1; - if (!succed) + &succeed) & 1; + if (!succeed) { String value = XawConvertActionRes(info->rlist, info->widget, @@ -276,18 +276,18 @@ get_token(XawEvalInfo *info) /* '\\' may have been used to escape a resource name. */ - succed = True; + succeed = True; info->value = info->parse_proc(info->widget, value, info->event, - &succed) & 1; - if (!succed) + &succeed) & 1; + if (!succeed) { /* not a numeric value or boolean string */ info->value = True; - succed = True; + succeed = True; } } } - if (succed) + if (succeed) return (info->token = BOOLEAN); } else if (ch == '\0') diff --git a/lib/libXaw/src/AsciiSink.c b/lib/libXaw/src/AsciiSink.c index af715f00b..29850ba33 100644 --- a/lib/libXaw/src/AsciiSink.c +++ b/lib/libXaw/src/AsciiSink.c @@ -1878,7 +1878,7 @@ MaxLines(Widget w, unsigned int height) * lines - number of lines * * Description: - * Finds the Minium height that will contain a given number lines. + * Finds the Minimum height that will contain a given number lines. * * Returns: * the height diff --git a/lib/libXaw/src/AsciiSrc.c b/lib/libXaw/src/AsciiSrc.c index 875b97c6c..78335144c 100644 --- a/lib/libXaw/src/AsciiSrc.c +++ b/lib/libXaw/src/AsciiSrc.c @@ -336,7 +336,7 @@ XawAsciiSrcInitialize(Widget request _X_UNUSED, Widget cnew, * * Parameters: * w - AsciiSource widget - * pos - position of the text to retreive. + * pos - position of the text to retrieve. * text - text block that will contain returned text * length - maximum number of characters to read * @@ -618,7 +618,7 @@ ReplaceText(Widget w, XawTextPosition startPos, XawTextPosition endPos, * position - position to start scanning * type - type of thing to scan for * dir - direction to scan - * count - which occurance if this thing to search for. + * count - which occurrence if this thing to search for. * include - whether or not to include the character found in * the position that is returned * @@ -746,7 +746,7 @@ Scan(Widget w, register XawTextPosition position, XawTextScanType type, while (True) { if (ptr < lim) { piece = piece->prev; - if (piece == NULL) /* Begining of text */ + if (piece == NULL) /* Beginning of text */ return (0); ptr = piece->text + piece->used - 1; lim = piece->text; @@ -821,7 +821,7 @@ Scan(Widget w, register XawTextPosition position, XawTextScanType type, * text - text block to search for * * Description: - * Searchs the text source for the text block passed. + * Searches the text source for the text block passed. * * Returns: * The position of the item found @@ -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; @@ -1046,7 +1046,7 @@ XawAsciiSrcGetValuesHook(Widget w, ArgList args, Cardinal *num_args) if (streq(args[i].name, XtNstring)) { if (src->ascii_src.use_string_in_place) *((char **)args[i].value) = src->ascii_src.first_piece->text; - else if (XawAsciiSave(w)) /* If save sucessful */ + else if (XawAsciiSave(w)) /* If save successful */ *((char **)args[i].value) = src->ascii_src.string; break; } @@ -1181,7 +1181,7 @@ XawAsciiSave(Widget w) * Save the current buffer as a file. * * Returns: - * True if the save was sucessful + * True if the save was successful */ Bool XawAsciiSaveAsFile(Widget w, _Xconst char *name) @@ -1270,10 +1270,10 @@ RemoveOldStringOrFile(AsciiSrcObject src, Bool checkString) * name - the name of the file * * Description: - * Write the string specified to the begining of the file specified. + * Write the string specified to the beginning of the file specified. * * Returns: - * returns True if sucessful, False otherwise + * returns True if successful, False otherwise */ static Bool WriteToFile(String string, String name, unsigned length) @@ -1308,7 +1308,7 @@ WriteToFile(String string, String name, unsigned length) * what can be useful when editing very large files. * * Returns: - * returns True if sucessful, False otherwise + * returns True if successful, False otherwise */ static Bool WritePiecesToFile(AsciiSrcObject src, String name) @@ -1790,7 +1790,7 @@ GetDefaultPieceSize(Widget w _X_UNUSED, int offset _X_UNUSED, XrmValue *value) #ifdef ASCII_STRING /* - * Compatability functions. + * Compatibility functions. */ /* * Function: diff --git a/lib/libXaw/src/Box.c b/lib/libXaw/src/Box.c index 2a1bc688e..4f759c5f1 100644 --- a/lib/libXaw/src/Box.c +++ b/lib/libXaw/src/Box.c @@ -436,7 +436,7 @@ XawBoxResize(Widget w) /* * Try to do a new layout within the current width and height; - * if that fails try to resize and do it within the box returne + * if that fails try to resize and do it within the box returned * by XawBoxQueryGeometry * * TryNewLayout just says if it's possible, and doesn't actually move the kids @@ -533,7 +533,7 @@ XawBoxGeometryManager(Widget w, XtWidgetGeometry *request, || ((request->request_mode & CWY) && request->y != XtY(w))) return (XtGeometryNo); - /* Size changes must see if the new size can be accomodated */ + /* Size changes must see if the new size can be accommodated */ if (request->request_mode & (CWWidth | CWHeight | CWBorderWidth)) { /* Make all three fields in the request valid */ if ((request->request_mode & CWWidth) == 0) diff --git a/lib/libXaw/src/Converters.c b/lib/libXaw/src/Converters.c index cc3efcbb0..a818e332f 100644 --- a/lib/libXaw/src/Converters.c +++ b/lib/libXaw/src/Converters.c @@ -154,7 +154,7 @@ XawInitializeDefaultConverters(void) first_time = False; - /* Replace with more apropriate converters */ + /* Replace with more appropriate converters */ XtSetTypeConverter(XtRCallback, XtRString, _XawCvtCARD32ToString, NULL, 0, XtCacheNone, NULL); XtSetTypeConverter(XtRColormap, XtRString, _XawCvtCARD32ToString, diff --git a/lib/libXaw/src/DisplayList.c b/lib/libXaw/src/DisplayList.c index 540cc1e78..ae5e7c6dc 100644 --- a/lib/libXaw/src/DisplayList.c +++ b/lib/libXaw/src/DisplayList.c @@ -494,7 +494,7 @@ XawDestroyDisplayList(_XawDisplayList *dlist) /********************************************************************** * If you want to implement your own class of procedures, look at - * the code bellow. + * the code below. **********************************************************************/ /* Start of Implementation of class "xlib" */ typedef struct _XawXlibData { @@ -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/lib/libXaw/src/Form.c b/lib/libXaw/src/Form.c index ea33cbcf6..f673d3e6f 100644 --- a/lib/libXaw/src/Form.c +++ b/lib/libXaw/src/Form.c @@ -650,7 +650,7 @@ ResizeChildren(Widget w) if (fw->form.no_refigure) { /* - * I am changing the widget wrapper w/o modifing the window. This is + * I am changing the widget wrapper w/o modifying the window. This is * risky, but I can get away with it since I am the parent of this * widget, and he must ask me for any geometry changes * @@ -893,7 +893,7 @@ XawFormGeometryManager(Widget w, XtWidgetGeometry *request, if (fw->form.no_refigure) { /* - * I am changing the widget wrapper w/o modifing the window. + * I am changing the widget wrapper w/o modifying the window. * This is risky, but I can get away with it since I am the * parent of this widget, and he must ask me for any geometry * changes diff --git a/lib/libXaw/src/Label.c b/lib/libXaw/src/Label.c index 4c95d4261..cec1875cf 100644 --- a/lib/libXaw/src/Label.c +++ b/lib/libXaw/src/Label.c @@ -305,12 +305,12 @@ SetTextWidthAndHeight(LabelWidget lw) lw->label.label_len = 0; lw->label.label_width = 0; } - else if ((nl = index(lw->label.label, '\n')) != NULL) { + else if ((nl = strchr(lw->label.label, '\n')) != NULL) { char *label; lw->label.label_len = MULTI_LINE_LABEL; lw->label.label_width = 0; - for (label = lw->label.label; nl != NULL; nl = index(label, '\n')) { + for (label = lw->label.label; nl != NULL; nl = strchr(label, '\n')) { int width = XmbTextEscapement(fset, label, (int)(nl - label)); if (width > (int)lw->label.label_width) @@ -338,12 +338,12 @@ SetTextWidthAndHeight(LabelWidget lw) lw->label.label_len = 0; lw->label.label_width = 0; } - else if ((nl = index(lw->label.label, '\n')) != NULL) { + else if ((nl = strchr(lw->label.label, '\n')) != NULL) { char *label; lw->label.label_len = MULTI_LINE_LABEL; lw->label.label_width = 0; - for (label = lw->label.label; nl != NULL; nl = index(label, '\n')) { + for (label = lw->label.label; nl != NULL; nl = strchr(label, '\n')) { int width; if (lw->label.encoding) @@ -537,7 +537,7 @@ XawLabelRedisplay(Widget gw, XEvent *event, Region region) if (len == MULTI_LINE_LABEL) { char *nl; - while ((nl = index(label, '\n')) != NULL) { + while ((nl = strchr(label, '\n')) != NULL) { XmbDrawString(XtDisplay(w), XtWindow(w), w->label.fontset, gc, w->label.label_x, ksy, label, (int)(nl - label)); @@ -554,7 +554,7 @@ XawLabelRedisplay(Widget gw, XEvent *event, Region region) if (len == MULTI_LINE_LABEL) { char *nl; - while ((nl = index(label, '\n')) != NULL) { + while ((nl = strchr(label, '\n')) != NULL) { if (w->label.encoding) XDrawString16(XtDisplay(gw), XtWindow(gw), gc, w->label.label_x, y, diff --git a/lib/libXaw/src/List.c b/lib/libXaw/src/List.c index a68a7bdd0..de765974f 100644 --- a/lib/libXaw/src/List.c +++ b/lib/libXaw/src/List.c @@ -455,11 +455,11 @@ ChangeSize(Widget w, unsigned int width, unsigned int height) Layout(w, False, False, &request.width, &request.height); request.request_mode = CWWidth | CWHeight; XtMakeGeometryRequest(w, &request, &reply); - /*FALLTROUGH*/ + /*FALLTHROUGH*/ default: break; } - /*FALLTROUGH*/ + /*FALLTHROUGH*/ default: break; } diff --git a/lib/libXaw/src/Makefile.in b/lib/libXaw/src/Makefile.in index 65e499ec5..28caee936 100644 --- a/lib/libXaw/src/Makefile.in +++ b/lib/libXaw/src/Makefile.in @@ -232,7 +232,6 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHANGELOG_CMD = @CHANGELOG_CMD@ -CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CWARNFLAGS = @CWARNFLAGS@ CYGPATH_W = @CYGPATH_W@ diff --git a/lib/libXaw/src/MultiSink.c b/lib/libXaw/src/MultiSink.c index 3e9a6f379..c9d51690a 100644 --- a/lib/libXaw/src/MultiSink.c +++ b/lib/libXaw/src/MultiSink.c @@ -880,7 +880,7 @@ MaxLines(Widget w, unsigned int height) * lines - number of lines * * Description: - * Finds the Minium height that will contain a given number lines. + * Finds the Minimum height that will contain a given number lines. * Returns: * The height */ diff --git a/lib/libXaw/src/MultiSrc.c b/lib/libXaw/src/MultiSrc.c index b4a123c14..a9e84baee 100644 --- a/lib/libXaw/src/MultiSrc.c +++ b/lib/libXaw/src/MultiSrc.c @@ -515,8 +515,8 @@ ReplaceText(Widget w, XawTextPosition startPos, XawTextPosition endPos, * position - position to start scanning * type - type of thing to scan for * dir - direction to scan - * count - which occurance if this thing to search for - * include - whether or not to include the character found in + * count - which occurrence of this thing to search for + * include - whether or not to include the character found in * the position that is returned * * Description: @@ -526,8 +526,8 @@ ReplaceText(Widget w, XawTextPosition startPos, XawTextPosition endPos, * The position of the item found * * Note: - * While there are only 'n' characters in the file there are n+1 - * possible cursor positions (one before the first character and + * While there are only 'n' characters in the file there are n+1 + * possible cursor positions (one before the first character and * one after the last character */ static XawTextPosition @@ -584,7 +584,7 @@ Scan(Widget w, register XawTextPosition position, XawTextScanType type, if (ptr < piece->text) { piece = piece->prev; - if (piece == NULL) /* Begining of text */ + if (piece == NULL) /* Beginning of text */ return (0); ptr = piece->text + piece->used - 1; c = *ptr; @@ -671,7 +671,7 @@ Scan(Widget w, register XawTextPosition position, XawTextScanType type, * text - text block to search for * * Description: - * Searchs the text source for the text block passed. + * Searches the text source for the text block passed. * * Returns: * The position of the item found @@ -708,7 +708,7 @@ Search(Widget w, register XawTextPosition position, XawTextScanDirection dir, I'm being passed a string claiming to be 8bit chars (ie, MB text.) If that is the case, naturally I convert to 32bit format */ - /*if the block was FMT8BIT, length will convert to REAL wchar count bellow */ + /*if the block was FMT8BIT, length will convert to REAL wchar count below */ wtarget_len = text->length; if (text->format == XawFmtWide) @@ -752,7 +752,7 @@ Search(Widget w, register XawTextPosition position, XawTextScanDirection dir, cnt = (int)(piece->text - ptr); piece = piece->prev; - if (piece == NULL) { /* Begining of text */ + if (piece == NULL) { /* Beginning of text */ XtFree((char *)buf); return (XawTextSearchError); } @@ -877,7 +877,7 @@ XawMultiSrcGetValuesHook(Widget w, ArgList args, Cardinal *num_args) if (src->multi_src.use_string_in_place) *((char **)args[i].value) = (char *) src->multi_src.first_piece->text; - else if (_XawMultiSave(w)) /* If save sucessful */ + else if (_XawMultiSave(w)) /* If save successful */ *((char **)args[i].value) = (char *)src->multi_src.string; break; } @@ -1025,7 +1025,7 @@ _XawMultiSave(Widget w) * Save the current buffer as a file. * * Returns: - * True if the save was sucessful + * True if the save was successful * * Note: * The public interface is XawAsciiSaveAsFile! @@ -1078,10 +1078,10 @@ RemoveOldStringOrFile(MultiSrcObject src, Bool checkString) * name - name of the file * * Description: - * Write the string specified to the begining of the file specified. + * Write the string specified to the beginning of the file specified. * * Returns: - * Returns True if sucessful, False otherwise + * Returns True if successful, False otherwise */ static Bool WriteToFile(String string, String name) diff --git a/lib/libXaw/src/Paned.c b/lib/libXaw/src/Paned.c index 1cd5e4a9f..363c9692d 100644 --- a/lib/libXaw/src/Paned.c +++ b/lib/libXaw/src/Paned.c @@ -566,7 +566,7 @@ AdjustPanedSize(PanedWidget pw, unsigned int off_size, * * 1) size < max && size > min * 2) skip adjust == False - * 3) widget not its prefered height + * 3) widget not its preferred height * && this change will bring it closer * && The user has not resized this pane. * @@ -723,7 +723,7 @@ LoopAndRefigureChildren(PanedWidget pw, int paneindex, Direction dir, * dir - AnyPane. * * If either of these is true then all panes may be resized and - * the choosing of panes procedes in reverse order starting with the + * the choosing of panes proceeds in reverse order starting with the * last child. */ static void @@ -1822,7 +1822,7 @@ XawPanedChangeManaged(Widget w) if (HasGrip(*childP)) PaneInfo(pane->grip)->position = pw->paned.num_panes; - pane->position = pw->paned.num_panes; /* TEMPORY -CDP 3/89 */ + pane->position = pw->paned.num_panes; /* TEMPORARY -CDP 3/89 */ pw->paned.num_panes++; } else diff --git a/lib/libXaw/src/Panner.c b/lib/libXaw/src/Panner.c index eada8f9f8..9f3262038 100644 --- a/lib/libXaw/src/Panner.c +++ b/lib/libXaw/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/lib/libXaw/src/Pixmap.c b/lib/libXaw/src/Pixmap.c index 9798c9c3b..7072eb3bd 100644 --- a/lib/libXaw/src/Pixmap.c +++ b/lib/libXaw/src/Pixmap.c @@ -690,6 +690,7 @@ GetResourcePixmapPath(Display *display) length = (length + (int)strlen(tok) + 3); } } + XtFree(buffer); pixmap_path = XtRealloc(pixmap_path, (Cardinal)((size_t)length + strlen(default_path) + 2)); if (length) pixmap_path[length++] = ':'; diff --git a/lib/libXaw/src/Scrollbar.c b/lib/libXaw/src/Scrollbar.c index 855013db5..5bc8db9eb 100644 --- a/lib/libXaw/src/Scrollbar.c +++ b/lib/libXaw/src/Scrollbar.c @@ -807,7 +807,7 @@ EndScroll(Widget gw, XEvent *event _X_UNUSED, String *params _X_UNUSED, Cardinal ScrollbarWidget w = (ScrollbarWidget)gw; XtVaSetValues(gw, XtNcursor, w->scrollbar.inactiveCursor, NULL); - XFlush(XtDisplay(w)); /* make sure it get propogated */ + XFlush(XtDisplay(w)); /* make sure it get propagated */ w->scrollbar.direction = 0; } diff --git a/lib/libXaw/src/SimpleMenu.c b/lib/libXaw/src/SimpleMenu.c index 89711b9a5..4ac62a57d 100644 --- a/lib/libXaw/src/SimpleMenu.c +++ b/lib/libXaw/src/SimpleMenu.c @@ -1087,7 +1087,7 @@ CreateLabel(Widget w) * about the return values, and just want a relayout. * * if this is not the case then it will set width_ret and height_ret - * to be width and height that the child would get if it were layed out + * to be width and height that the child would get if it were laid out * at this time. * * "w" can be the simple menu widget or any of its object children. @@ -1379,7 +1379,7 @@ PositionMenu(Widget w, XPoint *location) * * Description: * Actually moves the menu, may force it to - * to be fully visable if menu_on_screen is True. + * to be fully visible if menu_on_screen is True. */ static void MoveMenu(Widget w, int x, int y) diff --git a/lib/libXaw/src/Sme.c b/lib/libXaw/src/Sme.c index 7814eb8ba..6822ac9a9 100644 --- a/lib/libXaw/src/Sme.c +++ b/lib/libXaw/src/Sme.c @@ -134,7 +134,7 @@ WidgetClass smeObjectClass = (WidgetClass)&smeClassRec; * XawSmeClassPartInitialize * * Parameters: - * cclass - widget classs of this widget + * cclass - widget class of this widget * * Description: * Handles inheritance of class functions. @@ -186,7 +186,7 @@ XawSmeInitialize(Widget request _X_UNUSED, Widget cnew, * w - menu entry * * Description: - * Default highlight proceedure for menu entries. + * Default highlight procedure for menu entries. */ /*ARGSUSED*/ static void @@ -202,7 +202,7 @@ Highlight(Widget w _X_UNUSED) * w - menu entry * * Description: - * Default unhighlight proceedure for menu entries. + * Default unhighlight procedure for menu entries. */ /*ARGSUSED*/ static void @@ -218,7 +218,7 @@ Unhighlight(Widget w _X_UNUSED) * w - menu entry * * Description: - * Calls the callback proceedures for this entry. + * Calls the callback procedures for this entry. */ static void Notify(Widget w) diff --git a/lib/libXaw/src/StripChart.c b/lib/libXaw/src/StripChart.c index 96ae48dbc..942a7d51a 100644 --- a/lib/libXaw/src/StripChart.c +++ b/lib/libXaw/src/StripChart.c @@ -297,7 +297,7 @@ XawStripChartDestroy(Widget gw) } /* - * NOTE: This function really needs to recieve graphics exposure + * NOTE: This function really needs to receive graphics exposure * events, but since this is not easily supported until R4 I am * going to hold off until then. */ diff --git a/lib/libXaw/src/Text.c b/lib/libXaw/src/Text.c index 9a2a2efc3..da15a3795 100644 --- a/lib/libXaw/src/Text.c +++ b/lib/libXaw/src/Text.c @@ -925,7 +925,7 @@ XawTextInitialize(Widget request _X_UNUSED, Widget cnew, ctx->text.update = XmuNewScanline(0, 0, 0); ctx->text.gc = XtGetGC(cnew, 0, 0); ctx->text.hasfocus = False; - ctx->text.margin = ctx->text.r_margin; /* Strucure copy */ + ctx->text.margin = ctx->text.r_margin; /* Structure copy */ ctx->text.left_margin = ctx->text.r_margin.left; ctx->text.update_disabled = False; ctx->text.clear_to_eol = True; @@ -1095,7 +1095,7 @@ _XawTextGetText(TextWidget ctx, XawTextPosition left, XawTextPosition right) bytes = sizeof(unsigned char); else if (XawTextFormat(ctx, XawFmtWide)) bytes = sizeof(wchar_t); - else /* if there is another fomat, add here */ + else /* if there is another format, add here */ bytes = 1; /* leave space for ZERO */ @@ -1459,7 +1459,7 @@ _BuildLineTable(TextWidget ctx, XawTextPosition position, int line) * * Description: * Returns the width (in pixels) of the widest line that - * is currently visable. + * is currently visible. * * Returns: * The width of the widest line @@ -2824,8 +2824,8 @@ DisplayText(Widget w, XawTextPosition left, XawTextPosition right) /* * This routine implements multi-click selection in a hardwired manner. * It supports multi-click entity cycling (char, word, line, file) and mouse - * motion adjustment of the selected entitie (i.e. select a word then, with - * button still down, adjust wich word you really meant by moving the mouse). + * motion adjustment of the selected entity (i.e. select a word then, with + * button still down, adjust which word you really meant by moving the mouse). * [NOTE: This routine is to be replaced by a set of procedures that * will allows clients to implements a wide class of draw through and * multi-click selection user interfaces.] @@ -3289,7 +3289,7 @@ XawTextExpose(Widget w, XEvent *event, Region region) } /* - * This routine does all setup required to syncronize batched screen updates + * This routine does all setup required to synchronize batched screen updates */ void _XawTextPrepareToUpdate(TextWidget ctx) @@ -3802,7 +3802,7 @@ XawTextGetValuesHook(Widget w, ArgList args, Cardinal *num_args) * pos - any position * * Description: - * Returns a valid position given any postition. + * Returns a valid position given any position. * * Returns: * A position between (0 and lastPos) diff --git a/lib/libXaw/src/TextAction.c b/lib/libXaw/src/TextAction.c index 43d1d3258..5eae39ea8 100644 --- a/lib/libXaw/src/TextAction.c +++ b/lib/libXaw/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); @@ -2822,7 +2822,7 @@ RedrawDisplay(Widget w, XEvent *event, String *p _X_UNUSED, Cardinal *n _X_UNUSE /* This is kind of a hack, but, only one text widget can have focus at * a time on one display. There is a problem in the implementation of the - * text widget, the scrollbars can not be adressed via editres, since they + * text widget, the scrollbars can not be addressed via editres, since they * are not children of a subclass of composite. * The focus variable is required to make sure only one text window will * show a block cursor at one time. @@ -2971,7 +2971,7 @@ TextLeaveWindow(Widget w, XEvent *event, String *params _X_UNUSED, Cardinal *num * Arguments: ctx - The text widget. * * Description: - * Breaks the line at the previous word boundry when + * Breaks the line at the previous word boundary when * called inside InsertChar. */ static void @@ -3201,7 +3201,7 @@ InsertChar(Widget w, XEvent *event, String *p _X_UNUSED, Cardinal *n _X_UNUSED) * * i18n requires the ability to specify multiple characters in a hexa- * decimal string at once. Since Insert was already too long, I made - * this a seperate routine. + * this a separate routine. * * A legal hex string in MBNF: '0' 'x' ( HEX-DIGIT HEX-DIGIT )+ '\0' * @@ -3259,7 +3259,7 @@ IfHexConvertHexElseReturnParam(char *param, int *len_return) } } - /* We quit the above loop becasue we hit a non hex. If that char is \0... */ + /* We quit the above loop because we hit a non hex. If that char is \0... */ if ((c == '\0') && first_digit) { *len_return = (int)strlen(hexval); return (hexval); /* ...it was a legal hex string, so return it */ @@ -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); @@ -3811,7 +3811,7 @@ GetBlockBoundaries(TextWidget ctx, XawMin(ctx->text.s.left, ctx->text.s.right), XawstEOL, XawsdLeft, 1, False); to = SrcScan(ctx->text.source, - XawMax(ctx->text.s.right, ctx->text.s.right), + XawMax(ctx->text.s.left, ctx->text.s.right), XawstEOL, XawsdRight, 1, False); } else { @@ -4130,7 +4130,7 @@ NoOp(Widget w, XEvent *event _X_UNUSED, String *params, Cardinal *num_params) case 'R': case 'r': XBell(XtDisplay(w), 0); - /*FALLTROUGH*/ + /*FALLTHROUGH*/ default: break; } diff --git a/lib/libXaw/src/TextPop.c b/lib/libXaw/src/TextPop.c index 3f942aa4d..9bf35eeed 100644 --- a/lib/libXaw/src/TextPop.c +++ b/lib/libXaw/src/TextPop.c @@ -34,7 +34,7 @@ in this Software without prior written authorization from The Open Group. * used by all more than one of these dialogs. * * The following functions are the only non-static ones defined - * in this module. They are located at the begining of the + * in this module. They are located at the beginning of the * section that contains this dialog box that uses them. * * void _XawTextInsertFileAction(w, event, params, num_params); @@ -296,7 +296,7 @@ DoInsert(Widget w, XtPointer closure, XtPointer call_data) * Inserts a file into the text widget. * * Returns: - * True if the insert was sucessful, False otherwise. + * True if the insert was successful, False otherwise. */ static Bool InsertFileNamed(Widget tw, String str) @@ -417,7 +417,7 @@ AddInsertFileChildren(Widget form, String ptr, Widget tw) * will search for a string in the main Text Widget. * * Note: - * If the search was sucessful and the argument popdown is passed to + * If the search was successful and the argument popdown is passed to * this action routine then the widget will automatically popdown the * search widget */ @@ -515,7 +515,7 @@ SearchButton(Widget w _X_UNUSED, XtPointer closure, XtPointer call_data _X_UNUSE * * First Entry: * The first entry is the direction to search by default. - * This arguement must be specified and may have a value of + * This argument must be specified and may have a value of * "left" or "right". * * Second Entry: @@ -547,7 +547,7 @@ _XawTextSearch(Widget w, XEvent *event, String *params, Cardinal *num_params) ptr = params[1]; else if (XawTextFormat(ctx, XawFmtWide)) { /* This just does the equivalent of - ptr = ""L, a waste because params[1] isnt W aligned */ + ptr = ""L, a waste because params[1] isn't W aligned */ ptr = (char *)wcs; wcs[0] = 0; } @@ -601,7 +601,7 @@ _XawTextSearch(Widget w, XEvent *event, String *params, Cardinal *num_params) * * Description: * This function initializes the search widget and - * is called each time the search widget is poped up. + * is called each time the search widget is popped up. */ static void InitializeSearchWidget(struct SearchAndReplace *search, @@ -830,7 +830,7 @@ AddSearchChildren(Widget form, String ptr, Widget tw) * Performs a search * * Returns: - * True if sucessful + * True if successful */ /*ARGSUSED*/ static Bool @@ -1256,7 +1256,7 @@ _SetField(Widget cnew, Widget old) * name of the child and the shell widget of the dialog. * * Returns: - * True if sucessful + * True if successful */ static Bool SetResourceByName(Widget shell, String name, String res_name, XtArgVal value) diff --git a/lib/libXaw/src/TextSink.c b/lib/libXaw/src/TextSink.c index bb6b0f2d3..3b435765b 100644 --- a/lib/libXaw/src/TextSink.c +++ b/lib/libXaw/src/TextSink.c @@ -364,7 +364,7 @@ XawTextSinkSetValues(Widget current, Widget request _X_UNUSED, Widget cnew, * y - "" * pos1 - location of starting and ending points in the text buffer * pos2 - "" - * highlight - hightlight this text? + * highlight - highlight this text? * * Description: * Stub function that in subclasses will display text. @@ -475,7 +475,7 @@ FindPosition(Widget w _X_UNUSED, XawTextPosition fromPos _X_UNUSED, int fromx _X * fromX - x location of starting Position * toPos - end Position * resWidth - Distance between fromPos and toPos - * resPos - Acutal toPos used + * resPos - Actual toPos used * resHeight - Height required by this text * * Description: @@ -503,7 +503,7 @@ FindDistance(Widget w _X_UNUSED, XawTextPosition fromPos, int fromx _X_UNUSED, * resPos - resulting position * * Description: - * Resloves a location to a position. + * Resolves a location to a position. */ /*ARGSUSED*/ static void @@ -549,7 +549,7 @@ MaxLines(Widget w _X_UNUSED, unsigned int height _X_UNUSED) * lines - number of lines * * Description: - * Finds the Minium height that will contain a given number lines. + * Finds the Minimum height that will contain a given number lines. * * Returns: * the height @@ -610,7 +610,7 @@ GetCursorBounds(Widget w _X_UNUSED, XRectangle *rect) * y - "" * pos1 - location of starting and ending points in the text buffer * pos2 - "" - * highlight - hightlight this text? + * highlight - highlight this text? */ /*ARGSUSED*/ void @@ -750,7 +750,7 @@ XawTextSinkFindPosition(Widget w, XawTextPosition fromPos, int fromx, int width, * fromX - x location of starting Position * toPos - end Position * resWidth - Distance between fromPos and toPos - * resPos - Acutal toPos used + * resPos - Actual toPos used * resHeight - Height required by this text * * Description: @@ -780,7 +780,7 @@ XawTextSinkFindDistance(Widget w, XawTextPosition fromPos, int fromx, * resPos - resulting position * * Description: - * Resloves a location to a position. + * Resolves a location to a position. */ /*ARGSUSED*/ void @@ -828,7 +828,7 @@ XawTextSinkMaxLines(Widget w, Dimension height) * lines - number of lines * * Description: - * Finds the Minium height that will contain a given number lines. + * Finds the Minimum height that will contain a given number lines. * * Returns: * the height @@ -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' */ } @@ -1583,6 +1583,7 @@ XawTextSinkConvertPropertyList(String name, String spec, Screen *screen, if (prev) prev->next = NULL; XawFreeParamsStruct(params); + XtFree((char *)prop); return (NULL); } prop->mask |= XAW_TPROP_FONT; @@ -1602,6 +1603,7 @@ XawTextSinkConvertPropertyList(String name, String spec, Screen *screen, if (prev) prev->next = NULL; XawFreeParamsStruct(params); + XtFree((char *)prop); return (NULL); } prop->foreground = color.pixel; @@ -1619,6 +1621,7 @@ XawTextSinkConvertPropertyList(String name, String spec, Screen *screen, if (prev) prev->next = NULL; XawFreeParamsStruct(params); + XtFree((char *)prop); return (NULL); } prop->background = color.pixel; diff --git a/lib/libXaw/src/TextSrc.c b/lib/libXaw/src/TextSrc.c index 0a9db664b..adea9b3dc 100644 --- a/lib/libXaw/src/TextSrc.c +++ b/lib/libXaw/src/TextSrc.c @@ -399,7 +399,7 @@ XawTextSrcSetValues(Widget current _X_UNUSED, Widget request _X_UNUSED, Widget c * * Parameters: * w - TextSrc Object - * pos - position of the text to retreive + * pos - position of the text to retrieve * text - text block that will contain returned text * length - maximum number of characters to read * @@ -446,8 +446,8 @@ Replace(Widget w _X_UNUSED, XawTextPosition startPos _X_UNUSED, XawTextPosition * position - position to start scanning * type - type of thing to scan for * dir - direction to scan - * count - which occurance if this thing to search for - * include - whether or not to include the character found in + * count - which occurrence 0f this thing to search for + * include - whether or not to include the character found in * the position that is returned * * Description: @@ -472,7 +472,7 @@ Scan(Widget w _X_UNUSED, XawTextPosition position _X_UNUSED, XawTextScanType typ * text - the text block to search for * * Description: - * Searchs the text source for the text block passed + * Searches the text source for the text block passed */ /*ARGSUSED*/ static XawTextPosition @@ -690,7 +690,7 @@ _XawSourceSetUndoErase(TextSrcObject src, int value) } /* - * To diferentiate insert-char's separeted by cursor movements. + * To differentiate insert-char's separated by cursor movements. */ void _XawSourceSetUndoMerge(TextSrcObject src, Bool state) @@ -1399,7 +1399,7 @@ UndoGC(XawTextUndo *undo) * position - position to start scanning * type - type of thing to scan for * dir - direction to scan - * count - which occurance if this thing to search for + * count - which occurrence if this thing to search for * include - whether or not to include the character found in * the position that is returned. * @@ -1439,7 +1439,7 @@ XawTextSourceScan(Widget w, XawTextPosition position, * The position of the text we are searching for or XawTextSearchError. * * Description: - * Searchs the text source for the text block passed + * Searches the text source for the text block passed */ XawTextPosition XawTextSourceSearch(Widget w, XawTextPosition position, @@ -1463,7 +1463,7 @@ XawTextSourceSearch(Widget w, XawTextPosition position, * w - TextSrc object * selection - current selection atom * target - current target atom - * type - type to conver the selection to + * type - type to convert the selection to * value - return value that has been converted * length - "" * format - format of the returned value @@ -1489,7 +1489,7 @@ XawTextSourceConvertSelection(Widget w, Atom *selection, Atom *target, * Parameters: * w - TextSrc object * left - bounds of the selection - * rigth - "" + * right - "" * selection - selection atom * * Description: @@ -1522,7 +1522,7 @@ _XawTextFormat(TextWidget tw) * The caller is responsible for freeing both the source and ret string * * wstr - source wchar string - * len_in_out - lengh of string. + * len_in_out - length of string. * As In, length of source wchar string, measured in wchar * As Out, length of returned string */ @@ -1548,7 +1548,7 @@ _XawTextWCToMB(Display *d, wchar_t *wstr, int *len_in_out) * The caller is responsible for freeing both the source and ret string. * * str - source string - * len_in_out - lengh of string + * len_in_out - length of string * As In, it is length of source string * As Out, it is length of returned string, measured in wchar */ diff --git a/lib/libXaw/src/Tip.c b/lib/libXaw/src/Tip.c index 06d53c818..33e562008 100644 --- a/lib/libXaw/src/Tip.c +++ b/lib/libXaw/src/Tip.c @@ -332,7 +332,7 @@ XawTipExpose(Widget w, XEvent *event, Region region) ksy = (ksy + XawAbs(ext->max_ink_extent.y)); - while ((nl = index(label, '\n')) != NULL) { + while ((nl = strchr(label, '\n')) != NULL) { XmbDrawString(XtDisplay(w), XtWindow(w), tip->tip.fontset, gc, tip->tip.left_margin, ksy, label, (int)(nl - label)); @@ -345,7 +345,7 @@ XawTipExpose(Widget w, XEvent *event, Region region) tip->tip.left_margin, ksy, label, len); } else { - while ((nl = index(label, '\n')) != NULL) { + while ((nl = strchr(label, '\n')) != NULL) { if (tip->tip.encoding) XDrawString16(XtDisplay(w), XtWindow(w), gc, tip->tip.left_margin, y, @@ -411,7 +411,7 @@ TipLayout(XawTipInfo *info) XFontSetExtents *ext = XExtentsOfFontSet(fset); height = ext->max_ink_extent.height; - if ((nl = index(label, '\n')) != NULL) { + if ((nl = strchr(label, '\n')) != NULL) { /*CONSTCOND*/ while (True) { int w = XmbTextEscapement(fset, label, (int)(nl - label)); @@ -423,8 +423,8 @@ TipLayout(XawTipInfo *info) label = nl + 1; if (*label) height += ext->max_ink_extent.height; - if ((nl = index(label, '\n')) == NULL) - nl = index(label, '\0'); + if ((nl = strchr(label, '\n')) == NULL) + nl = strchr(label, '\0'); } } else @@ -432,7 +432,7 @@ TipLayout(XawTipInfo *info) } else { height = fs->max_bounds.ascent + fs->max_bounds.descent; - if ((nl = index(label, '\n')) != NULL) { + if ((nl = strchr(label, '\n')) != NULL) { /*CONSTCOND*/ while (True) { int w = info->tip->tip.encoding ? @@ -445,8 +445,8 @@ TipLayout(XawTipInfo *info) label = nl + 1; if (*label) height += fs->max_bounds.ascent + fs->max_bounds.descent; - if ((nl = index(label, '\n')) == NULL) - nl = index(label, '\0'); + if ((nl = strchr(label, '\n')) == NULL) + nl = strchr(label, '\0'); } } else diff --git a/lib/libXaw/src/Toggle.c b/lib/libXaw/src/Toggle.c index 9b93d4128..eb6281d6e 100644 --- a/lib/libXaw/src/Toggle.c +++ b/lib/libXaw/src/Toggle.c @@ -179,7 +179,7 @@ ToggleClassRec toggleClassRec = { WidgetClass toggleWidgetClass = (WidgetClass)&toggleClassRec; /* - * Impelementation + * Implementation */ static void XawToggleClassInitialize(void) @@ -248,10 +248,10 @@ XawToggleInitialize(Widget request, Widget cnew, * have to handle the case where it needs to be set * * If this widget is in a radio group then it may cause another - * widget to be unset, thus calling the notify proceedure + * widget to be unset, thus calling the notify procedure * * I want to set the toggle if the user set the state to "On" in - * the resource group, reguardless of what my ancestors did + * the resource group, regardless of what my ancestors did */ if (tw_req->command.set) ToggleSet(cnew, NULL, NULL, NULL); diff --git a/lib/libXaw/src/Viewport.c b/lib/libXaw/src/Viewport.c index 893c8bf66..9256ffabc 100644 --- a/lib/libXaw/src/Viewport.c +++ b/lib/libXaw/src/Viewport.c @@ -707,7 +707,7 @@ ComputeLayout(Widget widget, Bool query, Bool destroy_scrollbars) * Parameters: * widget - viewport widget * query - whether or not to query the child - * intended - cache of the childs height is stored here + * intended - cache of the child's height is stored here * (used and returned) * clip_width - size of clip window (used and returned) * clip_height - "" diff --git a/lib/libXaw/src/XawIm.c b/lib/libXaw/src/XawIm.c index 1c733cdb3..ebc5edefb 100644 --- a/lib/libXaw/src/XawIm.c +++ b/lib/libXaw/src/XawIm.c @@ -357,7 +357,7 @@ DestroyAllIM(XawVendorShellExtPart *ve) contextErrDataRec *contextErrData; /* - * Destory all ICs + * Destroy all ICs */ if (IsSharedIC(ve)) { if ((p = ve->ic.shared_ic_table) && p->xic) { @@ -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); |