From fbd3587b1af74a2c5efcdb70671ec9314802fd2e Mon Sep 17 00:00:00 2001 From: Juan Jose Garcia Ripoll Date: Wed, 11 Apr 2012 23:04:27 +0200 Subject: [PATCH] Removed further warnings about uninitialized or unused variables and functions --- src/c/array.d | 8 -------- src/c/cfun_dispatch.d | 7 ------- src/c/character.d | 28 ++++++++++++++-------------- src/c/clos/accessor.d | 7 ++++--- src/c/clos/cache.d | 1 - src/c/file.d | 7 ------- src/c/num_arith.d | 1 - src/c/num_co.d | 1 - src/c/package.d | 1 - src/c/printer/write_ugly.d | 1 - src/c/threads/barrier.d | 1 - src/c/threads/process.d | 2 ++ src/c/threads/semaphore.d | 1 - src/c/unixsys.d | 1 - src/h/external.h | 2 +- 15 files changed, 21 insertions(+), 48 deletions(-) diff --git a/src/c/array.d b/src/c/array.d index c9998ad14..7b52fd4f2 100644 --- a/src/c/array.d +++ b/src/c/array.d @@ -48,8 +48,6 @@ static const cl_object ecl_aet_name[] = { @'base-char' /* aet_bc */ }; -static void check_displaced (cl_object dlist, cl_object orig, cl_index newdim); - static void FEbad_aet() ecl_attr_noreturn; static void @@ -731,12 +729,6 @@ address_inc(void *address, cl_fixnum inc, cl_elttype elt_type) } } -static void * -array_address(cl_object x, cl_index inc) -{ - return address_inc(x->array.self.t, inc, x->array.elttype); -} - cl_object cl_array_element_type(cl_object a) { diff --git a/src/c/cfun_dispatch.d b/src/c/cfun_dispatch.d index 2494d9d55..44381e0d6 100644 --- a/src/c/cfun_dispatch.d +++ b/src/c/cfun_dispatch.d @@ -451,13 +451,6 @@ static cl_object dispatch63 (cl_narg narg, cl_object x0, cl_object x1, cl_object return fun->cfunfixed.entry_fixed(x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22, x23, x24, x25, x26, x27, x28, x29, x30, x31, x32, x33, x34, x35, x36, x37, x38, x39, x40, x41, x42, x43, x44, x45, x46, x47, x48, x49, x50, x51, x52, x53, x54, x55, x56, x57, x58, x59, x60, x61, x62); } -static cl_object dispatch64 (cl_narg narg, cl_object x0, cl_object x1, cl_object x2, cl_object x3, cl_object x4, cl_object x5, cl_object x6, cl_object x7, cl_object x8, cl_object x9, cl_object x10, cl_object x11, cl_object x12, cl_object x13, cl_object x14, cl_object x15, cl_object x16, cl_object x17, cl_object x18, cl_object x19, cl_object x20, cl_object x21, cl_object x22, cl_object x23, cl_object x24, cl_object x25, cl_object x26, cl_object x27, cl_object x28, cl_object x29, cl_object x30, cl_object x31, cl_object x32, cl_object x33, cl_object x34, cl_object x35, cl_object x36, cl_object x37, cl_object x38, cl_object x39, cl_object x40, cl_object x41, cl_object x42, cl_object x43, cl_object x44, cl_object x45, cl_object x46, cl_object x47, cl_object x48, cl_object x49, cl_object x50, cl_object x51, cl_object x52, cl_object x53, cl_object x54, cl_object x55, cl_object x56, cl_object x57, cl_object x58, cl_object x59, cl_object x60, cl_object x61, cl_object x62, cl_object x63) { - const cl_env_ptr the_env = ecl_process_env(); - cl_object fun = the_env->function; - if (ecl_unlikely(narg != 64)) FEwrong_num_arguments(fun); - return fun->cfunfixed.entry_fixed(x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22, x23, x24, x25, x26, x27, x28, x29, x30, x31, x32, x33, x34, x35, x36, x37, x38, x39, x40, x41, x42, x43, x44, x45, x46, x47, x48, x49, x50, x51, x52, x53, x54, x55, x56, x57, x58, x59, x60, x61, x62, x63); -} - static cl_objectfn dispatch_table[64] = { (cl_objectfn)dispatch0, (cl_objectfn)dispatch1, diff --git a/src/c/character.d b/src/c/character.d index a01a348b9..9716d6108 100644 --- a/src/c/character.d +++ b/src/c/character.d @@ -200,7 +200,7 @@ ecl_char_eq(cl_object x, cl_object y) @) static cl_object -Lchar_cmp(cl_narg narg, int s, int t, cl_va_list args) +Lchar_cmp(cl_env_ptr env, cl_narg narg, int s, int t, cl_va_list args) { cl_object c, d; @@ -210,9 +210,9 @@ Lchar_cmp(cl_narg narg, int s, int t, cl_va_list args) for (; --narg; c = d) { d = cl_va_arg(args); if (s*ecl_char_cmp(d, c) < t) - @(return Cnil) + ecl_return1(env, Cnil); } - @(return Ct) + ecl_return1(env, Ct); } int @@ -226,22 +226,22 @@ ecl_char_cmp(cl_object x, cl_object y) @(defun char< (&rest args) @ - return Lchar_cmp(narg, 1, 1, args); + return Lchar_cmp(the_env, narg, 1, 1, args); @) @(defun char> (&rest args) @ - return Lchar_cmp(narg,-1, 1, args); + return Lchar_cmp(the_env, narg,-1, 1, args); @) @(defun char<= (&rest args) @ - return Lchar_cmp(narg, 1, 0, args); + return Lchar_cmp(the_env, narg, 1, 0, args); @) @(defun char>= (&rest args) @ - return Lchar_cmp(narg,-1, 0, args); + return Lchar_cmp(the_env, narg,-1, 0, args); @) @(defun char_equal (c &rest cs) @@ -283,7 +283,7 @@ ecl_char_equal(cl_object x, cl_object y) @) static cl_object -Lchar_compare(cl_narg narg, int s, int t, cl_va_list args) +Lchar_compare(cl_env_ptr env, cl_narg narg, int s, int t, cl_va_list args) { cl_object c, d; @@ -294,9 +294,9 @@ Lchar_compare(cl_narg narg, int s, int t, cl_va_list args) for (; --narg; c = d) { d = cl_va_arg(args); if (s*ecl_char_compare(d, c) < t) - @(return Cnil) + ecl_return1(env, Cnil); } - @(return Ct) + ecl_return1(env, Ct); } int @@ -315,22 +315,22 @@ ecl_char_compare(cl_object x, cl_object y) @(defun char-lessp (&rest args) @ - return Lchar_compare(narg, 1, 1, args); + return Lchar_compare(the_env, narg, 1, 1, args); @) @(defun char-greaterp (&rest args) @ - return Lchar_compare(narg,-1, 1, args); + return Lchar_compare(the_env, narg,-1, 1, args); @) @(defun char-not-greaterp (&rest args) @ - return Lchar_compare(narg, 1, 0, args); + return Lchar_compare(the_env, narg, 1, 0, args); @) @(defun char-not-lessp (&rest args) @ - return Lchar_compare(narg,-1, 0, args); + return Lchar_compare(the_env, narg,-1, 0, args); @) diff --git a/src/c/clos/accessor.d b/src/c/clos/accessor.d index 08d75df39..e3320a29e 100644 --- a/src/c/clos/accessor.d +++ b/src/c/clos/accessor.d @@ -69,7 +69,7 @@ static ecl_cache_record_ptr search_slot_index(const cl_env_ptr env, cl_object gfun, cl_object instance) { ecl_cache_ptr cache = env->slot_cache; - cl_object vector = fill_spec_vector(cache->keys, gfun, instance); + fill_spec_vector(cache->keys, gfun, instance); return ecl_search_cache(cache); } @@ -85,9 +85,10 @@ add_new_index(const cl_env_ptr env, cl_object gfun, cl_object instance, cl_objec return 0; } { + ecl_cache_record_ptr e; ecl_cache_ptr cache = env->slot_cache; - cl_object vector = fill_spec_vector(cache->keys, gfun, instance); - ecl_cache_record_ptr e = ecl_search_cache(cache); + fill_spec_vector(cache->keys, gfun, instance); + e = ecl_search_cache(cache); e->key = cl_copy_seq(cache->keys); e->value = index; return e; diff --git a/src/c/clos/cache.d b/src/c/clos/cache.d index 4c0387acc..511d8b0d3 100644 --- a/src/c/clos/cache.d +++ b/src/c/clos/cache.d @@ -78,7 +78,6 @@ ecl_cache_ptr ecl_make_cache(cl_index key_size, cl_index cache_size) { ecl_cache_ptr cache = ecl_alloc(sizeof(struct ecl_cache)); - cl_object table; cache->keys = si_make_vector(Ct, /* element type */ MAKE_FIXNUM(key_size), /* Maximum size */ diff --git a/src/c/file.d b/src/c/file.d index 84a15e498..a4917184c 100755 --- a/src/c/file.d +++ b/src/c/file.d @@ -5298,13 +5298,6 @@ io_error(cl_object strm) 1, strm); } -static void -character_size_overflow(cl_object strm, ecl_character c) -{ - FEerror("Tried to write a character ~S in a ~A stream.", 2, - CODE_CHAR(c), cl_stream_external_format(strm)); -} - static void wrong_file_handler(cl_object strm) { diff --git a/src/c/num_arith.d b/src/c/num_arith.d index e93a0b266..b64065623 100644 --- a/src/c/num_arith.d +++ b/src/c/num_arith.d @@ -67,7 +67,6 @@ ecl_integer_divide(cl_object x, cl_object y) cl_object ecl_gcd(cl_object x, cl_object y) { - cl_object gcd; ECL_WITH_TEMP_BIGNUM(x_big,1); ECL_WITH_TEMP_BIGNUM(y_big,1); diff --git a/src/c/num_co.d b/src/c/num_co.d index 072d2cf4c..25f1646f0 100644 --- a/src/c/num_co.d +++ b/src/c/num_co.d @@ -768,7 +768,6 @@ cl_decode_float(cl_object x) switch (tx) { case t_singlefloat: { f = sf(x); - FLOAT: if (f >= 0.0) { s = 1; } else { diff --git a/src/c/package.d b/src/c/package.d index 44ddda824..f62e11ae1 100644 --- a/src/c/package.d +++ b/src/c/package.d @@ -527,7 +527,6 @@ potential_export_conflict(cl_object name, cl_object s, cl_object p) void cl_export2(cl_object s, cl_object p) { - cl_object x; int intern_flag, error; cl_object other_p, name = ecl_symbol_name(s); p = si_coerce_to_package(p); diff --git a/src/c/printer/write_ugly.d b/src/c/printer/write_ugly.d index 357134165..cb312c002 100644 --- a/src/c/printer/write_ugly.d +++ b/src/c/printer/write_ugly.d @@ -474,7 +474,6 @@ static printer dispatch[FREE+1] = { cl_object si_write_ugly_object(cl_object x, cl_object stream) { - int t; if (x == OBJNULL) { if (ecl_print_readably()) FEprint_not_readable(x); diff --git a/src/c/threads/barrier.d b/src/c/threads/barrier.d index 68a43f9a5..cf6174e43 100644 --- a/src/c/threads/barrier.d +++ b/src/c/threads/barrier.d @@ -103,7 +103,6 @@ mp_barrier_arrivers_count(cl_object barrier) static cl_object barrier_wait_condition(cl_env_ptr env, cl_object barrier) { - cl_object output; /* We were signaled */ if (env->own_process->process.waiting_for != barrier) return Ct; diff --git a/src/c/threads/process.d b/src/c/threads/process.d index 4bbb0c804..197384571 100644 --- a/src/c/threads/process.d +++ b/src/c/threads/process.d @@ -200,6 +200,7 @@ thread_cleanup(void *aux) /* No signals from here on */ { sigset_t new[1]; + sigemptyset(new); sigaddset(new, ecl_option_values[ECL_OPT_SIGNAL_HANDLING_THREAD]); pthread_sigmask(SIG_BLOCK, new, NULL); } @@ -548,6 +549,7 @@ mp_exit_process(void) */ const cl_env_ptr the_env = ecl_process_env(); ecl_unwind(the_env, the_env->frs_org); + /* Never reached */ } cl_object diff --git a/src/c/threads/semaphore.d b/src/c/threads/semaphore.d index 65a066089..848754bf0 100644 --- a/src/c/threads/semaphore.d +++ b/src/c/threads/semaphore.d @@ -80,7 +80,6 @@ mp_semaphore_wait_count(cl_object semaphore) { cl_fixnum n = fixnnint(count); cl_env_ptr env = ecl_process_env(); - cl_object own_process = env->own_process; unlikely_if (type_of(semaphore) != t_semaphore) { FEerror_not_a_semaphore(semaphore); } diff --git a/src/c/unixsys.d b/src/c/unixsys.d index ff67983b7..955d33318 100755 --- a/src/c/unixsys.d +++ b/src/c/unixsys.d @@ -384,7 +384,6 @@ make_windows_handle(HANDLE h) cl_object stream_write; cl_object stream_read; cl_object exit_status = Cnil; - cl_object external_process; @ command = si_copy_to_simple_base_string(command); argv = cl_mapcar(2, @'si::copy-to-simple-base-string', argv); diff --git a/src/h/external.h b/src/h/external.h index d30557a52..ae08a0691 100755 --- a/src/h/external.h +++ b/src/h/external.h @@ -1701,7 +1701,7 @@ extern ECL_API void ecl_tcp_close_all(void); #ifdef ECL_THREADS extern ECL_API cl_object mp_own_process(void) __attribute__((const)); extern ECL_API cl_object mp_all_processes(void); -extern ECL_API cl_object mp_exit_process(void) /*ecl_attr_noreturn*/; +extern ECL_API cl_object mp_exit_process(void) ecl_attr_noreturn; extern ECL_API cl_object mp_interrupt_process(cl_object process, cl_object function); extern ECL_API cl_object mp_make_process _ARGS((cl_narg narg, ...)); extern ECL_API cl_object mp_process_active_p(cl_object process);