1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-15 04:32:24 +00:00

dtmail: Fix XtVaGetValues() return value storage

At least one crash was caused by this
on the 64-bit system
This commit is contained in:
Marcin Cieslak 2012-09-24 13:36:14 +02:00 committed by Jon Trulson
parent 3a246dfb9b
commit 91bfe1e4dc
8 changed files with 48 additions and 33 deletions

View file

@ -406,7 +406,8 @@ MenuBar::addCommands(
// if(isValidMenuPane(pulldown) == FALSE) // if(isValidMenuPane(pulldown) == FALSE)
// return NULL; // return NULL;
int i, num_children; int i;
XtArgVal num_children;
WidgetList children; WidgetList children;
Boolean haveNoSeparator; Boolean haveNoSeparator;
int newItemIndex, numPBUnmanaged, tmpPBUnmanaged; int newItemIndex, numPBUnmanaged, tmpPBUnmanaged;
@ -503,7 +504,8 @@ MenuBar::removeOnlyCommands(
// if(isValidMenuPane(pulldown) == FALSE) // if(isValidMenuPane(pulldown) == FALSE)
// return; // return;
int i, j, num_children; int i, j;
XtArgVal num_children;
WidgetList children; WidgetList children;
XtVaGetValues(pulldown, XtVaGetValues(pulldown,
@ -545,7 +547,8 @@ MenuBar::removeCommands(
// if(isValidMenuPane(pulldown) == FALSE) // if(isValidMenuPane(pulldown) == FALSE)
// return; // return;
int i, j, num_children; int i, j;
XtArgVal num_children;
WidgetList children; WidgetList children;
XtVaGetValues(pulldown, XtVaGetValues(pulldown,
@ -615,7 +618,8 @@ MenuBar::changeLabel(
// if(isValidMenuPane(pulldown) == FALSE) // if(isValidMenuPane(pulldown) == FALSE)
// return; // return;
int managed_widgets, i, num_children; int managed_widgets, i;
XtArgVal num_children;
WidgetList children; WidgetList children;
XmString label; XmString label;
Widget wid; Widget wid;
@ -658,7 +662,7 @@ MenuBar::changeLabel(Widget pulldown,
// Locate the appropriate widget in the list. // Locate the appropriate widget in the list.
// //
int num_children; XtArgVal num_children;
char wid_name[200]; char wid_name[200];
XmString label_string = XmStringCreateLocalized((char *)label); XmString label_string = XmStringCreateLocalized((char *)label);
@ -695,7 +699,8 @@ MenuBar::rotateLabels(
// if(isValidMenuPane(pulldown) == FALSE) // if(isValidMenuPane(pulldown) == FALSE)
// return; // return;
int num_managed_wids=0, i, j, num_children, num_to_change; int num_managed_wids=0, i, j, num_to_change;
XtArgVal num_children;
WidgetList children; WidgetList children;
XmString label, endlabel; XmString label, endlabel;
Widget prevwid, wid; Widget prevwid, wid;
@ -805,7 +810,8 @@ MenuBar::removeCommand(
//if(isValidMenuPane(pulldown) == FALSE) //if(isValidMenuPane(pulldown) == FALSE)
// return; // return;
int managed_widgets, i, num_children; int managed_widgets, i;
XtArgVal num_children;
WidgetList children; WidgetList children;
XtVaGetValues(pulldown, XtVaGetValues(pulldown,

View file

@ -111,10 +111,13 @@ void
MenuWindow::getIconColors(Pixel & fore, Pixel & back) MenuWindow::getIconColors(Pixel & fore, Pixel & back)
{ {
if (_menuBar) { if (_menuBar) {
XtArgVal fore0, back0;
XtVaGetValues (_menuBar->baseWidget(), XtVaGetValues (_menuBar->baseWidget(),
XmNforeground, &fore, XmNforeground, &fore0,
XmNbackground, &back, XmNbackground, &back0,
NULL); NULL);
fore = (Pixel) fore0;
back = (Pixel) back0;
} }
else { else {
MainWindow::getIconColors(fore, back); MainWindow::getIconColors(fore, back);

View file

@ -347,7 +347,7 @@ int
SelectFileCmd::getHidden() SelectFileCmd::getHidden()
{ {
int val; int val;
unsigned char current_state; XtArgVal current_state;
if (NULL == _fileBrowser || NULL == _hidden_button) if (NULL == _fileBrowser || NULL == _hidden_button)
return 0; return 0;
@ -388,8 +388,8 @@ SelectFileCmd::setSelected(char *path)
void void
SelectFileCmd::setHidden(int on) SelectFileCmd::setHidden(int on)
{ {
unsigned char current_state; XtArgVal current_state;
unsigned char desired_state; XtArgVal desired_state;
if (NULL == _fileBrowser || NULL == _hidden_button) if (NULL == _fileBrowser || NULL == _hidden_button)
return; return;

View file

@ -475,7 +475,7 @@ void AttachArea::resizeCallback (
XtPointer //callData XtPointer //callData
) )
{ {
Dimension wid; XtArgVal wid;
AttachArea *obj = (AttachArea *) clientData; AttachArea *obj = (AttachArea *) clientData;
XtVaGetValues( XtVaGetValues(
@ -484,7 +484,7 @@ void AttachArea::resizeCallback (
NULL NULL
); );
obj->resize(wid); obj->resize((Dimension)wid);
} }
void AttachArea::resize( void AttachArea::resize(
@ -1284,13 +1284,11 @@ AttachArea::attachment_summary(
void void
AttachArea::manage() AttachArea::manage()
{ {
Dimension wid; XtArgVal /* Dimension */ ht;
Dimension ht; XtArgVal /* Dimension */ pht;
Dimension pht;
Widget sww; Widget sww;
// Update the display // Update the display
XtVaGetValues(this->baseWidget(), XmNwidth, &wid, NULL);
sww = getSWWindow(); sww = getSWWindow();
this->manageList(); this->manageList();

View file

@ -674,7 +674,7 @@ DmxPrintJob::printOnePageCB(
if (thisJob->_print_output == NULL) if (thisJob->_print_output == NULL)
{ {
Dimension width, height; XtArgVal /* Dimension */ width, height;
width = 0; height=0; width = 0; height=0;
XtVaGetValues( XtVaGetValues(

View file

@ -546,7 +546,7 @@ DmxPrintOutput::setWrapToFit (DtMailBoolean onoff)
int DmxPrintOutput::getCharactersPerLine () int DmxPrintOutput::getCharactersPerLine ()
{ {
short columns = 0; XtArgVal columns = 0;
#ifdef USE_DTEDITOR #ifdef USE_DTEDITOR
XtVaGetValues(_editor, DtNcolumns, &columns, NULL); XtVaGetValues(_editor, DtNcolumns, &columns, NULL);
@ -560,7 +560,7 @@ int DmxPrintOutput::getCharactersPerLine ()
int DmxPrintOutput::getNumLines () int DmxPrintOutput::getNumLines ()
{ {
int total = 0; XtArgVal total = 0;
#ifdef USE_DTEDITOR #ifdef USE_DTEDITOR
#else #else
@ -570,7 +570,7 @@ int DmxPrintOutput::getNumLines ()
// //
total -= 1; total -= 1;
#endif #endif
return(total); return((int)total);
} }
@ -726,7 +726,7 @@ void DmxPrintOutput::clearContents (void)
int int
DmxPrintOutput::doGetLinesPerPage () DmxPrintOutput::doGetLinesPerPage ()
{ {
Dimension lpp; XtArgVal /* Dimension */ lpp;
XtVaGetValues(_editor, XmNrows, &lpp, NULL); XtVaGetValues(_editor, XmNrows, &lpp, NULL);
return ((int) lpp); return ((int) lpp);
@ -741,22 +741,27 @@ DmxPrintOutput::setInnerPageDimensions (
Dimension left Dimension left
) )
{ {
XtArgVal height0, width0;
Dimension inner_height, inner_width, inner_x, inner_y, Dimension inner_height, inner_width, inner_x, inner_y,
outer_height, outer_width, outer_height, outer_width,
editor_height, footer_height, header_height; editor_height, footer_height, header_height;
XtVaGetValues(_form, XtVaGetValues(_form,
XmNheight, &outer_height, XmNheight, &height0,
XmNwidth, &outer_width, XmNwidth, &width0,
NULL); NULL);
outer_height = (Dimension)height0;
outer_width = (Dimension)width0;
XtVaGetValues(_header_left, XtVaGetValues(_header_left,
XmNheight, &header_height, XmNheight, &height0,
NULL); NULL);
header_height = (Dimension)height0;
XtVaGetValues(_footer_left, XtVaGetValues(_footer_left,
XmNheight, &footer_height, XmNheight, &height0,
NULL); NULL);
footer_height = (Dimension)height0;
inner_x = left; inner_x = left;
inner_y = top; inner_y = top;

View file

@ -161,8 +161,8 @@ DmxPrintSetup::display (void)
if (_dtprint_setup == NULL) return; if (_dtprint_setup == NULL) return;
#ifdef REUSE_PRINT_SETUP_DIALOGS #ifdef REUSE_PRINT_SETUP_DIALOGS
Position x1, y1, x2, y2; XtArgVal /* Position */ x1, y1, x2, y2;
Dimension w1, h1, w2, h2; XtArgVal /* Dimension */ w1, h1, w2, h2;
XtVaGetValues( XtVaGetValues(
XtParent(_dtprint_setup), XtParent(_dtprint_setup),
XmNx, &x1, XmNy, &y1, XmNx, &x1, XmNy, &y1,
@ -444,7 +444,7 @@ DmxPrintSetup::detachPrintSetupDialog (void)
void void
DmxPrintSetup::savePrintSetupOptions(DtPrintSetupData *print_data) DmxPrintSetup::savePrintSetupOptions(DtPrintSetupData *print_data)
{ {
unsigned char is_set; XtArgVal /* unsigned char */ is_set;
XtVaGetValues(_widgets->print_separately_tb, XmNset, &is_set, NULL); XtVaGetValues(_widgets->print_separately_tb, XmNset, &is_set, NULL);
_print_separately = (is_set == XmSET) ? DTM_TRUE : DTM_FALSE; _print_separately = (is_set == XmSET) ? DTM_TRUE : DTM_FALSE;
@ -479,7 +479,7 @@ DmxPrintSetup::destinationChangedCB(
XtPointer) XtPointer)
{ {
PrintSetupWidgets *widgets = (PrintSetupWidgets*) client_data; PrintSetupWidgets *widgets = (PrintSetupWidgets*) client_data;
Boolean toggleFlag; XtArgVal /* Boolean */ toggleFlag;
if (NULL == checkbox_tb) return; if (NULL == checkbox_tb) return;

View file

@ -214,9 +214,12 @@ IndexedOptionMenu::getIndexSpec (void)
if (_w) if (_w)
{ {
XtArgVal arg;
Widget selected; Widget selected;
XtVaGetValues(_w, XmNmenuHistory, &selected, NULL); XtVaGetValues(_w, XmNmenuHistory, &arg, NULL);
XtVaGetValues(selected, XmNuserData, &data, NULL); selected = (Widget)arg;
XtVaGetValues(selected, XmNuserData, &arg, NULL);
data = (int)arg;
} }
return data; return data;
} }