From 584bfdc4e1093e43e4eb328a418b012745935a29 Mon Sep 17 00:00:00 2001 From: Thiemo Seufer Date: Wed, 25 Jul 2007 21:37:31 +0000 Subject: [PATCH] 1.0.8.1: Nicer C code - More consistent formatting. - Spelling fixes. - Declare empty parameter lists as void. --- src/runtime/alpha-linux-os.h | 3 ++- src/runtime/alpha-osf1-os.h | 3 ++- src/runtime/fixnump.h | 3 ++- src/runtime/hppa-linux-os.h | 3 ++- src/runtime/interrupt.c | 14 ++++++++------ src/runtime/interrupt.h | 10 +++++----- src/runtime/mips-linux-os.h | 3 ++- src/runtime/os.h | 2 +- src/runtime/ppc-bsd-os.h | 3 ++- src/runtime/ppc-darwin-os.h | 3 ++- src/runtime/ppc-linux-os.h | 3 ++- src/runtime/runtime.h | 7 +++++-- src/runtime/sparc-linux-os.h | 3 ++- src/runtime/sparc-sunos-os.h | 3 ++- src/runtime/thread.h | 16 +++++++++++----- src/runtime/x86-64-bsd-os.h | 3 ++- src/runtime/x86-64-darwin-os.h | 3 ++- src/runtime/x86-64-linux-os.h | 3 ++- src/runtime/x86-bsd-os.h | 3 ++- src/runtime/x86-darwin-os.h | 3 ++- src/runtime/x86-linux-os.h | 3 ++- src/runtime/x86-sunos-os.h | 3 ++- src/runtime/x86-win32-os.h | 3 ++- version.lisp-expr | 2 +- 24 files changed, 67 insertions(+), 38 deletions(-) diff --git a/src/runtime/alpha-linux-os.h b/src/runtime/alpha-linux-os.h index d428042..40a25ea 100644 --- a/src/runtime/alpha-linux-os.h +++ b/src/runtime/alpha-linux-os.h @@ -4,7 +4,8 @@ typedef struct ucontext os_context_t; typedef long os_context_register_t; -static inline os_context_t *arch_os_get_context(void **void_context) { +static inline os_context_t *arch_os_get_context(void **void_context) +{ return (os_context_t *) *void_context; } diff --git a/src/runtime/alpha-osf1-os.h b/src/runtime/alpha-osf1-os.h index 058c494..567e55b 100644 --- a/src/runtime/alpha-osf1-os.h +++ b/src/runtime/alpha-osf1-os.h @@ -3,7 +3,8 @@ typedef struct ucontext os_context_t; -static inline os_context_t *arch_os_get_context(void **void_context) { +static inline os_context_t *arch_os_get_context(void **void_context) +{ return (os_context_t *) *void_context; } diff --git a/src/runtime/fixnump.h b/src/runtime/fixnump.h index b3aadb7..9681520 100644 --- a/src/runtime/fixnump.h +++ b/src/runtime/fixnump.h @@ -12,7 +12,8 @@ #ifndef _FIXNUMP_H #define _FIXNUMP_H -static inline int fixnump(lispobj obj) { +static inline int fixnump(lispobj obj) +{ return((obj & (LOWTAG_MASK & (~(EVEN_FIXNUM_LOWTAG|ODD_FIXNUM_LOWTAG)))) diff --git a/src/runtime/hppa-linux-os.h b/src/runtime/hppa-linux-os.h index f0c23ac..961ec44 100644 --- a/src/runtime/hppa-linux-os.h +++ b/src/runtime/hppa-linux-os.h @@ -6,7 +6,8 @@ typedef struct ucontext os_context_t; wide-sigcontext for 32-bit kernels */ typedef unsigned long os_context_register_t; -static inline os_context_t *arch_os_get_context(void **void_context) { +static inline os_context_t *arch_os_get_context(void **void_context) +{ return (os_context_t *) *void_context; } diff --git a/src/runtime/interrupt.c b/src/runtime/interrupt.c index 3597ee1..d9a9301 100644 --- a/src/runtime/interrupt.c +++ b/src/runtime/interrupt.c @@ -597,7 +597,8 @@ interrupt_handle_now(int signal, siginfo_t *info, os_context_t *context) * already; we're just doing the Lisp-level processing now that we * put off then */ static void -run_deferred_handler(struct interrupt_data *data, void *v_context) { +run_deferred_handler(struct interrupt_data *data, void *v_context) +{ /* The pending_handler may enable interrupts and then another * interrupt may hit, overwrite interrupt_data, so reset the * pending handler before calling it. Trust the handler to finish @@ -1023,7 +1024,8 @@ interrupt_thread_handler(int num, siginfo_t *info, void *v_context) * functions and variables. */ void -undefined_alien_function() { +undefined_alien_function(void) +{ funcall0(SymbolFunction(UNDEFINED_ALIEN_FUNCTION_ERROR)); } @@ -1112,7 +1114,7 @@ sigaction_nodefer_test_handler(int signal, siginfo_t *info, void *void_context) } static void -see_if_sigaction_nodefer_works() +see_if_sigaction_nodefer_works(void) { struct sigaction sa, old_sa; @@ -1255,7 +1257,7 @@ install_handler(int signal, void handler(int, siginfo_t*, void*)) } void -interrupt_init() +interrupt_init(void) { #ifndef LISP_FEATURE_WIN32 int i; @@ -1302,7 +1304,7 @@ lisp_memory_fault_error(os_context_t *context, os_vm_address_t addr) } #endif -void +static void unhandled_trap_error(os_context_t *context) { lispobj context_sap; @@ -1315,7 +1317,7 @@ unhandled_trap_error(os_context_t *context) lose("UNHANDLED-TRAP-ERROR fell through"); } -/* Common logic far trapping instructions. How we actually handle each +/* Common logic for trapping instructions. How we actually handle each * case is highly architecture dependent, but the overall shape is * this. */ void diff --git a/src/runtime/interrupt.h b/src/runtime/interrupt.h index 4e0a45f..d26df28 100644 --- a/src/runtime/interrupt.h +++ b/src/runtime/interrupt.h @@ -26,9 +26,9 @@ /* FIXME: do not rely on NSIG being a multiple of 8 */ #define REAL_SIGSET_SIZE_BYTES ((NSIG/8)) -extern void check_blockables_blocked_or_lose(); -extern void check_gc_signals_unblocked_or_lose(); -extern void unblock_gc_signals(); +extern void check_blockables_blocked_or_lose(void); +extern void check_gc_signals_unblocked_or_lose(void); +extern void unblock_gc_signals(void); static inline void sigcopyset(sigset_t *new, sigset_t *old) @@ -62,7 +62,7 @@ struct interrupt_data { }; -extern void interrupt_init(); +extern void interrupt_init(void); extern void fake_foreign_function_call(os_context_t* context); extern void undo_fake_foreign_function_call(os_context_t* context); extern void arrange_return_to_lisp_function(os_context_t *, lispobj); @@ -96,7 +96,7 @@ extern void sigaddset_deferrable(sigset_t *s); /* Set all blockable signals into *s. */ extern void sigaddset_blockable(sigset_t *s); -extern void block_blockable_signals(); +extern void block_blockable_signals(void); /* The void* casting here avoids having to mess with the various types * of function argument lists possible for signal handlers: diff --git a/src/runtime/mips-linux-os.h b/src/runtime/mips-linux-os.h index c28d9be..cc442b1 100644 --- a/src/runtime/mips-linux-os.h +++ b/src/runtime/mips-linux-os.h @@ -4,7 +4,8 @@ typedef struct ucontext os_context_t; typedef unsigned long long os_context_register_t; -static inline os_context_t *arch_os_get_context(void **void_context) { +static inline os_context_t *arch_os_get_context(void **void_context) +{ return (os_context_t *) *void_context; } diff --git a/src/runtime/os.h b/src/runtime/os.h index 7eb58f1..a471ab6 100644 --- a/src/runtime/os.h +++ b/src/runtime/os.h @@ -175,6 +175,6 @@ int os_get_errno(void); /* Return an absolute path to the runtime executable, or NULL if this * information is unavailable. If a non-null pathname is returned, it * must be 'free'd. */ -extern char *os_get_runtime_executable_path(); +extern char *os_get_runtime_executable_path(void); #endif diff --git a/src/runtime/ppc-bsd-os.h b/src/runtime/ppc-bsd-os.h index 5c8dde0..20babe3 100644 --- a/src/runtime/ppc-bsd-os.h +++ b/src/runtime/ppc-bsd-os.h @@ -3,7 +3,8 @@ typedef int os_context_register_t; -static inline os_context_t *arch_os_get_context(void **void_context) { +static inline os_context_t *arch_os_get_context(void **void_context) +{ return (os_context_t *) *void_context; } diff --git a/src/runtime/ppc-darwin-os.h b/src/runtime/ppc-darwin-os.h index adbbdad..984e932 100644 --- a/src/runtime/ppc-darwin-os.h +++ b/src/runtime/ppc-darwin-os.h @@ -3,7 +3,8 @@ typedef unsigned int os_context_register_t; -static inline os_context_t *arch_os_get_context(void **void_context) { +static inline os_context_t *arch_os_get_context(void **void_context) +{ return (os_context_t *) *void_context; } diff --git a/src/runtime/ppc-linux-os.h b/src/runtime/ppc-linux-os.h index 4f65e16..3ae5596 100644 --- a/src/runtime/ppc-linux-os.h +++ b/src/runtime/ppc-linux-os.h @@ -4,7 +4,8 @@ typedef struct ucontext os_context_t; typedef long os_context_register_t; -static inline os_context_t *arch_os_get_context(void **void_context) { +static inline os_context_t *arch_os_get_context(void **void_context) +{ return (os_context_t *) *void_context; } diff --git a/src/runtime/runtime.h b/src/runtime/runtime.h index 2fce3fd..9525a17 100644 --- a/src/runtime/runtime.h +++ b/src/runtime/runtime.h @@ -80,12 +80,14 @@ typedef unsigned int lispobj; #endif static inline int -lowtag_of(lispobj obj) { +lowtag_of(lispobj obj) +{ return obj & LOWTAG_MASK; } static inline int -widetag_of(lispobj obj) { +widetag_of(lispobj obj) +{ return obj & WIDETAG_MASK; } @@ -128,6 +130,7 @@ native_pointer(lispobj obj) { return (lispobj *) ((pointer_sized_uint_t) (obj & ~LOWTAG_MASK)); } + /* inverse operation: create a suitably tagged lispobj from a native * pointer or integer. Needs to be a macro due to the tedious C type * system */ diff --git a/src/runtime/sparc-linux-os.h b/src/runtime/sparc-linux-os.h index 76d9eb6..7214d15 100644 --- a/src/runtime/sparc-linux-os.h +++ b/src/runtime/sparc-linux-os.h @@ -4,7 +4,8 @@ typedef struct sigcontext os_context_t; typedef unsigned long os_context_register_t; -static inline os_context_t *arch_os_get_context(void **void_context) { +static inline os_context_t *arch_os_get_context(void **void_context) +{ asm volatile ("ta 0x03"); /* ta ST_FLUSH_WINDOWS */ return (os_context_t *) (void_context + 37); } diff --git a/src/runtime/sparc-sunos-os.h b/src/runtime/sparc-sunos-os.h index 4f099ac..b1dc334 100644 --- a/src/runtime/sparc-sunos-os.h +++ b/src/runtime/sparc-sunos-os.h @@ -3,7 +3,8 @@ typedef ucontext_t os_context_t; -static inline os_context_t *arch_os_get_context(void **void_context) { +static inline os_context_t *arch_os_get_context(void **void_context) +{ asm volatile ("ta 0x03"); /* ta ST_FLUSH_WINDOWS */ return (os_context_t *) (*void_context); } diff --git a/src/runtime/thread.h b/src/runtime/thread.h index 8f0436f..5d5eba9 100644 --- a/src/runtime/thread.h +++ b/src/runtime/thread.h @@ -42,7 +42,8 @@ extern int dynamic_values_bytes; #endif static inline lispobj -SymbolValue(u64 tagged_symbol_pointer, void *thread) { +SymbolValue(u64 tagged_symbol_pointer, void *thread) +{ struct symbol *sym= (struct symbol *) (pointer_sized_uint_t)(tagged_symbol_pointer-OTHER_POINTER_LOWTAG); #ifdef LISP_FEATURE_SB_THREAD @@ -57,7 +58,8 @@ SymbolValue(u64 tagged_symbol_pointer, void *thread) { } static inline lispobj -SymbolTlValue(u64 tagged_symbol_pointer, void *thread) { +SymbolTlValue(u64 tagged_symbol_pointer, void *thread) +{ struct symbol *sym= (struct symbol *) (pointer_sized_uint_t)(tagged_symbol_pointer-OTHER_POINTER_LOWTAG); #ifdef LISP_FEATURE_SB_THREAD @@ -69,7 +71,8 @@ SymbolTlValue(u64 tagged_symbol_pointer, void *thread) { } static inline void -SetSymbolValue(u64 tagged_symbol_pointer,lispobj val, void *thread) { +SetSymbolValue(u64 tagged_symbol_pointer,lispobj val, void *thread) +{ struct symbol *sym= (struct symbol *) (pointer_sized_uint_t)(tagged_symbol_pointer-OTHER_POINTER_LOWTAG); #ifdef LISP_FEATURE_SB_THREAD @@ -84,8 +87,10 @@ SetSymbolValue(u64 tagged_symbol_pointer,lispobj val, void *thread) { #endif sym->value = val; } + static inline void -SetTlSymbolValue(u64 tagged_symbol_pointer,lispobj val, void *thread) { +SetTlSymbolValue(u64 tagged_symbol_pointer,lispobj val, void *thread) +{ #ifdef LISP_FEATURE_SB_THREAD struct symbol *sym= (struct symbol *) (pointer_sized_uint_t)(tagged_symbol_pointer-OTHER_POINTER_LOWTAG); @@ -109,7 +114,8 @@ os_context_t *get_interrupt_context_for_thread(struct thread *th) * much stuff like struct thread and all_threads to be defined, which * usually aren't by that time. So, it's here instead. Sorry */ -static inline struct thread *arch_os_get_current_thread() { +static inline struct thread *arch_os_get_current_thread(void) +{ #if defined(LISP_FEATURE_SB_THREAD) #if defined(LISP_FEATURE_X86) register struct thread *me=0; diff --git a/src/runtime/x86-64-bsd-os.h b/src/runtime/x86-64-bsd-os.h index 327922a..aefdd30 100644 --- a/src/runtime/x86-64-bsd-os.h +++ b/src/runtime/x86-64-bsd-os.h @@ -7,7 +7,8 @@ typedef register_t os_context_register_t; -static inline os_context_t *arch_os_get_context(void **void_context) { +static inline os_context_t *arch_os_get_context(void **void_context) +{ return (os_context_t *) *void_context; } diff --git a/src/runtime/x86-64-darwin-os.h b/src/runtime/x86-64-darwin-os.h index ff3d342..d68693d 100644 --- a/src/runtime/x86-64-darwin-os.h +++ b/src/runtime/x86-64-darwin-os.h @@ -5,7 +5,8 @@ typedef register_t os_context_register_t; -static inline os_context_t *arch_os_get_context(void **void_context) { +static inline os_context_t *arch_os_get_context(void **void_context) +{ return (os_context_t *) *void_context; } diff --git a/src/runtime/x86-64-linux-os.h b/src/runtime/x86-64-linux-os.h index ba96988..48e3e25 100644 --- a/src/runtime/x86-64-linux-os.h +++ b/src/runtime/x86-64-linux-os.h @@ -4,7 +4,8 @@ typedef struct ucontext os_context_t; typedef long os_context_register_t; -static inline os_context_t *arch_os_get_context(void **void_context) { +static inline os_context_t *arch_os_get_context(void **void_context) +{ return (os_context_t *) *void_context; } diff --git a/src/runtime/x86-bsd-os.h b/src/runtime/x86-bsd-os.h index 3ff9f52..406cf57 100644 --- a/src/runtime/x86-bsd-os.h +++ b/src/runtime/x86-bsd-os.h @@ -8,7 +8,8 @@ typedef int os_context_register_t; -static inline os_context_t *arch_os_get_context(void **void_context) { +static inline os_context_t *arch_os_get_context(void **void_context) +{ return (os_context_t *) *void_context; } diff --git a/src/runtime/x86-darwin-os.h b/src/runtime/x86-darwin-os.h index 36581d3..aa2710c 100644 --- a/src/runtime/x86-darwin-os.h +++ b/src/runtime/x86-darwin-os.h @@ -8,7 +8,8 @@ typedef int os_context_register_t; -static inline os_context_t *arch_os_get_context(void **void_context) { +static inline os_context_t *arch_os_get_context(void **void_context) +{ return (os_context_t *) *void_context; } diff --git a/src/runtime/x86-linux-os.h b/src/runtime/x86-linux-os.h index c24c962..6e688c6 100644 --- a/src/runtime/x86-linux-os.h +++ b/src/runtime/x86-linux-os.h @@ -4,7 +4,8 @@ typedef struct ucontext os_context_t; typedef greg_t os_context_register_t; -static inline os_context_t *arch_os_get_context(void **void_context) { +static inline os_context_t *arch_os_get_context(void **void_context) +{ return (os_context_t *) *void_context; } diff --git a/src/runtime/x86-sunos-os.h b/src/runtime/x86-sunos-os.h index a7d6a92..dffcc33 100644 --- a/src/runtime/x86-sunos-os.h +++ b/src/runtime/x86-sunos-os.h @@ -3,7 +3,8 @@ typedef ucontext_t os_context_t; -static inline os_context_t *arch_os_get_context(void **void_context) { +static inline os_context_t *arch_os_get_context(void **void_context) +{ return (os_context_t *) *void_context; } diff --git a/src/runtime/x86-win32-os.h b/src/runtime/x86-win32-os.h index 1f2e748..e703338 100644 --- a/src/runtime/x86-win32-os.h +++ b/src/runtime/x86-win32-os.h @@ -4,7 +4,8 @@ typedef CONTEXT os_context_t; typedef long os_context_register_t; -static inline os_context_t *arch_os_get_context(void **void_context) { +static inline os_context_t *arch_os_get_context(void **void_context) +{ return (os_context_t *) *void_context; } diff --git a/version.lisp-expr b/version.lisp-expr index 3abece1..70e157b 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"1.0.8" +"1.0.8.1" -- 1.7.10.4