From: Peter Howkins Date: Tue, 30 Dec 2014 17:13:41 +0000 (+0000) Subject: dtwm: resolve 92 compiler warnings (related to 64 bit pointer to int coversions) X-Git-Tag: 2.2.3~54 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=8ed5281e3ee8bf46f60d215716ef676561cd69e8;p=oweals%2Fcde.git dtwm: resolve 92 compiler warnings (related to 64 bit pointer to int coversions) --- diff --git a/cde/programs/dtwm/Callback.c b/cde/programs/dtwm/Callback.c index 9e40a61f..b3fb3ea8 100644 --- a/cde/programs/dtwm/Callback.c +++ b/cde/programs/dtwm/Callback.c @@ -625,12 +625,12 @@ WorkspaceModifyCB (Widget w, /* When adding a switch buttons, keep the row columns row count */ /* equal to the requested value with small number of buttons */ - if (switch_data->switch_count <= (int) + if (switch_data->switch_count <= (intptr_t) (switch_data->element_values[SWITCH_NUMBER_OF_ROWS].parsed_value)) { Arg al[1]; - panel.switch_row_count = (int) + panel.switch_row_count = (intptr_t) (switch_data->element_values[SWITCH_NUMBER_OF_ROWS].parsed_value); XtSetArg (al[0], XmNnumColumns, panel.switch_row_count); @@ -710,7 +710,7 @@ WorkspaceModifyCB (Widget w, /* When deleting a switch button, keep trying to decrease the */ /* row count to the requested value. */ - if (panel.switch_row_count > (int) + if (panel.switch_row_count > (intptr_t) (switch_data->element_values[SWITCH_NUMBER_OF_ROWS].parsed_value)) { button_width = XtWidth (switch_data->buttons[0]); @@ -1237,7 +1237,7 @@ CheckControlTypeFile (ControlData * control_data) char * message; - if ((int) control_data->element_values[CONTROL_TYPE].parsed_value != CONTROL_FILE) + if ((intptr_t) control_data->element_values[CONTROL_TYPE].parsed_value != CONTROL_FILE) return (True); file_name = @@ -1372,7 +1372,7 @@ PushCB (Widget w, int i, j; - control_behavior = (int) (panel.element_values[PANEL_CONTROL_BEHAVIOR].parsed_value); + control_behavior = (intptr_t) (panel.element_values[PANEL_CONTROL_BEHAVIOR].parsed_value); /* See if the workspace name is being edited. If so, call the */ @@ -1563,9 +1563,9 @@ PushCB (Widget w, (callback->reason == XmCR_DEFAULT_ACTION || callback->reason == XmCR_SINGLE_SELECT))) { - control_type = (int) (control_data->element_values[CONTROL_TYPE].parsed_value); + control_type = (intptr_t) (control_data->element_values[CONTROL_TYPE].parsed_value); push_action = (PanelActionData *) (control_data->element_values[CONTROL_PUSH_ACTION].parsed_value); - push_recall = (Boolean) (control_data->element_values[CONTROL_PUSH_RECALL].parsed_value); + push_recall = (Boolean) (intptr_t) (control_data->element_values[CONTROL_PUSH_RECALL].parsed_value); switch (control_type) { @@ -1577,7 +1577,7 @@ PushCB (Widget w, /* Turn off the subpanel control monitor indicator */ - if ((char) control_data->element_values[CONTROL_MONITOR_TYPE]. + if ((char) (intptr_t) control_data->element_values[CONTROL_MONITOR_TYPE]. parsed_value != MONITOR_NONE) { if (subpanel_data != NULL) @@ -1731,7 +1731,7 @@ PushCB (Widget w, /* action occured out of a subpanel. */ if (subpanel_data != NULL && unpost_subpanel && - (Boolean) panel.element_values[PANEL_SUBPANEL_UNPOST].parsed_value && + (Boolean) (intptr_t) panel.element_values[PANEL_SUBPANEL_UNPOST].parsed_value && subpanel_data->torn == False) ArrowCB (main_control_data->arrow, (XtPointer)main_control_data, (XtPointer)NULL); @@ -1774,8 +1774,8 @@ DropCB (Widget w, animate_data->dropData->protocol == DtDND_BUFFER_TRANSFER)) { int numItems; - int control_type = - (int)control_data->element_values[CONTROL_TYPE].parsed_value; + intptr_t control_type = + (intptr_t)control_data->element_values[CONTROL_TYPE].parsed_value; char * control_name = (char *)control_data->element_values[CONTROL_FILE_NAME].parsed_value; Boolean send_control_name = False; @@ -2291,7 +2291,7 @@ CustomizeDropCB (Widget w, Boolean drop_of_fp; Boolean bad_control; Boolean control_monitor; - int position_hints; + intptr_t position_hints; int count; char * new_control_name; @@ -2456,18 +2456,18 @@ CustomizeDropCB (Widget w, if (bad_control) continue; - if ((int) element_values[CONTROL_MONITOR_TYPE].parsed_value != MONITOR_NONE) + if ((intptr_t) element_values[CONTROL_MONITOR_TYPE].parsed_value != MONITOR_NONE) control_monitor = True; else control_monitor = False; - position_hints = (int)element_values[CONTROL_POSITION_HINTS].parsed_value; + position_hints = (intptr_t) element_values[CONTROL_POSITION_HINTS].parsed_value; /* Initialize the subpanel layout and processing attributes. */ - if ((int) main_control_data-> + if ((intptr_t) main_control_data-> element_values[CONTROL_MONITOR_TYPE].parsed_value != MONITOR_NONE) { control_monitor = True; @@ -2476,7 +2476,7 @@ CustomizeDropCB (Widget w, for (j = 0; j < subpanel_data->control_data_count; j++) { - if ((int) subpanel_data->control_data[j]-> + if ((intptr_t) subpanel_data->control_data[j]-> element_values[CONTROL_MONITOR_TYPE].parsed_value != MONITOR_NONE) { control_monitor = True; @@ -2517,7 +2517,7 @@ CustomizeDropCB (Widget w, for (j = count - 2; j >= 0; j--) { if (position_hints >= - (int) subpanel_data->control_data[j]->element_values[CONTROL_POSITION_HINTS].parsed_value) + (intptr_t) subpanel_data->control_data[j]->element_values[CONTROL_POSITION_HINTS].parsed_value) break; } diff --git a/cde/programs/dtwm/DataBaseLoad.c b/cde/programs/dtwm/DataBaseLoad.c index 042ad62e..b5986dde 100644 --- a/cde/programs/dtwm/DataBaseLoad.c +++ b/cde/programs/dtwm/DataBaseLoad.c @@ -607,7 +607,7 @@ _DtPerfChkpntMsgSend("End Front panel database read"); for (i = panel_count - 1; i > 0; i--) { - if ((Boolean)(panel_data[i].element_values[PANEL_LOCKED].parsed_value)) + if ((intptr_t)(panel_data[i].element_values[PANEL_LOCKED].parsed_value)) break; } @@ -680,7 +680,7 @@ _DtPerfChkpntMsgSend("End Front panel database read"); if (switch_count != 0) { for (i = switch_count - 1; i > 0; i--) { - if ((Boolean)(switch_data[i].element_values[SWITCH_LOCKED].parsed_value)) + if ((intptr_t)(switch_data[i].element_values[SWITCH_LOCKED].parsed_value)) break; } @@ -1149,7 +1149,7 @@ AnimationParseCB (DtDtsDbField * fields, if ((string = _DtWmParseNextTokenC(&source, False)) != NULL) { StringToInt((char *)string, &val_rtn); - panel.animation_data[count].items[i].delay = (int) val_rtn; + panel.animation_data[count].items[i].delay = (int) (intptr_t) val_rtn; } else { @@ -1495,8 +1495,8 @@ BubbleSort (RecordData * rec_data, } else { - if ((int) rec_data[j].element_values[elem_index].parsed_value > - (int) rec_data[j+1].element_values[elem_index].parsed_value) + if ((intptr_t) rec_data[j].element_values[elem_index].parsed_value > + (intptr_t) rec_data[j+1].element_values[elem_index].parsed_value) { SwapEntries(rec_data, j, j+1); t = j; @@ -1559,9 +1559,9 @@ ReorderByContainerName (RecordData * rec_data, while (i < rec_count) { - cont_type = (int) + cont_type = (int) (intptr_t) (rec_data[start].element_values[elem_type].parsed_value); - while ((int)(rec_data[i].element_values[elem_type].parsed_value) == + while ((intptr_t)(rec_data[i].element_values[elem_type].parsed_value) == cont_type) { i++; @@ -1653,9 +1653,9 @@ ReorderByPosition(RecordData *rec_data, } else { - container_type = (int) + container_type = (int) (intptr_t) (rec_data[start].element_values[cont_type].parsed_value); - while (((int)rec_data[i].element_values[cont_type].parsed_value == + while (((intptr_t)rec_data[i].element_values[cont_type].parsed_value == container_type) && (strcmp((char *) rec_data[i].element_values[cont_name].parsed_value, @@ -1809,12 +1809,12 @@ ResolveDuplicates (RecordData * record_data, element_values = record_data[i].element_values; if (ANY_CONTAINER_TYPE != container_type) { - cont_type = (int) (element_values[container_type].parsed_value); + cont_type = (int) (intptr_t) (element_values[container_type].parsed_value); cont_name = (char *) (element_values[container_name].parsed_value); } record_name = (char *) (element_values[name_type].parsed_value); - locked = (Boolean)(element_values[lock_type].parsed_value); + locked = (Boolean) (intptr_t) (element_values[lock_type].parsed_value); if (locked) { i--; @@ -1834,7 +1834,7 @@ ResolveDuplicates (RecordData * record_data, } else { - while (((int)(element_values[container_type].parsed_value) + while (((intptr_t)(element_values[container_type].parsed_value) == cont_type) && (strcmp((char *)(element_values[container_name].parsed_value), cont_name) == 0) && @@ -1864,7 +1864,7 @@ ResolveDuplicates (RecordData * record_data, while ((strcmp((char *) (element_values[name_type].parsed_value), record_name) == 0)) { - locked = (Boolean)(element_values[lock_type].parsed_value); + locked = (Boolean) (intptr_t) (element_values[lock_type].parsed_value); if (locked && start_index == lock_index) lock_index = i; last_index = i; @@ -1875,14 +1875,14 @@ ResolveDuplicates (RecordData * record_data, } else { - while (((int)(element_values[container_type].parsed_value) + while (((intptr_t)(element_values[container_type].parsed_value) == cont_type) && (strcmp((char *)(element_values[container_name].parsed_value), cont_name) == 0) && (strcmp((char *)(element_values[name_type].parsed_value), record_name) == 0)) { - locked = (Boolean)(element_values[lock_type].parsed_value); + locked = (Boolean) (intptr_t) (element_values[lock_type].parsed_value); if (locked && start_index == lock_index) lock_index = i; last_index = i; @@ -1942,7 +1942,7 @@ GetNameList (RecordData * record_data, for (i = 0; i < record_count; i++) { if (ANY_CONTAINER_TYPE == container_type || - (int)(record_data[i].element_values[container_type].parsed_value) == + (intptr_t)(record_data[i].element_values[container_type].parsed_value) == container) { if (found_count >= name_list_count) @@ -1999,7 +1999,7 @@ EliminateUnused (RecordData * record_data, { element_values = record_data[i].element_values; if (cont_type == ANY_CONTAINER_TYPE || - (int)(element_values[cont_type].parsed_value) == container) + (intptr_t)(element_values[cont_type].parsed_value) == container) { if (cont_name_list != NULL) { @@ -2069,15 +2069,15 @@ EliminateDeleted (RecordData * record_data, { start = i; element_values = record_data[i].element_values; - if ((Boolean)element_values[delete_type].parsed_value) + if ((intptr_t)element_values[delete_type].parsed_value) { Boolean delete_rest = False; if (record_type == CONTROL) { - rec_type = (int)element_values[CONTROL_TYPE].parsed_value; + rec_type = (intptr_t)element_values[CONTROL_TYPE].parsed_value; container_type = - (int)element_values[CONTROL_CONTAINER_TYPE].parsed_value; + (intptr_t)element_values[CONTROL_CONTAINER_TYPE].parsed_value; } container_name = XtNewString ((char *)element_values[cont_name].parsed_value); @@ -2088,18 +2088,18 @@ EliminateDeleted (RecordData * record_data, { other_element_values = record_data[j].element_values; if ((record_type != CONTROL || - ((int)other_element_values[CONTROL_CONTAINER_TYPE].parsed_value + ((intptr_t)other_element_values[CONTROL_CONTAINER_TYPE].parsed_value == container_type && - (int) other_element_values[CONTROL_TYPE].parsed_value + (intptr_t) other_element_values[CONTROL_TYPE].parsed_value == rec_type)) && strcmp((char *)other_element_values[cont_name].parsed_value, container_name) == 0 && strcmp((char *)other_element_values[record_name].parsed_value, rec_name) == 0) { - if ((Boolean)other_element_values[lock_type].parsed_value) + if ((intptr_t)other_element_values[lock_type].parsed_value) { - if ((Boolean)other_element_values[delete_type].parsed_value) + if ((intptr_t)other_element_values[delete_type].parsed_value) { EliminateEntries(record_data, record_count, j, j, &dummy, &count, record_type); @@ -2194,7 +2194,7 @@ CountElements (RecordData * record_data, for (i = 0; i < record_count; i++) { if (ANY_CONTAINER_TYPE == container_type || - (int)(record_data[i].element_values[container_type].parsed_value) == + (intptr_t)(record_data[i].element_values[container_type].parsed_value) == container) { if (strcmp (container_name, @@ -2273,7 +2273,7 @@ AddControlActionList (ControlData * control_data) int j = 0; - if ((int)control_data->element_values[CONTROL_TYPE].parsed_value == + if ((intptr_t)control_data->element_values[CONTROL_TYPE].parsed_value == CONTROL_FILE) { file_name = (char *) @@ -2450,7 +2450,7 @@ ProcessBox (BoxData * box_data) { element_values = control_data[i].element_values; - if ((int) element_values[CONTROL_CONTAINER_TYPE].parsed_value == BOX && + if ((intptr_t) element_values[CONTROL_CONTAINER_TYPE].parsed_value == BOX && strcmp ((char *) box_data->element_values[BOX_NAME].parsed_value, (char *) element_values[CONTROL_CONTAINER_NAME].parsed_value) == 0) { @@ -2619,7 +2619,7 @@ ProcessSubpanel (SubpanelData * subpanel_data) { element_values = control_data[i].element_values; - if ((int) element_values[CONTROL_CONTAINER_TYPE].parsed_value == SUBPANEL && + if ((intptr_t) element_values[CONTROL_CONTAINER_TYPE].parsed_value == SUBPANEL && strcmp ((char *) subpanel_data->element_values[SUBPANEL_NAME].parsed_value, (char *) element_values[CONTROL_CONTAINER_NAME].parsed_value) == 0) { @@ -2664,7 +2664,7 @@ ProcessSwitch (SwitchData * switch_data) { element_values = control_data[i].element_values; - if ((int) element_values[CONTROL_CONTAINER_TYPE].parsed_value == SWITCH && + if ((intptr_t) element_values[CONTROL_CONTAINER_TYPE].parsed_value == SWITCH && strcmp ((char *) switch_data->element_values[SWITCH_NAME].parsed_value, (char *) element_values[CONTROL_CONTAINER_NAME].parsed_value) == 0) { @@ -2784,7 +2784,7 @@ WriteComponentToFile (RecordData * record_data, record_data->element_values[k].use_default == False) { if (record_type == CONTROL && - (int) record_data->element_values[CONTROL_TYPE].parsed_value == CONTROL_FILE && + (intptr_t) record_data->element_values[CONTROL_TYPE].parsed_value == CONTROL_FILE && (k == CONTROL_PUSH_ACTION || k == CONTROL_LABEL || k == CONTROL_DROP_ACTION)) continue; @@ -2880,7 +2880,7 @@ WriteControlComponentFile (ControlData * control_data) WriteComponentToFile ((RecordData *) control_data, CONTROL, control_keywords, (char *) element_values[CONTROL_CONTAINER_NAME].parsed_value, - (int) element_values[CONTROL_CONTAINER_TYPE].parsed_value, + (int) (intptr_t) element_values[CONTROL_CONTAINER_TYPE].parsed_value, False); } @@ -2932,7 +2932,7 @@ RemoveControlComponentFile (ControlData * control_data) RemoveComponentFile ((RecordData *) control_data, CONTROL, control_keywords, (char *) element_values[CONTROL_CONTAINER_NAME].parsed_value, - (int) element_values[CONTROL_CONTAINER_TYPE].parsed_value); + (int) (intptr_t) element_values[CONTROL_CONTAINER_TYPE].parsed_value); } @@ -3193,7 +3193,7 @@ InitializeFileControlFields (ElementValue * element_values, { - if ((int)element_values[CONTROL_TYPE].parsed_value == CONTROL_FILE) + if ((intptr_t)element_values[CONTROL_TYPE].parsed_value == CONTROL_FILE) { Boolean free_data_type = False; char * act_list; @@ -3377,7 +3377,7 @@ UpdateFileType (ControlData * control_data) icon_name = (char *)control_data->element_values[CONTROL_NORMAL_ICON].parsed_value; - if ((int)control_data->element_values[CONTROL_CONTAINER_TYPE].parsed_value == + if ((intptr_t)control_data->element_values[CONTROL_CONTAINER_TYPE].parsed_value == SUBPANEL) { icon_name = GetIconName (icon_name, panel.sub_icon_size); @@ -3431,7 +3431,7 @@ UpdateFileTypeControlFields (void) { control_data = box_data->control_data[j]; - if ((int)control_data->element_values[CONTROL_TYPE].parsed_value == + if ((intptr_t)control_data->element_values[CONTROL_TYPE].parsed_value == CONTROL_FILE) UpdateFileType(control_data); @@ -3443,7 +3443,7 @@ UpdateFileTypeControlFields (void) { control_data = subpanel_data->control_data[k]; - if ((int)control_data->element_values[CONTROL_TYPE].parsed_value + if ((intptr_t)control_data->element_values[CONTROL_TYPE].parsed_value == CONTROL_FILE) UpdateFileType(control_data); } @@ -3457,7 +3457,7 @@ UpdateFileTypeControlFields (void) { control_data = switch_data->control_data[j]; - if ((int)control_data->element_values[CONTROL_TYPE].parsed_value == + if ((intptr_t)control_data->element_values[CONTROL_TYPE].parsed_value == CONTROL_FILE) UpdateFileType(control_data); } diff --git a/cde/programs/dtwm/Print.c b/cde/programs/dtwm/Print.c index c33d451b..40734e60 100644 --- a/cde/programs/dtwm/Print.c +++ b/cde/programs/dtwm/Print.c @@ -161,7 +161,7 @@ PrintFrontPanelContents(void) if (box_data->switch_data != NULL) { switch_data = box_data->switch_data; - switch_position = (int) box_data->switch_data->element_values[SWITCH_POSITION_HINTS].parsed_value; + switch_position = (int) (intptr_t) box_data->switch_data->element_values[SWITCH_POSITION_HINTS].parsed_value; } else switch_data = NULL; @@ -175,7 +175,7 @@ PrintFrontPanelContents(void) control_data = box_data->control_data[j]; if (switch_data != NULL && - switch_position < (int) (control_data->element_values[CONTROL_POSITION_HINTS].parsed_value)) + switch_position < (int) (intptr_t) (control_data->element_values[CONTROL_POSITION_HINTS].parsed_value)) { printf (" SWITCH %s\n", (char *) switch_data->element_values[0].parsed_value); diff --git a/cde/programs/dtwm/UI.c b/cde/programs/dtwm/UI.c index 1d057d0b..3a9c8fa6 100644 --- a/cde/programs/dtwm/UI.c +++ b/cde/programs/dtwm/UI.c @@ -222,7 +222,7 @@ FrontPanelCreate (Widget toplevel) /* Create the handles, menu and iconify */ - if ((Boolean) panel.element_values[PANEL_DISPLAY_HANDLES].parsed_value) + if ((intptr_t) panel.element_values[PANEL_DISPLAY_HANDLES].parsed_value) { XtTranslations handle_translations = HandleInputTranslations(); @@ -241,7 +241,7 @@ FrontPanelCreate (Widget toplevel) XtAddCallback (panel.right_handle, XmNhelpCallback, (XtCallbackProc) GeneralTopicHelpCB, PANEL_HANDLE); - if ((Boolean) panel.element_values[PANEL_DISPLAY_MENU].parsed_value) + if ((intptr_t) panel.element_values[PANEL_DISPLAY_MENU].parsed_value) { panel.menu = PanelControlCreate (panel.form, "menu", menu_normal_image); @@ -297,7 +297,7 @@ FrontPanelCreate (Widget toplevel) XtSetValues (panel.left_handle, al, ac); } - if ((Boolean) panel.element_values[PANEL_DISPLAY_MINIMIZE].parsed_value) + if ((intptr_t) panel.element_values[PANEL_DISPLAY_MINIMIZE].parsed_value) { panel.iconify = PanelControlCreate (panel.form, "minimize", minimize_normal_image); @@ -430,7 +430,7 @@ Initialize (DtPanelShellWidget panel_shell) XFreePixmap (display, busy_pixmap_mask); - panel.resolution = (int) panel.element_values[PANEL_RESOLUTION].parsed_value; + panel.resolution = (int) (intptr_t) panel.element_values[PANEL_RESOLUTION].parsed_value; /* Extract and validate resolution. */ @@ -802,7 +802,7 @@ BoxCreate () XtSetArg (al[ac], XmNbottomOffset, 0); ac++; switch_position = - (int) box_data->switch_data->element_values[SWITCH_POSITION_HINTS].parsed_value; + (intptr_t) box_data->switch_data->element_values[SWITCH_POSITION_HINTS].parsed_value; /* Determine if the defined switch position is actually the */ @@ -812,7 +812,7 @@ BoxCreate () { for (j = 0; j < box_data->control_data_count; j++) { - if (switch_position < (int) ((box_data->control_data[j])->element_values[CONTROL_POSITION_HINTS].parsed_value)) + if (switch_position < (intptr_t) ((box_data->control_data[j])->element_values[CONTROL_POSITION_HINTS].parsed_value)) break; } @@ -1369,7 +1369,7 @@ MainControlCreate (int switch_position) for (j = 0; j < box_data->control_data_count; j++) { if (switch_position < - (int) ((box_data->control_data[j])->element_values[CONTROL_POSITION_HINTS].parsed_value)) + (intptr_t) ((box_data->control_data[j])->element_values[CONTROL_POSITION_HINTS].parsed_value)) { ControlCreate (box_data->left_control_form, &box_data->control_data[0], j); @@ -1439,7 +1439,7 @@ ControlSetVisualData (ControlData * control_data, else { if (control_data != NULL && - (char) control_data->element_values[CONTROL_TYPE].parsed_value == + (intptr_t) control_data->element_values[CONTROL_TYPE].parsed_value == CONTROL_CLOCK) { if (panel.color_use != XmCO_BLACK_WHITE) @@ -1470,7 +1470,7 @@ ControlSetVisualData (ControlData * control_data, XtSetArg (al[*ac], XmNbottomShadowColor, panel.primary_pixel_set->bs);(*ac)++; XtSetArg (al[*ac], XmNselectColor, panel.primary_pixel_set->sc); (*ac)++; - if ((char) control_data->element_values[CONTROL_TYPE].parsed_value == + if ((intptr_t) control_data->element_values[CONTROL_TYPE].parsed_value == CONTROL_DATE) { /* @@ -1564,7 +1564,7 @@ ControlSetIconData (Widget parent, /* If this is not a subpanel control and the keyword is is set so that */ /* labels are not to be displayed, set the string resource to NULL. */ - if (container_type != SUBPANEL && (Boolean) + if (container_type != SUBPANEL && (intptr_t) panel.element_values[PANEL_DISPLAY_CONTROL_LABELS].parsed_value == False) { XtSetArg (al[*ac], XmNstring, NULL); (*ac)++; @@ -1575,7 +1575,7 @@ ControlSetIconData (Widget parent, (char *) control_data->element_values[CONTROL_LABEL].parsed_value; - if ((int) control_data->element_values[CONTROL_TYPE].parsed_value + if ((intptr_t) control_data->element_values[CONTROL_TYPE].parsed_value != CONTROL_BLANK) { if (control_label != NULL) @@ -1655,7 +1655,7 @@ ControlSetBehavior (ControlData * control_data, } if (panel.resolution == HIGH && - (char) control_data->element_values[CONTROL_CONTAINER_TYPE].parsed_value == BOX && + (intptr_t) control_data->element_values[CONTROL_CONTAINER_TYPE].parsed_value == BOX && in_subpanel == False) margin_width = 5; else @@ -1672,7 +1672,7 @@ ControlSetBehavior (ControlData * control_data, /* Switch on the controls control type to set the behaviors */ /* specific to the individual control types. */ - switch ((char) control_data->element_values[CONTROL_TYPE].parsed_value) + switch ((intptr_t) control_data->element_values[CONTROL_TYPE].parsed_value) { case CONTROL_BLANK: { @@ -1704,11 +1704,11 @@ ControlSetBehavior (ControlData * control_data, XtSetArg (al[*ac], XmNmarginWidth, margin_width); (*ac)++; - if ((char) control_data->element_values[CONTROL_MONITOR_TYPE].parsed_value == MONITOR_NONE) + if ((intptr_t) control_data->element_values[CONTROL_MONITOR_TYPE].parsed_value == MONITOR_NONE) { XtSetArg (al[*ac], XmNcontrolType, XmCONTROL_BUTTON); (*ac)++; } - else if ((char) control_data->element_values[CONTROL_MONITOR_TYPE].parsed_value == MONITOR_FILE) + else if ((intptr_t) control_data->element_values[CONTROL_MONITOR_TYPE].parsed_value == MONITOR_FILE) { String file_name; @@ -1718,7 +1718,7 @@ ControlSetBehavior (ControlData * control_data, XtSetArg (al[*ac], XmNfileName, *expanded_file_name); (*ac)++; XtSetArg (al[*ac], XmNcontrolType, XmCONTROL_MONITOR); (*ac)++; } - else if ((char) control_data->element_values[CONTROL_MONITOR_TYPE].parsed_value == MONITOR_MAIL) + else if ((intptr_t) control_data->element_values[CONTROL_MONITOR_TYPE].parsed_value == MONITOR_MAIL) { String file_name; @@ -1869,17 +1869,17 @@ ControlCreateAndRegister (Widget parent, /* Create either a normal control or a clock */ - if ((int) control_data->element_values[CONTROL_TYPE].parsed_value + if ((intptr_t) control_data->element_values[CONTROL_TYPE].parsed_value == CONTROL_CLOCK) icon = DtCreateClock (parent, "icon", al, ac); else icon = _DtCreateControl (parent, "icon", al, ac); - if ((int)control_data->element_values[CONTROL_TYPE].parsed_value + if ((intptr_t)control_data->element_values[CONTROL_TYPE].parsed_value == CONTROL_DATE && (control_data->subpanel_data == NULL || main_copy) && (main_copy || - (int)control_data->element_values[CONTROL_CONTAINER_TYPE].parsed_value + (intptr_t)control_data->element_values[CONTROL_CONTAINER_TYPE].parsed_value == SUBPANEL)) { format = nl_langinfo(D_FMT); @@ -1916,7 +1916,7 @@ ControlCreateAndRegister (Widget parent, if (control_data->element_values[CONTROL_DROP_ACTION].parsed_value != NULL) { - if ((int)control_data->element_values[CONTROL_TYPE].parsed_value == + if ((intptr_t)control_data->element_values[CONTROL_TYPE].parsed_value == CONTROL_FILE) { if (control_data->is_action) @@ -1969,10 +1969,10 @@ ControlCreateAndRegister (Widget parent, if (!main_copy) { - if ((Boolean) control_data->element_values[CONTROL_PUSH_RECALL].parsed_value) + if ((intptr_t) control_data->element_values[CONTROL_PUSH_RECALL].parsed_value) PushRecallRegister (control_data, True); - if ((char) control_data->element_values[CONTROL_TYPE].parsed_value == CONTROL_CLIENT) + if ((intptr_t) control_data->element_values[CONTROL_TYPE].parsed_value == CONTROL_CLIENT) EmbeddedClientRegister (control_data, True); } @@ -2075,7 +2075,7 @@ SwitchCreate (BoxData * box_data) } panel.switch_row_count = - (int) (switch_data->element_values[SWITCH_NUMBER_OF_ROWS].parsed_value); + (int) (intptr_t) (switch_data->element_values[SWITCH_NUMBER_OF_ROWS].parsed_value); switch_data->buttons = (Widget *) XtMalloc (sizeof (Widget *) * switch_count); @@ -2643,7 +2643,7 @@ ArrowCreate (Widget parent, } else { - if ((int) (control_data[i]-> + if ((intptr_t) (control_data[i]-> element_values[CONTROL_MONITOR_TYPE].parsed_value) != MONITOR_NONE) { if (CheckOtherMonitorsOn(control_data[i]->subpanel_data)) @@ -2820,7 +2820,7 @@ SubpanelCreate (ControlData * main_control_data, /* the drop zone as the top child of the form */ control_install = - (Boolean) subpanel_data->element_values[SUBPANEL_CONTROL_INSTALL].parsed_value; + (Boolean) (intptr_t) subpanel_data->element_values[SUBPANEL_CONTROL_INSTALL].parsed_value; if (control_install) { @@ -2897,7 +2897,7 @@ SubpanelCreate (ControlData * main_control_data, /* have monitor files attached to them. If so, the constraints */ /* for the form need to be set appropriately. */ - if ((int) (main_control_data-> + if ((intptr_t) (main_control_data-> element_values[CONTROL_MONITOR_TYPE].parsed_value) != MONITOR_NONE) monitor = True; @@ -2905,7 +2905,7 @@ SubpanelCreate (ControlData * main_control_data, { for (i = 0; i < subpanel_data->control_data_count; i++) { - if ((int) (subpanel_data->control_data[i]-> + if ((intptr_t) (subpanel_data->control_data[i]-> element_values[CONTROL_MONITOR_TYPE].parsed_value) != MONITOR_NONE) { monitor = True; @@ -3085,7 +3085,7 @@ SubpanelControlCreate (SubpanelData * subpanel_data, /* If there is a monitor file, create the indicator */ - if ((int) (control_data-> + if ((intptr_t) (control_data-> element_values[CONTROL_MONITOR_TYPE].parsed_value) != MONITOR_NONE) { ac = ac_save; @@ -3792,7 +3792,7 @@ DeleteSubpanelControl (SubpanelData * subpanel_data, for (j = 0; j < subpanel_data->control_data_count; j++) { - if ((int) subpanel_data->control_data[j]-> + if ((intptr_t) subpanel_data->control_data[j]-> element_values[CONTROL_MONITOR_TYPE].parsed_value != MONITOR_NONE) { control_monitor = True; @@ -3800,7 +3800,7 @@ DeleteSubpanelControl (SubpanelData * subpanel_data, } } - if ((int) main_control_data-> + if ((intptr_t) main_control_data-> element_values[CONTROL_MONITOR_TYPE].parsed_value != MONITOR_NONE) { control_monitor = True; @@ -3901,15 +3901,15 @@ ToggleDefaultControl (ControlData * main_control_data, control_icon = main_control_data->icon; main_control_data->icon = subpanel_data->main_panel_icon_copy; - if ((Boolean) main_control_data->element_values[CONTROL_PUSH_RECALL].parsed_value) + if ((intptr_t) main_control_data->element_values[CONTROL_PUSH_RECALL].parsed_value) PushRecallRegister (main_control_data, True); - if ((char) main_control_data->element_values[CONTROL_TYPE].parsed_value == CONTROL_CLIENT) + if ((intptr_t) main_control_data->element_values[CONTROL_TYPE].parsed_value == CONTROL_CLIENT) EmbeddedClientRegister (main_control_data, True); main_control_data->icon = control_icon; - if ((char) main_control_data-> + if ((intptr_t) main_control_data-> element_values[CONTROL_TYPE].parsed_value == CONTROL_CLIENT) { EmbeddedClientReparent ((char *) main_control_data-> @@ -3919,13 +3919,13 @@ ToggleDefaultControl (ControlData * main_control_data, } else { - if ((Boolean) subpanel_data->default_control->element_values[CONTROL_PUSH_RECALL].parsed_value) + if ((intptr_t) subpanel_data->default_control->element_values[CONTROL_PUSH_RECALL].parsed_value) PushRecallRegister (subpanel_data->default_control, True); - if ((char) subpanel_data->default_control->element_values[CONTROL_TYPE].parsed_value == CONTROL_CLIENT) + if ((intptr_t) subpanel_data->default_control->element_values[CONTROL_TYPE].parsed_value == CONTROL_CLIENT) EmbeddedClientRegister (subpanel_data->default_control, True); - if ((char) subpanel_data->default_control-> + if ((intptr_t) subpanel_data->default_control-> element_values[CONTROL_TYPE].parsed_value == CONTROL_CLIENT) { EmbeddedClientReparent ((char *) subpanel_data->default_control-> @@ -4037,7 +4037,7 @@ ToggleDefaultControl (ControlData * main_control_data, /* If this is a toggle of a client control from the subpanel to */ /* the main panel, call the reparenting function. */ - if ((char) control_data-> + if ((intptr_t) control_data-> element_values[CONTROL_TYPE].parsed_value == CONTROL_CLIENT) { EmbeddedClientReparent ((char *) control_data-> diff --git a/cde/programs/dtwm/WmFP.c b/cde/programs/dtwm/WmFP.c index bd7fe7c5..1410d2f6 100644 --- a/cde/programs/dtwm/WmFP.c +++ b/cde/programs/dtwm/WmFP.c @@ -224,7 +224,7 @@ EmbeddedClientRegister (ControlData * control_data, WmFpEmbeddedClientData * embedded_client = NULL; - if ((char) control_data-> + if ((intptr_t) control_data-> element_values[CONTROL_TYPE].parsed_value != CONTROL_CLIENT) return;