Tk Source Code

Check-in [cd374e7d]
Login

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

Overview
Comment:Remove unused macro's. Somewhat less length checking for "##ID##%p##%p##%u##" tag, since TCL_WIDE_INT_IS_LONG doesn't behave as expected on WIN64.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | revised_text | tip-466
Files: files | file ages | folders
SHA1: cd374e7d05710373ef6bf6b0672f0c286f9a1e91
User & Date: jan.nijtmans 2017-03-21 12:46:33
References
2017-03-22
06:19
Reverting the destructive changes of [ab1bc6a5], [cd374e7d], and [f8055298]. In case of compile problems, please use the bug tracker. check-in: feff1159 user: gcramer tags: revised_text, tip-466
Context
2017-03-21
12:58
Another place where TCL_WIDE_INT_IS_LONG doesn't behave as expected on WIN64 check-in: f8055298 user: jan.nijtmans tags: revised_text, tip-466
12:46
Remove unused macro's. Somewhat less length checking for "##ID##%p##%p##%u##" tag, since TCL_WIDE_INT_IS_LONG doesn't behave as expected on WIN64. check-in: cd374e7d user: jan.nijtmans tags: revised_text, tip-466
11:58
Fix gcc compiler warning: tkTextMark.c: In function ‘TkTextMarkCmd’: tkTextMark.c:653:6: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] (uint32_t) textPtr, (uint32_t) textPtr->sharedTextPtr, ++textPtr->uniqueIdCounter); ^ check-in: ab1bc6a5 user: jan.nijtmans tags: revised_text, tip-466
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/tkTextMark.c.

14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35

#include "tkInt.h"
#include "tkText.h"
#include "tkAlloc.h"
#include "tk3d.h"
#include <assert.h>

#if HAVE_INTTYPES_H
# include <inttypes.h>
#elif !defined(PRIx32)
/* work-around for ancient MSVC versions */
# define PRIx64 "llx"
# define PRIx32 "lx"
#endif

#ifndef MAX
# define MAX(a,b) ((a) < (b) ? b : a)
#endif
#ifndef MIN
# define MIN(a,b) ((a) < (b) ? a : b)
#endif








<
<
<
<
<
<
<
<







14
15
16
17
18
19
20








21
22
23
24
25
26
27

#include "tkInt.h"
#include "tkText.h"
#include "tkAlloc.h"
#include "tk3d.h"
#include <assert.h>









#ifndef MAX
# define MAX(a,b) ((a) < (b) ? b : a)
#endif
#ifndef MIN
# define MIN(a,b) ((a) < (b) ? a : b)
#endif

1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
    if (!widgetSpecific) {
	int dummy;
	hPtr = Tcl_CreateHashEntry(&sharedTextPtr->markTable, name, &dummy);
	markPtr = Tcl_GetHashValue(hPtr);
    }

    if (!markPtr) {
	if (name[0] == '#' && name[1] == '#' && name[2] == 'I') {
#ifdef TCL_WIDE_INT_IS_LONG
	    static const size_t length = 32 + 2*sizeof(uint64_t);
#else /* ifndef TCL_WIDE_INT_IS_LONG */
	    static const size_t length = 32 + 2*sizeof(uint32_t);
#endif /* TCL_WIDE_INT_IS_LONG */

	    void *sPtr, *tPtr;
	    unsigned num;

	    if (strlen(name) == length && sscanf(name, "##ID##%p##%p##%u##", &sPtr, &tPtr, &num) == 3) {
		assert(hPtr);
		Tcl_DeleteHashEntry(hPtr);
		return NULL; /* this is an expired generated mark */
	    }
	}

	markPtr = MakeMark(textPtr);







|
<
<
<
<
<
<



|







1618
1619
1620
1621
1622
1623
1624
1625






1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
    if (!widgetSpecific) {
	int dummy;
	hPtr = Tcl_CreateHashEntry(&sharedTextPtr->markTable, name, &dummy);
	markPtr = Tcl_GetHashValue(hPtr);
    }

    if (!markPtr) {
	if (name[0] == '#' && name[1] == '#' && name[2] == 'I' && name[3] == 'D' && name[4] == '#' && name[5] == '#') {






	    void *sPtr, *tPtr;
	    unsigned num;

	    if ((strlen(name)>=24) && sscanf(name+6, "%p##%p##%u##", &sPtr, &tPtr, &num) == 3) {
		assert(hPtr);
		Tcl_DeleteHashEntry(hPtr);
		return NULL; /* this is an expired generated mark */
	    }
	}

	markPtr = MakeMark(textPtr);