summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2024-04-07 12:07:58 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2024-04-07 12:07:58 -0700
commite074743e9c38afdcf5809d857921959bb6c14241 (patch)
tree4a0e5be952ca9c7c9a3e575233e9fd981ec03b52
parent98ebfcf3bc9a9f7cdd94eea880bd64e2af705fd5 (diff)
Handle -Wdiscarded-qualifiers warnings for XawTextBlock ptrHEADmaster
xclipboard.c: In function ‘NewCurrentClip’: xclipboard.c:384:29: warning: passing argument 1 of ‘NewCurrentClipContents’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] 384 | NewCurrentClipContents ("", 0); | ^~ xclipboard.c:77:44: note: expected ‘char *’ but argument is of type ‘const char *’ 77 | static void NewCurrentClipContents ( char *data, int len ); | ~~~~~~^~~~ xclipboard.c: In function ‘EraseTextWidget’: xclipboard.c:420:15: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] 420 | block.ptr = ""; | ^ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Part-of: <https://gitlab.freedesktop.org/xorg/app/xclipboard/-/merge_requests/4>
-rw-r--r--xclipboard.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/xclipboard.c b/xclipboard.c
index 50d8741..d331c52 100644
--- a/xclipboard.c
+++ b/xclipboard.c
@@ -377,11 +377,13 @@ WMProtocols(Widget w, XEvent *ev, String *params, Cardinal *n)
}
}
+static char empty_string[] = "";
+
/* ARGUSED */
static void
NewCurrentClip(Widget w, XEvent *ev, String *parms, Cardinal *np)
{
- NewCurrentClipContents ("", 0);
+ NewCurrentClipContents (empty_string, 0);
}
static void
@@ -417,7 +419,7 @@ EraseTextWidget(void)
{
XawTextBlock block;
- block.ptr = "";
+ block.ptr = empty_string;
block.length = 0;
block.firstPos = 0;
block.format = FMT8BIT;