diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2019-06-01 19:27:15 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2019-06-01 19:27:15 -0700 |
commit | 3a2473affe1e15d6e8d252db7ec5e22fd1683978 (patch) | |
tree | 023b0349e60706cf11213e67ce09c99c975c5cd8 | |
parent | 6dcc9c8064baeb2f9d853309123cd9736809a4fd (diff) |
Use _CONST_X_STRING to make libXt declare String as const char *
Clears 169 out of 240 -Wdiscarded-qualifiers warnings from gcc 7.3
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | BitEdit.c | 2 | ||||
-rw-r--r-- | Bitmap.c | 18 | ||||
-rw-r--r-- | Bitmap.h | 6 | ||||
-rw-r--r-- | BitmapP.h | 3 | ||||
-rw-r--r-- | Dialog.c | 4 | ||||
-rw-r--r-- | Dialog.h | 4 | ||||
-rw-r--r-- | Makefile.am | 2 |
7 files changed, 21 insertions, 18 deletions
@@ -226,7 +226,7 @@ static Boolean image_visible = False; static Pixmap check_mark; static Dialog input_dialog, error_dialog, qsave_dialog; static Time btime; -static String filename = NULL, base_name = NULL, format; +static char *filename = NULL, *base_name = NULL, *format; static char message[80]; @@ -648,7 +648,7 @@ BWPutImage(BitmapWidget w, Display *display, Drawable drawable, GC gc, } #endif -static String +static char * StripFilename(_Xconst _XtString filename) { const char *begin = strrchr(filename, '/'); @@ -688,7 +688,7 @@ XmuWriteBitmapDataToFile(_Xconst _XtString filename, file = fopen(filename, "w+"); if (file) { - String new_basename; + char *new_basename; if (!basename || !strcmp(basename, "") || !strcmp(basename, "-")) basename = new_basename = StripFilename(filename); @@ -1227,8 +1227,8 @@ BWWriteFile(Widget w, _Xconst _XtString filename, _Xconst _XtString basename) return status; } -String -BWGetFilename(Widget w, String *str) +_XtString +BWGetFilename(Widget w, _XtString *str) { BitmapWidget BW = (BitmapWidget) w; @@ -1237,11 +1237,11 @@ BWGetFilename(Widget w, String *str) return *str; } -String -BWGetFilepath(Widget w, String *str) +_XtString +BWGetFilepath(Widget w, _XtString *str) { BitmapWidget BW = (BitmapWidget) w; - String end; + _XtString end; *str = XtNewString(BW->bitmap.filename); assert(*str); @@ -1257,8 +1257,8 @@ BWGetFilepath(Widget w, String *str) } -String -BWGetBasename(Widget w, String *str) +_XtString +BWGetBasename(Widget w, _XtString *str) { BitmapWidget BW = (BitmapWidget) w; @@ -227,8 +227,8 @@ extern Boolean BWQueryChanged ( Widget w ); extern int BWReadFile ( Widget w, _Xconst _XtString filename, _Xconst _XtString basename ); extern int BWWriteFile ( Widget w, _Xconst _XtString filename, _Xconst _XtString basename ); extern String BWUnparseStatus ( Widget w ); -extern String BWGetFilename ( Widget w, String *str ); -extern String BWGetBasename ( Widget w, String *str ); +extern _XtString BWGetFilename ( Widget w, _XtString *str ); +extern _XtString BWGetBasename ( Widget w, _XtString *str ); extern void BWChangeBasename ( Widget w, _Xconst _XtString str ); extern void BWRemoveAllRequests ( Widget w ); extern void BWClearHotSpot ( Widget w ); @@ -250,7 +250,7 @@ extern void BWSwitchStippled ( Widget w ); extern void BWRedrawMark ( Widget w ); extern Boolean BWQueryAxes ( Widget w ); extern void BWHighlightAxes ( Widget w ); -extern String BWGetFilepath ( Widget w, String *str ); +extern _XtString BWGetFilepath ( Widget w, _XtString *str ); extern void BWZoomOut ( Widget w ); extern void BWZoomMarked ( Widget w ); extern void BWRescale ( Widget w, Dimension width, Dimension height ); @@ -119,7 +119,8 @@ typedef struct { Dimension margin, squareW, squareH, width, height; XPoint hot; int button_function[5]; - String filename, basename; + _XtString filename; + _XtString basename; /* private state */ String size; Position horizOffset, vertOffset; @@ -127,7 +127,7 @@ CreateDialog(Widget top_widget, String name, unsigned long options) } void -PopdownDialog(Dialog popup, String *answer) +PopdownDialog(Dialog popup, _XtString *answer) { if (answer) *answer = XawDialogGetValueString(popup->dialog_widget); @@ -137,7 +137,7 @@ PopdownDialog(Dialog popup, String *answer) unsigned long PopupDialog(Dialog popup, String message, String suggestion, - String *answer, XtGrabKind grab) + _XtString *answer, XtGrabKind grab) { Position popup_x, popup_y, top_x, top_y; Dimension popup_width, popup_height, top_width, top_height, border_width; @@ -51,5 +51,5 @@ typedef struct { } DialogButton; extern Dialog CreateDialog(Widget, String, unsigned long); -extern unsigned long PopupDialog(Dialog, String, String, String *, XtGrabKind); -extern void PopdownDialog(Dialog, String *); +extern unsigned long PopupDialog(Dialog, String, String, _XtString *, XtGrabKind); +extern void PopdownDialog(Dialog, _XtString *); diff --git a/Makefile.am b/Makefile.am index def4d8b..4e44ade 100644 --- a/Makefile.am +++ b/Makefile.am @@ -22,6 +22,8 @@ SUBDIRS=man bin_PROGRAMS = bitmap bmtoa atobm +AM_CPPFLAGS = -D_CONST_X_STRING + bitmap_CFLAGS = $(CWARNFLAGS) $(BITMAP_CFLAGS) bitmap_LDADD = $(BITMAP_LIBS) $(MATH_LIBS) bitmap_SOURCES = \ |