mirror of
				git://git.code.sf.net/p/cdesktopenv/code
				synced 2025-03-09 15:50:02 +00:00 
			
		
		
		
	dticon: Fix some warnings related to mixing NULL, 0 and '\0' randomly.
This commit is contained in:
		
							parent
							
								
									f737b30289
								
							
						
					
					
						commit
						55539b71c1
					
				
					 6 changed files with 24 additions and 24 deletions
				
			
		| 
						 | 
				
			
			@ -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 :
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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);
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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");
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue