Fixed various warnings to allow compiling ECL with CLang

This commit is contained in:
Juan Jose Garcia Ripoll 2011-01-23 16:06:47 +01:00
parent a8cd321f53
commit a86bbd3605
19 changed files with 43 additions and 32 deletions

View file

@ -48,6 +48,7 @@ static void ecl_mark_env(struct cl_env_struct *env);
static int cl_object_kind, cl_object_mark_proc_index;
static void **cl_object_free_list;
# endif
extern void GC_init_explicit_typing(void);
# endif
#endif
@ -775,7 +776,7 @@ init_alloc(void)
# else
# ifdef GBC_BOEHM_OWN_MARKER
cl_object_free_list = (void **)GC_new_free_list_inner();
cl_object_mark_proc_index = GC_new_proc(cl_object_mark_proc);
cl_object_mark_proc_index = GC_new_proc((GC_mark_proc)cl_object_mark_proc);
cl_object_kind = GC_new_kind_inner(cl_object_free_list,
GC_MAKE_PROC(cl_object_mark_proc_index, 0),
FALSE, TRUE);

View file

@ -50,6 +50,8 @@ static const cl_object ecl_aet_name[] = {
static void check_displaced (cl_object dlist, cl_object orig, cl_index newdim);
static void FEbad_aet() ecl_attr_noreturn;
static void
FEbad_aet()
{

View file

@ -14,6 +14,7 @@
See file '../Copyright' for full details.
*/
#define ECL_INCLUDE_MATH_H
#include <string.h>
#include <ecl/ecl.h>
#include <ecl/internal.h>
@ -105,9 +106,9 @@ _ecl_big_register_normalize(cl_object x)
}
#if GMP_LIMB_BITS >= FIXNUM_BITS
static const limbs_per_fixnum = 1;
static const int limbs_per_fixnum = 1;
#else
static const limbs_per_fixnum = (FIXNUM_BITS + GMP_LIMB_BITS - 1) / GMP_LIMB_BITS;
static const int limbs_per_fixnum = (FIXNUM_BITS + GMP_LIMB_BITS - 1) / GMP_LIMB_BITS;
#endif

View file

@ -204,7 +204,7 @@ si_compiled_function_file(cl_object b)
}
}
cl_object
void
ecl_set_function_source_file_info(cl_object b, cl_object source, cl_object position)
{
cl_env_ptr the_env = ecl_process_env();

View file

@ -272,6 +272,7 @@ si_free_foreign_data(cl_object f)
}
f->foreign.size = 0;
f->foreign.data = NULL;
@(return)
}
cl_object
@ -444,6 +445,14 @@ ecl_foreign_cc_code(cl_object cc)
}
#endif
static void wrong_ffi_tag(enum ecl_ffi_tag tag) ecl_attr_noreturn;
static void
wrong_ffi_tag(enum ecl_ffi_tag tag)
{
FEerror("Invalid ecl_ffi_tag code ~D", 1, ecl_make_integer(tag));
}
cl_object
ecl_foreign_data_ref_elt(void *p, enum ecl_ffi_tag tag)
{
@ -511,6 +520,8 @@ ecl_foreign_data_ref_elt(void *p, enum ecl_ffi_tag tag)
return ecl_make_doublefloat(*(double *)p);
case ECL_FFI_VOID:
return Cnil;
default:
wrong_ffi_tag(tag);
}
}
@ -605,6 +616,8 @@ ecl_foreign_data_set_elt(void *p, enum ecl_ffi_tag tag, cl_object value)
break;
case ECL_FFI_VOID:
break;
default:
wrong_ffi_tag(tag);
}
}

View file

@ -824,10 +824,8 @@ ucs_2be_decoder(cl_object stream, cl_eformat_read_byte8 read_byte8, cl_object so
if ((buffer[0] & 0xF8) != 0xDC) {
malformed_character(stream);
}
c = ((c & 0x3FFF) << 10) + (aux & 0x3FFF) + 0x10000;
return ((c & 0x3FFF) << 10) + (aux & 0x3FFF) + 0x10000;
}
} else {
return c;
}
}
}
@ -867,10 +865,8 @@ ucs_2le_decoder(cl_object stream, cl_eformat_read_byte8 read_byte8, cl_object so
if ((buffer[1] & 0xF8) != 0xDC) {
malformed_character(stream);
}
c = ((c & 0x3FFF) << 10) + (aux & 0x3FFF) + 0x10000;
return ((c & 0x3FFF) << 10) + (aux & 0x3FFF) + 0x10000;
}
} else {
return c;
}
}
}
@ -4563,6 +4559,7 @@ ecl_open_stream(cl_object fn, enum ecl_smmode smm, cl_object if_exists,
case smm_input: fp = fopen(fname, OPEN_R); break;
case smm_output:
case smm_io: fp = fopen(fname, OPEN_RW); break;
default:; /* never reached */
}
x = ecl_make_stream_from_FILE(fn, fp, smm, byte_size, flags,
external_format);

View file

@ -110,7 +110,7 @@ si_generic_function_p(cl_object x)
#define RECORD_GEN(e) fix((e+2)[0])
#define RECORD_GEN_SET(e,v) ((e+2)[0]=MAKE_FIXNUM(v))
static cl_object
static void
do_clear_method_hash(struct cl_env_struct *env, cl_object target)
{
cl_object table = env->method_hash;
@ -182,6 +182,7 @@ si_clear_gfun_hash(cl_object what)
#else
do_clear_method_hash(&cl_env, what);
#endif
return0();
}
static cl_index

View file

@ -541,7 +541,7 @@ ecl_interpret(cl_object frame, cl_object env, cl_object bytecodes)
Pops a singe value pushed by a OP_PUSH* operator, ignoring it.
*/
CASE(OP_POP1); {
ECL_STACK_POP_UNSAFE(the_env);
(void)ECL_STACK_POP_UNSAFE(the_env);
THREAD_NEXT;
}
/* OP_POPREQ
@ -1155,7 +1155,7 @@ ecl_interpret(cl_object frame, cl_object env, cl_object bytecodes)
CASE(OP_PROTECT_NORMAL); {
ecl_bds_unwind(the_env, the_env->frs_top->frs_bds_top_index);
ecl_frs_pop(the_env);
ECL_STACK_POP_UNSAFE(the_env);
(void)ECL_STACK_POP_UNSAFE(the_env);
lex_env = ECL_STACK_POP_UNSAFE(the_env);
ECL_STACK_PUSH(the_env, MAKE_FIXNUM(1));
goto PUSH_VALUES;

View file

@ -41,7 +41,7 @@ si_load_binary(cl_object filename, cl_object verbose, cl_object print, cl_object
/* Fist try to call "init_CODE()" */
init_prefix = _ecl_library_default_entry();
block->cblock.entry =
ecl_library_symbol(block, init_prefix->base_string.self, 0);
ecl_library_symbol(block, (char *)init_prefix->base_string.self, 0);
if (block->cblock.entry != NULL)
goto GO_ON;

View file

@ -270,7 +270,7 @@ read_char_database()
si_get_library_pathname(),
make_constant_base_string("ucd.dat"));
cl_object output = Cnil;
FILE *f = fopen(s->base_string.self, "rb");
FILE *f = fopen((char *)s->base_string.self, "rb");
if (f) {
cl_index size, read;
if (!fseek(f, 0, SEEK_END)) {

View file

@ -15,6 +15,7 @@
See file '../Copyright' for full details.
*/
#include <string.h>
#define ECL_INCLUDE_MATH_H
#include <ecl/ecl.h>

View file

@ -49,7 +49,7 @@ static cl_object
push_base_string(cl_object buffer, cl_object s)
{
buffer = _ecl_ensure_buffer(buffer, s->base_string.fillp);
_ecl_string_push_c_string(buffer, s->base_string.self);
_ecl_string_push_c_string(buffer, (char *)s->base_string.self);
return buffer;
}
@ -57,7 +57,7 @@ push_base_string(cl_object buffer, cl_object s)
* FREE FORMAT (FIXED OR EXPONENT) OF FLOATS
*/
static cl_object
static void
print_float_exponent(cl_object buffer, cl_object number, cl_fixnum exp)
{
cl_object r = ecl_symbol_value(@'*read-default-float-format*');

View file

@ -2238,7 +2238,7 @@ read_VV(cl_object block, void (*entry_point)(cl_object))
}
#else
in=ecl_make_string_input_stream
(ecl_make_simple_base_string(block->cblock.data_text,
(ecl_make_simple_base_string((char *)block->cblock.data_text,
block->cblock.data_text_size),
0, block->cblock.data_text_size);
progv_list = ECL_SYM_VAL(env, @'si::+ecl-syntax-progv-list+');

View file

@ -22,12 +22,6 @@ exponent_charp(cl_fixnum c)
(c == 'l') || (c == 'L');
}
static cl_object
read_exponent(cl_object str, cl_index start, cl_index end, cl_index *ep)
{
}
static cl_object
expt10(cl_index expt)
{

View file

@ -245,7 +245,7 @@ create_server_port(int port)
fclose(fp);
}
#else
if ((conn = accept(request, (struct sockaddr *)NULL, (int *)NULL)) < 0)
if ((conn = accept(request, (struct sockaddr *)NULL, NULL)) < 0)
FElibc_error("Accepting requests", 0);
#endif /* THREADS */

View file

@ -333,18 +333,19 @@ mp_break_suspend_loop()
if (frs_sch(@'mp::suspend-loop')) {
cl_throw(@'mp::suspend-loop');
}
@(return)
}
cl_object
mp_process_suspend(cl_object process)
{
mp_interrupt_process(process, @'mp::suspend-loop');
return mp_interrupt_process(process, @'mp::suspend-loop');
}
cl_object
mp_process_resume(cl_object process)
{
mp_interrupt_process(process, @'mp::break-suspend-loop');
return mp_interrupt_process(process, @'mp::break-suspend-loop');
}
cl_object

View file

@ -54,11 +54,11 @@ safe_chdir(const char *path, cl_object prefix)
if (prefix != Cnil) {
cl_object aux = make_constant_base_string(path);
aux = si_base_string_concatenate(2, prefix, aux);
return safe_chdir(aux->base_string.self, Cnil);
return safe_chdir((char *)aux->base_string.self, Cnil);
} else {
int output;
ecl_disable_interrupts();
output = chdir(path);
output = chdir((char *)path);
ecl_enable_interrupts();
return output;
}

View file

@ -124,7 +124,7 @@ from_list_to_execve_argument(cl_object l, char ***environp)
" changed during execution.", 0);
break;
}
environ[j++] = buffer->base_string.self + i;
environ[j++] = (char*)(buffer->base_string.self + i);
memcpy(buffer->base_string.self + i,
s->base_string.self,
l);

View file

@ -421,7 +421,7 @@ extern ECL_API void ecl_def_c_function(cl_object sym, cl_objectfn_fixed c_functi
extern ECL_API void ecl_def_c_macro(cl_object sym, cl_objectfn_fixed c_function, int narg);
extern ECL_API void ecl_def_c_macro_va(cl_object sym, cl_objectfn c_function);
extern ECL_API void ecl_def_c_function_va(cl_object sym, cl_objectfn c_function);
extern ECL_API cl_object ecl_set_function_source_file_info(cl_object fun, cl_object source, cl_object position);
extern ECL_API void ecl_set_function_source_file_info(cl_object fun, cl_object source, cl_object position);
extern ECL_API void ecl_cmp_defmacro(cl_object data);
extern ECL_API void ecl_cmp_defun(cl_object data);
@ -944,7 +944,7 @@ extern ECL_API cl_object si_setenv(cl_object var, cl_object value);
extern ECL_API cl_object si_environ(void);
extern ECL_API cl_object si_pointer(cl_object x);
extern ECL_API cl_object si_quit _ARGS((cl_narg narg, ...)) /*ecl_attr_noreturn*/;
extern ECL_API cl_object si_exit _ARGS((cl_narg narg, ...)) /*ecl_attr_noreturn*/;
extern ECL_API cl_object si_exit _ARGS((cl_narg narg, ...)) ecl_attr_noreturn;
typedef enum {
ECL_OPT_INCREMENTAL_GC = 0,