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) file_mgr_data->busy_status == busy_readdir)
{ {
if (file_mgr_data->busy_detail == 0) 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) else if (file_mgr_data->busy_detail == 1)
sprintf (buf, (GETMESSAGE(3,11, "%d Item(s)...")), sprintf (buf, (GETMESSAGE(3,11, "%d Item(s)...")),
file_mgr_data->busy_detail); file_mgr_data->busy_detail);

View file

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

View file

@ -460,7 +460,7 @@ FileOpError(
char *message1, char *message1,
char *message2 ) char *message2 )
{ {
int pipe_fd = (int)w; /* @@@ Hack! @@@ int pipe_fd = (int) (intptr_t) w; /* @@@ Hack! @@@
In the background process we call FileManip with In the background process we call FileManip with
the file descriptor for the pipe instead of a the file descriptor for the pipe instead of a
widget id. We rely on the fact that FileManip widget id. We rely on the fact that FileManip
@ -950,11 +950,11 @@ FileMoveCopyProcess(
else else
{ {
if (strncmp(directory, desktop_dir, strlen(desktop_dir)) == 0) 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, isContainer,
FileOpError, True, DESKTOP); FileOpError, True, DESKTOP);
else else
return_val = FileManip((Widget)pipe_s2m, mode, from, to, return_val = FileManip((Widget) (intptr_t) pipe_s2m, mode, from, to,
isContainer, isContainer,
FileOpError, True, NOT_DESKTOP); FileOpError, True, NOT_DESKTOP);
XtFree( (char *) from ); XtFree( (char *) from );
@ -1155,11 +1155,11 @@ FileMoveCopyProcess(
case PIPEMSG_MERGE: case PIPEMSG_MERGE:
if (strncmp(directory, desktop_dir, strlen(desktop_dir)) == 0) 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, to, isContainer,
FileOpError, True, DESKTOP); FileOpError, True, DESKTOP);
else else
return_val = FileManip((Widget)pipe_s2m, MERGE_DIR, from, return_val = FileManip((Widget) (intptr_t) pipe_s2m, MERGE_DIR, from,
to, isContainer, to, isContainer,
FileOpError, True, NOT_DESKTOP); FileOpError, True, NOT_DESKTOP);
break; break;
@ -1197,7 +1197,7 @@ FileMoveCopyProcess(
break; break;
default: default:
if (strncmp(directory, desktop_dir, strlen(desktop_dir)) == 0) 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, isContainer,FileOpError, True,
DESKTOP); DESKTOP);
else else
@ -1222,14 +1222,14 @@ FileMoveCopyProcess(
strcat(toFile, "/"); strcat(toFile, "/");
strcat(toFile, newFile); strcat(toFile, newFile);
return_val = FileManip((Widget)pipe_s2m, mode, from, return_val = FileManip((Widget) (intptr_t) pipe_s2m, mode, from,
toFile, False, FileOpError, toFile, False, FileOpError,
True, NOT_DESKTOP); True, NOT_DESKTOP);
XtFree(path); XtFree(path);
XtFree(toFile); XtFree(toFile);
} }
else else
return_val = FileManip((Widget)pipe_s2m, mode, from, return_val = FileManip((Widget) (intptr_t) pipe_s2m, mode, from,
to, isContainer, FileOpError, to, isContainer, FileOpError,
True, NOT_DESKTOP); True, NOT_DESKTOP);
} }
@ -1377,7 +1377,7 @@ FileMoveCopyProcessDesktop(
} }
else 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); FileOpError, True, DESKTOP);
XtFree (from); XtFree (from);
from = NULL; from = NULL;
@ -2455,7 +2455,7 @@ ChangeIconNameProcess(
XtFree(new_name); XtFree(new_name);
return 1; 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); FileOpError, True, NOT_DESKTOP);
XtFree( old_full_name ); XtFree( old_full_name );
/* send a 'done' msg through the pipe */ /* 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 */ /* Remove the original information file, and move the new one */
(void) fclose(newFile); (void) fclose(newFile);
(void) chown(NewTrashInfoFileName, getuid(), getgid()); if(-1 == chown(NewTrashInfoFileName, getuid(), getgid())) {
return( False );
}
(void) remove(TrashInfoFileName); (void) remove(TrashInfoFileName);
(void) rename(NewTrashInfoFileName, TrashInfoFileName); (void) rename(NewTrashInfoFileName, TrashInfoFileName);
(void) chown(TrashInfoFileName, getuid(), getgid()); if(-1 == chown(TrashInfoFileName, getuid(), getgid())) {
return( False );
}
return( True ); return( True );
} }
else else
@ -2830,7 +2834,7 @@ MoveToTrashProcess(
to = CreateTrashFilename(baseName, TRUE); to = CreateTrashFilename(baseName, TRUE);
/* move file to the trash directory */ /* 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); FileOpError, True, TRASH_DIRECTORY);
if (success) if (success)
{ {
@ -3366,7 +3370,12 @@ MoveToTrash(
#endif /* SUN_PERF */ #endif /* SUN_PERF */
/* create a pipe */ /* 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 */ /* fork the process that does the actual work */
pid = fork(); pid = fork();
@ -3512,7 +3521,7 @@ RestoreProcess(
if (to != NULL) 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); TRUE, FileOpError, False, NOT_DESKTOP,CheckedAlready);
/* restore was successful */ /* restore was successful */
if(status == (int) True) if(status == (int) True)
@ -3756,7 +3765,12 @@ RestoreFromTrash(
cb_data->msg = msg; cb_data->msg = msg;
/* create a pipe */ /* 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 */ /* fork the process that does the actual work */
pid = fork(); pid = fork();
@ -4076,7 +4090,12 @@ EmptyTrash(
cb_data->msg = msg; cb_data->msg = msg;
/* create a pipe */ /* 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 */ /* fork the process that does the actual work */
pid = fork(); pid = fork();