1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-15 04:32:24 +00:00

libDtSvc: Resolve 28 compiler warnings.

This commit is contained in:
Peter Howkins 2015-01-14 14:10:55 +00:00
parent 49266f9019
commit 5c8f66a07d
12 changed files with 31 additions and 19 deletions

View file

@ -206,7 +206,7 @@ void local_channel_object_input_handler(void * client_data,
timeout.tv_sec = 0; timeout.tv_sec = 0;
timeout.tv_usec = 0; timeout.tv_usec = 0;
#if defined(SVR4) || defined(__osf__) || defined(__hpux) || defined(__OpenBSD__) #if defined(SVR4) || defined(__osf__) || defined(__hpux) || defined(__OpenBSD__) || defined(linux)
select(max_fds, (fd_set*)&read_fd_vect, NULL, (fd_set*)&except_fd_vect, &timeout); select(max_fds, (fd_set*)&read_fd_vect, NULL, (fd_set*)&except_fd_vect, &timeout);
#else #else
/* UX has select defined with int*, not fd_set* parms */ /* UX has select defined with int*, not fd_set* parms */

View file

@ -41,6 +41,7 @@
#include <stdarg.h> #include <stdarg.h>
#include <sys/utsname.h> #include <sys/utsname.h>
#include <limits.h> #include <limits.h>
#include <stdint.h>
#define X_INCLUDE_PWD_H #define X_INCLUDE_PWD_H
#define XOS_USE_XT_LOCKING #define XOS_USE_XT_LOCKING
@ -652,7 +653,7 @@ int print_protocol_request(XeString name, protocol_request_ptr proto)
dptr->data[dptr->offset+dptr->len]=0; dptr->data[dptr->offset+dptr->len]=0;
fprintf(SPC_Print_Protocol, fprintf(SPC_Print_Protocol,
"%s channel: %x, request: %d, length: %d, seq: %d data: %s\n", "%s channel: %p, request: %d, length: %d, seq: %d data: %s\n",
name, proto->channel, proto->request_type, dptr->len, proto->seqno, name, proto->channel, proto->request_type, dptr->len, proto->seqno,
dptr->data+dptr->offset); dptr->data+dptr->offset);
@ -691,7 +692,7 @@ int SPC_Write_Protocol_Request (SPC_Connection_Ptr connection,
/* We are overloading the "channel" field. We put the cid rather */ /* We are overloading the "channel" field. We put the cid rather */
/* than the actual channel pointer in when we pass it to the other */ /* than the actual channel pointer in when we pass it to the other */
/* side of the connection. */ /* side of the connection. */
prot_request->channel=(SPC_Channel_Ptr)(channel ? channel->cid : 0); prot_request->channel=(SPC_Channel_Ptr) (intptr_t) (channel ? channel->cid : 0);
switch (request) { switch (request) {

View file

@ -36,6 +36,7 @@
#include <bms/sbport.h> /* NOTE: sbport.h must be the first include. */ #include <bms/sbport.h> /* NOTE: sbport.h must be the first include. */
#include <signal.h> #include <signal.h>
#include <stdint.h>
#include <bms/bms.h> #include <bms/bms.h>
#include <bms/Symbolic.h> #include <bms/Symbolic.h>
@ -50,7 +51,7 @@ static void Xe_addsig(XeString name, int value)
/*-------------------------------------------------------------------------+*/ /*-------------------------------------------------------------------------+*/
{ {
XeSymbol sym = Xe_intern(Xe_sig_table, name); XeSymbol sym = Xe_intern(Xe_sig_table, name);
sym->value = (void *)value; sym->value = (void *) (intptr_t) value;
} }
/*-------------------------------------------------------------------------+*/ /*-------------------------------------------------------------------------+*/
@ -162,7 +163,7 @@ int XeNameToSignal(XeString name)
sym = Xe_lookup(Xe_sig_table, name); sym = Xe_lookup(Xe_sig_table, name);
_DtSvcProcessUnlock(); _DtSvcProcessUnlock();
return (sym) ? (int) sym->value : XE_SIG_NOT_IN_TABLE; return (sym) ? (intptr_t) sym->value : XE_SIG_NOT_IN_TABLE;
} }
/*-------------------------------------------------------------------------+*/ /*-------------------------------------------------------------------------+*/

View file

@ -1063,7 +1063,7 @@ _DtActionConverter(DtDtsDbField * fields,
if ((ThisBit = _DtActFieldBitLookup(XrmQuarkToString(fields[i].fieldName))) != 0) if ((ThisBit = _DtActFieldBitLookup(XrmQuarkToString(fields[i].fieldName))) != 0)
{ {
switch ((int)(fieldVal=_DtActValidateFieldValue(ThisBit, switch ((intptr_t)(fieldVal=_DtActValidateFieldValue(ThisBit,
fields[i].fieldValue, fields[0].fieldValue, fields[i].fieldValue, fields[0].fieldValue,
fileName))) fileName)))
{ {

View file

@ -951,13 +951,19 @@ _DtCmdCommandInvokerExecute (
* Save the current directory and then "chdir" to the directory * Save the current directory and then "chdir" to the directory
* to do the execution. If the chdir fails, return. * to do the execution. If the chdir fails, return.
*/ */
(void) getcwd (tmpDir, MAXPATHLEN); if(NULL == getcwd (tmpDir, MAXPATHLEN))
{
perror(strerror(errno));
return (_CMD_EXECUTE_FAILURE);
}
if (!_DtCmdValidDir (_cmdClientHost, contextDir, contextHost)) if (!_DtCmdValidDir (_cmdClientHost, contextDir, contextHost))
{ {
Cmd_FreeAllocatedStringVector (commandArray); Cmd_FreeAllocatedStringVector (commandArray);
(void) sprintf (errorMessage, errorChdir, contextDir, execHost); (void) sprintf (errorMessage, errorChdir, contextDir, execHost);
(void) chdir (tmpDir); if(-1 == chdir (tmpDir)) {
perror(strerror(errno));
}
return (_CMD_EXECUTE_FAILURE); return (_CMD_EXECUTE_FAILURE);
} }
@ -981,7 +987,9 @@ _DtCmdCommandInvokerExecute (
if (commandPid < 0) if (commandPid < 0)
{ {
Cmd_FreeAllocatedStringVector (commandArray); Cmd_FreeAllocatedStringVector (commandArray);
(void) chdir (tmpDir); if(-1 == chdir (tmpDir)) {
perror(strerror(errno));
}
(void) sprintf(errorMessage, errorFork, execHost); (void) sprintf(errorMessage, errorFork, execHost);
(void) _DtEnvControl (DT_ENV_RESTORE_POST_DT); (void) _DtEnvControl (DT_ENV_RESTORE_POST_DT);
return (_CMD_EXECUTE_FAILURE); return (_CMD_EXECUTE_FAILURE);

View file

@ -53,6 +53,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdarg.h> #include <stdarg.h>
#include <stdint.h>
#include <X11/Intrinsic.h> #include <X11/Intrinsic.h>
#include <Xm/AtomMgr.h> #include <Xm/AtomMgr.h>
#include <Xm/DragDrop.h> #include <Xm/DragDrop.h>
@ -428,7 +429,7 @@ DtDndDropUnregister(
dndDropSiteDestroy, NULL); dndDropSiteDestroy, NULL);
XDeleteContext(display, dndGetContextXID(display), XDeleteContext(display, dndGetContextXID(display),
(XContext)dropReceiver); (XContext)(intptr_t)dropReceiver);
_DtDndDestroyTransfers(dtDropInfo->transfers, dtDropInfo->numTransfers); _DtDndDestroyTransfers(dtDropInfo->transfers, dtDropInfo->numTransfers);
@ -1020,7 +1021,7 @@ dndSaveDropInfo(
int status; int status;
status = XSaveContext(display, dndGetContextXID(display), status = XSaveContext(display, dndGetContextXID(display),
(XContext)dropReceiver, (XPointer)dtDropInfo); (XContext)(intptr_t)dropReceiver, (XPointer)dtDropInfo);
return (status == 0); return (status == 0);
} }
@ -1039,7 +1040,7 @@ dndFindDropInfo(
DtDropInfo * dtDropInfo; DtDropInfo * dtDropInfo;
status = XFindContext(display, dndGetContextXID(display), status = XFindContext(display, dndGetContextXID(display),
(XContext)dropReceiver, (XPointer *)&dtDropInfo); (XContext)(intptr_t)dropReceiver, (XPointer *)&dtDropInfo);
if (status != 0) if (status != 0)
dtDropInfo = (DtDropInfo *)NULL; dtDropInfo = (DtDropInfo *)NULL;

View file

@ -498,7 +498,7 @@ getDragCollection(
int status; int status;
_DtSvcProcessLock(); _DtSvcProcessLock();
if (dragCollectionContext == (XContext)NULL) { if (dragCollectionContext == (XContext)0) {
dragCollectionContext = XUniqueContext(); dragCollectionContext = XUniqueContext();
} }
_DtSvcProcessUnlock(); _DtSvcProcessUnlock();

View file

@ -152,7 +152,7 @@ void ** _DtUtilGetHash(DtHashTbl t, const unsigned char * key)
if(tbl->hash_type == String_Key) if(tbl->hash_type == String_Key)
tmp = tbl->table[bucket = hash_string(key, tbl->size)]; tmp = tbl->table[bucket = hash_string(key, tbl->size)];
else else
tmp = tbl->table[bucket = abs((int)key) % tbl->size]; tmp = tbl->table[bucket = abs((int)(intptr_t)key) % tbl->size];
if(tbl->hash_type == String_Key) if(tbl->hash_type == String_Key)
while(tmp!=NULL) while(tmp!=NULL)
@ -205,7 +205,7 @@ void ** _DtUtilFindHash(DtHashTbl t, const unsigned char * key)
} }
else else
{ {
tmp = tbl->table[abs((int)key) % tbl->size]; tmp = tbl->table[abs((int)(intptr_t)key) % tbl->size];
for(;tmp!=NULL; tmp = tmp->next_entry) for(;tmp!=NULL; tmp = tmp->next_entry)
if(tmp->key == key) if(tmp->key == key)
return((void *)&tmp->data); return((void *)&tmp->data);
@ -224,7 +224,7 @@ void * _DtUtilDelHash(DtHashTbl t, const unsigned char * key)
if(tbl->hash_type == String_Key) if(tbl->hash_type == String_Key)
bucket = hash_string(key, tbl->size); bucket = hash_string(key, tbl->size);
else else
bucket = abs((int)key) % tbl->size; bucket = abs((int)(intptr_t)key) % tbl->size;
if((tmp = tbl->table[bucket])==NULL) if((tmp = tbl->table[bucket])==NULL)
return(NULL); return(NULL);

View file

@ -1197,7 +1197,7 @@ type_path(const char *path, char *attr)
char *c; char *c;
int match = 0; int match = 0;
if(path && (int)path != -1) if(path && (intptr_t)path != -1)
{ {
#ifdef USE_FNMATCH #ifdef USE_FNMATCH
match = !fnmatch(attr, path, 0); match = !fnmatch(attr, path, 0);

View file

@ -731,5 +731,5 @@ _DtActionCompareRecordBoson(
if (results) if (results)
return(results); return(results);
return((int)record1 - (int)record2); return((intptr_t)record1 - (intptr_t)record2);
} }

View file

@ -41,6 +41,7 @@
**************************************************************************** ****************************************************************************
************************************<+>*************************************/ ************************************<+>*************************************/
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#include <X11/Xlib.h> #include <X11/Xlib.h>
#include <X11/Xutil.h> #include <X11/Xutil.h>
#include <Dt/Wsm.h> #include <Dt/Wsm.h>

View file

@ -140,7 +140,7 @@ inline void strfree(const char *s)
#if defined(__hpux) || defined(__osf__) || defined(CSRG_BASED) #if defined(__hpux) || defined(__osf__) || defined(CSRG_BASED)
{ if (s != NULL) free((void *)s); } { if (s != NULL) free((void *)s); }
#else #else
{ if (s != NULL) free((const void *)s); } { if (s != NULL) free((void *)s); }
#endif /* __hpux */ #endif /* __hpux */
#endif #endif
#if defined(bsd) #if defined(bsd)