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