1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-15 04:32:24 +00:00

dtfile: resolve 19 compiler warnings.

This commit is contained in:
Peter Howkins 2015-01-09 16:16:53 +00:00
parent 561d858140
commit 22830f478a
4 changed files with 38 additions and 19 deletions

View file

@ -792,7 +792,7 @@ GetStatusMsg(
file_mgr_data->busy_status == busy_readdir)
{
if (file_mgr_data->busy_detail == 0)
sprintf (buf, (GETMESSAGE(3,5, "Reading ...")));
sprintf (buf, "%s", (GETMESSAGE(3,5, "Reading ...")));
else if (file_mgr_data->busy_detail == 1)
sprintf (buf, (GETMESSAGE(3,11, "%d Item(s)...")),
file_mgr_data->busy_detail);

View file

@ -5074,7 +5074,7 @@ ShowChangeDirField (
if (w)
{
if((int)client_data == FM_POPUP)
if((intptr_t) client_data == FM_POPUP)
mbar = XtParent(w);
else
mbar = XmGetPostedFromWidget(XtParent(w));

View file

@ -460,7 +460,7 @@ FileOpError(
char *message1,
char *message2 )
{
int pipe_fd = (int)w; /* @@@ Hack! @@@
int pipe_fd = (int) (intptr_t) w; /* @@@ Hack! @@@
In the background process we call FileManip with
the file descriptor for the pipe instead of a
widget id. We rely on the fact that FileManip
@ -950,11 +950,11 @@ FileMoveCopyProcess(
else
{
if (strncmp(directory, desktop_dir, strlen(desktop_dir)) == 0)
return_val = FileManip((Widget)pipe_s2m, mode, from, to,
return_val = FileManip((Widget) (intptr_t) pipe_s2m, mode, from, to,
isContainer,
FileOpError, True, DESKTOP);
else
return_val = FileManip((Widget)pipe_s2m, mode, from, to,
return_val = FileManip((Widget) (intptr_t) pipe_s2m, mode, from, to,
isContainer,
FileOpError, True, NOT_DESKTOP);
XtFree( (char *) from );
@ -1155,11 +1155,11 @@ FileMoveCopyProcess(
case PIPEMSG_MERGE:
if (strncmp(directory, desktop_dir, strlen(desktop_dir)) == 0)
return_val = FileManip((Widget)pipe_s2m, MERGE_DIR, from,
return_val = FileManip((Widget) (intptr_t) pipe_s2m, MERGE_DIR, from,
to, isContainer,
FileOpError, True, DESKTOP);
else
return_val = FileManip((Widget)pipe_s2m, MERGE_DIR, from,
return_val = FileManip((Widget) (intptr_t) pipe_s2m, MERGE_DIR, from,
to, isContainer,
FileOpError, True, NOT_DESKTOP);
break;
@ -1197,7 +1197,7 @@ FileMoveCopyProcess(
break;
default:
if (strncmp(directory, desktop_dir, strlen(desktop_dir)) == 0)
return_val = FileManip((Widget)pipe_s2m, mode, from, to,
return_val = FileManip((Widget) (intptr_t) pipe_s2m, mode, from, to,
isContainer,FileOpError, True,
DESKTOP);
else
@ -1222,14 +1222,14 @@ FileMoveCopyProcess(
strcat(toFile, "/");
strcat(toFile, newFile);
return_val = FileManip((Widget)pipe_s2m, mode, from,
return_val = FileManip((Widget) (intptr_t) pipe_s2m, mode, from,
toFile, False, FileOpError,
True, NOT_DESKTOP);
XtFree(path);
XtFree(toFile);
}
else
return_val = FileManip((Widget)pipe_s2m, mode, from,
return_val = FileManip((Widget) (intptr_t) pipe_s2m, mode, from,
to, isContainer, FileOpError,
True, NOT_DESKTOP);
}
@ -1377,7 +1377,7 @@ FileMoveCopyProcessDesktop(
}
else
{
return_val = FileManip((Widget)pipe_s2m, mode, from, to, TRUE,
return_val = FileManip((Widget) (intptr_t) pipe_s2m, mode, from, to, TRUE,
FileOpError, True, DESKTOP);
XtFree (from);
from = NULL;
@ -2455,7 +2455,7 @@ ChangeIconNameProcess(
XtFree(new_name);
return 1;
}
success = FileManip((Widget)pipe_fd, MOVE_FILE, old_full_name, full_name, TRUE,
success = FileManip((Widget) (intptr_t) pipe_fd, MOVE_FILE, old_full_name, full_name, TRUE,
FileOpError, True, NOT_DESKTOP);
XtFree( old_full_name );
/* send a 'done' msg through the pipe */

View file

@ -704,10 +704,14 @@ WriteTrashEntries( void )
/* Remove the original information file, and move the new one */
(void) fclose(newFile);
(void) chown(NewTrashInfoFileName, getuid(), getgid());
if(-1 == chown(NewTrashInfoFileName, getuid(), getgid())) {
return( False );
}
(void) remove(TrashInfoFileName);
(void) rename(NewTrashInfoFileName, TrashInfoFileName);
(void) chown(TrashInfoFileName, getuid(), getgid());
if(-1 == chown(TrashInfoFileName, getuid(), getgid())) {
return( False );
}
return( True );
}
else
@ -2830,7 +2834,7 @@ MoveToTrashProcess(
to = CreateTrashFilename(baseName, TRUE);
/* move file to the trash directory */
success = FileManip((Widget)pipe_fd, MOVE_FILE, path, to, TRUE,
success = FileManip((Widget) (intptr_t) pipe_fd, MOVE_FILE, path, to, TRUE,
FileOpError, True, TRASH_DIRECTORY);
if (success)
{
@ -3366,7 +3370,12 @@ MoveToTrash(
#endif /* SUN_PERF */
/* create a pipe */
pipe(pipe_fd);
if(-1 == pipe(pipe_fd)) {
fprintf(stderr,
"%s: pipe failed error %d=%s\n",
pname, errno, strerror(errno));
return;
}
/* fork the process that does the actual work */
pid = fork();
@ -3512,7 +3521,7 @@ RestoreProcess(
if (to != NULL)
{
status = RestoreObject((Widget)pipe_fd, MOVE_FILE, from,to,
status = RestoreObject((Widget) (intptr_t) pipe_fd, MOVE_FILE, from,to,
TRUE, FileOpError, False, NOT_DESKTOP,CheckedAlready);
/* restore was successful */
if(status == (int) True)
@ -3756,7 +3765,12 @@ RestoreFromTrash(
cb_data->msg = msg;
/* create a pipe */
pipe(pipe_fd);
if(-1 == pipe(pipe_fd)) {
fprintf(stderr,
"%s: pipe failed, error %d=%s\n",
pname, errno, strerror(errno));
return;
}
/* fork the process that does the actual work */
pid = fork();
@ -4076,7 +4090,12 @@ EmptyTrash(
cb_data->msg = msg;
/* create a pipe */
pipe(pipe_fd);
if(-1 == pipe(pipe_fd)) {
fprintf(stderr,
"%s: pipe failed, error %d=%s\n",
pname, errno, strerror(errno));
return;
}
/* fork the process that does the actual work */
pid = fork();