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

dtpad: Use XtArgVal for int conversion

Avoid overwrite of local variables when using
short (int, etc.) types with XtVaGetValues().

Cast XtPointer using (XtArgVal) without
the need to use C99 <stdint.h> and friends.
This commit is contained in:
Marcin Cieslak 2012-09-24 03:15:20 +02:00 committed by Jon Trulson
parent d089ff7599
commit e077181a46
4 changed files with 23 additions and 12 deletions

View file

@ -924,7 +924,7 @@ SendMessageToServer(
ttdt_subcontract_manage(msg,
pStatusCB,
NULL,
(void *) ((int) pPad->xrdb.blocking));/* client data */
(void *) ((XtArgVal) pPad->xrdb.blocking));/* client data */
/* Add pArgs to msg using tt_message_context_set */
SetupLoadArgs(msg, pPad);
@ -1163,7 +1163,7 @@ StartDbUpdate(
void
exitCB(Widget w, XtPointer callData, XtPointer clientData)
{
exit((int) clientData);
exit((XtArgVal) clientData);
}
/************************************************************************

View file

@ -953,14 +953,17 @@ _pjPrintOnePageCB(
if (pJob->pOutput == NULL)
{
Dimension width, height;
XtArgVal width0, height0;
Dimension width, height;
width = 0; height=0;
XtVaGetValues(
pJob->pShell,
XmNwidth, &width,
XmNheight, &height,
XmNwidth, &width0,
XmNheight, &height0,
NULL);
width = (Dimension)width0;
height = (Dimension)height0;
#if defined(PRINT_TO_VIDEO)
printf("PrintShell in _pjPrintOnePageCB: <W %d - H %d>\n",width,height);

View file

@ -569,6 +569,7 @@ PrintOutputGetLinesPerPage(PrintOutput *pOutput)
int
PrintOutputGetNumLines(PrintOutput *pOutput)
{
XtArgVal p;
int total = 0;
int saveTop;
@ -581,7 +582,8 @@ PrintOutputGetNumLines(PrintOutput *pOutput)
DtEditorGoToLine(pOutput->editor, saveTop);
pOutput->currentLine = saveTop;
#else
XtVaGetValues(pOutput->editor, XmNtotalLines, &total, NULL);
XtVaGetValues(pOutput->editor, XmNtotalLines, &p, NULL);
total = (int)p;
#endif
return(total);
}
@ -698,7 +700,7 @@ PrintOutputLoadFile( PrintOutput *pOutput, char *file)
static int
_poDoGetLinesPerPage(PrintOutput *pOutput)
{
Dimension lpp;
XtArgVal lpp;
XtVaGetValues(pOutput->editor, XmNrows, &lpp, NULL);
return ((int) lpp);
@ -714,23 +716,29 @@ _poSetInnerPageDimensions(
Dimension left
)
{
XtArgVal outer_height0, outer_width0, footer_height0, header_height0;
Dimension inner_height, inner_width, inner_x, inner_y,
outer_height, outer_width,
editor_height, footer_height, header_height;
XtVaGetValues(pOutput->page,
XmNheight, &outer_height,
XmNwidth, &outer_width,
XmNheight, &outer_height0,
XmNwidth, &outer_width0,
NULL);
XtVaGetValues(pOutput->headerLeft,
XmNheight, &header_height,
XmNheight, &header_height0,
NULL);
XtVaGetValues(pOutput->footerLeft,
XmNheight, &footer_height,
XmNheight, &footer_height0,
NULL);
outer_height = (Dimension)outer_height0;
outer_width = (Dimension)outer_width0;
header_height = (Dimension)header_height0;
footer_height = (Dimension)footer_height0;
inner_x = left;
inner_y = top;
inner_height = (outer_height > (Dimension) (top + bottom)) ?

View file

@ -614,7 +614,7 @@ _psSetupToUi(PrintSetup *pSetup)
static void
_psUiToSetup(PrintSetup *pSetup)
{
unsigned char isSet;
XtArgVal isSet;
Widget frame, w;
PrintOptions *pOption;
char *marginSpec;