dticon: Fix some warnings related to mixing NULL, 0 and '\0' randomly.
authorPeter Howkins <flibble@users.sourceforge.net>
Thu, 30 Aug 2012 16:48:26 +0000 (17:48 +0100)
committerPeter Howkins <flibble@users.sourceforge.net>
Thu, 30 Aug 2012 16:48:26 +0000 (17:48 +0100)
cde/programs/dticon/event.c
cde/programs/dticon/fileIO.c
cde/programs/dticon/help.c
cde/programs/dticon/main.c
cde/programs/dticon/process.c
cde/programs/dticon/utils.c

index 23d27c9617ee38cab002e897e34d22a180dc9946..20ef5b127f6f4e5e48deb59f1e0401dc2304697c 100644 (file)
@@ -550,7 +550,7 @@ Do_ButtonOp(
                                 min(tx, last_tx), min(ty, last_ty),
                                 abs(tx-last_tx), abs(ty-last_ty));
                             GraphicsOp = Backup_G_Op;
-                            Backup_G_Op = NULL;
+                            Backup_G_Op = 0;
                             Pressed = False;
                            }
                           break;
@@ -571,7 +571,7 @@ Do_ButtonOp(
          case S_HOTSPOT :
          case S_WAIT_RELEASE :
                           GraphicsOp = Backup_G_Op;
-                          Backup_G_Op = NULL;
+                          Backup_G_Op = 0;
                           break;
          case S_ROTATE  :
          case S_SCALE_2 :
index 4e3e80ff8c6dc68af7307515209419e01174cc14..ca03aa0cc92b00a3c064c629600f591d61d13af9 100644 (file)
@@ -132,9 +132,9 @@ Do_FileIO(
   if (debug)
     stat_out("Entering Do_FileIO\n");
 #endif
-  pix_ret = NULL;
-  shape_ret = NULL;
-  mask_ret = NULL;
+  pix_ret = 0;
+  shape_ret = 0;
+  mask_ret = 0;
 
   /* get file name */
   if (SaveMeNot){
@@ -294,9 +294,9 @@ Read_File(
 
   XmUpdateDisplay(mainWindow);
 
-  pix_ret = NULL;
-  shape_ret = NULL;
-  mask_ret = NULL;
+  pix_ret = 0;
+  shape_ret = 0;
+  mask_ret = 0;
   xpm_ReadAttribs.valuemask = READ_FLAGS;
   xpm_ReadAttribs.colorsymbols = colorSymbols;
   xpm_ReadAttribs.numsymbols = NUM_PENS;
@@ -388,7 +388,7 @@ Read_File(
 /*** does a suffix exist? ***/
     if (suffix) {
       strncpy(dummy, fname, ((suffix-fname)-1));
-      dummy[(int) (suffix-fname)-1] = NULL;
+      dummy[(int) (suffix-fname)-1] = '\0';
       strcat(dummy, "_m.");
       strcat(dummy, suffix);
 #ifdef DEBUG
@@ -412,11 +412,11 @@ Read_File(
     if (status == BitmapSuccess) {
       if ((width_ret != mask_width_ret) || (height_ret != mask_height_ret)) {
         XFreePixmap(dpy, mask_ret);
-        mask_ret = NULL;
+        mask_ret = 0;
        }
      }
     else
-      mask_ret = NULL;
+      mask_ret = 0;
    }
 
   strcpy(last_fname, fname);
@@ -517,7 +517,7 @@ Write_File(
   if (debug)
     Dump_AttribStruct(&xpm_WriteAttribs);
 #endif
-    status = _DtXpmWriteFileFromPixmap(dpy, fname, color_icon, NULL,
+    status = _DtXpmWriteFileFromPixmap(dpy, fname, color_icon, 0,
                                 &xpm_WriteAttribs);
 
 /*******
@@ -550,7 +550,7 @@ Write_File(
 /*** THIRD, construct the mask filename ***/
     if (suffix) {
       strncpy(dummy, fname, ((suffix-fname)-1));
-      dummy[(int) (suffix-fname)-1] = NULL;
+      dummy[(int) (suffix-fname)-1] = '\0';
       strcat(dummy, "_m.");
       strcat(dummy, suffix);
     }
index 2dbeb32c21dc7e37c0cbe20aab7c7086e22ee090..b27c80885c4fc0cc0a48df48622790bd860291e0 100644 (file)
@@ -359,7 +359,7 @@ HelpOnItemCB(
     while (!XtIsSubclass(w, applicationShellWidgetClass))
         w = XtParent(w);
 
-    status = DtHelpReturnSelectedWidgetId(w, NULL, &selWidget);
+    status = DtHelpReturnSelectedWidgetId(w, 0, &selWidget);
     /* NULL value for cursor, uses default cursor value. */
 
     switch ((int)status)
index e648d20c12127a5a475c855864e61fb3043ccbfb..381086c11a3af66f7faa7b70aa4b58366d1f1d96 100644 (file)
@@ -220,7 +220,7 @@ main(
 
         TopLevel = XtAppInitialize(&AppContext, CLASS_NAME,
                                 option_list, XtNumber(option_list),
-                                &argc, argv, NULL, NULL, NULL);
+                                &argc, argv, NULL, NULL, 0);
 
         XtGetApplicationResources(TopLevel, &xrdb, resources,
                                       XtNumber(resources), NULL, 0);
index 0e807a1dceccecebe6a59b6ca33176798567d7f6..87c35eb3471fe7307e88f86eb7ddf73e692f0f75 100644 (file)
@@ -216,7 +216,7 @@ Process_Save( void )
      tmp2 = strchr(tmp1, c);
      strcpy(newName, tmp2);
   }
-  if (strncmp(newName, untitledStr, 8) == 0 || last_fname[0] == NULL) Process_SaveAs();
+  if (strncmp(newName, untitledStr, 8) == 0 || last_fname[0] == '\0') Process_SaveAs();
   else
  {
   if (SavedOnce == True)
@@ -969,7 +969,7 @@ Do_Paste(
     GraphicsOp = Backup_G_Op;
     if (Backup_G_Op == SELECT)
       Start_HotBox(CONTINUE);
-    Backup_G_Op = NULL;
+    Backup_G_Op = 0;
   }
 
   XPutImage(dpy, color_icon, Color_gc, color_img, 0, 0, x, y,
index 5ccde1d067013636d30f3636313805e6781933ca..307aa0c231f3f074386999af5a84e63ee9da7da5 100644 (file)
@@ -333,7 +333,7 @@ Init_Editor(
   Position lx, ly;
 
 /*** window ID of tablet ***/
-  tablet_win = NULL;
+  tablet_win = 0;
 
 /*** Nothing needs to be saved, yet ***/
   Dirty = False;
@@ -347,7 +347,7 @@ Init_Editor(
   pointCount = 0;
 
 /*** file I/O related globals ***/
-  last_fname[0] = NULL;
+  last_fname[0] = '\0';
   X_Hot = -1;
   Y_Hot = -1;
 
@@ -1346,8 +1346,8 @@ Init_Icons(
     stat_out("         Init_Icons: color=%x mono=%x\n", color_icon, mono_icon);
 #endif
 
-  tmp_color = NULL;
-  tmp_mono = NULL;
+  tmp_color = 0;
+  tmp_mono = 0;
 
 /*** App. init or 'New Icon' ***/
   if (!saveFlag) {
@@ -1371,7 +1371,7 @@ Init_Icons(
   mono_icon = XCreatePixmap(dpy, root, width, height,
                                 DefaultDepth(dpy, screen));
 
-  if ((color_icon == NULL) || (mono_icon == NULL))
+  if ((color_icon == 0) || (mono_icon == 0))
     Abort(GETSTR(10,50, "Cannot initialize application icon storage"));
 
   XSetForeground(dpy, scratch_gc, Transparent);
@@ -2337,7 +2337,7 @@ SaveSession( void )
     sprintf(bufr, "%s*y: %d\n", bufr, y);
     sprintf(bufr, "%s*width: %d\n", bufr, width);
     sprintf(bufr, "%s*height: %d\n", bufr, height);
-    if (last_fname[0] != NULL)
+    if (last_fname[0] != '\0')
         sprintf(bufr, "%s*file: %s\n", bufr, last_fname);
 
     write (fd, bufr, strlen(bufr));
@@ -2414,7 +2414,7 @@ GetSessionInfo( void )
     /*** now get the information we want from the database ***/
     /*** make sure values are at least somewhat reasonable ***/
 
-    xrm_name[1] = NULL;
+    xrm_name[1] = '\0';
 
     /* get x position */
     xrm_name[0] = XrmStringToQuark ("x");