summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2021-11-28 10:38:43 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2021-11-30 17:52:59 +0000
commit4bf092e35a92b4fb613f4fee01d5ab26a612ddb6 (patch)
tree093d2ef94b6f58d58de8191784aca276540526dc
parentc7a7f81b18f8594aceaa9c32217753ef935dac2d (diff)
Use _CONST_X_STRING to make libXt declare String as const char *
Clears 5 -Wincompatible-pointer-types warnings and 18 -Wdiscarded-qualifiers warnings from gcc Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--choose.c4
-rw-r--r--info.c4
-rw-r--r--save.c6
-rw-r--r--saveutil.c9
-rw-r--r--xsm.h2
5 files changed, 13 insertions, 12 deletions
diff --git a/choose.c b/choose.c
index 72f6bb1..a161e28 100644
--- a/choose.c
+++ b/choose.c
@@ -461,7 +461,7 @@ ChooseSessionDeleteXtProc(Widget w, XtPointer client_data, XtPointer callData)
{
XawListReturnStruct *current;
int longest;
- char *name;
+ String name;
CheckBreakLockCancel ();
@@ -555,7 +555,7 @@ ChooseSessionBreakLockXtProc(Widget w, XtPointer client_data,
XtPointer callData)
{
XawListReturnStruct *current;
- char *name;
+ String name;
CheckDeleteCancel ();
diff --git a/info.c b/info.c
index 9de747a..56f830e 100644
--- a/info.c
+++ b/info.c
@@ -382,7 +382,7 @@ UpdateClientList(void)
{
ClientRec *client;
char *progName, *hostname, *tmp1, *tmp2;
- String clientInfo;
+ char *clientInfo;
int maxlen1, maxlen2;
char extraBuf1[80], extraBuf2[80];
char *restart_service_prop;
@@ -398,7 +398,7 @@ UpdateClientList(void)
*/
for (i = 0; i < numClientListNames; i++)
- XtFree (clientListNames[i]);
+ XtFree ((char *) clientListNames[i]);
XtFree ((char *) clientListNames);
diff --git a/save.c b/save.c
index fc6f4e0..1bbf448 100644
--- a/save.c
+++ b/save.c
@@ -620,7 +620,7 @@ SaveCancelXtProc(Widget w, XtPointer client_data, XtPointer callData)
*/
static Widget
-AddToggle(char *widgetName, Widget parent, int state, Widget radioGroup,
+AddToggle(String widgetName, Widget parent, int state, Widget radioGroup,
XtPointer radioData, Widget fromHoriz, Widget fromVert)
{
Widget toggle;
@@ -1195,7 +1195,7 @@ PopupBadSave(void)
{
ClientRec *client;
char *progName, *hostname, *tmp1, *tmp2;
- String clientInfo;
+ char *clientInfo;
int maxlen1, maxlen2;
char extraBuf1[80], extraBuf2[80];
char *restart_service_prop;
@@ -1211,7 +1211,7 @@ PopupBadSave(void)
*/
for (i = 0; i < numFailedNames; i++)
- XtFree (failedNames[i]);
+ XtFree ((char *) failedNames[i]);
XtFree ((char *) failedNames);
diff --git a/saveutil.c b/saveutil.c
index 486e4cc..1b5132e 100644
--- a/saveutil.c
+++ b/saveutil.c
@@ -204,7 +204,7 @@ ReadSave(const char *session_name, char **sm_id)
if (state == 5)
{
- String strbuf;
+ char *strbuf;
int bufsize = 0;
getnextline(&buf, &buflen, f);
@@ -220,13 +220,12 @@ ReadSave(const char *session_name, char **sm_id)
{
getnextline(&buf, &buflen, f);
if((p = strchr(buf, '\n'))) *p = '\0';
- non_session_aware_clients[i] = (char *) malloc (
- strlen (buf) + 2);
+ non_session_aware_clients[i] = malloc (strlen (buf) + 2);
strcpy (non_session_aware_clients[i], buf);
bufsize += (strlen (buf) + 1);
}
- strbuf = (String) malloc (bufsize + 1);
+ strbuf = malloc (bufsize + 1);
strbuf[0] = '\0';
for (i = 0; i < non_session_aware_count; i++)
@@ -303,7 +302,7 @@ WriteSave(const char *sm_id)
ClientRec *client;
FILE *f;
List *cl;
- String commands;
+ char *commands;
char *p, *c;
int count;
diff --git a/xsm.h b/xsm.h
index e780355..1ee74e8 100644
--- a/xsm.h
+++ b/xsm.h
@@ -33,6 +33,8 @@ in this Software without prior written authorization from The Open Group.
# include "config.h"
#endif
+#define _CONST_X_STRING
+
#include <X11/Xos.h>
#include <X11/Xfuncs.h>