Commit c6b4296b authored by Marius Gerbershagen's avatar Marius Gerbershagen
Browse files

cosmetic: fix some compiler warnings

parent bae7d696
......@@ -81,7 +81,7 @@
(defun bc-compile-file-pathname (name &key (output-file name) (type :fasl)
verbose print c-file h-file data-file
shared-data-file system-p load external-format)
(declare (ignore load c-file h-file data-file shared-data-file system-p verbose print))
(declare (ignore load c-file h-file data-file shared-data-file system-p verbose print external-format))
(let ((extension "fasc"))
(case type
((:fasl :fas) (setf extension "fasc"))
......
......@@ -191,11 +191,13 @@ static struct ecl_type_information {
size_t t;
} type_info[t_end];
#ifdef GBC_BOEHM_PRECISE
static void
error_wrong_tag(cl_type t)
{
ecl_internal_error("Collector called with invalid tag number.");
}
#endif
cl_index
ecl_object_byte_size(cl_type t)
......@@ -764,6 +766,7 @@ extern void (*GC_push_other_roots)();
static void (*old_GC_push_other_roots)();
static void stacks_scanner();
#ifdef GBC_BOEHM_PRECISE
static cl_index
to_bitmap(void *x, void *y)
{
......@@ -773,6 +776,7 @@ to_bitmap(void *x, void *y)
n /= sizeof(void*);
return 1 << n;
}
#endif
void
init_alloc(void)
......
......@@ -36,6 +36,7 @@ empty_cache(ecl_cache_ptr cache)
#endif
}
#ifndef ECL_THREADS
static void
clear_one_from_cache(ecl_cache_ptr cache, cl_object target)
{
......@@ -51,8 +52,7 @@ clear_one_from_cache(ecl_cache_ptr cache, cl_object target)
}
}
}
#ifdef ECL_THREADS
#else
static void
clear_list_from_cache(ecl_cache_ptr cache)
{
......
......@@ -847,7 +847,7 @@ c_block(cl_env_ptr env, cl_object body, int old_flags) {
struct cl_compiler_env old_env;
cl_object name = pop(&body);
cl_object block_record;
cl_index labelz, pc, loc, constants;
cl_index labelz, pc, constants;
int flags;
if (!ECL_SYMBOLP(name))
......@@ -858,7 +858,7 @@ c_block(cl_env_ptr env, cl_object body, int old_flags) {
pc = current_pc(env);
flags = maybe_values_or_reg0(old_flags);
loc = c_register_block(env, name);
c_register_block(env, name);
block_record = ECL_CONS_CAR(env->c_env->variables);
if (Null(name)) {
asm_op(env, OP_DO);
......@@ -1063,7 +1063,7 @@ c_case(cl_env_ptr env, cl_object clause, int flags) {
static int
c_catch(cl_env_ptr env, cl_object args, int flags) {
cl_index labelz, loc;
cl_index labelz;
cl_object old_env;
/* Compile evaluation of tag */
......@@ -1071,7 +1071,7 @@ c_catch(cl_env_ptr env, cl_object args, int flags) {
/* Compile binding of tag */
old_env = env->c_env->variables;
loc = c_register_block(env, ecl_make_fixnum(0));
c_register_block(env, ecl_make_fixnum(0));
asm_op(env, OP_CATCH);
/* Compile jump point */
......@@ -3039,7 +3039,7 @@ c_default(cl_env_ptr env, cl_object var, cl_object stmt, cl_object flag, cl_obje
cl_object
ecl_make_lambda(cl_env_ptr env, cl_object name, cl_object lambda) {
cl_object reqs, opts, rest, key, keys, auxs, allow_other_keys;
cl_object specials, doc, decl, body, output;
cl_object specials, decl, body, output;
cl_index handle;
struct cl_compiler_env *old_c_env, new_c_env;
......@@ -3057,7 +3057,7 @@ ecl_make_lambda(cl_env_ptr env, cl_object name, cl_object lambda) {
keys = env->values[4];
allow_other_keys = env->values[5];
auxs = env->values[6];
doc = env->values[7];
/* doc = env->values[7]; unused */;
specials = env->values[8];
decl = env->values[9];
body = env->values[10];
......
......@@ -53,13 +53,11 @@ print_oparg_arg(const char *s, cl_fixnum n, cl_object x) {
static void
disassemble_lambda(cl_object bytecodes) {
const cl_env_ptr env = ecl_process_env();
cl_object *data;
cl_opcode *vector;
ecl_bds_bind(env, @'*print-pretty*', ECL_NIL);
/* Print required arguments */
data = bytecodes->bytecodes.data->vector.self.t;
cl_print(1,bytecodes->bytecodes.data);
/* Name of LAMBDA */
......
......@@ -53,7 +53,7 @@
@':element-type', element_type,
@':if-exists', if_exists,
@':if-does-not-exist', if_does_not_exist,
@':external-format', @':default',
@':external-format', external_format,
@':cstream', ECL_NIL);
fd = ecl_to_int(si_file_stream_fd(stream));
if (Null(length))
......
......@@ -314,7 +314,6 @@ ecl_interpret(cl_object frame, cl_object env, cl_object bytecodes)
frame_aux.stack = frame_aux.base = 0;
frame_aux.size = 0;
frame_aux.env = the_env;
BEGIN:
BEGIN_SWITCH {
CASE(OP_NOP); {
reg0 = ECL_NIL;
......
......@@ -611,7 +611,7 @@ si_complex_float(cl_object r, cl_object i)
{
cl_type tr = ecl_t_of(r);
cl_type ti = ecl_t_of(i);
cl_object result;
cl_object result = OBJNULL;
switch (tr) {
case t_singlefloat:
if (ti != tr) { ecl_type_error(@'si::complex-float',"imag part", i, @'single-float'); }
......
......@@ -36,7 +36,6 @@
int
ecl_number_equalp(cl_object x, cl_object y)
{
double dx;
/* INV: (= fixnum bignum) => 0 */
/* INV: (= fixnum ratio) => 0 */
/* INV: (= bignum ratio) => 0 */
......
......@@ -659,7 +659,9 @@ ecl_parse_namestring(cl_object s, cl_index start, cl_index end, cl_index *ep,
if (!ecl_stringp(device)) {
return ECL_NIL;
}
#if defined(ECL_MS_WINDOWS_HOST)
maybe_parse_host:
#endif
/* Files have no effective device. */
if (@string-equal(2, device, @':file') == ECL_T)
device = ECL_NIL;
......
......@@ -161,10 +161,8 @@ generate(cl_object digits, float_approx *approx)
static void
change_precision(float_approx *approx, cl_object position, cl_object relativep)
{
cl_fixnum pos;
if (Null(position))
return;
pos = ecl_fixnum(position);
if (!Null(relativep)) {
cl_object k = ecl_make_fixnum(0);
cl_object l = ecl_make_fixnum(1);
......
......@@ -102,13 +102,15 @@ needs_to_be_escaped(cl_object s, cl_object readtable, cl_object print_case)
return 0;
}
#define buffer_write_char(c, buffer, stream, buffer_ndx, buffer_size) \
ecl_char_set(buffer, buffer_ndx++, c); \
if (buffer_ndx >= buffer_size) { \
si_fill_pointer_set(buffer, ecl_make_fixnum(buffer_size)); \
si_do_write_sequence(buffer, stream, ecl_make_fixnum(0), ECL_NIL);\
buffer_ndx = 0; \
static inline void
buffer_write_char(char c, cl_object buffer, cl_object stream, cl_index *buffer_ndx, cl_index buffer_size) {
ecl_char_set(buffer, (*buffer_ndx)++, c);
if (*buffer_ndx >= buffer_size) {
si_fill_pointer_set(buffer, ecl_make_fixnum(buffer_size));
si_do_write_sequence(buffer, stream, ecl_make_fixnum(0), ECL_NIL);
*buffer_ndx = 0;
}
}
static void
write_symbol_string(cl_object s, int action, cl_object print_case,
......@@ -124,13 +126,13 @@ write_symbol_string(cl_object s, int action, cl_object print_case,
cl_index buffer_size = ecl_fixnum(cl_array_total_size(buffer));
cl_index buffer_ndx = 0;
if (escape)
buffer_write_char('|', buffer, stream, buffer_ndx, buffer_size);
buffer_write_char('|', buffer, stream, &buffer_ndx, buffer_size);
capitalize = 1;
for (i = 0; i < s->base_string.fillp; i++) {
ecl_character c = ecl_char(s, i);
if (escape) {
if (c == '|' || c == '\\') {
buffer_write_char('\\', buffer, stream, buffer_ndx, buffer_size);
buffer_write_char('\\', buffer, stream, &buffer_ndx, buffer_size);
}
} else if (action != ecl_case_preserve) {
if (ecl_upper_case_p(c)) {
......@@ -155,10 +157,10 @@ write_symbol_string(cl_object s, int action, cl_object print_case,
capitalize = !ecl_alphanumericp(c);
}
}
buffer_write_char(c, buffer, stream, buffer_ndx, buffer_size);
buffer_write_char(c, buffer, stream, &buffer_ndx, buffer_size);
}
if (escape)
buffer_write_char('|', buffer, stream, buffer_ndx, buffer_size);
buffer_write_char('|', buffer, stream, &buffer_ndx, buffer_size);
si_fill_pointer_set(buffer, ecl_make_fixnum(buffer_ndx));
si_do_write_sequence(buffer, stream, ecl_make_fixnum(0), ECL_NIL);
si_put_buffer_string(buffer);
......
......@@ -120,7 +120,7 @@ write_float(cl_object f, cl_object stream)
static void /* XXX: do not cons new floats here! */
write_complex_float(cl_object f, cl_object stream)
{
cl_object real, imag;
cl_object real = OBJNULL, imag = OBJNULL;
switch (ecl_t_of(f)) {
case t_csfloat:
real = ecl_make_single_float(crealf(ecl_csfloat(f)));
......
......@@ -189,7 +189,7 @@ ecl_copy_seq(cl_object sequence)
return ecl_subseq(sequence, 0, MOST_POSITIVE_FIXNUM);
}
@(defun subseq (sequence start &optional end &aux x)
@(defun subseq (sequence start &optional end)
cl_index_pair p;
@
p = ecl_sequence_start_end(@[subseq], sequence, start, end);
......
......@@ -84,6 +84,7 @@ wait_queue_delete(cl_env_ptr the_env, cl_object q, cl_object item)
* THREAD SCHEDULER & WAITING
*/
#if !defined(HAVE_SIGPROCMASK)
static cl_object
bignum_set_time(cl_object bignum, struct ecl_timeval *time)
{
......@@ -194,6 +195,7 @@ ecl_wait_on_timed(cl_env_ptr env, cl_object (*condition)(cl_env_ptr, cl_object),
ecl_bds_unwind1(the_env);
return output;
}
#endif
/**********************************************************************
* BLOCKING WAIT QUEUE ALGORITHM
......
......@@ -351,7 +351,7 @@ file_truename(cl_object pathname, cl_object filename, int flags)
* the other hand, if the link is broken – return file
* truename "as is". */
struct stat filestatus;
if (safe_stat(filename->base_string.self, &filestatus) < 0) {
if (safe_stat((char*) filename->base_string.self, &filestatus) < 0) {
@(return pathname kind);
}
filename = si_readlink(filename);
......@@ -560,7 +560,9 @@ ecl_file_len(int f)
}
#endif
}
#if defined(ECL_MS_WINDOWS_HOST)
FAILURE_CLOBBER:
#endif
ecl_enable_interrupts();
{
cl_object c_error = _ecl_strerror(errno);
......
......@@ -211,6 +211,7 @@
o))
(defun find-method-combination (gf method-combination-type-name method-combination-options)
(declare (ignore gf))
(make-method-combination method-combination-type-name
(search-method-combination method-combination-type-name)
method-combination-options
......
......@@ -181,7 +181,7 @@
(defmethod shared-initialize ((gfun standard-generic-function) slot-names
&rest initargs)
(declare (ignore initargs slot-names))
(declare (ignore slot-names))
(call-next-method)
(when (generic-function-methods gfun)
(compute-g-f-spec-list gfun))
......
......@@ -355,7 +355,7 @@
(with-early-accessors (+standard-generic-function-slots+
+eql-specializer-slots+
+standard-method-slots+)
(flet ((nupdate-spec-how-list (spec-how-list specializers gf)
(flet ((nupdate-spec-how-list (spec-how-list specializers)
;; update the spec-how of the gfun
;; computing the or of the previous value and the new one
(setf spec-how-list (or spec-how-list
......@@ -379,7 +379,7 @@
(a-p-o (generic-function-argument-precedence-order gf)))
(dolist (method (generic-function-methods gf))
(setf spec-how-list
(nupdate-spec-how-list spec-how-list (method-specializers method) gf)))
(nupdate-spec-how-list spec-how-list (method-specializers method))))
(setf (generic-function-spec-list gf)
(loop for type in spec-how-list
for i from 0
......
......@@ -102,6 +102,7 @@
(when (eq (first method-lambda) 'lambda)
(multiple-value-bind (declarations body documentation)
(si::find-declarations (cddr method-lambda))
(declare (ignore documentation))
(let (block)
(when (and (null (rest body))
(listp (setf block (first body)))
......@@ -177,6 +178,7 @@
(values method-lambda declarations documentation))))
(defun make-method-lambda (gf method method-lambda env)
(declare (ignore method gf))
(multiple-value-bind (call-next-method-p next-method-p-p in-closure-p)
(walk-method-lambda method-lambda env)
(values `(lambda (.combined-method-args. *next-methods*)
......@@ -190,6 +192,7 @@
(defun add-call-next-method-closure (method-lambda)
(multiple-value-bind (declarations real-body documentation)
(si::find-declarations (cddr method-lambda))
(declare (ignore documentation))
`(lambda ,(second method-lambda)
,@declarations
(let* ((.closed-combined-method-args.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment