summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2016-12-23 10:07:38 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2016-12-23 10:07:38 (GMT)
commit9c4eb9d12191daaee0a919967abc8f21b3f4fd99 (patch)
treedbbf5d9b49dba582d4ea6bd1f8c5c3d857a60a49
parent9394984c31c5ff3087bbdc784811b2d57fda1114 (diff)
downloadtcl-9c4eb9d12191daaee0a919967abc8f21b3f4fd99.zip
tcl-9c4eb9d12191daaee0a919967abc8f21b3f4fd99.tar.gz
tcl-9c4eb9d12191daaee0a919967abc8f21b3f4fd99.tar.bz2
Deprecate otherValuePtr and ptrAndLongRep. Some more minor tweaks.
-rw-r--r--doc/Object.39
-rw-r--r--generic/tcl.decls2
-rw-r--r--generic/tcl.h9
-rw-r--r--generic/tclDTrace.d9
-rw-r--r--generic/tclObj.c6
-rw-r--r--generic/tclTestObj.c4
-rw-r--r--generic/tclThread.c2
-rw-r--r--win/tclWinFile.c1
8 files changed, 10 insertions, 32 deletions
diff --git a/doc/Object.3 b/doc/Object.3
index bf80fe2..027fea5 100644
--- a/doc/Object.3
+++ b/doc/Object.3
@@ -111,23 +111,18 @@ which is defined as follows.
.PP
.CS
typedef struct Tcl_Obj {
- int \fIrefCount\fR;
+ size_t \fIrefCount\fR;
char *\fIbytes\fR;
- int \fIlength\fR;
+ size_t \fIlength\fR;
const Tcl_ObjType *\fItypePtr\fR;
union {
long \fIlongValue\fR;
double \fIdoubleValue\fR;
- void *\fIotherValuePtr\fR;
Tcl_WideInt \fIwideValue\fR;
struct {
void *\fIptr1\fR;
void *\fIptr2\fR;
} \fItwoPtrValue\fR;
- struct {
- void *\fIptr\fR;
- unsigned long \fIvalue\fR;
- } \fIptrAndLongRep\fR;
} \fIinternalRep\fR;
} \fBTcl_Obj\fR;
.CE
diff --git a/generic/tcl.decls b/generic/tcl.decls
index 3901d77..db57902 100644
--- a/generic/tcl.decls
+++ b/generic/tcl.decls
@@ -289,7 +289,7 @@ declare 75 {
declare 76 {
void Tcl_BackgroundError(Tcl_Interp *interp)
}
-# Removed in 9.0. Don't re-use it in any 9.x release, see TIP ???.
+# Removed in 9.0.
#declare 77 {
# char Tcl_Backslash(const char *src, int *readPtr)
#}
diff --git a/generic/tcl.h b/generic/tcl.h
index 8dbd320..e1d5ed9 100644
--- a/generic/tcl.h
+++ b/generic/tcl.h
@@ -610,7 +610,7 @@ typedef struct Tcl_ObjType {
*/
typedef struct Tcl_Obj {
- size_t refCount; /* When 0 the object will be freed. */
+ size_t refCount; /* When 0 the object will be freed. */
char *bytes; /* This points to the first byte of the
* object's string representation. The array
* must be followed by a null byte (i.e., at
@@ -631,8 +631,6 @@ typedef struct Tcl_Obj {
union { /* The internal representation: */
long longValue; /* - an long integer value. */
double doubleValue; /* - a double-precision floating value. */
- void *otherValuePtr; /* - another, type-specific value, not used
- * internally any more. */
Tcl_WideInt wideValue; /* - a long long value. */
struct { /* - internal rep as two pointers.
* Many uses in Tcl, including a bignum's
@@ -643,11 +641,6 @@ typedef struct Tcl_Obj {
void *ptr1;
void *ptr2;
} twoPtrValue;
- struct { /* - internal rep as a pointer and a long,
- * not used internally any more. */
- void *ptr;
- unsigned long value;
- } ptrAndLongRep;
} internalRep;
} Tcl_Obj;
diff --git a/generic/tclDTrace.d b/generic/tclDTrace.d
index 360bdff..1ad9ae5 100644
--- a/generic/tclDTrace.d
+++ b/generic/tclDTrace.d
@@ -182,23 +182,18 @@ typedef struct Tcl_ObjType {
} Tcl_ObjType;
struct Tcl_Obj {
- int refCount;
+ size_t refCount;
char *bytes;
- int length;
+ size_t length;
Tcl_ObjType *typePtr;
union {
long longValue;
double doubleValue;
- void *otherValuePtr;
int64_t wideValue;
struct {
void *ptr1;
void *ptr2;
} twoPtrValue;
- struct {
- void *ptr;
- unsigned long value;
- } ptrAndLongRep;
} internalRep;
};
diff --git a/generic/tclObj.c b/generic/tclObj.c
index f004c3a..a6f8da3 100644
--- a/generic/tclObj.c
+++ b/generic/tclObj.c
@@ -309,11 +309,7 @@ const Tcl_HashKeyType tclObjHashKeyType = {
* argument in a Tcl command.
*
* NOTE: the ResolvedCmdName that gets cached is stored in the
- * twoPtrValue.ptr1 field, and the twoPtrValue.ptr2 field is unused. You might
- * think you could use the simpler otherValuePtr field to store the single
- * ResolvedCmdName pointer, but DO NOT DO THIS. It seems that some extensions
- * use the second internal pointer field of the twoPtrValue field for their
- * own purposes.
+ * twoPtrValue.ptr1 field, and the twoPtrValue.ptr2 field is unused.
*
* TRICKY POINT! Some extensions update this structure! (Notably, these
* include TclBlend and TCom). This is highly ill-advised on their part, but
diff --git a/generic/tclTestObj.c b/generic/tclTestObj.c
index 6c4a1ed..d11c65f 100644
--- a/generic/tclTestObj.c
+++ b/generic/tclTestObj.c
@@ -1266,8 +1266,8 @@ TeststringobjCmd(
if (objc != 3) {
goto wrongNumArgs;
}
- Tcl_SetLongObj(Tcl_GetObjResult(interp), (varPtr[varIndex] != NULL)
- ? varPtr[varIndex]->length : (size_t)-1);
+ Tcl_SetWideIntObj(Tcl_GetObjResult(interp), (varPtr[varIndex] != NULL)
+ ? (Tcl_WideInt)varPtr[varIndex]->length : (Tcl_WideInt)-1);
break;
case 5: /* length2 */
if (objc != 3) {
diff --git a/generic/tclThread.c b/generic/tclThread.c
index eaba259..a7e386c 100644
--- a/generic/tclThread.c
+++ b/generic/tclThread.c
@@ -76,7 +76,7 @@ static void RememberSyncObject(void *objPtr,
void *
Tcl_GetThreadData(
Tcl_ThreadDataKey *keyPtr, /* Identifier for the data chunk */
- size_t size) /* Size of storage block */
+ size_t size) /* Size of storage block */
{
void *result;
#ifdef TCL_THREADS
diff --git a/win/tclWinFile.c b/win/tclWinFile.c
index e2b6d1e..e61d619 100644
--- a/win/tclWinFile.c
+++ b/win/tclWinFile.c
@@ -2799,7 +2799,6 @@ TclWinVolumeRelativeNormalize(
size_t cwdLen = useThisCwd->length;
char drive_cur = path[0];
- cwdLen = useThisCwd->length;
if (drive_cur >= 'a') {
drive_cur -= ('a' - 'A');
}