libDtSvc: Resolve 89 compiler warnings.
authorPeter Howkins <flibble@users.sourceforge.net>
Sat, 1 Sep 2012 20:35:10 +0000 (21:35 +0100)
committerPeter Howkins <flibble@users.sourceforge.net>
Sat, 1 Sep 2012 20:35:10 +0000 (21:35 +0100)
24 files changed:
cde/lib/DtSvc/DtEncap/connect.c
cde/lib/DtSvc/DtEncap/spc-exec.c
cde/lib/DtSvc/DtEncap/spc-net.c
cde/lib/DtSvc/DtEncap/spc-obj.c
cde/lib/DtSvc/DtEncap/spc-proto.c
cde/lib/DtSvc/DtEncap/spc-util.c
cde/lib/DtSvc/DtEncap/spc-xt.c
cde/lib/DtSvc/DtUtil1/Action.c
cde/lib/DtSvc/DtUtil1/ActionDb.c
cde/lib/DtSvc/DtUtil1/ActionFind.c
cde/lib/DtSvc/DtUtil1/ActionUtil.c
cde/lib/DtSvc/DtUtil1/CmdMain.c
cde/lib/DtSvc/DtUtil1/DbReader.c
cde/lib/DtSvc/DtUtil1/DndDrop.c
cde/lib/DtSvc/DtUtil1/Dts.c
cde/lib/DtSvc/DtUtil1/DtsMM.c
cde/lib/DtSvc/DtUtil1/GetMwmW.c
cde/lib/DtSvc/DtUtil1/Qualify.c
cde/lib/DtSvc/DtUtil1/SmComm.c
cde/lib/DtSvc/DtUtil1/strtab.c
cde/lib/DtSvc/DtUtil2/EnvControl.c
cde/lib/DtSvc/DtUtil2/SmCreateDirs.c
cde/lib/DtSvc/DtUtil2/XlationSvc.c
cde/lib/DtSvc/DtUtil2/addToRes.c

index 50f2edb2723539cb2c92a1b85f65aa473cef2638..b9f0f099d7ec96ff8c367b9280dd3726b0a4ed5c 100644 (file)
@@ -119,7 +119,7 @@ XeFindShortHost(XeString host_spec)
       if (ptr2 && strequal(ptr, ptr2)) { /* domains same, can eliminate */
          host = Xe_make_ntype(ptr-host_spec+1, XeChar);
          strncpy(host, host_spec, ptr-host_spec); /* copy only up to "." */
-         host[ptr-host_spec] = NULL; /* NULL terminate copy */
+         host[ptr-host_spec] = '\0'; /* NULL terminate copy */
       }
       else
          host = strdup(host_spec);
@@ -311,7 +311,7 @@ Xegetshorthostname(XeString buffer, unsigned int bufsize)
    if (status = gethostname(buffer, bufsize))
       return status; /* failed gethostname */
    if (ptr = strstr(buffer, (XeString)"."))
-      *ptr = NULL;  /* delete domain name if there is one */
+      *ptr = '\0';  /* delete domain name if there is one */
    return 0;
 }
 
@@ -398,7 +398,7 @@ Xegetcwd(char *buf, int size)
          len = size-1;
       
       strncpy(buf, current_dir, len);
-      buf[len] = NULL;
+      buf[len] = '\0';
 
       /* Make sure $PWD is the same as "." before we trust it. */
       /* All this is still much faster the getcwd() esp. on UX discless. */
index 1123c8688ad38d2cdbc5f2ab297ed9d43487e485..3c2d23302055bf555ce23aeba219050ed9968366 100644 (file)
@@ -286,7 +286,7 @@ void SPC_Child_Terminated(int i)
      * as done.
      */
     if (SPC_pid_list != NULL) {
-      for (indx=0; SPC_pid_list[indx] != NULL; indx++)
+      for (indx=0; SPC_pid_list[indx] != 0; indx++)
         if (SPC_pid_list[indx] == pid) {
           SPC_pid_list[indx] = SPCD_DEAD_PROCESS;
           break;
@@ -323,7 +323,7 @@ void SPC_Child_Terminated(int i)
       print_protocol_request((XeString) (XeString)"  <-- INTERNAL APPLICATION_DIED", prot);
     }
     else {
-      SPC_Change_State(channel, NULL, -1, 0);
+      SPC_Change_State(channel, 0, -1, 0);
       if(channel->Terminate_Handler) {
        XeSPCGetProcessStatus(channel, &type, &cause);
        (* channel->Terminate_Handler)
@@ -474,7 +474,7 @@ int exec_proc_local_channel_object(SPC_Channel_Ptr channel)
        * If a dead pid entry exists, reuse it; otherwise, must create 
        * room for the new pid.
        */
-      for (i = 0; SPC_pid_list[i] != NULL; i++)
+      for (i = 0; SPC_pid_list[i] != 0; i++)
         if (SPC_pid_list[i] == SPCD_DEAD_PROCESS) {
          SPC_pid_list[i] = pid;
          reuse_pid = 1;
@@ -486,7 +486,7 @@ int exec_proc_local_channel_object(SPC_Channel_Ptr channel)
     }
     if (!reuse_pid) {
       SPC_pid_list[i] = pid;
-      SPC_pid_list[i+1] = NULL;
+      SPC_pid_list[i+1] = 0;
     }
     _DtSvcProcessUnlock();
 
index d83df3e29fc5ff2cfe853644013a398d8605c582..dc9cc4071dd4c497ca0c092f6e2294bdf3736219 100644 (file)
@@ -294,7 +294,7 @@ SPC_Open_Socket(SPC_Connection_Ptr conn,
 
   struct servent *service;
   
-  conn->sid=socket(type, SOCK_STREAM, NULL);
+  conn->sid=socket(type, SOCK_STREAM, 0);
   if(conn->sid == ERROR) {
     SPC_Error(SPC_Bad_Socket);
     return(SPC_ERROR);
@@ -406,7 +406,7 @@ SPC_Connection_Ptr SPC_Standalone_Daemon(SPC_Connection_Ptr conn)
 #if defined(__aix)
   if (setsockopt(conn->sid, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on))==ERROR) {
 #else
-  if (setsockopt(conn->sid, SOL_SOCKET, SO_REUSEADDR, NULL, NULL)==ERROR) {
+  if (setsockopt(conn->sid, SOL_SOCKET, SO_REUSEADDR, NULL, 0)==ERROR) {
 #endif
     SPC_Error(SPC_Bad_Reuse);
     return(SPC_ERROR);
index 1e2c5865513800300e0b29a58b9bed303772dcba..1adb475fe32c7729802964520ca45a3d65a7f6a9 100644 (file)
@@ -71,7 +71,7 @@ object *alloc_channel_object(object_clasp c)
 /*----------------------------------------------------------------------+*/
 {
   object *p=(object *) XeMalloc((unsigned) c->object_size);
-  memset(p, NULL, (int) c->object_size);
+  memset(p, 0, (int) c->object_size);
   return(p);
 }
 
@@ -116,7 +116,7 @@ static Wire dummy_wire={
   (XeString) "/dev/null",      /* Master PTY */
   (XeString) "/dev/null",      /* Slave PTY */
   0, 0,                          /* Toolkit IDs */
-  NULL                           /* pointer to next wire */
+  0                           /* pointer to next wire */
   };
 
 /*----------------------------------------------------------------------+*/
@@ -234,7 +234,7 @@ void SPC_Channel_Terminated(SPC_Channel_Ptr channel)
 {
   int type, cause;
 
-  SPC_Change_State(channel, NULL, -1, 0);
+  SPC_Change_State(channel, 0, -1, 0);
 
   /* Set the close timeout.  If we are on a PTY, we will return
      after two seconds if we are waiting for EOF */
@@ -596,7 +596,7 @@ int pre_fork_channel_object(SPC_Channel_Ptr channel)
 
   /* Move to the "Running & (possibly) data ready" state */
   
-  SPC_Change_State(channel, NULL, flag, 1);
+  SPC_Change_State(channel, 0, flag, 1);
 
   
   return(TRUE);
index 33a3981d43b61fc6b6d7281603267cad6b8127f3..a17818cd3f03ea3d040f58eee8b3eb7474a3e8a5 100644 (file)
@@ -189,7 +189,7 @@ SPC_Connection_Ptr SPC_Alloc_Connection(void)
   _DtSvcProcessLock();
   conn=(SPC_Connection_Ptr) XeMalloc(sizeof(SPC_Connection));
   /* Zero the connection */
-  memset(conn, NULL, sizeof(SPC_Connection));
+  memset(conn, 0, sizeof(SPC_Connection));
   conn->queued_remote_data = Xe_make_queue(FALSE);
   conn->termination_id = (-1);
   /* Init the socket id to "-1" because "0" is a valid file descriptor. */
@@ -439,7 +439,7 @@ protocol_request_ptr SPC_Read_Protocol(SPC_Connection_Ptr connection)
   if(!connection->connected)
     return(SPC_ERROR);
   
-  if((prot=SPC_New_Protocol_Ptr(NULL, NULL, NULL))==SPC_ERROR) {
+  if((prot=SPC_New_Protocol_Ptr(NULL, 0, 0))==SPC_ERROR) {
     SPC_Close_Connection(connection);
     return(SPC_ERROR);
   }
@@ -1159,12 +1159,12 @@ int SPC_Send_Multi_Packet(SPC_Connection_Ptr connection,
     
     if(this_str == NULL)
       this_str = NULL_STR;
-    if(*this_str == NULL)
+    if(*this_str == '\0')
       this_str = EMPTY_STR;
     
     tmp_len=strlen(this_str)+1;         /* Room for NULL char */
     if((bytes_left-tmp_len) < 1) {
-      *buf=NULL;
+      *buf='\0';
       prot->dataptr->len=numbytes+1;
       SPC_Write_Single_Prot_Request(connection, name, prot);
       SPC_Free_Protocol_Ptr(prot);
@@ -1193,7 +1193,7 @@ int SPC_Send_Multi_Packet(SPC_Connection_Ptr connection,
   }
   
   if(numbytes) {
-    *buf=NULL;
+    *buf='\0';
     prot->dataptr->len=numbytes+1;
     SPC_Write_Single_Prot_Request(connection, (XeString)"  <-- ENVIRON_RESET", prot);
     SPC_Free_Protocol_Ptr(prot);
@@ -1342,7 +1342,7 @@ XeString *sscan_counted_string(XeString buf,
     len=strlen(bufptr)+1;  /* len is string SIZE (with room for NULL) */
     *tmpidx=(XeString)XeMalloc(len);
     strncpy(*tmpidx, bufptr, len);
-    (*tmpidx)[len-1]=NULL;
+    (*tmpidx)[len-1]='\0';
     bufptr+= len;
   }
   *tmpidx=NULL;
index f934e23495e80d354bb8f854f69c1c642845464b..0083eac5fcc62a328b20ed8a0f3bbc7f73391d61 100644 (file)
@@ -51,12 +51,12 @@ Wire *get_new_wire(void)
   Wire *tmp_wire;
 
   tmp_wire=(Wire *)XeMalloc(sizeof(Wire));
-  memset(tmp_wire, NULL, sizeof(Wire));
+  memset(tmp_wire, 0, sizeof(Wire));
 
   tmp_wire->master_name=(XeString)XeMalloc(PTY_NAMLEN);
-  memset(tmp_wire->master_name, NULL, PTY_NAMLEN);
+  memset(tmp_wire->master_name, 0, PTY_NAMLEN);
   tmp_wire->slave_name =(XeString)XeMalloc(PTY_NAMLEN);
-  memset(tmp_wire->slave_name,  NULL, PTY_NAMLEN);
+  memset(tmp_wire->slave_name,  0, PTY_NAMLEN);
   tmp_wire->fd[0] = tmp_wire->fd[1] = (-1);
   tmp_wire->read_toolkit_id   = (-1);
   tmp_wire->except_toolkit_id = (-1);
@@ -114,7 +114,7 @@ spc_dup2(int from, int to)
   int retval;
   
   /* Dup file descriptors.  If a null descriptor, then use /dev/null */
-  static int devnull = NULL;
+  static int devnull = 0;
 
   if (from == to)
     return(TRUE);
@@ -155,7 +155,7 @@ XeString *Alloc_Argv(int n)
   av = (XeString *)XeMalloc((n + 1) * sizeof(XeString));
   
   /* Zero the space so we don't have to worry about trailing NULL */
-  memset((XeString) av, NULL, (n + 1) * sizeof(XeString));
+  memset((XeString) av, 0, (n + 1) * sizeof(XeString));
   
   return(av);
 }
@@ -263,7 +263,7 @@ Boolean _path_search (XeString path, XeString filename, path_search_predicate p)
     if(next_colon) { /* found colon */
       path_component_len = next_colon-path_rest;
       strncpy(buffer, path_rest, path_component_len);
-      buffer[path_component_len]=NULL;
+      buffer[path_component_len]='\0';
       path_rest=next_colon+1;
       if(!*path_rest)
        /* We've seen a ':' at the end of the string.  Make path_rest be "."
@@ -281,7 +281,7 @@ Boolean _path_search (XeString path, XeString filename, path_search_predicate p)
 
     if(!buffer[0]) {
       buffer[0] = '.';
-      buffer[1] = NULL;
+      buffer[1] = '\0';
     }
     
     /*
index 442ad9a38e821257c7ea7f6e93605645e64a8bac..364916025599c387ea40653e737160d45d685cc6 100644 (file)
@@ -71,7 +71,7 @@ static int SPC_AddInput(int                   source,
   if (SPC_Fd_Mapping == NULL) {
     SPC_Fd_Mapping = (SPC_Callback_Struct **) 
                     XeMalloc (FD_SETSIZE * sizeof (SPC_Callback_Struct *));
-    memset(SPC_Fd_Mapping, NULL, FD_SETSIZE * sizeof(SPC_Callback_Struct *));
+    memset(SPC_Fd_Mapping, 0, FD_SETSIZE * sizeof(SPC_Callback_Struct *));
   }
   structptr=SPC_LOOKUP_FD_MAPPING(source);
 
@@ -112,7 +112,7 @@ static SbInputId SPC_RemoveInput(int                         source,
   if (SPC_Fd_Mapping == NULL) {
     SPC_Fd_Mapping = (SPC_Callback_Struct **) 
                     XeMalloc (FD_SETSIZE * sizeof (SPC_Callback_Struct *));
-    memset(SPC_Fd_Mapping, NULL, FD_SETSIZE * sizeof(SPC_Callback_Struct *));
+    memset(SPC_Fd_Mapping, 0, FD_SETSIZE * sizeof(SPC_Callback_Struct *));
   }
   structptr=SPC_LOOKUP_FD_MAPPING(source);
   _DtSvcProcessUnlock();
@@ -129,7 +129,7 @@ static SbInputId SPC_RemoveInput(int                         source,
     
   }
 
-  return NULL;
+  return 0;
 }
   
 /*-----------------------------------------------------------------------+*/
index 8e232ee3ddc2589892c48a894f64a7a8be10ef7e..c14d98db9da1b84a58c48076961c19057fae9f2f 100644 (file)
@@ -1472,11 +1472,11 @@ CreateInvocationRecord(
                  */
                return NULL;
       }
-      myassert(invp->id != NULL );
+      myassert(invp->id != 0);
 
       SET_INV_PENDING(invp->state);
       invp->w = w;
-      invp->numChildren = NULL;
+      invp->numChildren = 0;
       invp->childRec = NULL;
 
       /*
@@ -4802,7 +4802,7 @@ InitiateCommandInvokerRequest(
    CallbackData *data=(CallbackData *)XtMalloc((Cardinal)sizeof(CallbackData));
    ActionPtr action = request->clonedAction;
 
-   tmpFileBuf[0]=NULL; /* seed the buffer with a null string */
+   tmpFileBuf[0]='\0'; /* seed the buffer with a null string */
 
    /*
     * Generate the procId option string for dtexec
@@ -4833,9 +4833,9 @@ InitiateCommandInvokerRequest(
    /*
     * The string generated for procId should never exceed the procId buf size. 
     */
-   sprintf(procIdBuf,"%s_%d_%d",
+   sprintf(procIdBuf,"%s_%d_%lu",
        _DtActNULL_GUARD(procId),
-       request->invocId,
+       (int) request->invocId,
        request->childId );
 
    myassert( strlen(procIdBuf) < sizeof(procIdBuf) );
@@ -5309,7 +5309,7 @@ _DtActMapFileName(
     * Create the full path name relative to curHost
     */
    
-   buf[0]=NULL;        /* empty string to start with */
+   buf[0]='\0';        /* empty string to start with */
 
    if ( dir )
           strcpy(buf,dir);
@@ -5326,7 +5326,7 @@ _DtActMapFileName(
    }
 
    /* We should have constructed a file name string now */
-   myassert(buf[0] != NULL);
+   myassert(buf[0] != '\0');
 
    if (newHost)
    {
index aa7fab9f4a605d3afd1fa7c304c448a750832120..d7dfb8ce2d13109e501a6b2a0dff2a8b0c073b78 100644 (file)
@@ -210,7 +210,7 @@ Meaningless for actions -- ignore these for now
        _DtACTION_DT_NGROUP,            _ActDb_DT_NGROUP_SET,
        _DtPFX _DtACTION_DTN_VALUE,     _ActDb_DT_ARGN_VAL_SET,
 #endif /* _DT_ALLOW_DT_MSGS */
-       NULL,                           NULL
+       NULL,                           0
 };
 
 #define        NUM_FIELD_NAMES         sizeof(_DtActNamesAndBits)/sizeof(_DtActNameAndBit) - 1
@@ -235,7 +235,7 @@ _DtActFieldBitLookup(char *name)
 #endif /* _DT_ALLOW_DT_MSGS */
 
        if ( !np )
-               return NULL;
+               return 0;
        /*
         * Check for [DT]T_ARGn_ fields
         * The following code assumes that a unique suffix identifying each
@@ -267,7 +267,7 @@ _DtActFieldBitLookup(char *name)
 #endif /* _DT_ALLOW_DT_MSGS */
 
        if ( !np )
-               return NULL;
+               return 0;
 
        for ( j = 0; j < NUM_FIELD_NAMES; j++ )
                if ( !strcmp(_DtActNamesAndBits[j].name,np) )
@@ -397,7 +397,7 @@ _DtActValidateFieldValue( long bit, char *value, char *actName, char *filename)
                        /*
                         * temporarily truncate string for testing
                         */
-                       *p = NULL;
+                       *p = '\0';
                        if (    strcmp(_DtACT_ANY,start)          &&
                                strcmp(_DtACTION_FILE,start)    && 
                                strcmp(_DtACTION_BUFFER,start)   )
@@ -540,7 +540,7 @@ _DtActValidateFieldValue( long bit, char *value, char *actName, char *filename)
                                return (char *) -1;
                        }
                }
-               if (*p == NULL)
+               if (*p == '\0')
                {
                        /* looks like an error */
                        buf = malloc(_DtAct_MAX_BUF_SIZE);
@@ -1028,7 +1028,7 @@ _DtActionConverter(DtDtsDbField * fields,
                _DtSvcProcessUnlock();
                return(True);
        }
-       else if (  fields[1].fieldName == NULL)
+       else if (  fields[1].fieldName == 0)
        {
                /* The record contains no fields */
                buf = XtMalloc(_DtAct_MAX_BUF_SIZE);
@@ -1060,7 +1060,7 @@ _DtActionConverter(DtDtsDbField * fields,
 
                /* find the corresponding field entry and bitmask */
 
-               if ((ThisBit = _DtActFieldBitLookup(XrmQuarkToString(fields[i].fieldName))) != NULL)
+               if ((ThisBit = _DtActFieldBitLookup(XrmQuarkToString(fields[i].fieldName))) != 0)
                {
                        switch ((int)(fieldVal=_DtActValidateFieldValue(ThisBit,
                                 fields[i].fieldValue, fields[0].fieldValue,
index 9b07aeaec0a80bf90112b5537bbb843c07803c35..a3fa5ec9a3187901e041239e098ec3e39dfd29f4 100644 (file)
@@ -1130,8 +1130,8 @@ _DtActionGetRecordWeight(
 static unsigned long
 _DtActMMParseArgTypesList(char *tlist, DtShmBoson **quarkAddr, int *countp)
 {
-       static DtShmBoson       quark_for_wild_char = NULL;
-       unsigned long   mask = NULL;
+       static DtShmBoson       quark_for_wild_char = 0;
+       unsigned long   mask = 0;
        int             tcount;
        DtShmBoson      *qp;
        char            **typeVec, **tvp;
@@ -1182,7 +1182,7 @@ _DtActMMParseClassList(char *clist)
        char buf[_DtAct_MAX_BUF_SIZE];
        char *bp;
        char **classVec, **cvp;
-       unsigned long mask = NULL;
+       unsigned long mask = 0;
 
        if (  !DtStrchr(clist, _DtACT_LIST_SEPARATOR_CHAR ) )
        {
@@ -1236,7 +1236,7 @@ _DtActMMParseClassList(char *clist)
 static unsigned long
 _DtActMMParseArgCountString( char *countStr, int *countp)
 {
-       unsigned long mask = NULL;
+       unsigned long mask = 0;
 
        if ( !strcmp(countStr,_DtACT_ANY) )     
                return SET_ARG_COUNT_WILD(mask);
@@ -1258,7 +1258,7 @@ _DtActMMParseArgCountString( char *countStr, int *countp)
 static unsigned long
 _DtActMMParseActionType(char *actionTypeStr)
 {
-       unsigned long mask = NULL;
+       unsigned long mask = 0;
 
        if ( !strcmp(actionTypeStr,_DtACTION_COMMAND) )
                return SET_CMD_ACTION(mask);
index 85f3ed765e0714d9003fa85b231798816eaaf8b7..3d099e9c39020c8f9ae3a2c62c2401a683ad4aa6 100644 (file)
@@ -111,7 +111,7 @@ _DtBasename( const char *s )
                return NULL;
 
        /* Work on a local copy of the original string */
-       *p = NULL;
+       *p = '\0';
        (void)strcpy(p,s);
 
 #ifdef _Dt_HOST_COLON_PATH_SUPPORT
@@ -140,7 +140,7 @@ _DtBasename( const char *s )
                 myassert( *basep == '/');
                if ( basep == p )
                        return XtNewString(basep);
-               *basep = NULL;  /* replace trailing slash */
+               *basep = '\0';  /* replace trailing slash */
                if ( (basep = DtStrrchr(p,'/')) == NULL )
                        return XtNewString(p);
        }
@@ -202,7 +202,7 @@ _DtDirname( const char *s)
 
 
        /* Work on a local copy of the original string */
-       *p = NULL;
+       *p = '\0';
        (void)strcpy(p,s);
 
 #ifdef _Dt_HOST_COLON_PATH_SUPPORT
@@ -231,7 +231,7 @@ _DtDirname( const char *s)
                 * -- then try again else break
                 */
                if ( slashp == DtPrevChar(p,p + strlen(p)) )
-                       *slashp = NULL;
+                       *slashp = '\0';
                else
                        break;
        }
@@ -244,7 +244,7 @@ _DtDirname( const char *s)
         * directory name.
         */
        dirp = XtNewString(p);
-       *(dirp + (slashp - p)) = NULL;
+       *(dirp + (slashp - p)) = '\0';
        return dirp;
 }
 
@@ -283,14 +283,14 @@ _DtHostString( const char *s)
         * Make a local copy of the string to avoid problems modifying
         * "const" strings.
         */
-       *p = NULL;
+       *p = '\0';
        (void) strcpy(p,s);
 
        /* if ( (slashp > s) && (*(slashp -1) == ':' )) */
        if ( (slashp > s) && (*DtPrevChar(s,slashp)  == ':' ))
        {
                /* *(p + (slashp - s - 1)) = NULL; */
-                *(p + (DtPrevChar(s,slashp) - s)) = NULL;
+                *(p + (DtPrevChar(s,slashp) - s)) = '\0';
                host = XtNewString(p);
                return host;
        }
@@ -344,7 +344,7 @@ _DtGetDisplayHostName( Display *dp)
              }
 
        tmpName = XtMalloc(MAXHOSTNAMELEN + 5);
-       tmpName[0] = NULL;
+       tmpName[0] = '\0';
 
        if ( dp )
        {
@@ -356,7 +356,7 @@ _DtGetDisplayHostName( Display *dp)
                strcpy(tmpName,DisplayString(dp));
                if ( tmp = DtStrrchr(tmpName,':') )
                {
-                       *tmp = NULL;
+                       *tmp = '\0';
                        displayHostName = XtNewString(tmpName);
                }
        } 
@@ -370,7 +370,7 @@ _DtGetDisplayHostName( Display *dp)
                strcpy(tmpName,getenv("DISPLAY"));
                if ( tmp = DtStrrchr(tmpName,':') )
                {
-                       *tmp = NULL;
+                       *tmp = '\0';
                        displayHostName = XtNewString(tmpName);
                }
        }
@@ -424,7 +424,7 @@ _DtGetLocalHostName( void )
                return NULL; /* failed gethostname */
              }
        if (ptr = DtStrchr(hostNameBuf, '.'))
-               *ptr = NULL;  /* delete domain name if there is one */
+               *ptr = '\0';  /* delete domain name if there is one */
 
        localHostName = hostNameBuf;
        _DtSvcProcessUnlock();
@@ -481,9 +481,9 @@ _DtIsSameHost(const char *host1, const char *host2)
         * to their short form before doing the compare.
         */
        if ( (tp = DtStrchr(hostName1,'.')) != NULL )
-               *tp = NULL;
+               *tp = '\0';
        if ( (tp = DtStrchr(hostName2,'.')) != NULL )
-               *tp = NULL;
+               *tp = '\0';
 
        /*
         * Try to avoid querying the name server (or /etc/hosts).
@@ -502,7 +502,7 @@ _DtIsSameHost(const char *host1, const char *host2)
         */
        strcpy(hostName1, host_ret->h_name);
        if ( (tp = DtStrchr(hostName1,'.')) != NULL )
-               *tp = NULL;
+               *tp = '\0';
 
        /*
         * Try comparing again -- avoiding another gethostbyname
@@ -838,7 +838,7 @@ _DtActGenerateTmpFile(char *dir,char *format,mode_t mode,int *fd)
                  * of the tmp file name (i.e. no %s in format) then
                  * there is no sense trying more than once.
                  */
-                if ( countTrys > 0 && (strcmp(f,nameBuf) == NULL))
+                if ( countTrys > 0 && (strcmp(f,nameBuf) == 0))
                     return NULL;
 
                base = XtNewString(nameBuf);
@@ -892,7 +892,7 @@ _DtRemoveTrailingBlanksInPlace(char **s)
        for ( p = DtPrevChar(*s,*s + strlen(*s)); 
               DtIsspace(p) && (p > *s); 
               p=DtPrevChar(*s,p))
-               *p = NULL;
+               *p = '\0';
        
 }
 
@@ -1245,7 +1245,7 @@ int _DtActDeleteInvRec( DtActionInvocationID id )
 
                     if (IS_BUFFER_OBJ(infop->mask) && IS_FILE_OBJ(infop->mask))
                     {
-                        myassert((infop->name!=NULL) && (*infop->name!=NULL));
+                        myassert((infop->name != NULL) && (*infop->name != '\0'));
                         if ( !infop->name )
                             continue;
                         /*
@@ -1317,7 +1317,7 @@ _DtActChildRecT *_DtActAllocChildRec( _DtActInvRecT *invRec )
 
        tchildRec = invRec->childRec[invRec->numChildren - 1];  /* shorthand */
 
-        memset(tchildRec, NULL, sizeof(_DtActChildRecT));
+        memset(tchildRec, 0, sizeof(_DtActChildRecT));
        tchildRec->childId     = invRec->numChildren;   /* serial # of sorts */
 
        /* tchildRec->u.*      = initialized elsewhere */
@@ -1837,7 +1837,7 @@ _DtActReadTmpFileToBuffer( char *fname, int *sizep )
 
     buf = (char *) XtMalloc(MAX_BUF_SIZE);
     for (size=0, space=MAX_BUF_SIZE;
-        (bytes=read(fd,buf+size,space)) != NULL;
+        (bytes=read(fd,buf+size,space)) != 0;
          size += bytes  )
     {
        if ( bytes < 0 )
index d57a2f4ee430f228d5f001cfb7a51b22328d671b..08ff5c447fc7f47be938019b1e69de029bac35e9 100644 (file)
@@ -578,7 +578,7 @@ ExecuteQueuedRequest (
                                             strlen (pNode->exec_host) +
                                             cmdlen + 4);
            cmdp = (char *) XtMalloc(cmdlen + 1);
-           *cmdp = NULL;
+           *cmdp = '\0';
            for (i = 0; pNode->argv[i]; i++) {
               strcat(cmdp,pNode->argv[i]);
               strcat(cmdp, " ");
@@ -1177,7 +1177,7 @@ DtCmdGetWindowType(
        switch ( windowTypeMask )
        {
        case _DtAct_NO_STDIO_BIT:
-               winTypeNum = NULL;
+               winTypeNum = 0;
                break;
        case _DtAct_TERMINAL_BIT:
                winTypeNum = TERMINAL;
index e6ac28ee48e85613997b5dcfe31cf20e526ef9f0..e59f48483aaa9bb7af2c28d38dbec8bde63b5e10 100644 (file)
@@ -1712,7 +1712,7 @@ SplitField(
       *NumberFieldsAllocated += NUMBER_FIELDS_INCREMENT;
    }
 
-   (*fields)[*slotToUse].fieldName = NULL;
+   (*fields)[*slotToUse].fieldName = 0;
    (*fields)[*slotToUse].fieldValue = NULL;
 
    /* A NULL ptr is how we force a NULL entry to terminate the array */
index aa639f95a98c3118a9a6bbb46d0103b418a62c51..a3c05cff8d21fd6eeda9f91318d87d992b2ca07a 100644 (file)
@@ -998,7 +998,7 @@ dndGetContextXID(
         static XID contextXID;
 
        _DtSvcProcessLock();
-       if (contextXID == NULL) {
+       if (contextXID == 0) {
                contextXID = XCreatePixmap(display, 
                                        DefaultRootWindow(display), 1, 1, 1);
        }
index 4b5956c80e4ca2886e94234985982a99de6ec2eb..eb9881bb282f83a0cf264a4f6081d6a49a556827 100644 (file)
@@ -712,7 +712,7 @@ get_buff(type_info_t *info)
                        if((info->buffer = mmap(NULL,
                                buf->st_size,
                                PROT_READ, MAP_PRIVATE,
-                               info->file_fd, NULL)) == (char *)-1)
+                               info->file_fd, 0)) == (char *)-1)
                        {
                                info->mmap_size_to_free = -1;
                                info->size_to_free = buf->st_size+1;
index d9d745f191ad8587612570f395e62e17060819df..8e2a84b5b545feddae2f2bf742e2e782a0cedb83 100644 (file)
@@ -609,7 +609,7 @@ _DtDtsMMapDB(const char *CacheFile)
                                        MAP_SHARED,
 #endif
                                        mmaped_fd,
-                                       NULL);
+                                       0);
                        if(mmaped_db != (void *) -1)
                        {
                                success = TRUE;
index 2f4c6dab9a704bf5cf71216b0b4bb921e4378e63..98305cede974f69d0961d6cafa4f677210629338 100644 (file)
@@ -115,7 +115,7 @@ _GetMwmWindow(
     Window wroot, wparent, *pchildren;
     unsigned int nchildren;
 
-    *pMwmWindow = NULL;
+    *pMwmWindow = 0;
     if ((rcode=XGetWindowProperty(display,root,
                             property,0L, PROP_MWM_INFO_ELEMENTS,
                             False,property,
index 5b4803b12abe14cfaf795074f8a086afa5c1e0ef..0395300ea2920ad984857ef33027f39995653335 100644 (file)
@@ -38,6 +38,7 @@
  ************************************<+>*************************************/
 #include <stdio.h>
 #include <string.h>
+#include <stdlib.h>
 
 /*********************************************************************
  * _DtQualifyWithFirst
index 42c6a53121b054dafbf102767c03b293bb2d00cb..92df8d681086413b7d774e1b354b128c1a16bfe5 100644 (file)
@@ -843,7 +843,7 @@ _GetSmWindow(
     Window wroot, wparent, *pchildren;
     unsigned int nchildren;
 
-    *pSmWindow = NULL;
+    *pSmWindow = 0;
     if ((rcode=XGetWindowProperty(display,root,
                             property,0L, PROP_DT_SM_WINDOW_INFO_ELEMENTS,
                             False,property,
@@ -938,8 +938,8 @@ static struct {
   char *string;
   Atom atom;
 } smAtomList[] = {
-  {_XA_DT_SM_STATE_INFO, NULL},
-  {_XA_DT_SM_SAVER_INFO, NULL},
+  {_XA_DT_SM_STATE_INFO, 0},
+  {_XA_DT_SM_SAVER_INFO, 0},
 };
 
 static Atom
index 26c0015b8f238e5e32f20f790235c06728e710c2..a1628d3a9ed255f07a4066e57c800130deb1fbec 100644 (file)
@@ -170,7 +170,7 @@ _DtShmProtoAddStrtab(DtShmProtoStrtab strlist, const char * string, int * isnew)
   
   int ret = *bucket;
 
-  if(*bucket == NULL) /* new */ {
+  if(*bucket == 0) /* new */ {
     unsigned char ** sptr;
     *isnew = 1;
     *bucket = ret = ptr->sl_charcount;
index bf046fc6521a3535687541b34439ec75fdad8bbd..30ad91bf86fdba9ebc925b037c56e10123160eeb 100644 (file)
@@ -443,7 +443,7 @@ _DtEnvControl(
                                 * then put our dt string just ahead of 
                                 * "/usr/bin/X11" in the new PATH 
                                 */
-                                *(ptr - 1) = NULL
+                                *(ptr - 1) = '\0'
                                 sprintf(_postDtEnvironment.binPath,
                                   "%s=%s:%s:%s",
                                    BIN_PATH_ENVIRON,
@@ -479,7 +479,7 @@ _DtEnvControl(
                                 * "/usr/bin" in the new PATH 
                                 */
 
-                                *(ptr - 1) = NULL
+                                *(ptr - 1) = '\0'
                                 sprintf(_postDtEnvironment.binPath,
                                   "%s=%s:%s:%s",
                                    BIN_PATH_ENVIRON,
index 07e33349e98663e18bc65bf2d47da4ea17fc57cb..6fcc7b8aa3c7b486d87cd0f85745d7faf6ce4320 100644 (file)
@@ -265,7 +265,7 @@ GetShortHostname(
    if (status = gethostname(buffer, bufsize))
       return status; /* failed gethostname */
    if (ptr = strstr(buffer, (char *)"."))
-      *ptr = NULL;  /* delete domain name if there is one */
+      *ptr = '\0';  /* delete domain name if there is one */
    return 0;
 }
 
index 054f2b60f2dc7de4aba6ad69518f3601a347d306..60f9d6b5b399eadf07cf50ee6199146eef6c2804 100644 (file)
@@ -259,7 +259,7 @@ char * ExpandPath (
     /*** otherwise, make it relative to the current directory ***/
 
     /* get user's current working directory */
-    if (getcwd(tmpPath, MAXPATHLEN) == NULL) return NULL; /* RETURN: error */
+    if (getcwd(tmpPath, MAXPATHLEN) == 0) return NULL; /* RETURN: error */
 
     /*** add a slash to end of path component, if needed ***/
     /* get end of the string */
index e53d10e5177a80fee784045791c1c1705aca3b93..5c220aea095c407e6e3a40445ac6a02210d52f68 100644 (file)
@@ -564,7 +564,7 @@ _DtAddResString(
     int                 actualFormat;
     unsigned long       nitems, leftover;
 
-    if((data == NULL) || (*data == NULL))
+    if((data == NULL) || (*data == '\0'))
     {
        return;
     }