From e18a25f27313d90ec8da4057b8413b6937bee1c2 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sat, 1 Jun 2019 19:39:07 -0700 Subject: Use _CONST_X_STRING to make libXt declare String as const char * Clears up 20 of 35 gcc -Wdiscarded-qualifiers warnings from gcc 7.3 Signed-off-by: Alan Coopersmith --- Mailbox.c | 4 ++-- MailboxP.h | 2 +- Makefile.am | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Mailbox.c b/Mailbox.c index d7f7fb8..4d263b6 100644 --- a/Mailbox.c +++ b/Mailbox.c @@ -541,10 +541,10 @@ static void GetMailFile (MailboxWidget w) } #endif if ((mailpath = getenv("MAIL"))) { - w->mailbox.filename = (String) XtMalloc (strlen (mailpath) + 1); + w->mailbox.filename = XtMalloc (strlen (mailpath) + 1); strcpy (w->mailbox.filename, mailpath); } else { - w->mailbox.filename = (String) XtMalloc (strlen (MAILBOX_DIRECTORY) + 1 + w->mailbox.filename = XtMalloc (strlen (MAILBOX_DIRECTORY) + 1 + strlen (username) + 1); strcpy (w->mailbox.filename, MAILBOX_DIRECTORY); strcat (w->mailbox.filename, "/"); diff --git a/MailboxP.h b/MailboxP.h index f21d62a..23b2589 100644 --- a/MailboxP.h +++ b/MailboxP.h @@ -59,7 +59,7 @@ typedef struct { /* new fields for mailbox widget */ /* resources */ int update; /* seconds between updates */ Pixel foreground_pixel; /* color index of normal state fg */ - String filename; /* filename to watch */ + char *filename; /* filename to watch */ String check_command; /* command to exec for mail check */ Boolean flipit; /* do flip of full pixmap */ int volume; /* bell volume */ diff --git a/Makefile.am b/Makefile.am index 898a7ea..c55f53e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -22,7 +22,7 @@ SUBDIRS = man bin_PROGRAMS = xbiff -AM_CFLAGS = $(CWARNFLAGS) $(XBIFF_CFLAGS) -D_BSD_SOURCE +AM_CFLAGS = $(CWARNFLAGS) $(XBIFF_CFLAGS) -D_BSD_SOURCE -D_CONST_X_STRING xbiff_LDADD = $(XBIFF_LIBS) xbiff_SOURCES = \ -- cgit v1.2.3