From 9c07fa62d4ff167afb01ddf126db97b13d06fb1d Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sat, 9 Oct 2021 11:35:13 -0700 Subject: 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. --- ffi.c | 9 +-------- 1 file changed, 1 insertion(+), 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; } } -- cgit v1.2.3