From: Douglas K. <sn...@us...> - 2017-06-19 21:38:07
|
The branch "master" has been updated in SBCL: via bb1e50f538da92593b4302603ccb2bc173bdef2d (commit) from e5b74d92e2983cf89c9ff2d2a1b6b20fabf6f39f (commit) - Log ----------------------------------------------------------------- commit bb1e50f538da92593b4302603ccb2bc173bdef2d Author: Douglas Katzman <do...@go...> Date: Mon Jun 19 17:35:45 2017 -0400 Eliminate temporary vars that act solely to cast a pointer. --- src/runtime/backtrace.c | 5 ++--- src/runtime/gencgc.c | 6 ++---- src/runtime/print.c | 12 ++++-------- 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/src/runtime/backtrace.c b/src/runtime/backtrace.c index 006c91d..9c94779 100644 --- a/src/runtime/backtrace.c +++ b/src/runtime/backtrace.c @@ -168,9 +168,8 @@ print_entry_name (lispobj name) (void*)name); return; } - struct cons *cons = (struct cons *) native_pointer(name); - print_entry_name(cons->car); - name = cons->cdr; + print_entry_name(CONS(name)->car); + name = CONS(name)->cdr; if (name != NIL) putchar(' '); } diff --git a/src/runtime/gencgc.c b/src/runtime/gencgc.c index 8250359..d807f60 100644 --- a/src/runtime/gencgc.c +++ b/src/runtime/gencgc.c @@ -3332,10 +3332,8 @@ garbage_collect_generation(generation_index_t generation, int raise) for_each_thread(th) { lispobj pin_list = SymbolTlValue(PINNED_OBJECTS,th); while (pin_list != NIL) { - struct cons *list_entry = - (struct cons *)native_pointer(pin_list); - preserve_pointer((void*)list_entry->car); - pin_list = list_entry->cdr; + preserve_pointer((void*)(CONS(pin_list)->car)); + pin_list = CONS(pin_list)->cdr; } } #endif diff --git a/src/runtime/print.c b/src/runtime/print.c index 8a46f42..475b714 100644 --- a/src/runtime/print.c +++ b/src/runtime/print.c @@ -387,8 +387,6 @@ static void brief_list(lispobj obj) else { putchar('('); while (lowtag_of(obj) == LIST_POINTER_LOWTAG) { - struct cons *cons = (struct cons *)native_pointer(obj); - if (space) putchar(' '); if (++length >= max_length) { @@ -396,8 +394,8 @@ static void brief_list(lispobj obj) obj = NIL; break; } - print_obj("", cons->car); - obj = cons->cdr; + print_obj("", CONS(obj)->car); + obj = CONS(obj)->cdr; space = 1; if (obj == NIL) break; @@ -417,10 +415,8 @@ static void print_list(lispobj obj) } else if (obj == NIL) { printf(" (NIL)"); } else { - struct cons *cons = (struct cons *)native_pointer(obj); - - print_obj("car: ", cons->car); - print_obj("cdr: ", cons->cdr); + print_obj("car: ", CONS(obj)->car); + print_obj("cdr: ", CONS(obj)->cdr); } } ----------------------------------------------------------------------- hooks/post-receive -- SBCL |