Tk Source Code

Check-in [25ed4c46]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Remove useless (void *) casts introduced in checkin [b7a58eae61]. The warnings were false flags from a faulty OpenBSD C compiler.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | core-8-5-branch
Files: files | file ages | folders
SHA1: 25ed4c4604a5a1ea71f7a8b18cc1a21e5f5b2354
User & Date: stwo 2012-08-09 16:40:41
Context
2012-08-11
07:37
Fixed [Bug 3554273]: Test textDisp-32.2 failed check-in: 2fac4a25 user: fvogel tags: core-8-5-branch
2012-08-10
12:22
merge-mark check-in: f9c3c487 user: jan.nijtmans tags: trunk
2012-08-09
16:40
Remove useless (void *) casts introduced in checkin [b7a58eae61]. The warnings were false flags from a faulty OpenBSD C compiler. check-in: 25ed4c46 user: stwo tags: core-8-5-branch
07:25
partly backport from 8.6 check-in: c2823d74 user: jan.nijtmans tags: core-8-5-branch
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ChangeLog.








1
2
3
4
5
6
7







2012-08-03  Francois Vogel  <[email protected]>

	* tests/bind.test:  [Bug 3554081]: Test bind-22.10 failed

2012-08-02  Francois Vogel  <[email protected]>

	* tests/spinbox.test:  [Bug 3553311]: Test spinbox-3.70 failed
>
>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
2012-08-09  Stuart Cassoff  <[email protected]>

	* generic/tkEvent.c:	Remove useless (void *) casts
	* unix/tkUnixEvent.c:	introduced in checkin [b7a58eae61].
	* unix/tkUnixKey.c:	The warnings were false flags from a
	* unix/tkUnixRFont.c:	faulty OpenBSD C compiler.

2012-08-03  Francois Vogel  <[email protected]>

	* tests/bind.test:  [Bug 3554081]: Test bind-22.10 failed

2012-08-02  Francois Vogel  <[email protected]>

	* tests/spinbox.test:  [Bug 3553311]: Test spinbox-3.70 failed

Changes to generic/tkEvent.c.

339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
    if (dispPtr->inputStyle & XIMPreeditPosition) {
	XPoint spot = {0, 0};

	preedit_attname = XNPreeditAttributes;
	preedit_attlist = XVaCreateNestedList(0,
		XNSpotLocation, &spot,
		XNFontSet, dispPtr->inputXfs,
		(void *) NULL);
    }

    winPtr->inputContext = XCreateIC(dispPtr->inputMethod,
	    XNInputStyle, dispPtr->inputStyle,
	    XNClientWindow, winPtr->window,
	    XNFocusWindow, winPtr->window,
	    preedit_attname, preedit_attlist,
	    (void *) NULL);

    if (preedit_attlist) {
	XFree(preedit_attlist);
    }

    
    if (winPtr->inputContext == NULL) {
	/* XCreateIC failed. */
        return;
    }
    
    /*
     * Adjust the window's event mask if the IM requires it.
     */
    XGetICValues(winPtr->inputContext, XNFilterEvents, &im_event_mask, (void *) NULL);
    if ((winPtr->atts.event_mask & im_event_mask) != im_event_mask) {
	winPtr->atts.event_mask |= im_event_mask;
	XSelectInput(winPtr->display, winPtr->window, winPtr->atts.event_mask);
    }
}
#endif








|







|














|







339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
    if (dispPtr->inputStyle & XIMPreeditPosition) {
	XPoint spot = {0, 0};

	preedit_attname = XNPreeditAttributes;
	preedit_attlist = XVaCreateNestedList(0,
		XNSpotLocation, &spot,
		XNFontSet, dispPtr->inputXfs,
		NULL);
    }

    winPtr->inputContext = XCreateIC(dispPtr->inputMethod,
	    XNInputStyle, dispPtr->inputStyle,
	    XNClientWindow, winPtr->window,
	    XNFocusWindow, winPtr->window,
	    preedit_attname, preedit_attlist,
	    NULL);

    if (preedit_attlist) {
	XFree(preedit_attlist);
    }

    
    if (winPtr->inputContext == NULL) {
	/* XCreateIC failed. */
        return;
    }
    
    /*
     * Adjust the window's event mask if the IM requires it.
     */
    XGetICValues(winPtr->inputContext, XNFilterEvents, &im_event_mask, NULL);
    if ((winPtr->atts.event_mask & im_event_mask) != im_event_mask) {
	winPtr->atts.event_mask |= im_event_mask;
	XSelectInput(winPtr->display, winPtr->window, winPtr->atts.event_mask);
    }
}
#endif


Changes to unix/tkUnixEvent.c.

635
636
637
638
639
640
641
642
643
644
645
646
647
648
649

    dispPtr->inputMethod = XOpenIM(dispPtr->display, NULL, NULL, NULL);
    if (dispPtr->inputMethod == NULL) {
	return;
    }

    if ((XGetIMValues(dispPtr->inputMethod, XNQueryInputStyle, &stylePtr,
	    (void *) NULL) != NULL) || (stylePtr == NULL)) {
	goto error;
    }

    /*
     * Select the best input style supported by both the IM and Tk.
     */
    for (i = 0; i < stylePtr->count_styles; i++) {







|







635
636
637
638
639
640
641
642
643
644
645
646
647
648
649

    dispPtr->inputMethod = XOpenIM(dispPtr->display, NULL, NULL, NULL);
    if (dispPtr->inputMethod == NULL) {
	return;
    }

    if ((XGetIMValues(dispPtr->inputMethod, XNQueryInputStyle, &stylePtr,
	    NULL) != NULL) || (stylePtr == NULL)) {
	goto error;
    }

    /*
     * Select the best input style supported by both the IM and Tk.
     */
    for (i = 0; i < stylePtr->count_styles; i++) {

Changes to unix/tkUnixKey.c.

61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
	&& (winPtr->inputContext != NULL) )
    {
	XVaNestedList preedit_attr;
	XPoint spot;

	spot.x = dispPtr->caret.x;
	spot.y = dispPtr->caret.y + dispPtr->caret.height;
	preedit_attr = XVaCreateNestedList(0, XNSpotLocation, &spot, (void *) NULL);
	XSetICValues(winPtr->inputContext,
		XNPreeditAttributes, preedit_attr,
		(void *) NULL);
	XFree(preedit_attr);
    }
#endif
}

/*
 *----------------------------------------------------------------------







|


|







61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
	&& (winPtr->inputContext != NULL) )
    {
	XVaNestedList preedit_attr;
	XPoint spot;

	spot.x = dispPtr->caret.x;
	spot.y = dispPtr->caret.y + dispPtr->caret.height;
	preedit_attr = XVaCreateNestedList(0, XNSpotLocation, &spot, NULL);
	XSetICValues(winPtr->inputContext,
		XNPreeditAttributes, preedit_attr,
		NULL);
	XFree(preedit_attr);
    }
#endif
}

/*
 *----------------------------------------------------------------------

Changes to unix/tkUnixRFont.c.

97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
	     * but sometimes does anyway.  Usual cause appears to be
	     * a misconfigured fontconfig installation; see [Bug 1090382].
	     * Try a fallback:
	     */
	    ftFont = XftFontOpen(fontPtr->display, fontPtr->screen,
			FC_FAMILY, FcTypeString, "sans",
			FC_SIZE, FcTypeDouble, 12.0,
			(void *) NULL);
	}
	if (!ftFont) {
	    /*
	     * The previous call should definitely not fail.
	     * Impossible to proceed at this point.
	     */
	    Tcl_Panic("Cannot find a usable font.");







|







97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
	     * but sometimes does anyway.  Usual cause appears to be
	     * a misconfigured fontconfig installation; see [Bug 1090382].
	     * Try a fallback:
	     */
	    ftFont = XftFontOpen(fontPtr->display, fontPtr->screen,
			FC_FAMILY, FcTypeString, "sans",
			FC_SIZE, FcTypeDouble, 12.0,
			NULL);
	}
	if (!ftFont) {
	    /*
	     * The previous call should definitely not fail.
	     * Impossible to proceed at this point.
	     */
	    Tcl_Panic("Cannot find a usable font.");