mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-02-14 20:22:21 +00:00
dtfile: Resolve uninitialized warnings
This commit is contained in:
parent
daf072463a
commit
207253b401
9 changed files with 52 additions and 40 deletions
|
@ -904,7 +904,7 @@ DrawCurrentDirectory(
|
|||
int draw_x;
|
||||
int draw_y;
|
||||
int dir_width;
|
||||
int msg_width;
|
||||
int msg_width = 0;
|
||||
short columns;
|
||||
Boolean msg_drawn;
|
||||
|
||||
|
|
|
@ -1635,7 +1635,7 @@ ReadDirectoryProcess(
|
|||
position_count = 0;
|
||||
if ((fptr = fopen(file_name, "r")) != NULL)
|
||||
{
|
||||
PositionInfo * position_info;
|
||||
PositionInfo * position_info = NULL;
|
||||
fscanf(fptr, "%d\n", &position_count);
|
||||
|
||||
if (position_count > 0)
|
||||
|
@ -2142,7 +2142,7 @@ ReaddirPipeCallback(
|
|||
Boolean done;
|
||||
short msg;
|
||||
Boolean update_due;
|
||||
FileData *new_data, **new_nextp;
|
||||
FileData *new_data = NULL, **new_nextp;
|
||||
FileData *old_data, **old_nextp;
|
||||
char *ptr;
|
||||
char *err_msg;
|
||||
|
@ -2285,7 +2285,9 @@ ReaddirPipeCallback(
|
|||
new_nextp = &(*new_nextp)->next)
|
||||
;
|
||||
*new_nextp = new_data;
|
||||
new_data->next = NULL;
|
||||
if(new_data ) {
|
||||
new_data->next = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (activity == activity_reading)
|
||||
|
@ -2814,7 +2816,7 @@ _ReadDir(
|
|||
{
|
||||
char subdir_name[MAX_PATH];
|
||||
FileData *fp, *file_data;
|
||||
FileViewData **lp, *ip;
|
||||
FileViewData **lp = NULL, *ip;
|
||||
int i, j, n, rc;
|
||||
TreeShow ts;
|
||||
Boolean busy_reading;
|
||||
|
@ -2894,7 +2896,7 @@ _ReadDir(
|
|||
}
|
||||
|
||||
/* add new entry to linked list */
|
||||
if (dp)
|
||||
if (dp && lp)
|
||||
{
|
||||
*lp = ip;
|
||||
lp = &ip->next;
|
||||
|
@ -5130,7 +5132,7 @@ SelectDesktopFile(
|
|||
FileMgrData *file_mgr_data)
|
||||
{
|
||||
DirectorySet *directory_data;
|
||||
FileViewData *file_view_data;
|
||||
FileViewData *file_view_data = NULL;
|
||||
int j;
|
||||
|
||||
directory_data = file_mgr_data->directory_set[0];
|
||||
|
@ -5149,5 +5151,7 @@ FileMgrData *file_mgr_data)
|
|||
}
|
||||
ActivateSingleSelect(file_mgr_data->file_mgr_rec,
|
||||
file_mgr_data->selection_list[0]->file_data->logical_type);
|
||||
PositionFileView(file_view_data, file_mgr_data);
|
||||
if(file_view_data) {
|
||||
PositionFileView(file_view_data, file_mgr_data);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -785,7 +785,7 @@ OrderFiles(
|
|||
FileViewData ** file_view_data;
|
||||
int file_count;
|
||||
FileViewData ** order_list;
|
||||
int * sort;
|
||||
int * sort = NULL;
|
||||
int * sub_sort;
|
||||
int i;
|
||||
int start;
|
||||
|
@ -853,11 +853,14 @@ OrderFiles(
|
|||
else
|
||||
sort = (int *) FileSizeDescending;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
/* Unknown sort order? */
|
||||
return;
|
||||
}
|
||||
|
||||
/* Sort the files and if the sub_sort function is non-null, */
|
||||
/* sort sets of the files broken according to file type. */
|
||||
|
||||
qsort (order_list, file_count, sizeof (FileViewData *), (int (*)())sort);
|
||||
|
||||
if (sub_sort != NULL)
|
||||
|
@ -3177,8 +3180,8 @@ CreateNameChangeDialog (
|
|||
int type)
|
||||
{
|
||||
XRectangle textExtent;
|
||||
FileMgrData * file_mgr_data;
|
||||
DesktopRec * desktopWindow;
|
||||
FileMgrData * file_mgr_data = NULL;
|
||||
DesktopRec * desktopWindow = NULL;
|
||||
Widget parent = XtParent(w);
|
||||
Widget text;
|
||||
Arg args[8];
|
||||
|
@ -3317,18 +3320,20 @@ CreateNameChangeDialog (
|
|||
else
|
||||
{
|
||||
text = XmCreateTextField(parent, "nameChangeT", args, n);
|
||||
file_mgr_data->renaming = file_view_data;
|
||||
XtAddCallback (text, XmNmotionVerifyCallback,
|
||||
(XtCallbackProc)ChangeIconName,
|
||||
(XtPointer)file_mgr_data);
|
||||
XtAddCallback (text, XmNmodifyVerifyCallback,
|
||||
(XtCallbackProc)ChangeIconName,
|
||||
(XtPointer)file_mgr_data);
|
||||
XtAddCallback (text, XmNactivateCallback,
|
||||
(XtCallbackProc)ChangeIconName,
|
||||
(XtPointer)file_mgr_data);
|
||||
XtAddCallback(text, XmNhelpCallback, (XtCallbackProc)HelpRequestCB,
|
||||
HELP_NAMECHANGE_DIALOG_STR);
|
||||
if(file_mgr_data) {
|
||||
file_mgr_data->renaming = file_view_data;
|
||||
XtAddCallback(text, XmNmotionVerifyCallback,
|
||||
(XtCallbackProc)ChangeIconName,
|
||||
(XtPointer)file_mgr_data);
|
||||
XtAddCallback(text, XmNmodifyVerifyCallback,
|
||||
(XtCallbackProc)ChangeIconName,
|
||||
(XtPointer)file_mgr_data);
|
||||
XtAddCallback(text, XmNactivateCallback,
|
||||
(XtCallbackProc)ChangeIconName,
|
||||
(XtPointer)file_mgr_data);
|
||||
XtAddCallback(text, XmNhelpCallback, (XtCallbackProc)HelpRequestCB,
|
||||
HELP_NAMECHANGE_DIALOG_STR);
|
||||
}
|
||||
}
|
||||
|
||||
XtAddCallback (text, XmNdestroyCallback, DestroyIconName, (XtPointer)NULL);
|
||||
|
@ -3425,7 +3430,7 @@ CreateNameChangeDialog (
|
|||
XtManageChild(text);
|
||||
XmProcessTraversal(text, XmTRAVERSE_CURRENT);
|
||||
|
||||
if(type != DESKTOP)
|
||||
if(type != DESKTOP && file_mgr_data)
|
||||
{
|
||||
FileMgrRec *file_mgr_rec;
|
||||
|
||||
|
|
|
@ -1482,7 +1482,7 @@ RenameOk(
|
|||
char to_host[256];
|
||||
char to_dir[MAX_PATH];
|
||||
char to_file[256];
|
||||
unsigned int modifiers;
|
||||
unsigned int modifiers = 0;
|
||||
char *host_set[1], *file_set[1];
|
||||
int file_count = 1;
|
||||
|
||||
|
|
|
@ -567,7 +567,7 @@ FileMoveCopyProcess(
|
|||
int mode,
|
||||
DesktopRec *desktopWindow)
|
||||
{
|
||||
char * target_dir, * from, * to;
|
||||
char * target_dir, * from = NULL, * to;
|
||||
int i, j, rc, result;
|
||||
Boolean return_val = False;
|
||||
Boolean isContainer;
|
||||
|
@ -587,7 +587,7 @@ FileMoveCopyProcess(
|
|||
Boolean targetError = FALSE;
|
||||
Boolean CopyError=FALSE,MoveError1=FALSE,MoveError2=FALSE;
|
||||
char *CopyString=NULL,*MoveString1=NULL,*MoveString2=NULL;
|
||||
Boolean Same;
|
||||
Boolean Same = FALSE;
|
||||
|
||||
/* Get the fully qualified destination path. */
|
||||
target_dir = (char *)ResolveLocalPathName(host, directory, NULL, home_host_name, &tt_status);
|
||||
|
@ -2489,7 +2489,7 @@ ChangeIconPipeCB(
|
|||
Widget msg_widget;
|
||||
DirectorySet *directory_set;
|
||||
FileMgrData *file_mgr_data = NULL;
|
||||
FileMgrRec *file_mgr_rec;
|
||||
FileMgrRec *file_mgr_rec = NULL;
|
||||
short pipe_msg;
|
||||
int i, j, n;
|
||||
int rc;
|
||||
|
|
|
@ -2107,7 +2107,7 @@ AlternateInputHandler(
|
|||
int offset = 0;
|
||||
char next;
|
||||
XmString string;
|
||||
int count;
|
||||
int count = 0;
|
||||
Arg args[1];
|
||||
char * findptr;
|
||||
char * end;
|
||||
|
@ -2260,7 +2260,7 @@ AlternateInputHandler2(
|
|||
FindRec * find_rec = (FindRec *) client_data;
|
||||
int offset = 0;
|
||||
char next;
|
||||
int count;
|
||||
int count = 0;
|
||||
char * findptr;
|
||||
struct stat stat_data;
|
||||
char * content;
|
||||
|
@ -2381,7 +2381,7 @@ AlternateInputHandler3(
|
|||
int offset = 0;
|
||||
char next;
|
||||
XmString string;
|
||||
int count;
|
||||
int count = 0;
|
||||
Arg args[1];
|
||||
char * findptr;
|
||||
struct stat stat_data;
|
||||
|
|
|
@ -290,8 +290,8 @@ FileWindowInputCallback(
|
|||
DirectorySet * directoryData;
|
||||
XEvent *new_event;
|
||||
XButtonPressedEvent *event;
|
||||
XKeyEvent *kevent;
|
||||
Widget eventIcon;
|
||||
XKeyEvent *kevent = NULL;
|
||||
Widget eventIcon = NULL;
|
||||
int i, j;
|
||||
FileViewData * fileViewData = NULL;
|
||||
Arg args[10];
|
||||
|
@ -373,8 +373,11 @@ FileWindowInputCallback(
|
|||
/* get the gadget that received the input */
|
||||
if (keybdFocusPolicy == XmEXPLICIT)
|
||||
eventIcon = (Widget) XmGetFocusWidget(w);
|
||||
else
|
||||
eventIcon = (Widget) InputForGadget(w, kevent->x, kevent->y);
|
||||
else {
|
||||
if(kevent) {
|
||||
eventIcon = (Widget) InputForGadget(w, kevent->x, kevent->y);
|
||||
}
|
||||
}
|
||||
if (eventIcon == NULL)
|
||||
return;
|
||||
|
||||
|
|
|
@ -3219,7 +3219,7 @@ LoadViews (
|
|||
static char * name_list[] = { DTFILE_CLASS_NAME, NULL, NULL };
|
||||
char view_number[11];
|
||||
DialogData * dialog_data;
|
||||
FileMgrData * file_mgr_data;
|
||||
FileMgrData * file_mgr_data = NULL;
|
||||
char * workspaces;
|
||||
XClassHint classHints;
|
||||
char * iconify = NULL;
|
||||
|
@ -3397,7 +3397,7 @@ LoadViews (
|
|||
view_count++;
|
||||
}
|
||||
|
||||
if (openDirType == NEW)
|
||||
if (openDirType == NEW && file_mgr_data)
|
||||
ForceMyIconOpen(file_mgr_data->host, NULL);
|
||||
}
|
||||
|
||||
|
|
|
@ -312,7 +312,7 @@ buffer_replace_rename_ok_callback(
|
|||
XtPointer call_data)
|
||||
{
|
||||
int rc = 0;
|
||||
String newFile, renameNewName, destinationName;
|
||||
String newFile = NULL, renameNewName, destinationName;
|
||||
struct stat buf;
|
||||
int saveError = 0;
|
||||
static char msg[38+MAX_PATH];
|
||||
|
|
Loading…
Reference in a new issue