mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-02-15 04:32:24 +00:00
Fix dtfile crash on 64 bit
When asking for data using XtVaGetValue() make sure that there is enough place for the return value (which is sometimes XtPointer). Providing pointer to (int) is not enough. Cast XtPointer into requested int types directly, which unfortunately introduces compilation warning: cast from pointer to integer of different size
This commit is contained in:
parent
9b77aa08b4
commit
1041e08003
4 changed files with 29 additions and 15 deletions
|
@ -7193,7 +7193,7 @@ CommitWorkProcUpdates(
|
|||
/* If not managed yet, manage the file window again */
|
||||
if (!XtIsManaged((Widget)file_window))
|
||||
{
|
||||
int incr;
|
||||
XtPointer incr;
|
||||
Arg args[2];
|
||||
|
||||
XtManageChild ((Widget)file_window);
|
||||
|
|
|
@ -192,7 +192,7 @@ ShowRenameFileDialog(
|
|||
|
||||
XmUpdateDisplay (w);
|
||||
|
||||
if((int)client_data != 0)
|
||||
if(client_data != 0)
|
||||
{
|
||||
file_view_data = (FileViewData *)client_data;
|
||||
mbar = XtParent(w);
|
||||
|
@ -224,7 +224,7 @@ ShowRenameFileDialog(
|
|||
XtSetArg (args[n], XmNallowShellResize, True); n++;
|
||||
|
||||
/* Ignore accelerators when we're insensitive */
|
||||
if((int)client_data == 0)
|
||||
if(client_data == 0)
|
||||
{
|
||||
if ((file_mgr_rec->menuStates & RENAME) == 0)
|
||||
return;
|
||||
|
@ -270,6 +270,7 @@ ShowCopyFileDialog(
|
|||
char * directory_name;
|
||||
char * tmpStr, *tempStr;
|
||||
|
||||
XtPointer width;
|
||||
Dimension f_width, d_width;
|
||||
|
||||
Widget shell;
|
||||
|
@ -301,7 +302,7 @@ ShowCopyFileDialog(
|
|||
|
||||
XmUpdateDisplay (w);
|
||||
|
||||
if((int)client_data != 0)
|
||||
if(client_data != 0)
|
||||
{
|
||||
file_view_data = (FileViewData *)client_data;
|
||||
mbar = XtParent(w);
|
||||
|
@ -542,16 +543,20 @@ ShowCopyFileDialog(
|
|||
/* Make the two labels the same length - maximum. */
|
||||
/* ------------------------------------------------ */
|
||||
|
||||
XtVaGetValues(dir_label, XmNwidth, &d_width, NULL);
|
||||
XtVaGetValues(file_label, XmNwidth, &f_width, NULL);
|
||||
XtVaGetValues(dir_label, XmNwidth, &width, NULL);
|
||||
d_width = (Dimension)width;
|
||||
XtVaGetValues(file_label, XmNwidth, &width, NULL);
|
||||
f_width = (Dimension)width;
|
||||
|
||||
if (d_width > f_width)
|
||||
XtVaSetValues(file_label, XmNwidth, d_width, NULL);
|
||||
else
|
||||
XtVaSetValues(dir_label, XmNwidth, f_width, NULL);
|
||||
|
||||
XtVaGetValues(dir_text, XmNwidth, &d_width, NULL);
|
||||
XtVaGetValues(file_text, XmNwidth, &f_width, NULL);
|
||||
XtVaGetValues(dir_text, XmNwidth, &width, NULL);
|
||||
d_width = (Dimension)width;
|
||||
XtVaGetValues(file_text, XmNwidth, &width, NULL);
|
||||
f_width = (Dimension)width;
|
||||
|
||||
if (d_width > f_width)
|
||||
XtVaSetValues(file_text, XmNwidth, d_width, NULL);
|
||||
|
@ -772,7 +777,7 @@ ShowMoveFileDialog(
|
|||
|
||||
XmUpdateDisplay (w);
|
||||
|
||||
if((int)client_data != 0)
|
||||
if(client_data != 0)
|
||||
{
|
||||
file_view_data = (FileViewData *)client_data;
|
||||
mbar = XtParent(w);
|
||||
|
@ -1097,7 +1102,7 @@ ShowLinkFileDialog(
|
|||
|
||||
XmUpdateDisplay (w);
|
||||
|
||||
if((int)client_data != 0)
|
||||
if(client_data != 0)
|
||||
{
|
||||
file_view_data = (FileViewData *)client_data;
|
||||
mbar = XtParent(w);
|
||||
|
|
|
@ -1757,9 +1757,12 @@ Create_Action_Area(
|
|||
|
||||
if (i == actions.defaultAction)
|
||||
{
|
||||
XtPointer heightptr;
|
||||
Dimension height, h;
|
||||
XtVaGetValues (action_area, XmNmarginHeight, &h, NULL);
|
||||
XtVaGetValues (widget, XmNheight, &height, NULL);
|
||||
XtVaGetValues (action_area, XmNmarginHeight, &heightptr, NULL);
|
||||
height = (Dimension)heightptr;
|
||||
XtVaGetValues (widget, XmNheight, &heightptr, NULL);
|
||||
h = (Dimension)heightptr;
|
||||
|
||||
height +=2 * h;
|
||||
XtVaSetValues (action_area,
|
||||
|
|
|
@ -137,7 +137,7 @@ help_callback(
|
|||
char *helpVolume, *locationId;
|
||||
int topic;
|
||||
|
||||
topic = (int) client_data;
|
||||
topic = (int)client_data;
|
||||
helpVolume = HELP_VOLUME;
|
||||
|
||||
switch (topic)
|
||||
|
@ -418,9 +418,15 @@ Create_Action_Area(
|
|||
|
||||
if (i == actions.defaultAction)
|
||||
{
|
||||
union {
|
||||
XtPointer ptr;
|
||||
Dimension dim;
|
||||
} wide;
|
||||
Dimension height, h;
|
||||
XtVaGetValues (action_area, XmNmarginHeight, &h, NULL);
|
||||
XtVaGetValues (widget, XmNheight, &height, NULL);
|
||||
XtVaGetValues (action_area, XmNmarginHeight, &wide.ptr, NULL);
|
||||
h = wide.dim;
|
||||
XtVaGetValues (widget, XmNheight, &wide.ptr, NULL);
|
||||
height = wide.dim;
|
||||
|
||||
height +=2 * h;
|
||||
XtVaSetValues (action_area,
|
||||
|
|
Loading…
Reference in a new issue