summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-10-09 11:35:13 -0700
committerKaz Kylheku <kaz@kylheku.com>2021-10-09 11:35:13 -0700
commit9c07fa62d4ff167afb01ddf126db97b13d06fb1d (patch)
tree6e973d7fa3cdd8df41e6739fa91ad0ddd1f7a71c
parentb8689dbc7446e11c84dfbbf851e49d72859296ac (diff)
downloadtxr-9c07fa62d4ff167afb01ddf126db97b13d06fb1d.tar.gz
txr-9c07fa62d4ff167afb01ddf126db97b13d06fb1d.tar.bz2
txr-9c07fa62d4ff167afb01ddf126db97b13d06fb1d.zip
ffi: remove useless locals from enum constructor.
* ffi.c (make_ffi_type_enum): the variables lowest, highest and count do not serve any purpose; they are hereby removed.
-rw-r--r--ffi.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/ffi.c b/ffi.c
index 07feab41..ced44f2f 100644
--- a/ffi.c
+++ b/ffi.c
@@ -3599,10 +3599,7 @@ static val make_ffi_type_enum(val syntax, val enums,
val sym_num = make_hash(hash_weak_none, t);
val num_sym = make_hash(hash_weak_none, nil);
val obj = cobj(coerce(mem_t *, tft), ffi_type_cls, &ffi_type_enum_ops);
- cnum lowest = INT_PTR_MAX;
- cnum highest = INT_PTR_MIN;
cnum cur = -1;
- ucnum count = 0;
val iter;
val enum_env = make_env(nil, nil, nil);
val shadow_menv = make_env(nil, nil, nil);
@@ -3628,7 +3625,7 @@ static val make_ffi_type_enum(val syntax, val enums,
tft->num_sym = num_sym;
tft->sym_num = sym_num;
- for (iter = enums; !endp(iter); iter = cdr(iter), count++) {
+ for (iter = enums; !endp(iter); iter = cdr(iter)) {
val en = car(iter);
val nn;
if (symbolp(en)) {
@@ -3646,8 +3643,6 @@ static val make_ffi_type_enum(val syntax, val enums,
sethash(sym_num, nn, sym);
env_vbind(enum_env, sym, nn);
env_vbind(shadow_menv, sym, special_s);
- if (cur > highest)
- highest = cur;
} else {
val expr = cadr(en);
val sym = car(en);
@@ -3674,8 +3669,6 @@ static val make_ffi_type_enum(val syntax, val enums,
sethash(sym_num, nn, sym);
env_vbind(enum_env, sym, nn);
env_vbind(shadow_menv, sym, special_s);
- if (cur < lowest)
- lowest = cur;
}
}