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