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:
parent
49266f9019
commit
5c8f66a07d
12 changed files with 31 additions and 19 deletions
|
@ -206,7 +206,7 @@ void local_channel_object_input_handler(void * client_data,
|
|||
timeout.tv_sec = 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);
|
||||
#else
|
||||
/* UX has select defined with int*, not fd_set* parms */
|
||||
|
|
|
@ -41,6 +41,7 @@
|
|||
#include <stdarg.h>
|
||||
#include <sys/utsname.h>
|
||||
#include <limits.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#define X_INCLUDE_PWD_H
|
||||
#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;
|
||||
|
||||
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,
|
||||
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 */
|
||||
/* than the actual channel pointer in when we pass it to the other */
|
||||
/* 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) {
|
||||
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
#include <bms/sbport.h> /* NOTE: sbport.h must be the first include. */
|
||||
|
||||
#include <signal.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <bms/bms.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);
|
||||
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);
|
||||
|
||||
_DtSvcProcessUnlock();
|
||||
return (sym) ? (int) sym->value : XE_SIG_NOT_IN_TABLE;
|
||||
return (sym) ? (intptr_t) sym->value : XE_SIG_NOT_IN_TABLE;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------+*/
|
||||
|
|
|
@ -1063,7 +1063,7 @@ _DtActionConverter(DtDtsDbField * fields,
|
|||
|
||||
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,
|
||||
fileName)))
|
||||
{
|
||||
|
|
|
@ -951,13 +951,19 @@ _DtCmdCommandInvokerExecute (
|
|||
* Save the current directory and then "chdir" to the directory
|
||||
* 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))
|
||||
{
|
||||
Cmd_FreeAllocatedStringVector (commandArray);
|
||||
(void) sprintf (errorMessage, errorChdir, contextDir, execHost);
|
||||
(void) chdir (tmpDir);
|
||||
if(-1 == chdir (tmpDir)) {
|
||||
perror(strerror(errno));
|
||||
}
|
||||
return (_CMD_EXECUTE_FAILURE);
|
||||
}
|
||||
|
||||
|
@ -981,7 +987,9 @@ _DtCmdCommandInvokerExecute (
|
|||
if (commandPid < 0)
|
||||
{
|
||||
Cmd_FreeAllocatedStringVector (commandArray);
|
||||
(void) chdir (tmpDir);
|
||||
if(-1 == chdir (tmpDir)) {
|
||||
perror(strerror(errno));
|
||||
}
|
||||
(void) sprintf(errorMessage, errorFork, execHost);
|
||||
(void) _DtEnvControl (DT_ENV_RESTORE_POST_DT);
|
||||
return (_CMD_EXECUTE_FAILURE);
|
||||
|
|
|
@ -53,6 +53,7 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdint.h>
|
||||
#include <X11/Intrinsic.h>
|
||||
#include <Xm/AtomMgr.h>
|
||||
#include <Xm/DragDrop.h>
|
||||
|
@ -428,7 +429,7 @@ DtDndDropUnregister(
|
|||
dndDropSiteDestroy, NULL);
|
||||
|
||||
XDeleteContext(display, dndGetContextXID(display),
|
||||
(XContext)dropReceiver);
|
||||
(XContext)(intptr_t)dropReceiver);
|
||||
|
||||
_DtDndDestroyTransfers(dtDropInfo->transfers, dtDropInfo->numTransfers);
|
||||
|
||||
|
@ -1020,7 +1021,7 @@ dndSaveDropInfo(
|
|||
int status;
|
||||
|
||||
status = XSaveContext(display, dndGetContextXID(display),
|
||||
(XContext)dropReceiver, (XPointer)dtDropInfo);
|
||||
(XContext)(intptr_t)dropReceiver, (XPointer)dtDropInfo);
|
||||
|
||||
return (status == 0);
|
||||
}
|
||||
|
@ -1039,7 +1040,7 @@ dndFindDropInfo(
|
|||
DtDropInfo * dtDropInfo;
|
||||
|
||||
status = XFindContext(display, dndGetContextXID(display),
|
||||
(XContext)dropReceiver, (XPointer *)&dtDropInfo);
|
||||
(XContext)(intptr_t)dropReceiver, (XPointer *)&dtDropInfo);
|
||||
|
||||
if (status != 0)
|
||||
dtDropInfo = (DtDropInfo *)NULL;
|
||||
|
|
|
@ -498,7 +498,7 @@ getDragCollection(
|
|||
int status;
|
||||
|
||||
_DtSvcProcessLock();
|
||||
if (dragCollectionContext == (XContext)NULL) {
|
||||
if (dragCollectionContext == (XContext)0) {
|
||||
dragCollectionContext = XUniqueContext();
|
||||
}
|
||||
_DtSvcProcessUnlock();
|
||||
|
|
|
@ -152,7 +152,7 @@ void ** _DtUtilGetHash(DtHashTbl t, const unsigned char * key)
|
|||
if(tbl->hash_type == String_Key)
|
||||
tmp = tbl->table[bucket = hash_string(key, tbl->size)];
|
||||
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)
|
||||
while(tmp!=NULL)
|
||||
|
@ -205,7 +205,7 @@ void ** _DtUtilFindHash(DtHashTbl t, const unsigned char * key)
|
|||
}
|
||||
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)
|
||||
if(tmp->key == key)
|
||||
return((void *)&tmp->data);
|
||||
|
@ -224,7 +224,7 @@ void * _DtUtilDelHash(DtHashTbl t, const unsigned char * key)
|
|||
if(tbl->hash_type == String_Key)
|
||||
bucket = hash_string(key, tbl->size);
|
||||
else
|
||||
bucket = abs((int)key) % tbl->size;
|
||||
bucket = abs((int)(intptr_t)key) % tbl->size;
|
||||
|
||||
if((tmp = tbl->table[bucket])==NULL)
|
||||
return(NULL);
|
||||
|
|
|
@ -1197,7 +1197,7 @@ type_path(const char *path, char *attr)
|
|||
char *c;
|
||||
int match = 0;
|
||||
|
||||
if(path && (int)path != -1)
|
||||
if(path && (intptr_t)path != -1)
|
||||
{
|
||||
#ifdef USE_FNMATCH
|
||||
match = !fnmatch(attr, path, 0);
|
||||
|
|
|
@ -731,5 +731,5 @@ _DtActionCompareRecordBoson(
|
|||
if (results)
|
||||
return(results);
|
||||
|
||||
return((int)record1 - (int)record2);
|
||||
return((intptr_t)record1 - (intptr_t)record2);
|
||||
}
|
||||
|
|
|
@ -41,6 +41,7 @@
|
|||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
#include <Dt/Wsm.h>
|
||||
|
|
|
@ -140,7 +140,7 @@ inline void strfree(const char *s)
|
|||
#if defined(__hpux) || defined(__osf__) || defined(CSRG_BASED)
|
||||
{ if (s != NULL) free((void *)s); }
|
||||
#else
|
||||
{ if (s != NULL) free((const void *)s); }
|
||||
{ if (s != NULL) free((void *)s); }
|
||||
#endif /* __hpux */
|
||||
#endif
|
||||
#if defined(bsd)
|
||||
|
|
Loading…
Reference in a new issue