From 26e8f33d8639e4de75e59e3aa30bbd7478d51a69 Mon Sep 17 00:00:00 2001 From: NIIMI Satoshi Date: Wed, 26 Sep 2007 11:24:01 +0000 Subject: [PATCH] 1.0.10.1: Cleanup code Shut GCC warnings up. --- src/runtime/alloc.c | 2 +- src/runtime/alloc.h | 2 +- src/runtime/gencgc.c | 5 +++-- src/runtime/interr.c | 2 +- src/runtime/thread.c | 4 ++-- src/runtime/x86-arch.c | 2 +- src/runtime/x86-assem.S | 1 - src/runtime/x86-bsd-os.c | 6 +++--- src/runtime/x86-bsd-os.h | 3 +++ tools-for-build/grovel-headers.c | 6 +++--- version.lisp-expr | 2 +- 11 files changed, 19 insertions(+), 16 deletions(-) diff --git a/src/runtime/alloc.c b/src/runtime/alloc.c index 78fc49f..2e056b5 100644 --- a/src/runtime/alloc.c +++ b/src/runtime/alloc.c @@ -32,7 +32,7 @@ #define ALIGNED_SIZE(n) ((n) + LOWTAG_MASK) & ~LOWTAG_MASK #ifdef LISP_FEATURE_GENCGC -extern lispobj *alloc(int bytes); +extern lispobj *alloc(long bytes); #endif static lispobj * diff --git a/src/runtime/alloc.h b/src/runtime/alloc.h index 3735f9f..54f6902 100644 --- a/src/runtime/alloc.h +++ b/src/runtime/alloc.h @@ -16,7 +16,7 @@ #include "runtime.h" #ifdef LISP_FEATURE_GENCGC -extern lispobj *alloc(int bytes); +extern lispobj *alloc(long bytes); #endif extern lispobj alloc_cons(lispobj car, lispobj cdr); diff --git a/src/runtime/gencgc.c b/src/runtime/gencgc.c index d16a44c..250ccee 100644 --- a/src/runtime/gencgc.c +++ b/src/runtime/gencgc.c @@ -42,6 +42,7 @@ #include "gc.h" #include "gc-internal.h" #include "thread.h" +#include "alloc.h" #include "genesis/vector.h" #include "genesis/weak-pointer.h" #include "genesis/fdefn.h" @@ -1095,7 +1096,7 @@ gc_heap_exhausted_error_or_lose (long available, long requested) } else { /* FIXME: assert free_pages_lock held */ - thread_mutex_unlock(&free_pages_lock); + (void)thread_mutex_unlock(&free_pages_lock); funcall2(SymbolFunction(HEAP_EXHAUSTED_ERROR), alloc_number(available), alloc_number(requested)); lose("HEAP-EXHAUSTED-ERROR fell through"); @@ -4581,7 +4582,7 @@ gc_initialize_pointers(void) * The check for a GC trigger is only performed when the current * region is full, so in most cases it's not needed. */ -char * +lispobj * alloc(long nbytes) { struct thread *thread=arch_os_get_current_thread(); diff --git a/src/runtime/interr.c b/src/runtime/interr.c index b24b726..5f7869c 100644 --- a/src/runtime/interr.c +++ b/src/runtime/interr.c @@ -177,6 +177,6 @@ lispobj debug_print(lispobj string) fprintf(stderr, "%s\n", (char *)(((struct vector *)native_pointer(string))->data)); /* shut GCC up about not using this, because that's the point.. */ - if (untouched); + (void)untouched; return NIL; } diff --git a/src/runtime/thread.c b/src/runtime/thread.c index 5b8ec4a..7c85b3e 100644 --- a/src/runtime/thread.c +++ b/src/runtime/thread.c @@ -522,7 +522,7 @@ boolean create_os_thread(struct thread *th,os_thread_t *kid_tid) pthread_attr_t attr; sigset_t newset,oldset; boolean r=1; - int retcode, initcode, sizecode, addrcode; + int retcode = 0, initcode; FSHOW_SIGNAL((stderr,"/create_os_thread: creating new thread\n")); @@ -551,7 +551,7 @@ boolean create_os_thread(struct thread *th,os_thread_t *kid_tid) #undef CONTROL_STACK_ADJUST (retcode = pthread_create (kid_tid,&attr,(void *(*)(void *))new_thread_trampoline,th))) { - FSHOW_SIGNAL((stderr, "init, size, addr = %d, %d, %d\n", initcode, sizecode, addrcode)); + FSHOW_SIGNAL((stderr, "init = %d\n", initcode)); FSHOW_SIGNAL((stderr, printf("pthread_create returned %d, errno %d\n", retcode, errno))); FSHOW_SIGNAL((stderr, "wanted stack size %d, min stack size %d\n", THREAD_CONTROL_STACK_SIZE-16, PTHREAD_STACK_MIN)); diff --git a/src/runtime/x86-arch.c b/src/runtime/x86-arch.c index b417bd7..a871962 100644 --- a/src/runtime/x86-arch.c +++ b/src/runtime/x86-arch.c @@ -204,7 +204,7 @@ arch_do_displaced_inst(os_context_t *context, unsigned int orig_inst) single_stepping = pc; #ifdef CANNOT_GET_TO_SINGLE_STEP_FLAG - *os_context_pc_addr(context) = (char *)pc - 9; + *os_context_pc_addr(context) = (os_context_register_t)((char *)pc - 9); #endif } diff --git a/src/runtime/x86-assem.S b/src/runtime/x86-assem.S index 9470533..1afa6ee 100644 --- a/src/runtime/x86-assem.S +++ b/src/runtime/x86-assem.S @@ -887,4 +887,3 @@ Lend_base: END() - \ No newline at end of file diff --git a/src/runtime/x86-bsd-os.c b/src/runtime/x86-bsd-os.c index d493800..c44c7db 100644 --- a/src/runtime/x86-bsd-os.c +++ b/src/runtime/x86-bsd-os.c @@ -156,7 +156,7 @@ int arch_os_thread_init(struct thread *thread) { struct segment_descriptor ldt_entry = { 0, 0, SDT_MEMRW, SEL_UPL, 1, 0, 0, 1, 0, 0 }; - set_data_desc_addr(&ldt_entry, (unsigned long) thread); + set_data_desc_addr(&ldt_entry, thread); set_data_desc_size(&ldt_entry, dynamic_values_bytes); n = i386_set_ldt(LDT_AUTO_ALLOC, (union descriptor*) &ldt_entry, 1); @@ -226,8 +226,8 @@ os_restore_fp_control(os_context_t *context) * On earlier systems, it is shared in a whole process. */ #if defined(__FreeBSD_version) && __FreeBSD_version >= 500040 - struct envxmm *ex = (struct envxmm*)(&context->uc_mcontext.mc_fpstate); - asm ("fldcw %0" : : "m" (ex->en_cw)); + struct envxmm *ex = (struct envxmm *)(context->uc_mcontext.mc_fpstate); + __asm__ __volatile__ ("fldcw %0" : : "m" (ex->en_cw)); #endif #if defined(LISP_FEATURE_RESTORE_TLS_SEGMENT_REGISTER_FROM_CONTEXT) /* Calling this function here may not be good idea. Or rename diff --git a/src/runtime/x86-bsd-os.h b/src/runtime/x86-bsd-os.h index 406cf57..dbd601f 100644 --- a/src/runtime/x86-bsd-os.h +++ b/src/runtime/x86-bsd-os.h @@ -28,6 +28,9 @@ static inline os_context_t *arch_os_get_context(void **void_context) #endif #if defined LISP_FEATURE_FREEBSD +#if defined(LISP_FEATURE_RESTORE_TLS_SEGMENT_REGISTER_FROM_CONTEXT) +void os_restore_tls_segment_register(os_context_t *context); +#endif #define RESTORE_FP_CONTROL_FROM_CONTEXT void os_restore_fp_control(os_context_t *context); #endif diff --git a/tools-for-build/grovel-headers.c b/tools-for-build/grovel-headers.c index 554ff33..c5de8e8 100644 --- a/tools-for-build/grovel-headers.c +++ b/tools-for-build/grovel-headers.c @@ -19,11 +19,11 @@ */ #include +#include #include #ifdef _WIN32 #define WIN32_LEAN_AND_MEAN #include - #include #include #else #include @@ -336,8 +336,8 @@ main(int argc, char *argv[]) printf("\n"); printf(";;; signals\n"); - defconstant("sig-dfl", SIG_DFL); - defconstant("sig-ign", SIG_IGN); + defconstant("sig-dfl", (unsigned long)SIG_DFL); + defconstant("sig-ign", (unsigned long)SIG_IGN); defsignal("sigalrm", SIGALRM); defsignal("sigbus", SIGBUS); diff --git a/version.lisp-expr b/version.lisp-expr index 73401d5..0701a42 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.10" +"1.0.10.1" -- 1.7.10.4