cleanup: eliminate "implicit declaration" warnings.
authorJon Trulson <jon@radscan.com>
Mon, 24 Mar 2014 21:54:43 +0000 (15:54 -0600)
committerJon Trulson <jon@radscan.com>
Mon, 24 Mar 2014 21:58:11 +0000 (15:58 -0600)
Also fixed a potential core/memory corruption in dticon.

cde/programs/dtdocbook/lib/tptregexp/regerror.c
cde/programs/dthelp/dthelpdemo/HelpCache.c
cde/programs/dthelp/dthelpdemo/Main.c
cde/programs/dthelp/dthelpprint/Main.c
cde/programs/dthelp/parser/canon1/util/wchar.c
cde/programs/dthelp/parser/pass2/util/wchar.c
cde/programs/dticon/event.c
cde/programs/dticon/fileIO.c
cde/programs/dtksh/ksh93/ship/shipproto.c

index 4a688779e9ee245963ac54ee4611be05ab669349..36af889d4dda728a488300bbb9439cb67e4d223c 100644 (file)
@@ -22,6 +22,7 @@
  */
 /* $XConsortium: regerror.c /main/3 1996/06/19 17:13:36 drk $ */
 #include <stdio.h>
+#include <stdlib.h>
 
 void
 tpt_regerror(s)
index 76c7e8f5e1e28cddbf7f5efbb660f6c9f5b0db69..0bdef5b984e812e28243d0e578e416983e7903e8 100644 (file)
@@ -43,7 +43,8 @@
  ************************************<+>*************************************/
 
 /* System Include Files  */
-
+#include <stdlib.h>
+#include <stdio.h>
 
 #include <Xm/Xm.h>
 #include <Xm/XmP.h>
index 87246a8ae851a0a6a1a32b471805abfd9bd9b0bd..c5c87ccbda609c93c9e19fb33a3caf6c3078bd24 100644 (file)
@@ -42,6 +42,9 @@
  ****************************************************************************
  ************************************<+>*************************************/
 
+#include <stdlib.h>
+#include <stdio.h>
+
 #include <Xm/Xm.h>
 #include <Xm/RowColumn.h>
 #include <Xm/PushB.h>
@@ -624,7 +627,7 @@ static void ManageButtonsCB(
 
   TurnOnHourGlass(topLevel);
 
-  switch ((int)clientData)
+  switch ((long)clientData)
     {
       case CREATE_SAMPLE:
    
@@ -745,7 +748,7 @@ static void Control1ButtonsCB(
 
   TurnOnHourGlass(topLevel);
 
-  switch ((int)clientData)
+  switch ((long)clientData)
     {
       case CHANGE_CONTENT:
          
@@ -881,14 +884,14 @@ static void HelpMenuCB(
   /* Determine which help button was activated and display the
    * appropriate help information */
 
-   switch ((int)clientData)
+   switch ((long)clientData)
           {
             case HELP_ON_ITEM:
                while (!XtIsSubclass(widget, applicationShellWidgetClass))
                    widget = XtParent(widget);
 
 
-               status = DtHelpReturnSelectedWidgetId(widget, NULL, &selWidget);
+               status = DtHelpReturnSelectedWidgetId(widget, 0, &selWidget);
 
                 switch ((int)status)
                  {
index 33f7130dae54b9de9f84964df47cb66aceb6e751..a00ef305c63f7e8b2ab61e1bb014d428a3e49572 100644 (file)
@@ -41,6 +41,7 @@ $COPYRIGHT$:
  * to determine how the lines are drawn.
  */
 #include <stdio.h>
+#include <stdlib.h>
 #include <locale.h>
 #include <X11/Xlib.h>
 #include <X11/Xresource.h>
@@ -108,7 +109,7 @@ int main(
    if (options.debugHelpPrint)
    {
       XrmPutFileDatabase(appDB,"db.dthelpprint"); /* dump rsrc for debug */
-      system("cat db.dthelpprint|fgrep -i print");
+      system("/bin/cat db.dthelpprint|/bin/fgrep -i print");
    }
 
    /****************************************
index d49e825f867245ba6a0ad438631bb9705a8cef18..08c9a0c1c9e8fe8924fca70a3dd139025061acb3 100644 (file)
@@ -25,6 +25,7 @@
               Copyright 1992 Hewlett-Packard Co.
 */
 
+#include <string.h>
 #include "basic.h"
 #include "trie.h"
 #include "cont.h"
index 780bbf40eb95a890422c987cc22ab91f8572bdda..33d4648d1cc016eb97e35755279d3937ec48247c 100644 (file)
@@ -25,6 +25,7 @@
               Copyright 1992 Hewlett-Packard Co.
 */
 
+#include <string.h>
 #include "basic.h"
 #include "trie.h"
 #include "cont.h"
index 20ef5b127f6f4e5e48deb59f1e0401dc2304697c..c719114d74cd980f33956c60c236784c988e737a 100644 (file)
@@ -55,6 +55,8 @@
  **  implied warranty.
  **
  ******************************************************************************/
+#include <stdio.h>
+
 #include <Xm/Xm.h>
 #include "externals.h"
 #include "main.h"
index ca03aa0cc92b00a3c064c629600f591d61d13af9..b86235d3df1bbe3b337930b2cca63179aa7aa802 100644 (file)
@@ -452,7 +452,7 @@ Write_File(
   int i, j;
   int mask_needed;
   Boolean SUN;
-  char *base_name, *suffix, fname[256], *tmp, *tmp2, *vend;
+  char *base_name, *suffix, fname[MAXPATHLEN], *tmp, *tmp2, *vend;
   Pixmap scratch_pix;
   XImage *scratch_shape, *scratch_mask;
   struct stat statbuf;        /* Information on a file. */
@@ -478,7 +478,8 @@ Write_File(
     netfile = tt_host_file_netfile(fnameIn, tmp+1);
     localfile = tt_netfile_file(netfile);
 
-    strncpy(fname, localfile, MAXPATHLEN);
+    strncpy(fname, localfile, MAXPATHLEN - 1);
+    fname[MAXPATHLEN - 1] = 0;
     tmp[0] = ':';
 
     tt_free(netfile);
index 8d4165d397e007e31de343285a7c790e225fbc7b..b016d0f8428318844492fd0f30399a93f5a01d36 100644 (file)
 
 
 # define ctime         _huh_ctime
-
+# include <stdlib.h>
 # include <sys/types.h>
 # include <sys/stat.h>
 # include <string.h>