Ticket #21330: patch-uintptr_t-cast.diff
File patch-uintptr_t-cast.diff, 17.1 KB (added by howarth@…, 15 years ago) |
---|
-
lib/Xm/DragBS.c
old new 217 217 static unsigned long firstProtectRequest; 218 218 static Window errorWindow; 219 219 220 static XContext displayToMotifWindowContext = (XContext) NULL;221 static XContext displayToTargetsContext = (XContext) NULL;222 static XContext displayToAtomsContext = (XContext) NULL;220 static XContext displayToMotifWindowContext = (XContext)(uintptr_t) NULL; 221 static XContext displayToTargetsContext = (XContext)(uintptr_t) NULL; 222 static XContext displayToAtomsContext = (XContext)(uintptr_t) NULL; 223 223 224 224 225 225 /***************************************************************************** … … 304 304 XContext loc_context; 305 305 306 306 _XmProcessLock(); 307 if (displayToMotifWindowContext == (XContext) NULL) {307 if (displayToMotifWindowContext == (XContext)(uintptr_t) NULL) { 308 308 displayToMotifWindowContext = XUniqueContext(); 309 309 } 310 310 loc_context = displayToMotifWindowContext; … … 335 335 XContext loc_context; 336 336 337 337 _XmProcessLock(); 338 if (displayToMotifWindowContext == (XContext) NULL) {338 if (displayToMotifWindowContext == (XContext)(uintptr_t) NULL) { 339 339 displayToMotifWindowContext = XUniqueContext(); 340 340 } 341 341 loc_context = displayToMotifWindowContext; … … 378 378 XContext loc_context; 379 379 380 380 _XmProcessLock(); 381 if (displayToTargetsContext == (XContext) NULL) {381 if (displayToTargetsContext == (XContext)(uintptr_t) NULL) { 382 382 displayToTargetsContext = XUniqueContext(); 383 383 } 384 384 loc_context = displayToTargetsContext; … … 409 409 XContext loc_context; 410 410 411 411 _XmProcessLock(); 412 if (displayToTargetsContext == (XContext) NULL) {412 if (displayToTargetsContext == (XContext)(uintptr_t) NULL) { 413 413 displayToTargetsContext = XUniqueContext(); 414 414 } 415 415 loc_context = displayToTargetsContext; … … 464 464 XContext loc_context; 465 465 466 466 _XmProcessLock(); 467 if (displayToAtomsContext == (XContext) NULL) {467 if (displayToAtomsContext == (XContext)(uintptr_t) NULL) { 468 468 displayToAtomsContext = XUniqueContext(); 469 469 } 470 470 loc_context = displayToAtomsContext; … … 495 495 XContext loc_context; 496 496 497 497 _XmProcessLock(); 498 if (displayToAtomsContext == (XContext) NULL) {498 if (displayToAtomsContext == (XContext)(uintptr_t) NULL) { 499 499 displayToAtomsContext = XUniqueContext(); 500 500 } 501 501 loc_context = displayToAtomsContext; -
lib/Xm/DragIcon.c
old new 760 760 #undef Offset 761 761 #define Offset(x) (XtOffsetOf( struct _XmDragIconRec, drag.x)) 762 762 763 static XContext _XmTextualDragIconContext = (XContext) NULL;763 static XContext _XmTextualDragIconContext = (XContext)(uintptr_t) NULL; 764 764 765 765 static XtResource resources[]= 766 766 { … … 1240 1240 use_alt = dpy -> display.enable_drag_icon; 1241 1241 1242 1242 _XmProcessLock(); 1243 if (_XmTextualDragIconContext == (XContext) NULL)1243 if (_XmTextualDragIconContext == (XContext)(uintptr_t) NULL) 1244 1244 _XmTextualDragIconContext = XUniqueContext(); 1245 1245 loc_context = _XmTextualDragIconContext; 1246 1246 _XmProcessUnlock(); -
lib/Xm/Text.c
old new 654 654 static void 655 655 _XmCreateCutBuffers(Widget w) 656 656 { 657 static XContext context = (XContext) NULL;657 static XContext context = (XContext)(uintptr_t)NULL; 658 658 char * tmp = NULL; 659 659 Display *dpy = XtDisplay(w); 660 660 Screen *screen = XtScreen(w); 661 661 XContext local_context; 662 662 663 663 _XmProcessLock(); 664 if (context == (XContext) NULL) context = XUniqueContext();664 if (context == (XContext)(uintptr_t)NULL) context = XUniqueContext(); 665 665 666 666 local_context = context; 667 667 _XmProcessUnlock(); … … 3023 3023 if (!tw->text.editable && editable) { 3024 3024 OutputData o_data = tw->text.output->data; 3025 3025 3026 XmImRegister(widget, (unsigned int) NULL);3026 XmImRegister(widget, (unsigned int)(uintptr_t) NULL); 3027 3027 3028 3028 (*tw->text.output->PosToXY)(tw, tw->text.cursor_position, 3029 3029 &xmim_point.x, &xmim_point.y); -
lib/Xm/TextF.c
old new 7306 7306 XmTextFieldSetEditable((Widget)tf, TextF_Editable(tf)); 7307 7307 7308 7308 if (TextF_Editable(tf)) { 7309 XmImRegister((Widget)tf, (unsigned int) NULL);7309 XmImRegister((Widget)tf, (unsigned int)(uintptr_t) NULL); 7310 7310 GetXYFromPos(tf, TextF_CursorPosition(tf), &xmim_point.x, &xmim_point.y); 7311 7311 (void)TextFieldGetDisplayRect((Widget)tf, &xmim_area); 7312 7312 n = 0; … … 8178 8178 diff_values = True; 8179 8179 if (TextF_WcValue(new_tf) == NULL) { 8180 8180 TextF_WcValue(new_tf) = (wchar_t*) XtMalloc(sizeof(wchar_t)); 8181 *TextF_WcValue(new_tf) = (wchar_t) NULL;8181 *TextF_WcValue(new_tf) = (wchar_t)(uintptr_t)NULL; 8182 8182 } 8183 8183 ValidateString(new_tf, (char*)TextF_WcValue(new_tf), True); 8184 8184 } else if (TextF_Value(new_tf) != TextF_Value(old_tf)) { … … 10091 10091 * give the IM the relevent values. */ 10092 10092 10093 10093 if (!TextF_Editable(tf) && editable) { 10094 XmImRegister((Widget)tf, (unsigned int) NULL);10094 XmImRegister((Widget)tf, (unsigned int)(uintptr_t) NULL); 10095 10095 10096 10096 GetXYFromPos(tf, TextF_CursorPosition(tf), &xmim_point.x, 10097 10097 &xmim_point.y); -
lib/Xm/Protocols.c
old new 136 136 * 137 137 ***************************************************************************/ 138 138 139 static XContext allProtocolsMgrContext = (XContext) NULL;139 static XContext allProtocolsMgrContext = (XContext)(uintptr_t) NULL; 140 140 141 141 142 142 #define Offset(field) XtOffsetOf( struct _XmProtocolRec, protocol.field) … … 374 374 display = XtDisplay(shell); 375 375 376 376 _XmProcessLock(); 377 if (allProtocolsMgrContext == (XContext) NULL)377 if (allProtocolsMgrContext == (XContext)(uintptr_t) NULL) 378 378 allProtocolsMgrContext = XUniqueContext(); 379 379 _XmProcessUnlock(); 380 380 -
lib/Xm/VendorS.c
old new 1576 1576 ttp->post_delay = 5000; 1577 1577 ttp->post_duration = 5000; 1578 1578 ttp->enable = False; 1579 ttp->timer = (int) NULL;1580 ttp->duration_timer = (int) NULL;1579 ttp->timer = (int)(uintptr_t) NULL; 1580 ttp->duration_timer = (int)(uintptr_t) NULL; 1581 1581 ttp->leave_time = 0; 1582 1582 ttp->slider = ttp->label = NULL; 1583 1583 -
lib/Xm/Synthetic.c
old new 197 197 198 198 for (i = 0; i < num_resources; i++) 199 199 resources[i].resource_name = 200 (String) XrmPermStringToQuark (resources[i].resource_name);200 (String)(uintptr_t) XrmPermStringToQuark (resources[i].resource_name); 201 201 } 202 202 203 203 -
lib/Xm/Obso2_0.c
/********************************************************************** @@ -241,7 +241,7 @@ for (j = 0; j < num_resources; j++) { if ((resources[j].export_proc) && - (XrmQuark)(resources[j].resource_name) == quark) + (XrmQuark)(uintptr_t)(resources[j].resource_name) == quark) { value_size = resources[j].resource_size; @@ -512,7 +512,7 @@ for (j = 0; j < num_resources; j++) { if ((resources[j].import_proc) && - (XrmQuark)(resources[j].resource_name) == quark) + (XrmQuark)(uintptr_t)(resources[j].resource_name) == quark) { value = args[i].value;
old new 1584 1584 Stuff from Desktop.c 1585 1585 **********************/ 1586 1586 1587 static XContext actualClassContext = (XContext) NULL;1587 static XContext actualClassContext = (XContext)(uintptr_t) NULL; 1588 1588 1589 1589 1590 1590 /*ARGSUSED*/ … … 1611 1611 { 1612 1612 WidgetClass actualClass; 1613 1613 1614 if (actualClassContext == (XContext) NULL)1614 if (actualClassContext == (XContext)(uintptr_t) NULL) 1615 1615 actualClassContext = XUniqueContext(); 1616 1616 1617 1617 /* … … 1645 1645 WidgetClass previous; 1646 1646 WidgetClass oldActualClass; 1647 1647 1648 if (actualClassContext == (XContext) NULL)1648 if (actualClassContext == (XContext)(uintptr_t) NULL) 1649 1649 actualClassContext = XUniqueContext(); 1650 1650 1651 1651 /* … … 1692 1692 Cardinal *num_args ) 1693 1693 { 1694 1694 XmDesktopObject worldObject; 1695 static XContext worldObjectContext = (XContext) NULL;1695 static XContext worldObjectContext = (XContext)(uintptr_t) NULL; 1696 1696 XmWidgetExtData ext; 1697 1697 Display *display; 1698 1698 … … 1701 1701 ** the display is closed, so that we don't get bad data if a second 1702 1702 ** display with the same id is opened. 1703 1703 */ 1704 if (worldObjectContext == (XContext) NULL)1704 if (worldObjectContext == (XContext)(uintptr_t) NULL) 1705 1705 worldObjectContext = XUniqueContext(); 1706 1706 1707 1707 display = XtDisplayOfObject(shell); -
lib/Xm/Xpmparse.c
old new 387 387 */ 388 388 if (USE_HASHTABLE) { 389 389 ErrorStatus = 390 xpmHashIntern(hashtable, color->string, HashAtomData( a));390 xpmHashIntern(hashtable, color->string, HashAtomData((uintptr_t)a)); 391 391 if (ErrorStatus != XpmSuccess) { 392 392 xpmFreeColorTable(colorTable, ncolors); 393 393 return (ErrorStatus); … … 475 475 */ 476 476 if (USE_HASHTABLE) { 477 477 ErrorStatus = 478 xpmHashIntern(hashtable, color->string, HashAtomData( a));478 xpmHashIntern(hashtable, color->string, HashAtomData((uintptr_t)a)); 479 479 if (ErrorStatus != XpmSuccess) { 480 480 xpmFreeColorTable(colorTable, ncolors); 481 481 return (ErrorStatus); -
lib/Xm/SlideC.c
old new 94 94 /* notify that initialize called XtArgsProc */ NULL, 95 95 /* NULL XtProc */ NULL, 96 96 /* NULL XtPointer */ NULL, 97 /* NULL Cardinal */ (Cardinal) NULL,97 /* NULL Cardinal */ (Cardinal)(uintptr_t)NULL, 98 98 /* resources for subclass fields XtResourceList */ resources, 99 99 /* number of entries in resources Cardinal */ XtNumber(resources), 100 100 /* resource class quarkified XrmClass */ NULLQUARK, 101 /* NULL Boolean */ (Boolean) NULL,102 /* NULL XtEnum */ (XtEnum) NULL,103 /* NULL Boolean */ (Boolean) NULL,104 /* NULL Boolean */ (Boolean) NULL,101 /* NULL Boolean */ (Boolean)(uintptr_t)NULL, 102 /* NULL XtEnum */ (XtEnum)(uintptr_t)NULL, 103 /* NULL Boolean */ (Boolean)(uintptr_t)NULL, 104 /* NULL Boolean */ (Boolean)(uintptr_t)NULL, 105 105 /* free data for subclass pointers XtWidgetProc */ destroy, 106 106 /* NULL XtProc */ NULL, 107 107 /* NULL XtProc */ NULL, -
lib/Xm/DataF.c
old new 9121 9121 /* CR03685 */ 9122 9122 SGI_hack_XmImRegister((Widget)tf); 9123 9123 #else 9124 XmImRegister((Widget)tf, (unsigned int) NULL);9124 XmImRegister((Widget)tf, (unsigned int)(uintptr_t) NULL); 9125 9125 #endif 9126 9126 df_GetXYFromPos(tf, XmTextF_cursor_position(tf), &xmim_point.x, &xmim_point.y); 9127 9127 n = 0; … … 10631 10631 diff_values = True; 10632 10632 if (XmTextF_wc_value(new_tf) == NULL) { 10633 10633 XmTextF_wc_value(new_tf) = (wchar_t*) XtMalloc(sizeof(wchar_t)); 10634 *XmTextF_wc_value(new_tf) = (wchar_t) NULL;10634 *XmTextF_wc_value(new_tf) = (wchar_t)(uintptr_t)NULL; 10635 10635 } 10636 10636 df_ValidateString(new_tf, (char*)XmTextF_wc_value(new_tf), True); 10637 10637 } else if (XmTextF_value(new_tf) != XmTextF_value(old_tf)) { … … 11777 11777 /* CR03685 */ 11778 11778 SGI_hack_XmImRegister((Widget)tf); 11779 11779 #else 11780 XmImRegister((Widget)tf, (unsigned int) NULL);11780 XmImRegister((Widget)tf, (unsigned int)(uintptr_t) NULL); 11781 11781 #endif 11782 11782 df_GetXYFromPos(tf, XmTextF_cursor_position(tf), &xmim_point.x, 11783 11783 &xmim_point.y); -
lib/Xm/FontS.c
old new 2748 2748 XmStringFree(label); 2749 2749 2750 2750 XtAddCallback(button, 2751 XmNactivateCallback, ChangeEncoding, (XtPointer) i);2751 XmNactivateCallback, ChangeEncoding, (XtPointer)(uintptr_t) i); 2752 2752 2753 2753 if (streq(*encodings, ENCODING_STRING(fsw))) 2754 2754 { … … 2910 2910 fsw = (XmFontSelectorWidget) w; 2911 2911 cf = XmFontS_font_info(fsw)->current_font; 2912 2912 2913 if ((int) data == 0)2913 if ((int)(uintptr_t) data == 0) 2914 2914 { 2915 2915 XtFree(ENCODING_STRING(fsw)); 2916 2916 ENCODING_STRING(fsw) = XtNewString(ANY_ENCODING); … … 2918 2918 else 2919 2919 { 2920 2920 XtFree(ENCODING_STRING(fsw)); 2921 ENCODING_STRING(fsw) = XtNewString(ENCODING_LIST(fsw)[(int) data - 1]);2921 ENCODING_STRING(fsw) = XtNewString(ENCODING_LIST(fsw)[(int)(uintptr_t) data - 1]); 2922 2922 } 2923 2923 2924 2924 UpdateFamilies(fsw); … … 3676 3676 num_largs = 0; 3677 3677 XtSetArg(largs[num_largs], XmNmenuHistory, button); num_largs++; 3678 3678 XtSetValues(XmFontS_option_menu(set_fsw), largs, num_largs); 3679 ChangeEncoding((Widget) set_fsw, (XtPointer) current, NULL);3679 ChangeEncoding((Widget) set_fsw, (XtPointer)(uintptr_t) current, NULL); 3680 3680 } 3681 3681 else 3682 3682 { -
clients/mwm/WmResParse.c
old new 188 188 {"mod3", Mod3Mask}, 189 189 {"mod4", Mod4Mask}, 190 190 {"mod5", Mod5Mask}, 191 {NULL, (unsigned int) NULL},191 {NULL, (unsigned int)(uintptr_t)NULL}, 192 192 }; 193 193 194 194 #define ALT_INDEX 3 … … 351 351 {"btn5up", ButtonRelease, ParseImmed, Button5, FALSE}, 352 352 {"btn5click", ButtonRelease, ParseImmed, Button5, TRUE}, 353 353 {"btn5click2", ButtonPress, ParseImmed, Button5, TRUE}, 354 { NULL, (unsigned int) NULL, (Boolean(*)())NULL, (unsigned int)NULL, (Boolean)NULL}354 { NULL, (unsigned int)(uintptr_t)NULL, (Boolean(*)())NULL, (unsigned int)(uintptr_t)NULL, (Boolean)(uintptr_t)NULL} 355 355 }; 356 356 357 357 358 358 static EventTableEntry keyEvents[] = { 359 359 360 360 {"key", KeyPress, ParseKeySym, 0, FALSE}, 361 { NULL, (unsigned int) NULL, (Boolean(*)())NULL, (unsigned int)NULL, (Boolean)NULL}361 { NULL, (unsigned int)(uintptr_t)NULL, (Boolean(*)())NULL, (unsigned int)(uintptr_t)NULL, (Boolean)(uintptr_t)NULL} 362 362 }; 363 363 364 364 #ifdef PANELIST -
lib/Xm/IconG.c
old new 279 279 280 280 /* those are created in ClassInitialize and filled by the 281 281 IconConverter. */ 282 static XContext largeIconContext = (XContext) NULL;283 static XContext smallIconContext = (XContext) NULL;282 static XContext largeIconContext = (XContext)(uintptr_t) NULL; 283 static XContext smallIconContext = (XContext)(uintptr_t) NULL; 284 284 285 285 static XPointer dummy; 286 286 #define OwnLargeMask(widget) \ -
clients/mwm/WmMenu.c
old new 861 861 static MenuItem *MakeClientCommandMenuItem (String label, String funcArgs) 862 862 { 863 863 return(MakeMenuItem(label, F_InvokeCommand, funcArgs, 864 (KeySym) NULL, (unsigned int)0,865 (KeyCode) NULL, (String)NULL));864 (KeySym)(uintptr_t) NULL, (unsigned int)0, 865 (KeyCode)(uintptr_t) NULL, (String)(uintptr_t)NULL)); 866 866 } 867 867 868 868 -
lib/Xm/XpmI.h
@@ -2216,7 +2216,7 @@ if (newMenuSpec == (MenuSpec *) NULL) { newMenuSpec = MakeMenuSpec(funcarg_buf, - tree == NULL ? (CARD32)NULL + tree == NULL ? (CARD32)(uintptr_t)NULL : tree->commandID); if (duplicate_globals) newMenuSpec->clientLocal = TRUE; else newMenuSpec->clientLocal = FALSE;
old new 291 291 FUNC(xpmHashIntern, int, (xpmHashTable *table, char *tag, void *data)); 292 292 293 293 #define HashAtomData(i) ((void *)i) 294 #define HashColorIndex(slot) ((unsigned int)( (*slot)->data))294 #define HashColorIndex(slot) ((unsigned int)(uintptr_t)((*slot)->data)) 295 295 #define USE_HASHTABLE (cpp > 2 && ncolors > 4) 296 296 297 297 /* I/O utility */ -
lib/Xm/BaseClass.c
old new 577 577 static ExtToContextRec extToContextMap[16]; 578 578 Cardinal i; 579 579 ExtToContext curr; 580 XContext context = (XContext) NULL;580 XContext context = (XContext)(uintptr_t) NULL; 581 581 582 582 _XmProcessLock(); 583 583 for (i = 0, curr = &extToContextMap[0]; -
lib/Xm/XmIm.c
old new 2499 2499 (void) add_ref(&xic_info->widget_refs, widget); 2500 2500 2501 2501 /* Set the current XIC for this widget. */ 2502 if (xim_info->current_xics == (XContext) NULL)2502 if (xim_info->current_xics == (XContext)(uintptr_t) NULL) 2503 2503 xim_info->current_xics = XUniqueContext(); 2504 2504 (void) XSaveContext(XtDisplay(widget), (XID) widget, 2505 2505 xim_info->current_xics, (XPointer) xic_info);