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:
parent
d089ff7599
commit
e077181a46
4 changed files with 23 additions and 12 deletions
|
@ -924,7 +924,7 @@ SendMessageToServer(
|
||||||
ttdt_subcontract_manage(msg,
|
ttdt_subcontract_manage(msg,
|
||||||
pStatusCB,
|
pStatusCB,
|
||||||
NULL,
|
NULL,
|
||||||
(void *) ((int) pPad->xrdb.blocking));/* client data */
|
(void *) ((XtArgVal) pPad->xrdb.blocking));/* client data */
|
||||||
|
|
||||||
/* Add pArgs to msg using tt_message_context_set */
|
/* Add pArgs to msg using tt_message_context_set */
|
||||||
SetupLoadArgs(msg, pPad);
|
SetupLoadArgs(msg, pPad);
|
||||||
|
@ -1163,7 +1163,7 @@ StartDbUpdate(
|
||||||
void
|
void
|
||||||
exitCB(Widget w, XtPointer callData, XtPointer clientData)
|
exitCB(Widget w, XtPointer callData, XtPointer clientData)
|
||||||
{
|
{
|
||||||
exit((int) clientData);
|
exit((XtArgVal) clientData);
|
||||||
}
|
}
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
|
|
|
@ -953,14 +953,17 @@ _pjPrintOnePageCB(
|
||||||
|
|
||||||
if (pJob->pOutput == NULL)
|
if (pJob->pOutput == NULL)
|
||||||
{
|
{
|
||||||
Dimension width, height;
|
XtArgVal width0, height0;
|
||||||
|
Dimension width, height;
|
||||||
|
|
||||||
width = 0; height=0;
|
width = 0; height=0;
|
||||||
XtVaGetValues(
|
XtVaGetValues(
|
||||||
pJob->pShell,
|
pJob->pShell,
|
||||||
XmNwidth, &width,
|
XmNwidth, &width0,
|
||||||
XmNheight, &height,
|
XmNheight, &height0,
|
||||||
NULL);
|
NULL);
|
||||||
|
width = (Dimension)width0;
|
||||||
|
height = (Dimension)height0;
|
||||||
|
|
||||||
#if defined(PRINT_TO_VIDEO)
|
#if defined(PRINT_TO_VIDEO)
|
||||||
printf("PrintShell in _pjPrintOnePageCB: <W %d - H %d>\n",width,height);
|
printf("PrintShell in _pjPrintOnePageCB: <W %d - H %d>\n",width,height);
|
||||||
|
|
|
@ -569,6 +569,7 @@ PrintOutputGetLinesPerPage(PrintOutput *pOutput)
|
||||||
int
|
int
|
||||||
PrintOutputGetNumLines(PrintOutput *pOutput)
|
PrintOutputGetNumLines(PrintOutput *pOutput)
|
||||||
{
|
{
|
||||||
|
XtArgVal p;
|
||||||
int total = 0;
|
int total = 0;
|
||||||
int saveTop;
|
int saveTop;
|
||||||
|
|
||||||
|
@ -581,7 +582,8 @@ PrintOutputGetNumLines(PrintOutput *pOutput)
|
||||||
DtEditorGoToLine(pOutput->editor, saveTop);
|
DtEditorGoToLine(pOutput->editor, saveTop);
|
||||||
pOutput->currentLine = saveTop;
|
pOutput->currentLine = saveTop;
|
||||||
#else
|
#else
|
||||||
XtVaGetValues(pOutput->editor, XmNtotalLines, &total, NULL);
|
XtVaGetValues(pOutput->editor, XmNtotalLines, &p, NULL);
|
||||||
|
total = (int)p;
|
||||||
#endif
|
#endif
|
||||||
return(total);
|
return(total);
|
||||||
}
|
}
|
||||||
|
@ -698,7 +700,7 @@ PrintOutputLoadFile( PrintOutput *pOutput, char *file)
|
||||||
static int
|
static int
|
||||||
_poDoGetLinesPerPage(PrintOutput *pOutput)
|
_poDoGetLinesPerPage(PrintOutput *pOutput)
|
||||||
{
|
{
|
||||||
Dimension lpp;
|
XtArgVal lpp;
|
||||||
|
|
||||||
XtVaGetValues(pOutput->editor, XmNrows, &lpp, NULL);
|
XtVaGetValues(pOutput->editor, XmNrows, &lpp, NULL);
|
||||||
return ((int) lpp);
|
return ((int) lpp);
|
||||||
|
@ -714,23 +716,29 @@ _poSetInnerPageDimensions(
|
||||||
Dimension left
|
Dimension left
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
XtArgVal outer_height0, outer_width0, footer_height0, header_height0;
|
||||||
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(pOutput->page,
|
XtVaGetValues(pOutput->page,
|
||||||
XmNheight, &outer_height,
|
XmNheight, &outer_height0,
|
||||||
XmNwidth, &outer_width,
|
XmNwidth, &outer_width0,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
XtVaGetValues(pOutput->headerLeft,
|
XtVaGetValues(pOutput->headerLeft,
|
||||||
XmNheight, &header_height,
|
XmNheight, &header_height0,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
XtVaGetValues(pOutput->footerLeft,
|
XtVaGetValues(pOutput->footerLeft,
|
||||||
XmNheight, &footer_height,
|
XmNheight, &footer_height0,
|
||||||
NULL);
|
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_x = left;
|
||||||
inner_y = top;
|
inner_y = top;
|
||||||
inner_height = (outer_height > (Dimension) (top + bottom)) ?
|
inner_height = (outer_height > (Dimension) (top + bottom)) ?
|
||||||
|
|
|
@ -614,7 +614,7 @@ _psSetupToUi(PrintSetup *pSetup)
|
||||||
static void
|
static void
|
||||||
_psUiToSetup(PrintSetup *pSetup)
|
_psUiToSetup(PrintSetup *pSetup)
|
||||||
{
|
{
|
||||||
unsigned char isSet;
|
XtArgVal isSet;
|
||||||
Widget frame, w;
|
Widget frame, w;
|
||||||
PrintOptions *pOption;
|
PrintOptions *pOption;
|
||||||
char *marginSpec;
|
char *marginSpec;
|
||||||
|
|
Loading…
Reference in a new issue