chiark
/
gitweb
/
~ian
/
chiark-tcl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
working on compiling out of troglodyte; before relegage maskmap
[chiark-tcl.git]
/
base
/
enum.c
diff --git
a/base/enum.c
b/base/enum.c
index e3fa041b6d621875909bb06c84a0e23011555785..e40b51343b3564cf7d3708d5f0f93f0c927e0f1f 100644
(file)
--- a/
base/enum.c
+++ b/
base/enum.c
@@
-2,9
+2,7
@@
*
*/
*
*/
-#include <string.h>
-
-#include "hbytes.h"
+#include "chiark-tcl-base.h"
static void enum_nt_dup(Tcl_Obj *src, Tcl_Obj *dup) {
dup->internalRep= src->internalRep;
static void enum_nt_dup(Tcl_Obj *src, Tcl_Obj *dup) {
dup->internalRep= src->internalRep;
@@
-19,12
+17,12
@@
static int enum_nt_sfa(Tcl_Interp *ip, Tcl_Obj *o) {
abort();
}
abort();
}
-Tcl_ObjType enum_nearlytype = {
+Tcl_ObjType
cht_
enum_nearlytype = {
"enum-nearly",
0, enum_nt_dup, enum_nt_ustr, enum_nt_sfa
};
"enum-nearly",
0, enum_nt_dup, enum_nt_ustr, enum_nt_sfa
};
-Tcl_ObjType enum1_nearlytype = {
+Tcl_ObjType
cht_
enum1_nearlytype = {
"enum1-nearly",
0, enum_nt_dup, enum_nt_ustr, enum_nt_sfa
};
"enum1-nearly",
0, enum_nt_dup, enum_nt_ustr, enum_nt_sfa
};
@@
-58,13
+56,13
@@
static void appres_enum(Tcl_Interp *ip, const void *p) {
Tcl_AppendResult(ip, enum_str(p), (char*)0);
}
Tcl_AppendResult(ip, enum_str(p), (char*)0);
}
-const void *enum_lookup_cached_func(Tcl_Interp *ip, Tcl_Obj *o,
+const void *
cht_
enum_lookup_cached_func(Tcl_Interp *ip, Tcl_Obj *o,
const void *firstentry, size_t entrysize,
const char *what) {
const char *supplied, *found;
const char *ep;
const void *firstentry, size_t entrysize,
const char *what) {
const char *supplied, *found;
const char *ep;
- if (o->typePtr == &enum_nearlytype &&
+ if (o->typePtr == &
cht_
enum_nearlytype &&
o->internalRep.twoPtrValue.ptr1 == firstentry)
return o->internalRep.twoPtrValue.ptr2;
o->internalRep.twoPtrValue.ptr1 == firstentry)
return o->internalRep.twoPtrValue.ptr2;
@@
-74,8
+72,8
@@
const void *enum_lookup_cached_func(Tcl_Interp *ip, Tcl_Obj *o,
ep += entrysize);
if (found) {
ep += entrysize);
if (found) {
- objfreeir(o);
- o->typePtr= &enum_nearlytype;
+
cht_
objfreeir(o);
+ o->typePtr= &
cht_
enum_nearlytype;
o->internalRep.twoPtrValue.ptr1= (void*)firstentry;
o->internalRep.twoPtrValue.ptr2= (void*)ep;
return ep;
o->internalRep.twoPtrValue.ptr1= (void*)firstentry;
o->internalRep.twoPtrValue.ptr2= (void*)ep;
return ep;
@@
-93,11
+91,11
@@
static void appres_enum1(Tcl_Interp *ip, const void *p) {
Tcl_AppendResult(ip, buf, (char*)0);
}
Tcl_AppendResult(ip, buf, (char*)0);
}
-int enum1_lookup_cached_func(Tcl_Interp *ip, Tcl_Obj *o,
+int
cht_
enum1_lookup_cached_func(Tcl_Interp *ip, Tcl_Obj *o,
const char *opts, const char *what) {
const char *supplied, *fp;
const char *opts, const char *what) {
const char *supplied, *fp;
- if (o->typePtr != &enum1_nearlytype ||
+ if (o->typePtr != &
cht_
enum1_nearlytype ||
o->internalRep.twoPtrValue.ptr1 != opts) {
supplied= Tcl_GetStringFromObj(o,0); assert(supplied);
o->internalRep.twoPtrValue.ptr1 != opts) {
supplied= Tcl_GetStringFromObj(o,0); assert(supplied);
@@
-108,8
+106,8
@@
int enum1_lookup_cached_func(Tcl_Interp *ip, Tcl_Obj *o,
return -1;
}
return -1;
}
- objfreeir(o);
- o->typePtr= &enum1_nearlytype;
+
cht_
objfreeir(o);
+ o->typePtr= &
cht_
enum1_nearlytype;
o->internalRep.twoPtrValue.ptr1= (void*)opts;
o->internalRep.twoPtrValue.ptr2= (void*)fp;
}
o->internalRep.twoPtrValue.ptr1= (void*)opts;
o->internalRep.twoPtrValue.ptr2= (void*)fp;
}