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 --- cde/programs/dtfile/File.c | 2 +- cde/programs/dtfile/FileDialog.c | 23 ++++++++++++++--------- cde/programs/dtfile/OverWrite.c | 7 +++++-- cde/programs/dtfile/dtcopy/utils.c | 12 +++++++++--- 4 files changed, 29 insertions(+), 15 deletions(-) diff --git a/cde/programs/dtfile/File.c b/cde/programs/dtfile/File.c index 3d9fba3..9f88b1c 100644 --- a/cde/programs/dtfile/File.c +++ b/cde/programs/dtfile/File.c @@ -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); diff --git a/cde/programs/dtfile/FileDialog.c b/cde/programs/dtfile/FileDialog.c index 6843c33..5a8577e 100644 --- a/cde/programs/dtfile/FileDialog.c +++ b/cde/programs/dtfile/FileDialog.c @@ -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); diff --git a/cde/programs/dtfile/OverWrite.c b/cde/programs/dtfile/OverWrite.c index e2f1d0b..38821b6 100644 --- a/cde/programs/dtfile/OverWrite.c +++ b/cde/programs/dtfile/OverWrite.c @@ -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, diff --git a/cde/programs/dtfile/dtcopy/utils.c b/cde/programs/dtfile/dtcopy/utils.c index 196fa43..30d0971 100644 --- a/cde/programs/dtfile/dtcopy/utils.c +++ b/cde/programs/dtfile/dtcopy/utils.c @@ -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, -- 1.7.9.2 ------------------------------------------------------------------------------ How fast is your code? 3 out of 4 devs don\\\'t know how their code performs in production. Find out how slow your code is with AppDynamics Lite. http://ad.doubleclick.net/clk;262219672;13503038;z? http://info.appdynamics.com/FreeJavaPerformanceDownload.html _______________________________________________ cdesktopenv-devel mailing list cdesktopenv-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/cdesktopenv-devel