diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2021-11-28 10:38:43 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2021-11-30 17:52:59 +0000 |
commit | 4bf092e35a92b4fb613f4fee01d5ab26a612ddb6 (patch) | |
tree | 093d2ef94b6f58d58de8191784aca276540526dc | |
parent | c7a7f81b18f8594aceaa9c32217753ef935dac2d (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.c | 4 | ||||
-rw-r--r-- | info.c | 4 | ||||
-rw-r--r-- | save.c | 6 | ||||
-rw-r--r-- | saveutil.c | 9 | ||||
-rw-r--r-- | xsm.h | 2 |
5 files changed, 13 insertions, 12 deletions
@@ -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 (); @@ -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); @@ -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); @@ -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; @@ -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> |