mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-02-15 04:32:24 +00:00
dtfile: fix pointer to integer conversion
Use XtArgVal (usually (long)) to convert (XtPointer) to (int) and back. This provides safe way to convert and avoids compiler warning.
This commit is contained in:
parent
359126b739
commit
18a78bbff5
14 changed files with 34 additions and 37 deletions
|
@ -304,7 +304,7 @@ ShowChangeDirDialog(
|
||||||
|
|
||||||
if (w)
|
if (w)
|
||||||
{
|
{
|
||||||
if((int)client_data == FM_POPUP)
|
if((XtArgVal)client_data == FM_POPUP)
|
||||||
mbar = XtParent(w);
|
mbar = XtParent(w);
|
||||||
else
|
else
|
||||||
mbar = (Widget) XmGetPostedFromWidget(XtParent(w));
|
mbar = (Widget) XmGetPostedFromWidget(XtParent(w));
|
||||||
|
|
|
@ -2535,7 +2535,7 @@ PutOnDTCB (
|
||||||
|
|
||||||
XmUpdateDisplay (w);
|
XmUpdateDisplay (w);
|
||||||
|
|
||||||
if((int)client_data != 0)
|
if(client_data != 0)
|
||||||
mbar = XtParent(w);
|
mbar = XtParent(w);
|
||||||
else
|
else
|
||||||
mbar = XmGetPostedFromWidget(XtParent(w));
|
mbar = XmGetPostedFromWidget(XtParent(w));
|
||||||
|
|
|
@ -1249,22 +1249,22 @@ IntDialogGetResources(
|
||||||
{
|
{
|
||||||
if (resource->size == sizeof(char))
|
if (resource->size == sizeof(char))
|
||||||
{
|
{
|
||||||
charVal = (char)resource->default_value;
|
charVal = (char)(XtArgVal)resource->default_value;
|
||||||
convertedValue.addr = (caddr_t) &charVal;
|
convertedValue.addr = (caddr_t) &charVal;
|
||||||
}
|
}
|
||||||
else if (resource->size == sizeof(short))
|
else if (resource->size == sizeof(short))
|
||||||
{
|
{
|
||||||
shortVal = (short)resource->default_value;
|
shortVal = (short)(XtArgVal)resource->default_value;
|
||||||
convertedValue.addr = (caddr_t) &shortVal;
|
convertedValue.addr = (caddr_t) &shortVal;
|
||||||
}
|
}
|
||||||
else if (resource->size == sizeof(int))
|
else if (resource->size == sizeof(int))
|
||||||
{
|
{
|
||||||
intVal = (int)resource->default_value;
|
intVal = (int)(XtArgVal)resource->default_value;
|
||||||
convertedValue.addr = (caddr_t) &intVal;
|
convertedValue.addr = (caddr_t) &intVal;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
longVal = (long)resource->default_value;
|
longVal = (long)(XtArgVal)resource->default_value;
|
||||||
convertedValue.addr = (caddr_t) &longVal;
|
convertedValue.addr = (caddr_t) &longVal;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7193,7 +7193,7 @@ CommitWorkProcUpdates(
|
||||||
/* If not managed yet, manage the file window again */
|
/* If not managed yet, manage the file window again */
|
||||||
if (!XtIsManaged((Widget)file_window))
|
if (!XtIsManaged((Widget)file_window))
|
||||||
{
|
{
|
||||||
XtPointer incr;
|
XtArgVal incr;
|
||||||
Arg args[2];
|
Arg args[2];
|
||||||
|
|
||||||
XtManageChild ((Widget)file_window);
|
XtManageChild ((Widget)file_window);
|
||||||
|
|
|
@ -270,7 +270,7 @@ ShowCopyFileDialog(
|
||||||
char * directory_name;
|
char * directory_name;
|
||||||
char * tmpStr, *tempStr;
|
char * tmpStr, *tempStr;
|
||||||
|
|
||||||
XtPointer width;
|
XtArgVal width;
|
||||||
Dimension f_width, d_width;
|
Dimension f_width, d_width;
|
||||||
|
|
||||||
Widget shell;
|
Widget shell;
|
||||||
|
@ -1750,7 +1750,7 @@ FileTypePreview(
|
||||||
char * new_link_path;
|
char * new_link_path;
|
||||||
PixmapData *pixmapData;
|
PixmapData *pixmapData;
|
||||||
Tt_status tt_status;
|
Tt_status tt_status;
|
||||||
Boolean Flag = ((Boolean)call_data == True)?True:False;
|
Boolean Flag = ((Boolean)(XtArgVal)call_data == True)?True:False;
|
||||||
|
|
||||||
call_struct = (DialogCallbackStruct *) client_data;
|
call_struct = (DialogCallbackStruct *) client_data;
|
||||||
new_name = (char *) _DtStripSpaces (new_name);
|
new_name = (char *) _DtStripSpaces (new_name);
|
||||||
|
|
|
@ -1391,7 +1391,7 @@ ShowHiddenFiles (
|
||||||
Widget mbar;
|
Widget mbar;
|
||||||
Arg args[1];
|
Arg args[1];
|
||||||
|
|
||||||
if ((int)client_data == FM_POPUP)
|
if ((XtArgVal)client_data == FM_POPUP)
|
||||||
mbar = XtParent(w);
|
mbar = XtParent(w);
|
||||||
else
|
else
|
||||||
mbar = (Widget)XmGetPostedFromWidget(XtParent(w));
|
mbar = (Widget)XmGetPostedFromWidget(XtParent(w));
|
||||||
|
|
|
@ -101,7 +101,7 @@ ShowFindDialog(
|
||||||
|
|
||||||
if (w)
|
if (w)
|
||||||
{
|
{
|
||||||
if ( (int) client_data == FM_POPUP )
|
if ( (XtArgVal) client_data == FM_POPUP )
|
||||||
mbar = XtParent(w);
|
mbar = XtParent(w);
|
||||||
else
|
else
|
||||||
mbar = XmGetPostedFromWidget(XtParent(w));
|
mbar = XmGetPostedFromWidget(XtParent(w));
|
||||||
|
|
|
@ -461,7 +461,7 @@ ShowDTHelpDialog(
|
||||||
}
|
}
|
||||||
|
|
||||||
_DtShowDialog(parentShell, NULL, NULL, dialogData, NULL, NULL,
|
_DtShowDialog(parentShell, NULL, NULL, dialogData, NULL, NULL,
|
||||||
DTHelpClose, (XtPointer)workspaceNum,
|
DTHelpClose, (XtPointer)(XtArgVal)workspaceNum,
|
||||||
desktop_data->workspaceData[workspaceNum]->name,
|
desktop_data->workspaceData[workspaceNum]->name,
|
||||||
False, False, NULL, NULL);
|
False, False, NULL, NULL);
|
||||||
|
|
||||||
|
@ -474,7 +474,7 @@ ShowDTHelpDialog(
|
||||||
helpRec = (HelpRec *)_DtGetDialogInstance(dialogData);
|
helpRec = (HelpRec *)_DtGetDialogInstance(dialogData);
|
||||||
XtRemoveAllCallbacks(helpRec->helpDialog, DtNhyperLinkCallback);
|
XtRemoveAllCallbacks(helpRec->helpDialog, DtNhyperLinkCallback);
|
||||||
XtAddCallback(helpRec->helpDialog, DtNhyperLinkCallback,
|
XtAddCallback(helpRec->helpDialog, DtNhyperLinkCallback,
|
||||||
DTHyperLink, (XtPointer)workspaceNum);
|
DTHyperLink, (XtPointer)(XtArgVal)workspaceNum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -494,7 +494,7 @@ DTHelpClose(
|
||||||
DialogData *new_dialog_data )
|
DialogData *new_dialog_data )
|
||||||
|
|
||||||
{
|
{
|
||||||
int workspaceNum = (int) client_data;
|
int workspaceNum = (int)(XtArgVal) client_data;
|
||||||
int count;
|
int count;
|
||||||
int i, j;
|
int i, j;
|
||||||
WorkspaceRec * wsInfo;
|
WorkspaceRec * wsInfo;
|
||||||
|
@ -535,7 +535,7 @@ DTHyperLink(
|
||||||
XtPointer callData )
|
XtPointer callData )
|
||||||
|
|
||||||
{
|
{
|
||||||
int workspaceNum = (int) clientData;
|
int workspaceNum = (int)(XtArgVal) clientData;
|
||||||
DtHelpDialogCallbackStruct * hyperData;
|
DtHelpDialogCallbackStruct * hyperData;
|
||||||
|
|
||||||
hyperData = (DtHelpDialogCallbackStruct *)callData;
|
hyperData = (DtHelpDialogCallbackStruct *)callData;
|
||||||
|
|
|
@ -5146,7 +5146,7 @@ CleanUp (
|
||||||
XRectangle textExtent;
|
XRectangle textExtent;
|
||||||
Position x, y;
|
Position x, y;
|
||||||
|
|
||||||
if ((int) client_data == FM_POPUP)
|
if ((int)(XtArgVal) client_data == FM_POPUP)
|
||||||
mbar = XtParent(w);
|
mbar = XtParent(w);
|
||||||
else
|
else
|
||||||
mbar = XmGetPostedFromWidget(XtParent(w));
|
mbar = XmGetPostedFromWidget(XtParent(w));
|
||||||
|
|
|
@ -843,7 +843,7 @@ UnselectAll(
|
||||||
Arg args[1];
|
Arg args[1];
|
||||||
Widget mbar;
|
Widget mbar;
|
||||||
|
|
||||||
if ((int)client_data == FM_POPUP)
|
if ((int)(XtArgVal) client_data == FM_POPUP)
|
||||||
mbar = XtParent(w);
|
mbar = XtParent(w);
|
||||||
else
|
else
|
||||||
mbar = XmGetPostedFromWidget(XtParent(w));
|
mbar = XmGetPostedFromWidget(XtParent(w));
|
||||||
|
@ -886,7 +886,7 @@ SelectAll(
|
||||||
Arg args[1];
|
Arg args[1];
|
||||||
Widget mbar;
|
Widget mbar;
|
||||||
|
|
||||||
if ((int)client_data == FM_POPUP)
|
if ((int)(XtArgVal)client_data == FM_POPUP)
|
||||||
mbar = XtParent(w);
|
mbar = XtParent(w);
|
||||||
else
|
else
|
||||||
mbar = XmGetPostedFromWidget(XtParent(w));
|
mbar = XmGetPostedFromWidget(XtParent(w));
|
||||||
|
@ -1009,7 +1009,7 @@ TrashFiles(
|
||||||
|
|
||||||
XmUpdateDisplay (w);
|
XmUpdateDisplay (w);
|
||||||
|
|
||||||
if((int)client_data == 0)
|
if((int)(XtArgVal)client_data == 0)
|
||||||
mbar = XmGetPostedFromWidget(XtParent(w));
|
mbar = XmGetPostedFromWidget(XtParent(w));
|
||||||
else
|
else
|
||||||
mbar = XtParent(w);
|
mbar = XtParent(w);
|
||||||
|
@ -1164,7 +1164,7 @@ ChangeToHome(
|
||||||
Boolean found;
|
Boolean found;
|
||||||
|
|
||||||
XmUpdateDisplay (w);
|
XmUpdateDisplay (w);
|
||||||
if((int)client_data == FM_POPUP)
|
if((int)(XtArgVal)client_data == FM_POPUP)
|
||||||
mbar = XtParent(w);
|
mbar = XtParent(w);
|
||||||
else
|
else
|
||||||
mbar = XmGetPostedFromWidget(XtParent(w));
|
mbar = XmGetPostedFromWidget(XtParent(w));
|
||||||
|
@ -1242,7 +1242,7 @@ ChangeToParent(
|
||||||
Widget focus_widget;
|
Widget focus_widget;
|
||||||
|
|
||||||
XmUpdateDisplay (w);
|
XmUpdateDisplay (w);
|
||||||
if((int)client_data == FM_POPUP)
|
if((int)(XtArgVal)client_data == FM_POPUP)
|
||||||
mbar = XtParent(w);
|
mbar = XtParent(w);
|
||||||
else
|
else
|
||||||
mbar = XmGetPostedFromWidget(XtParent(w));
|
mbar = XmGetPostedFromWidget(XtParent(w));
|
||||||
|
|
|
@ -134,7 +134,7 @@ ShowModAttrDialog(
|
||||||
|
|
||||||
XmUpdateDisplay (w);
|
XmUpdateDisplay (w);
|
||||||
|
|
||||||
if((int)client_data != 0)
|
if((int)(XtArgVal)client_data != 0)
|
||||||
mbar = XtParent(w);
|
mbar = XtParent(w);
|
||||||
else
|
else
|
||||||
mbar = XmGetPostedFromWidget(XtParent(w));
|
mbar = XmGetPostedFromWidget(XtParent(w));
|
||||||
|
|
|
@ -175,7 +175,7 @@ replace_rename_ok_callback(
|
||||||
char *newFileName = NULL;
|
char *newFileName = NULL;
|
||||||
int newFileDirLen;
|
int newFileDirLen;
|
||||||
int rename_rc;
|
int rename_rc;
|
||||||
Boolean same = (Boolean)client_data;
|
Boolean same = (Boolean)(XtArgVal)client_data;
|
||||||
|
|
||||||
/* if same is true, then the object is tring to be copied into the same
|
/* if same is true, then the object is tring to be copied into the same
|
||||||
* folder as itself. So the existing files stay the same and the new files
|
* folder as itself. So the existing files stay the same and the new files
|
||||||
|
@ -441,7 +441,7 @@ replace_rename_radio_callback(
|
||||||
|
|
||||||
|
|
||||||
if (state->set)
|
if (state->set)
|
||||||
switch ((int) client_data)
|
switch ((int)(XtArgVal) client_data)
|
||||||
{
|
{
|
||||||
case RADIO_REPLACE:
|
case RADIO_REPLACE:
|
||||||
XtVaSetValues (G_rename_text,
|
XtVaSetValues (G_rename_text,
|
||||||
|
@ -589,7 +589,7 @@ multicollide_ok_callback(
|
||||||
struct stat buf;
|
struct stat buf;
|
||||||
|
|
||||||
|
|
||||||
Boolean same = (Boolean)client_data;
|
Boolean same = (Boolean)(XtArgVal)client_data;
|
||||||
|
|
||||||
/* if same is true, then the object is tring to be copied into the same
|
/* if same is true, then the object is tring to be copied into the same
|
||||||
* folder as itself. So the existing files stay the same and the new files
|
* folder as itself. So the existing files stay the same and the new files
|
||||||
|
@ -1757,7 +1757,7 @@ Create_Action_Area(
|
||||||
|
|
||||||
if (i == actions.defaultAction)
|
if (i == actions.defaultAction)
|
||||||
{
|
{
|
||||||
XtPointer heightptr;
|
XtArgVal heightptr;
|
||||||
Dimension height, h;
|
Dimension height, h;
|
||||||
XtVaGetValues (action_area, XmNmarginHeight, &heightptr, NULL);
|
XtVaGetValues (action_area, XmNmarginHeight, &heightptr, NULL);
|
||||||
height = (Dimension)heightptr;
|
height = (Dimension)heightptr;
|
||||||
|
|
|
@ -94,7 +94,7 @@ radio_callback(
|
||||||
XmToggleButtonCallbackStruct *state = (XmToggleButtonCallbackStruct *)call_data;
|
XmToggleButtonCallbackStruct *state = (XmToggleButtonCallbackStruct *)call_data;
|
||||||
|
|
||||||
|
|
||||||
G_overwrite_selection = (int) client_data;
|
G_overwrite_selection = (int)(XtArgVal) client_data;
|
||||||
|
|
||||||
if (state->set)
|
if (state->set)
|
||||||
switch (G_overwrite_selection)
|
switch (G_overwrite_selection)
|
||||||
|
@ -404,7 +404,7 @@ create_overwrite_dialog(
|
||||||
XmNalignment, XmALIGNMENT_BEGINNING,
|
XmNalignment, XmALIGNMENT_BEGINNING,
|
||||||
XmNlabelString, xm_string[i],
|
XmNlabelString, xm_string[i],
|
||||||
NULL);
|
NULL);
|
||||||
XtAddCallback(radiobtn[i], XmNvalueChangedCallback, radio_callback, (XtPointer) i);
|
XtAddCallback(radiobtn[i], XmNvalueChangedCallback, radio_callback, (XtPointer)(XtArgVal) i);
|
||||||
XmStringFree(xm_string[i]);
|
XmStringFree(xm_string[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -137,7 +137,7 @@ help_callback(
|
||||||
char *helpVolume, *locationId;
|
char *helpVolume, *locationId;
|
||||||
int topic;
|
int topic;
|
||||||
|
|
||||||
topic = (int)client_data;
|
topic = (int)(XtArgVal) client_data;
|
||||||
helpVolume = HELP_VOLUME;
|
helpVolume = HELP_VOLUME;
|
||||||
|
|
||||||
switch (topic)
|
switch (topic)
|
||||||
|
@ -418,15 +418,12 @@ Create_Action_Area(
|
||||||
|
|
||||||
if (i == actions.defaultAction)
|
if (i == actions.defaultAction)
|
||||||
{
|
{
|
||||||
union {
|
XtArgVal arg;
|
||||||
XtPointer ptr;
|
|
||||||
Dimension dim;
|
|
||||||
} wide;
|
|
||||||
Dimension height, h;
|
Dimension height, h;
|
||||||
XtVaGetValues (action_area, XmNmarginHeight, &wide.ptr, NULL);
|
XtVaGetValues (action_area, XmNmarginHeight, &arg, NULL);
|
||||||
h = wide.dim;
|
h = (Dimension)arg;
|
||||||
XtVaGetValues (widget, XmNheight, &wide.ptr, NULL);
|
XtVaGetValues (widget, XmNheight, &arg, NULL);
|
||||||
height = wide.dim;
|
height = (Dimension)arg;
|
||||||
|
|
||||||
height +=2 * h;
|
height +=2 * h;
|
||||||
XtVaSetValues (action_area,
|
XtVaSetValues (action_area,
|
||||||
|
|
Loading…
Reference in a new issue