diff options
author | Thomas E. Dickey <dickey@invisible-island.net> | 2019-11-26 19:05:01 -0500 |
---|---|---|
committer | Thomas E. Dickey <dickey@invisible-island.net> | 2019-11-26 19:06:49 -0500 |
commit | 197e9d055f3cd351ae73551955ff463294b965bf (patch) | |
tree | 25d8a525fa6ccf30cf7b09e3f7e7879551318ab5 | |
parent | 9f5025729992607eaac987f7f82208018af84fb6 (diff) | |
download | xorg-lib-libXaw-197e9d055f3cd351ae73551955ff463294b965bf.tar.gz |
compiler-warning fixes for const-mismatches, no object-change
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
-rw-r--r-- | include/X11/Xaw/List.h | 2 | ||||
-rw-r--r-- | src/List.c | 4 | ||||
-rw-r--r-- | src/Pixmap.c | 10 | ||||
-rw-r--r-- | src/SmeBSB.c | 4 | ||||
-rw-r--r-- | src/TextPop.c | 18 | ||||
-rw-r--r-- | src/TextSink.c | 11 | ||||
-rw-r--r-- | src/Tip.c | 14 | ||||
-rw-r--r-- | src/XawIm.c | 3 |
8 files changed, 35 insertions, 31 deletions
diff --git a/include/X11/Xaw/List.h b/include/X11/Xaw/List.h index 2df3588..663b17f 100644 --- a/include/X11/Xaw/List.h +++ b/include/X11/Xaw/List.h @@ -167,7 +167,7 @@ _XFUNCPROTOBEGIN void XawListChange ( Widget w, - char **list, + _Xconst char **list, int nitems, int longest, #if NeedWidePrototypes @@ -683,7 +683,7 @@ ClipToShadowInteriorAndLongest(ListWidget lw, GC *gc_p, unsigned int x) static void PaintItemName(Widget w, int item) { - char *str; + _Xconst char *str; GC gc; int x, y, str_y; ListWidget lw = (ListWidget)w; @@ -1178,7 +1178,7 @@ XawListDestroy(Widget w) * If nitems is <= 0 then the list needs to be NULL terminated */ void -XawListChange(Widget w, char **list, int nitems, int longest, +XawListChange(Widget w, _Xconst char **list, int nitems, int longest, #if NeedWidePrototypes int resize_it #else diff --git a/src/Pixmap.c b/src/Pixmap.c index 9a8d205..9798c9c 100644 --- a/src/Pixmap.c +++ b/src/Pixmap.c @@ -238,9 +238,9 @@ XawFreeParamsStruct(XawParams *params) for (i = 0; i < params->num_args; i++) { - XtFree(params->args[i]->name); + XtFree((char *)params->args[i]->name); if (params->args[i]->value) - XtFree(params->args[i]->value); + XtFree((char *)params->args[i]->value); XtFree((char *)params->args[i]); } @@ -332,9 +332,9 @@ XawAddPixmapLoader(String type, String ext, XawPixmapLoader loader) { loader_info[i]->loader = loader; if (loader_info[i]->type) - XtFree(loader_info[i]->type); + XtFree((char *)loader_info[i]->type); if (loader_info[i]->ext) - XtFree(loader_info[i]->ext); + XtFree((char *)loader_info[i]->ext); loader_info[i]->type = type ? XtNewString(type) : NULL; loader_info[i]->ext = ext ? XtNewString(ext) : NULL; return (True); @@ -938,7 +938,7 @@ XPixmapLoader(XawParams *params, Screen *screen, Colormap colormap, int depth _X {'T', "pixmaps"}, {'P', PROJECT_ROOT}, }; - char *filename; + const char *filename; if ((argval = XawFindArgVal(params, "closeness")) != NULL && argval->value) diff --git a/src/SmeBSB.c b/src/SmeBSB.c index e5df7e2..380a215 100644 --- a/src/SmeBSB.c +++ b/src/SmeBSB.c @@ -295,7 +295,7 @@ XawSmeBSBDestroy(Widget w) DestroyGCs(w); if (entry->sme_bsb.label != XtName(w)) - XtFree(entry->sme_bsb.label); + XtFree((char *)entry->sme_bsb.label); } /* @@ -349,7 +349,7 @@ XawSmeBSBRedisplay(Widget w, XEvent *event _X_UNUSED, Region region _X_UNUSED) if (entry->sme_bsb.label != NULL) { int x_loc = entry->sme_bsb.left_margin; int len = (int)strlen(entry->sme_bsb.label); - char *label = entry->sme_bsb.label; + _Xconst char *label = entry->sme_bsb.label; int width, t_width; switch(entry->sme_bsb.justify) { diff --git a/src/TextPop.c b/src/TextPop.c index 8436373..3f942aa 100644 --- a/src/TextPop.c +++ b/src/TextPop.c @@ -61,14 +61,14 @@ in this Software without prior written authorization from The Open Group. #include <X11/Xaw/Toggle.h> #include "XawI18n.h" -static char* INSERT_FILE = "Enter Filename:"; -static char* SEARCH_LABEL_1 = "Use <Tab> to change fields."; -static char* SEARCH_LABEL_2 = "Use ^q<Tab> for <Tab>."; -static char* DISMISS_NAME = "cancel"; +static _Xconst char* INSERT_FILE = "Enter Filename:"; +static _Xconst char* SEARCH_LABEL_1 = "Use <Tab> to change fields."; +static _Xconst char* SEARCH_LABEL_2 = "Use ^q<Tab> for <Tab>."; +static _Xconst char* DISMISS_NAME = "cancel"; #define DISMISS_NAME_LEN 6 -static char* FORM_NAME = "form"; -static char* LABEL_NAME = "label"; -static char* TEXT_NAME = "text"; +static _Xconst char* FORM_NAME = "form"; +static _Xconst char* LABEL_NAME = "label"; +static _Xconst char* TEXT_NAME = "text"; #define R_OFFSET 1 @@ -88,7 +88,7 @@ static void DoReplaceOne(Widget, XtPointer, XtPointer); static Bool DoSearch(struct SearchAndReplace*); static Widget GetShell(Widget); static String GetString(Widget); -static String GetStringRaw(Widget); +static _XtString GetStringRaw(Widget); static void InitializeSearchWidget(struct SearchAndReplace*, XawTextScanDirection, Bool); static Bool InParams(String, String*, unsigned int); @@ -1320,7 +1320,7 @@ GetString(Widget text) return (string); } -static String +static _XtString GetStringRaw(Widget tw) { TextWidget ctx = (TextWidget)tw; diff --git a/src/TextSink.c b/src/TextSink.c index 4944dc1..bb6b0f2 100644 --- a/src/TextSink.c +++ b/src/TextSink.c @@ -428,8 +428,8 @@ ClearToBackground(Widget w, int x, int y, x2 = (XawMin(x + (int)width, (int)XtWidth(xaw) - xaw->text.r_margin.right)); y2 = (XawMin(y + (int)height, (int)XtHeight(xaw) - xaw->text.r_margin.bottom)); - x = x1; - y = y1; + x = (int)x1; + y = (int)y1; width = (unsigned)(XawMax(0, x2 - x1)); height = (unsigned)(XawMax(0, y2 - y1)); @@ -1208,10 +1208,11 @@ _XawTextSinkAddProperty(XawTextPropertyList *list, XawTextProperty *property, char identifier[1024]; char foreground[16]; char background[16]; - char *foundry, *family, *weight, *slant, *setwidth, *addstyle, *pixel_size, + const char *foundry, *family, *weight, *slant, *setwidth, *addstyle, *pixel_size, *point_size, *res_x, *res_y, *spacing, *avgwidth, *registry, *encoding; - char *xlfd; - static char *asterisk = "*", *null = ""; + const char *xlfd; + static const char *asterisk = "*"; + static const char *null = ""; XrmQuark quark; if (list == NULL || property == NULL) @@ -318,7 +318,8 @@ XawTipExpose(Widget w, XEvent *event, Region region) { TipWidget tip = (TipWidget)w; GC gc = tip->tip.gc; - char *nl, *label = tip->tip.label; + char *nl; + _Xconst char * label = tip->tip.label; Position y = (Position)(tip->tip.top_margin + tip->tip.font->max_bounds.ascent); int len; @@ -348,7 +349,7 @@ XawTipExpose(Widget w, XEvent *event, Region region) if (tip->tip.encoding) XDrawString16(XtDisplay(w), XtWindow(w), gc, tip->tip.left_margin, y, - (XChar2b*)label, (int)(nl - label) >> 1); + (_Xconst XChar2b*)label, (int)(nl - label) >> 1); else XDrawString(XtDisplay(w), XtWindow(w), gc, tip->tip.left_margin, y, label, (int)(nl - label)); @@ -360,7 +361,7 @@ XawTipExpose(Widget w, XEvent *event, Region region) if (len) { if (tip->tip.encoding) XDrawString16(XtDisplay(w), XtWindow(w), gc, - tip->tip.left_margin, y, (XChar2b*)label, len >> 1); + tip->tip.left_margin, y, (_Xconst XChar2b*)label, len >> 1); else XDrawString(XtDisplay(w), XtWindow(w), gc, tip->tip.left_margin, y, label, len); @@ -402,7 +403,8 @@ TipLayout(XawTipInfo *info) { XFontStruct *fs = info->tip->tip.font; int width = 0, height; - char *nl, *label = info->tip->tip.label; + char *nl; + _Xconst char *label = info->tip->tip.label; if (info->tip->tip.international == True) { XFontSet fset = info->tip->tip.fontset; @@ -434,7 +436,7 @@ TipLayout(XawTipInfo *info) /*CONSTCOND*/ while (True) { int w = info->tip->tip.encoding ? - XTextWidth16(fs, (XChar2b*)label, (int)(nl - label) >> 1) : + XTextWidth16(fs, (_Xconst XChar2b*)label, (int)(nl - label) >> 1) : XTextWidth(fs, label, (int)(nl - label)); if (w > width) width = w; @@ -449,7 +451,7 @@ TipLayout(XawTipInfo *info) } else width = info->tip->tip.encoding ? - XTextWidth16(fs, (XChar2b*)label, (int)(strlen(label) >> 1)) : + XTextWidth16(fs, (_Xconst XChar2b*)label, (int)(strlen(label) >> 1)) : XTextWidth(fs, label, (int)strlen(label)); } XtWidth(info->tip) = (width + info->tip->tip.left_margin + diff --git a/src/XawIm.c b/src/XawIm.c index 786d208..1c733cd 100644 --- a/src/XawIm.c +++ b/src/XawIm.c @@ -449,7 +449,8 @@ static void OpenIM(XawVendorShellExtPart *ve) { int i; - char *p, *s, *ns, *end, *pbuf, buf[32]; + _Xconst char *s, *ns, *end; + char *p, *pbuf, buf[32]; XIM xim = NULL; XIMStyles *xim_styles; XIMStyle input_style = 0; |