From 2bfd703aaa0a56039b2831fcbc8f11739dc158b7 Mon Sep 17 00:00:00 2001 From: Stas Boukarev Date: Tue, 1 May 2012 20:42:34 +0400 Subject: [PATCH] runtime clean up. coreparse.c: Move #define _BSD_SOURCE up, so that it won't conflict with subsequent files, and #undef it after it's used to include sys/mman.h search.c(search_for_type): Remove unused variable addr. interrupt.c: Remove double parentheses in if((x==y)). run-program.c: Include sys/wait.h --- src/runtime/coreparse.c | 19 +++++++++++-------- src/runtime/interrupt.c | 2 +- src/runtime/run-program.c | 2 +- src/runtime/search.c | 3 +-- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/runtime/coreparse.c b/src/runtime/coreparse.c index 28a08af..d3fa306 100644 --- a/src/runtime/coreparse.c +++ b/src/runtime/coreparse.c @@ -14,6 +14,17 @@ * files for more information. */ +#ifndef LISP_FEATURE_WIN32 +#ifdef LISP_FEATURE_LINUX +/* For madvise */ +#define _BSD_SOURCE +#include +#undef _BSD_SOURCE +#else +#include +#endif +#endif + #include #include #include @@ -25,14 +36,6 @@ #include "sbcl.h" -#ifndef LISP_FEATURE_WIN32 -#ifdef LISP_FEATURE_LINUX -/* For madvise */ -# define _BSD_SOURCE -#endif -#include -#endif - #include "os.h" #include "runtime.h" #include "globals.h" diff --git a/src/runtime/interrupt.c b/src/runtime/interrupt.c index 2e31562..6eccb2d 100644 --- a/src/runtime/interrupt.c +++ b/src/runtime/interrupt.c @@ -1754,7 +1754,7 @@ undoably_install_low_level_interrupt_handler (int signal, sa.sa_flags = SA_SIGINFO | SA_RESTART | (sigaction_nodefer_works ? SA_NODEFER : 0); #ifdef LISP_FEATURE_C_STACK_IS_CONTROL_STACK - if((signal==SIG_MEMORY_FAULT)) + if(signal==SIG_MEMORY_FAULT) sa.sa_flags |= SA_ONSTACK; #endif diff --git a/src/runtime/run-program.c b/src/runtime/run-program.c index 00692b7..c911074 100644 --- a/src/runtime/run-program.c +++ b/src/runtime/run-program.c @@ -25,7 +25,7 @@ #include #include #include - +#include #include #include #include diff --git a/src/runtime/search.c b/src/runtime/search.c index 4bf6b50..12e1c61 100644 --- a/src/runtime/search.c +++ b/src/runtime/search.c @@ -20,12 +20,11 @@ boolean search_for_type(int type, lispobj **start, int *count) { - lispobj obj, *addr; + lispobj obj; while ((*count == -1 || (*count > 0)) && is_valid_lisp_addr((os_vm_address_t)*start)) { obj = **start; - addr = *start; if (*count != -1) *count -= 2; -- 1.7.10.4