Commit 3a2473af authored by Alan Coopersmith's avatar Alan Coopersmith

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's avatarAlan Coopersmith <alan.coopersmith@oracle.com>
parent 6dcc9c80
......@@ -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 *);
......@@ -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 = \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment