* Fixed all compilation warnings in the base code.

git-svn-id: svn://svn.zoy.org/elk/trunk@41 55e467fa-43c5-0310-a8a2-de718669efc6
This commit is contained in:
sam 2003-08-25 15:01:22 +00:00
parent c0f08629cc
commit fd9e7337f5
8 changed files with 43 additions and 68 deletions

View File

@ -249,6 +249,9 @@ fi
# generational_gc is set to "no" in the site file. Set mprotect=mmap if
# mprotect is supported, but only for mmap()ed memory.
AC_CHECK_FUNCS(mprotect)
if false; then
AC_DEFINE(MPROTECT_SIG, 1, [FIXME HARD])
fi
if false; then
AC_DEFINE(MPROTECT_MMAP, 1, [FIXME HARD])
fi

View File

@ -10,10 +10,10 @@ typedef struct {
int tag;
} Object;
#define FIXBITS (8 * sizeof(int))
#define FIXBITS (8 * (int)sizeof(int))
#define SIGNBIT ((unsigned)1 << (FIXBITS-1))
#define CONSTBIT 1
#define TYPEBITS (8 * sizeof(int) - 1)
#define TYPEBITS (8 * (int)sizeof(int) - 1)
#define MAX_TYPE ((1 << TYPEBITS) - 1)
#define UFIXNUM_FITS(i) (((i) & SIGNBIT) == 0)
@ -41,8 +41,8 @@ typedef struct {
#ifdef GENERATIONAL_GC
typedef int gcspace_t; /* type for space and type arrays */
typedef unsigned long int gcptr_t; /* type for pointers */
typedef unsigned long int pageno_t; /* type for page numbers */
typedef ptrdiff_t gcptr_t; /* type for pointers */
typedef long int pageno_t; /* type for page numbers */
typedef ptrdiff_t addrarith_t; /* type for address arithmetic */
extern gcspace_t *space;

View File

@ -77,19 +77,15 @@ void Init_Dump () {
return False;\
}
#ifdef ELF
#if defined(ELF)
# include "dump-elf.c"
#else
#ifdef ECOFF
#elif defined(ECOFF)
# include "dump-ecoff.c"
#else
#ifdef HP9K
#elif defined(HP9K)
# include "dump-hp9k.c"
#else
# include "dump-vanilla.c"
#endif
#endif
#endif
/*ARGSUSED1*/
void Set_File_Executable (int fd, char *fn) {

View File

@ -12,13 +12,10 @@
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#ifdef HAVE_MPROTECT
#if defined(MPROTECT_SIG) || defined(MPROTECT_MMAP)
# include <sys/mman.h>
#endif
#ifdef HAVE_GETPAGESIZE
# define SC_PAGESIZE_IN_UNISTD_H
#endif
#ifdef SC_PAGESIZE_IN_UNISTD_H
#if defined(HAVE_GETPAGESIZE) || defined(SC_PAGESIZE_IN_UNISTD_H)
# define link FOO
# include <unistd.h>
# undef link
@ -135,8 +132,8 @@ static void TerminateGC ();
/* PAGEBYTES is defined in object.h */
#define PAGEWORDS (PAGEBYTES / sizeof (Object))
#define HEAPPAGEMASK ~(PAGEBYTES-1)
#define PAGEWORDS ((addrarith_t)(PAGEBYTES / sizeof (Object)))
#define HEAPPAGEMASK ~((gcptr_t)PAGEBYTES-1)
#ifdef ALIGN_8BYTE
# define MAX_OBJECTWORDS (PAGEWORDS - 1)
@ -191,7 +188,7 @@ static void TerminateGC ();
#define SET_PROTECT(addr) { PMAP (addr) = 1; protected_pages++; }
#define SET_UNPROTECT(addr) { PMAP (addr) = 0; protected_pages--; }
#ifdef HAVE_MPROTECT
#if defined(MPROTECT_SIG) || defined(MPROTECT_MMAP)
# ifndef PROT_RW
# define PROT_RW (PROT_READ | PROT_WRITE)
# endif
@ -463,7 +460,7 @@ void Make_Heap (int size) {
Object heap_obj;
pageno_t i;
#ifdef HAVE_MPROTECT
#if defined(MPROTECT_SIG) || defined(MPROTECT_MMAP)
InstallHandler ();
#endif
@ -472,19 +469,15 @@ void Make_Heap (int size) {
* then calculate the resulting number of heap pages.
*/
#ifdef SC_PAGESIZE_IN_UNISTD_H
#if defined(SC_PAGESIZE_IN_UNISTD_H)
if ((bytes_per_pp = sysconf (_SC_PAGESIZE)) == -1)
Fatal_Error ("sysconf(_SC_PAGESIZE) failed; can't get pagesize");
#else
#ifdef HAVE_GETPAGESIZE
#elif defined(HAVE_GETPAGESIZE)
bytes_per_pp = getpagesize ();
#elif defined(MPROTECT_SIG) || defined(MPROTECT_MMAP)
# error "mprotect requires getpagesize or sysconf_pagesize"
#else
# ifdef HAVE_MPROTECT
# include "mprotect requires getpagesize or sysconf_pagesize"
# else
bytes_per_pp = 4096;
# endif
#endif
bytes_per_pp = 4096;
#endif
physical_pages = (heapsize+bytes_per_pp-1)/bytes_per_pp;
hp_per_pp = bytes_per_pp / PAGEBYTES;
@ -1290,7 +1283,7 @@ static int Scanner (pageno_t npages) {
return (scanned);
}
#ifdef HAVE_MPROTECT
#if defined(MPROTECT_SIG) || defined(MPROTECT_MMAP)
/* the following function handles a page fault. If the fault was caused
* by the mutator and incremental collection is enabled, this will result
* in scanning the physical page the fault occured on.
@ -1633,7 +1626,7 @@ void Generational_GC_Finalize () {
}
void Generational_GC_Reinitialize () {
#ifdef HAVE_MPROTECT
#if defined(MPROTECT_SIG) || defined(MPROTECT_MMAP)
InstallHandler ();
#endif
}
@ -1641,7 +1634,7 @@ void Generational_GC_Reinitialize () {
Object Internal_GC_Status (int strat, int flags) {
Object list;
#ifdef HAVE_MPROTECT
#if defined(MPROTECT_SIG) || defined(MPROTECT_MMAP)
Object cell;
#endif
GC_Node;
@ -1650,7 +1643,7 @@ Object Internal_GC_Status (int strat, int flags) {
GC_Link (list);
switch (strat) {
default: /* query or stop-and-copy */
#ifdef HAVE_MPROTECT
#if defined(MPROTECT_SIG) || defined(MPROTECT_MMAP)
if (inc_collection) {
cell = Cons (Sym_Incremental_GC, Null);
(void)P_Set_Cdr (list, cell);
@ -1659,7 +1652,7 @@ Object Internal_GC_Status (int strat, int flags) {
break;
case GC_STRAT_GEN:
if (flags == GC_FLAGS_INCR) {
#ifdef HAVE_MPROTECT
#if defined(MPROTECT_SIG) || defined(MPROTECT_MMAP)
inc_collection = 1;
cell = Cons (Sym_Incremental_GC, Null);
(void)P_Set_Cdr (list, cell);

View File

@ -17,21 +17,15 @@ void Load_Source (Object);
void Fork_Load();
#endif
#ifdef USE_LD
#if defined(USE_LD)
# include "load-ld.c"
#else
#ifdef USE_RLD
#elif defined(USE_RLD)
# include "load-rld.c"
#else
#ifdef USE_SHL
#elif defined(USE_SHL)
# include "load-shl.c"
#else
#ifdef USE_DLOPEN
#elif defined(USE_DLOPEN)
# include "load-dl.c"
#endif
#endif
#endif
#endif
void Init_Load () {
Define_Variable (&V_Load_Path, "load-path",

View File

@ -133,7 +133,7 @@ int Get_Integer (Object x) {
if (d != floor (d))
Wrong_Type (x, T_Fixnum);
(void)frexp (d, &expo);
if (expo <= 8 * sizeof(int) - 1)
if (expo <= 8 * (int)sizeof(int) - 1)
return d;
Primitive_Error ("integer out of range: ~s", x);
default:
@ -160,7 +160,7 @@ unsigned int Get_Unsigned (Object x) {
if (d != floor (d))
Wrong_Type (x, T_Fixnum);
(void)frexp (d, &expo);
if (expo <= 8 * sizeof(int))
if (expo <= 8 * (int)sizeof(int))
return d;
err:
Primitive_Error ("integer out of range: ~s", x);
@ -184,7 +184,7 @@ long int Get_Long (Object x) {
if (d != floor (d))
Wrong_Type (x, T_Fixnum);
(void)frexp (d, &expo);
if (expo <= 8 * sizeof(long) - 1)
if (expo <= 8 * (int)sizeof(long) - 1)
return d;
Primitive_Error ("integer out of range: ~s", x);
default:
@ -211,7 +211,7 @@ unsigned long int Get_Unsigned_Long (Object x) {
if (d != floor (d))
Wrong_Type (x, T_Fixnum);
(void)frexp (d, &expo);
if (expo <= 8 * sizeof(long))
if (expo <= 8 * (int)sizeof(long))
return d;
err:
Primitive_Error ("integer out of range: ~s", x);

View File

@ -490,7 +490,8 @@ void Pr_Symbol (Object port, Object sym, int raw) {
void Pr_String (Object port, Object str, int raw) {
register char *p = STRING(str)->data;
register int c, i, len = STRING(str)->size;
register int c, i;
register size_t len = STRING(str)->size;
GC_Node2;
if (raw) {

View File

@ -10,35 +10,23 @@ void Free_Symbols (SYMTAB *);
#if defined(CAN_LOAD_OBJ) || defined (INIT_OBJECTS)
#ifdef MACH_O
#if defined(MACH_O)
# include "stab-macho.c"
#else
#ifdef ELF
#elif defined(ELF)
# include "stab-elf.c"
#else
#if defined(COFF) || defined(XCOFF)
#elif defined(COFF) || defined(XCOFF)
# include "stab-coff.c"
#else
#ifdef ECOFF
#elif defined(ECOFF)
# include "stab-ecoff.c"
#else
#ifdef CONVEX_AOUT
#elif defined(CONVEX_AOUT)
# include "stab-convex.c"
#else
#if defined(hp9000s300) || defined(__hp9000s300) || defined(__hp9000s300__)
#elif defined(hp9000s300) || defined(__hp9000s300) || defined(__hp9000s300__)
# include "stab-hp9k300.c"
#else
#if defined(hp9000s800) || defined(__hp9000s800) || defined(__hp9000s800__)
#elif defined(hp9000s800) || defined(__hp9000s800) || defined(__hp9000s800__)
# include "stab-hp9k800.c"
#else
# include "stab-bsd.c"
#endif
#endif
#endif
#endif
#endif
#endif
#endif
static SYMPREFIX Ignore_Prefixes[] = {
/* Currently none */