From c768260785066b91ce8f9462ebb611e173f64dcb Mon Sep 17 00:00:00 2001 From: Peter Howkins Date: Sat, 27 Dec 2014 20:56:29 +0000 Subject: [PATCH] dtlogin: resolve 8 compiler warnings. --- cde/programs/dtlogin/chooser.c | 6 +++--- cde/programs/dtlogin/util.c | 17 +++++++---------- cde/programs/dtlogin/vgcallback.c | 2 +- cde/programs/dtlogin/vgutil.c | 6 +++--- 4 files changed, 14 insertions(+), 17 deletions(-) diff --git a/cde/programs/dtlogin/chooser.c b/cde/programs/dtlogin/chooser.c index 6417c757..37e617fc 100644 --- a/cde/programs/dtlogin/chooser.c +++ b/cde/programs/dtlogin/chooser.c @@ -222,9 +222,9 @@ PingHosts (XtPointer closure, XtIntervalId *id) for (hosts = hostAddrdb; hosts; hosts = hosts->next) { if (hosts->type == QUERY) - XdmcpFlush (socketFD, &directBuffer, hosts->addr, hosts->addrlen); + XdmcpFlush (socketFD, &directBuffer, (XdmcpNetaddr) hosts->addr, hosts->addrlen); else - XdmcpFlush (socketFD, &broadcastBuffer, hosts->addr, hosts->addrlen); + XdmcpFlush (socketFD, &broadcastBuffer, (XdmcpNetaddr) hosts->addr, hosts->addrlen); } if (++pingTry < TRIES) XtAddTimeOut (PING_INTERVAL, PingHosts, (XtPointer) 0); @@ -501,7 +501,7 @@ ReceivePacket (XtPointer closure, int *source, XtInputId *id) int addrlen; addrlen = sizeof (addr); - if (!XdmcpFill (socketFD, &buffer, &addr, &addrlen)) + if (!XdmcpFill (socketFD, &buffer, (XdmcpNetaddr) &addr, &addrlen)) return; if (!XdmcpReadHeader (&buffer, &header)) return; diff --git a/cde/programs/dtlogin/util.c b/cde/programs/dtlogin/util.c index accb0ff6..c41b8edc 100644 --- a/cde/programs/dtlogin/util.c +++ b/cde/programs/dtlogin/util.c @@ -93,9 +93,7 @@ static char * makeEnv( static SIGVAL MakeLangAbort( int arg ); -static int MatchesFileSuffix( - char * filename, - char * suffix ); +static int MatchesFileSuffix(const char *filename, const char *suffix); static void ScanNLSDir( char * dirname ); @@ -676,23 +674,22 @@ MakeLangList( void ) static int -MatchesFileSuffix(char *filename, char *suffix) +MatchesFileSuffix(const char *filename, const char *suffix) { int retval = 0; #if defined(_AIX) || defined(SVR4) || defined (__osf__) || defined(linux) || \ defined(CSRG_BASED) - char *pch; + int different = 1; /* * The assumption here is that the use of strrstr is * to determine if "dp->d_name" ends in ".cat". */ - pch = filename; - if ((int) strlen(filename) >= (int) strlen(suffix)) - pch = (char *) - strcmp(filename + (strlen(filename) - strlen (suffix)), suffix); + if (strlen(filename) >= strlen(suffix)) { + different = strcmp(filename + (strlen(filename) - strlen (suffix)), suffix); + } - return (pch == NULL); + return (different == 0); #else return (strrstr(filename, suffix) != NULL); #endif diff --git a/cde/programs/dtlogin/vgcallback.c b/cde/programs/dtlogin/vgcallback.c index 0fc965e3..934fd995 100644 --- a/cde/programs/dtlogin/vgcallback.c +++ b/cde/programs/dtlogin/vgcallback.c @@ -794,7 +794,7 @@ MenuItemCB( Widget w, XtPointer client_data, XtPointer call_data ) session_selected = True; - switch ( (int) client_data) { + switch ( (long) client_data) { case OB_RESTART_SERVER: CleanupAndExit(NULL, NOTIFY_RESTART); diff --git a/cde/programs/dtlogin/vgutil.c b/cde/programs/dtlogin/vgutil.c index f38c7778..c373364a 100644 --- a/cde/programs/dtlogin/vgutil.c +++ b/cde/programs/dtlogin/vgutil.c @@ -774,7 +774,7 @@ OpenCatalog() if (NULL != langenv) { nl_fd = catopen(NLS_CATALOG, NL_CAT_LOCALE); - if (0 > (int) nl_fd) + if (0 > (long) nl_fd) LogError((unsigned char*) MC_DEF_LOG_NO_MSGCAT, langenv); } } @@ -791,7 +791,7 @@ unsigned char * ReadCatalog(int setn, int msgn, char *dflt) { OpenCatalog(); - if ((0 > (int) nl_fd) || (NULL == langenv)) + if ((0 > (long) nl_fd) || (NULL == langenv)) return (unsigned char*) dflt; else return (unsigned char*) catgets(nl_fd, setn, msgn, dflt); @@ -808,7 +808,7 @@ XmString ReadCatalogXms(int setn, int msgn, char *dflt) { OpenCatalog(); - if (0 > (int) nl_fd) + if (0 > (long) nl_fd) return XmStringCreateLocalized(dflt); else return XmStringCreateLocalized((char*) ReadCatalog(setn, msgn, dflt)); -- 2.25.1