summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2022-12-18 18:08:38 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2022-12-18 18:08:38 (GMT)
commit002511bea498081ece2abcbbc0b065a48f0cf8af (patch)
tree75ab624f97b0fa40cc09b1ebcaf1decb1346f7c8
parent8b3ccee931def9d9b51a2d7e6e0c5160f8cfa042 (diff)
downloadtcl-002511bea498081ece2abcbbc0b065a48f0cf8af.zip
tcl-002511bea498081ece2abcbbc0b065a48f0cf8af.tar.gz
tcl-002511bea498081ece2abcbbc0b065a48f0cf8af.tar.bz2
MODULE_SCOPE TclLengthOne (in stead of 2 separate static functions doing the same)
-rw-r--r--generic/tclInt.h2
-rw-r--r--generic/tclObj.c10
-rw-r--r--generic/tclUtil.c13
3 files changed, 15 insertions, 10 deletions
diff --git a/generic/tclInt.h b/generic/tclInt.h
index 392ccab..827fd6f 100644
--- a/generic/tclInt.h
+++ b/generic/tclInt.h
@@ -1103,6 +1103,8 @@ typedef struct { /* For internal core use only */
&& ((objPtr)->typePtr->version > offsetof(TclObjTypeWithAbstractList, abstractList.proc))) ? \
((const TclObjTypeWithAbstractList *)(objPtr)->typePtr)->abstractList.proc : NULL)
+MODULE_SCOPE size_t TclLengthOne(Tcl_Obj *);
+
/*
* The structure below defines an entry in the assocData hash table which is
* associated with an interpreter. The entry contains a pointer to a function
diff --git a/generic/tclObj.c b/generic/tclObj.c
index 67b7487..eaa6766 100644
--- a/generic/tclObj.c
+++ b/generic/tclObj.c
@@ -225,8 +225,6 @@ static int SetCmdNameFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr);
* implementations.
*/
-static size_t LengthOne(TCL_UNUSED(Tcl_Obj *)) {return 1;}
-
const TclObjTypeWithAbstractList tclBooleanType= {
{"boolean", /* name */
NULL, /* freeIntRepProc */
@@ -234,7 +232,7 @@ const TclObjTypeWithAbstractList tclBooleanType= {
NULL, /* updateStringProc */
TclSetBooleanFromAny, /* setFromAnyProc */
TCL_OBJTYPE_V0_1(
- LengthOne
+ TclLengthOne
)}
};
const TclObjTypeWithAbstractList tclDoubleType= {
@@ -244,7 +242,7 @@ const TclObjTypeWithAbstractList tclDoubleType= {
UpdateStringOfDouble, /* updateStringProc */
SetDoubleFromAny, /* setFromAnyProc */
TCL_OBJTYPE_V0_1(
- LengthOne
+ TclLengthOne
)}
};
const TclObjTypeWithAbstractList tclIntType = {
@@ -254,7 +252,7 @@ const TclObjTypeWithAbstractList tclIntType = {
UpdateStringOfInt, /* updateStringProc */
SetIntFromAny, /* setFromAnyProc */
TCL_OBJTYPE_V0_1(
- LengthOne
+ TclLengthOne
)}
};
const TclObjTypeWithAbstractList tclBignumType = {
@@ -264,7 +262,7 @@ const TclObjTypeWithAbstractList tclBignumType = {
UpdateStringOfBignum, /* updateStringProc */
NULL, /* setFromAnyProc */
TCL_OBJTYPE_V0_1(
- LengthOne
+ TclLengthOne
)}
};
diff --git a/generic/tclUtil.c b/generic/tclUtil.c
index a53ca28..e96a564 100644
--- a/generic/tclUtil.c
+++ b/generic/tclUtil.c
@@ -122,8 +122,6 @@ static int FindElement(Tcl_Interp *interp, const char *string,
* is unregistered, so has no need of a setFromAnyProc either.
*/
-static size_t LengthOne(TCL_UNUSED(Tcl_Obj *)) {return 1;}
-
static const TclObjTypeWithAbstractList endOffsetType = {
{"end-offset", /* name */
NULL, /* freeIntRepProc */
@@ -131,10 +129,17 @@ static const TclObjTypeWithAbstractList endOffsetType = {
NULL, /* updateStringProc */
NULL, /* setFromAnyProc */
TCL_OBJTYPE_V0_1(
- LengthOne
+ TclLengthOne
)}
};
-
+
+size_t
+TclLengthOne(
+ TCL_UNUSED(Tcl_Obj *))
+{
+ return 1;
+}
+
/*
* * STRING REPRESENTATION OF LISTS * * *
*