1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-13 19:52:20 +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)
// return NULL;
int i, num_children;
int i;
XtArgVal num_children;
WidgetList children;
Boolean haveNoSeparator;
int newItemIndex, numPBUnmanaged, tmpPBUnmanaged;
@ -503,7 +504,8 @@ MenuBar::removeOnlyCommands(
// if(isValidMenuPane(pulldown) == FALSE)
// return;
int i, j, num_children;
int i, j;
XtArgVal num_children;
WidgetList children;
XtVaGetValues(pulldown,
@ -545,7 +547,8 @@ MenuBar::removeCommands(
// if(isValidMenuPane(pulldown) == FALSE)
// return;
int i, j, num_children;
int i, j;
XtArgVal num_children;
WidgetList children;
XtVaGetValues(pulldown,
@ -615,7 +618,8 @@ MenuBar::changeLabel(
// if(isValidMenuPane(pulldown) == FALSE)
// return;
int managed_widgets, i, num_children;
int managed_widgets, i;
XtArgVal num_children;
WidgetList children;
XmString label;
Widget wid;
@ -658,7 +662,7 @@ MenuBar::changeLabel(Widget pulldown,
// Locate the appropriate widget in the list.
//
int num_children;
XtArgVal num_children;
char wid_name[200];
XmString label_string = XmStringCreateLocalized((char *)label);
@ -695,7 +699,8 @@ MenuBar::rotateLabels(
// if(isValidMenuPane(pulldown) == FALSE)
// 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;
XmString label, endlabel;
Widget prevwid, wid;
@ -805,7 +810,8 @@ MenuBar::removeCommand(
//if(isValidMenuPane(pulldown) == FALSE)
// return;
int managed_widgets, i, num_children;
int managed_widgets, i;
XtArgVal num_children;
WidgetList children;
XtVaGetValues(pulldown,

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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