* Fixed all signed/unsigned and undeclared function warnings.
git-svn-id: svn://svn.zoy.org/elk/trunk@158 55e467fa-43c5-0310-a8a2-de718669efc6
This commit is contained in:
+2
-1
@@ -84,7 +84,8 @@ int Eqv (Object x1, Object x2) {
|
||||
}
|
||||
|
||||
int Equal (Object x1, Object x2) {
|
||||
register int t1, t2, i;
|
||||
register int t1, t2;
|
||||
register unsigned int i;
|
||||
|
||||
again:
|
||||
if (EQ(x1, x2))
|
||||
|
||||
+1
-1
@@ -146,7 +146,7 @@ void Jump_Cont (struct S_Control *cp, Object val) {
|
||||
p = cp;
|
||||
Cont_Value = val;
|
||||
if (Stack_Grows_Down) {
|
||||
if (stkbase - &foo < p->size) Grow_Stack (cp, val);
|
||||
if (stkbase < &foo + p->size) Grow_Stack (cp, val);
|
||||
to = stkbase - p->size;
|
||||
} else {
|
||||
if (stkbase + p->size > &foo) Grow_Stack (cp, val);
|
||||
|
||||
+4
-3
@@ -43,7 +43,7 @@
|
||||
#include "kernel.h"
|
||||
|
||||
static char *heapstr[NUMSTRBUFS];
|
||||
static int heaplen[NUMSTRBUFS];
|
||||
static unsigned int heaplen[NUMSTRBUFS];
|
||||
static int nextstr;
|
||||
|
||||
void Init_Cstring() { /* Preallocate memory to avoid fragmentation */
|
||||
@@ -55,10 +55,11 @@ void Init_Cstring() { /* Preallocate memory to avoid fragmentation */
|
||||
|
||||
char *Get_String (Object str) {
|
||||
char **pp = &heapstr[nextstr];
|
||||
int len;
|
||||
unsigned int len;
|
||||
|
||||
Check_Type (str, T_String);
|
||||
if ((len = STRING(str)->size+1) > heaplen[nextstr]) {
|
||||
len = STRING(str)->size + 1;
|
||||
if (len > heaplen[nextstr]) {
|
||||
Disable_Interrupts;
|
||||
*pp = Safe_Realloc (*pp, len);
|
||||
heaplen[nextstr] = len;
|
||||
|
||||
+1
-1
@@ -48,7 +48,7 @@
|
||||
|
||||
#define copy(from,to,size) {\
|
||||
char buf[4096];\
|
||||
int len = (size), n;\
|
||||
unsigned int len = (size), n;\
|
||||
\
|
||||
while (len > 0) {\
|
||||
if ((n = read (from, buf, 4096)) == -1) {\
|
||||
|
||||
+1
-1
@@ -71,7 +71,7 @@ Object P_Provide (Object sym) {
|
||||
|
||||
static Object Feature_Filename (Object str) {
|
||||
struct S_String *sp = STRING(str);
|
||||
int len = sp->size;
|
||||
unsigned int len = sp->size;
|
||||
char *p;
|
||||
Object s;
|
||||
GC_Node;
|
||||
|
||||
+2
-2
@@ -348,7 +348,7 @@ static void DetermineCluster (gcptr_t *addr, int *len) {
|
||||
* is 0, DetermineCluster is called to set length accordingly.
|
||||
*/
|
||||
|
||||
static void ProtectCluster (gcptr_t addr, int len) {
|
||||
static void ProtectCluster (gcptr_t addr, unsigned int len) {
|
||||
if (!len) DetermineCluster (&addr, &len);
|
||||
if (len > 1) {
|
||||
while (len) {
|
||||
@@ -372,7 +372,7 @@ static void ProtectCluster (gcptr_t addr, int len) {
|
||||
}
|
||||
|
||||
|
||||
static void UnprotectCluster (gcptr_t addr, int len) {
|
||||
static void UnprotectCluster (gcptr_t addr, unsigned int len) {
|
||||
if (!len) DetermineCluster (&addr, &len);
|
||||
MPROTECT (addr, len << pp_shift, PROT_RW);
|
||||
while (len--) {
|
||||
|
||||
@@ -117,7 +117,7 @@ Object P_Output_Portp (Object x) {
|
||||
return TYPE(x) == T_Port && IS_OUTPUT(x) ? True : False;
|
||||
}
|
||||
|
||||
int Path_Max () {
|
||||
unsigned int Path_Max () {
|
||||
#if defined(PATH_MAX) /* POSIX */
|
||||
return PATH_MAX;
|
||||
#elif defined(MAXPATHLEN) /* 4.3 BSD */
|
||||
@@ -136,13 +136,14 @@ int Path_Max () {
|
||||
}
|
||||
|
||||
Object Get_File_Name (Object name) {
|
||||
register int len;
|
||||
register unsigned int len;
|
||||
|
||||
if (TYPE(name) == T_Symbol)
|
||||
name = SYMBOL(name)->name;
|
||||
else if (TYPE(name) != T_String)
|
||||
Wrong_Type_Combination (name, "string or symbol");
|
||||
if ((len = STRING(name)->size) > Path_Max () || len == 0)
|
||||
len = STRING(name)->size;
|
||||
if (len > Path_Max () || len == 0)
|
||||
Primitive_Error ("invalid file name");
|
||||
return name;
|
||||
}
|
||||
@@ -273,7 +274,7 @@ Object General_Open_File (Object name, int flags, Object path) {
|
||||
Object port, pref;
|
||||
char *buf = 0;
|
||||
register char *fn;
|
||||
register int plen, len, blen = 0, gotpath = 0;
|
||||
register unsigned int plen, len, blen = 0, gotpath = 0;
|
||||
Alloca_Begin;
|
||||
|
||||
name = Get_File_Name (name);
|
||||
@@ -291,7 +292,8 @@ Object General_Open_File (Object name, int flags, Object path) {
|
||||
if (TYPE(pref) != T_String)
|
||||
continue;
|
||||
gotpath = 1;
|
||||
if ((plen = STRING(pref)->size) > Path_Max () || plen == 0)
|
||||
plen = STRING(pref)->size;
|
||||
if (plen > Path_Max () || plen == 0)
|
||||
continue;
|
||||
if (len + plen + 2 > blen) {
|
||||
blen = len + plen + 2;
|
||||
|
||||
+3
-3
@@ -83,7 +83,7 @@ Object P_Cdr (Object x) {
|
||||
return Cdr (x);
|
||||
}
|
||||
|
||||
Object Cxr (Object x, register char *pat, register int len) {
|
||||
Object Cxr (Object x, register char *pat, register unsigned int len) {
|
||||
Object ret;
|
||||
|
||||
for (ret = x, pat += len; len > 0; len--)
|
||||
@@ -232,7 +232,7 @@ Object P_Assoc (Object key, Object alist) {
|
||||
return General_Assoc (key, alist, 2);
|
||||
}
|
||||
|
||||
int Fast_Length (Object list) {
|
||||
unsigned int Fast_Length (Object list) {
|
||||
Object tail;
|
||||
register int i;
|
||||
|
||||
@@ -251,7 +251,7 @@ Object P_Length (Object list) {
|
||||
}
|
||||
|
||||
Object P_Make_List (Object n, Object init) {
|
||||
register int len;
|
||||
register unsigned int len;
|
||||
Object list;
|
||||
GC_Node;
|
||||
|
||||
|
||||
+1
-1
@@ -73,7 +73,7 @@ void Init_Loadpath (char *s) { /* No GC possible here */
|
||||
|
||||
int Has_Suffix (Object name, char const *suffix) {
|
||||
register char *p;
|
||||
register int len = strlen(suffix);
|
||||
register unsigned int len = strlen(suffix);
|
||||
register struct S_String *str;
|
||||
|
||||
if (TYPE(name) == T_Symbol)
|
||||
|
||||
+14
-13
@@ -52,12 +52,12 @@ extern void Print_Bignum (Object, Object);
|
||||
extern int errno;
|
||||
|
||||
void Flush_Output (Object);
|
||||
void Print_String (Object, register char *, register int);
|
||||
void Print_String (Object, register char *, register unsigned int);
|
||||
void Pr_Char (Object, register int);
|
||||
void Pr_Symbol (Object, Object, int);
|
||||
void Pr_List (Object, Object, register int, register int, register int);
|
||||
void Pr_List (Object, Object, register int, register int, register unsigned int);
|
||||
void Pr_String (Object, Object, int);
|
||||
void Pr_Vector (Object, Object, register int, register int, register int);
|
||||
void Pr_Vector (Object, Object, register int, register int, register unsigned int);
|
||||
void Print_Special (Object, register int);
|
||||
|
||||
int Saved_Errno;
|
||||
@@ -99,7 +99,7 @@ void Print_Char (Object port, register int c) {
|
||||
}
|
||||
}
|
||||
|
||||
void Print_String (Object port, register char *buf, register int len) {
|
||||
void Print_String (Object port, register char *buf, register unsigned int len) {
|
||||
register int n;
|
||||
register struct S_Port *p;
|
||||
Object new;
|
||||
@@ -107,7 +107,7 @@ void Print_String (Object port, register char *buf, register int len) {
|
||||
|
||||
p = PORT(port);
|
||||
n = STRING(p->name)->size - p->ptr;
|
||||
if (n < len) {
|
||||
if (n < (int)len) {
|
||||
GC_Link (port);
|
||||
n = len - n;
|
||||
if (n < STRING_GROW_SIZE)
|
||||
@@ -263,7 +263,7 @@ void General_Print_Object (Object x, Object port, int raw) {
|
||||
}
|
||||
|
||||
void Print_Object (Object x, Object port, register int raw, register int depth,
|
||||
register int length) {
|
||||
register unsigned int length) {
|
||||
register int t;
|
||||
GC_Node2;
|
||||
|
||||
@@ -408,9 +408,9 @@ void Pr_Char (Object port, register int c) {
|
||||
}
|
||||
|
||||
void Pr_List (Object port, Object list, register int raw, register int depth,
|
||||
register int length) {
|
||||
register unsigned int length) {
|
||||
Object tail;
|
||||
register int len;
|
||||
register unsigned int len;
|
||||
register char *s = 0;
|
||||
GC_Node2;
|
||||
|
||||
@@ -463,8 +463,8 @@ void Pr_List (Object port, Object list, register int raw, register int depth,
|
||||
}
|
||||
|
||||
void Pr_Vector (Object port, Object vec, register int raw, register int depth,
|
||||
register int length) {
|
||||
register int i, j;
|
||||
register unsigned int length) {
|
||||
register unsigned int i, j;
|
||||
GC_Node2;
|
||||
|
||||
if (depth == 0) {
|
||||
@@ -488,7 +488,7 @@ void Pr_Vector (Object port, Object vec, register int raw, register int depth,
|
||||
|
||||
void Pr_Symbol (Object port, Object sym, int raw) {
|
||||
Object str;
|
||||
register int c, i;
|
||||
register unsigned int c, i;
|
||||
GC_Node2;
|
||||
|
||||
str = SYMBOL(sym)->name;
|
||||
@@ -518,7 +518,7 @@ 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;
|
||||
register unsigned int c, i;
|
||||
register size_t len = STRING(str)->size;
|
||||
GC_Node2;
|
||||
|
||||
@@ -586,7 +586,8 @@ Object P_Format (int argc, Object *argv) {
|
||||
return stringret ? P_Get_Output_String (port) : Void;
|
||||
}
|
||||
|
||||
void Format (Object port, char const *fmt, int len, int argc, Object *argv) {
|
||||
void Format (Object port, char const *fmt, unsigned int len, int argc,
|
||||
Object *argv) {
|
||||
register char const *s, *ep;
|
||||
char *p;
|
||||
register int c;
|
||||
|
||||
@@ -33,6 +33,8 @@
|
||||
#include <errno.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
extern void Free_Symbols (SYMTAB *);
|
||||
|
||||
extern int errno;
|
||||
|
||||
#ifndef O_BINARY
|
||||
|
||||
@@ -37,6 +37,8 @@
|
||||
|
||||
#include AOUT_H
|
||||
|
||||
extern void Free_Symbols (SYMTAB *);
|
||||
|
||||
SYMTAB *Snarf_Symbols (FILE *fp) {
|
||||
long fdi; /* a counter for the file desc table */
|
||||
FDR *file_desc; /* pointer to the filedesc table */
|
||||
|
||||
+6
-4
@@ -39,6 +39,8 @@
|
||||
|
||||
#include "kernel.h"
|
||||
|
||||
extern void Free_Symbols (SYMTAB *);
|
||||
|
||||
SYMTAB *
|
||||
Snarf_Symbols (lf)
|
||||
int lf;
|
||||
@@ -98,10 +100,10 @@ Snarf_Symbols (lf)
|
||||
* of the interesting symbols.
|
||||
*/
|
||||
while ((elf_data_ptr = elf_getdata (symtab_scn_ptr, elf_data_ptr))) {
|
||||
char *name = NULL;
|
||||
int symbol_count;
|
||||
Elf32_Sym *symbol_ptr = elf_data_ptr->d_buf;
|
||||
Elf32_Sym *current_symbol;
|
||||
char *name = NULL;
|
||||
unsigned int symbol_count;
|
||||
Elf32_Sym *symbol_ptr = elf_data_ptr->d_buf;
|
||||
Elf32_Sym *current_symbol;
|
||||
|
||||
tab = (SYMTAB *)Safe_Malloc (sizeof (SYMTAB));
|
||||
tab->first = 0;
|
||||
|
||||
@@ -43,6 +43,8 @@
|
||||
|
||||
#define STRING_BLOCK 8192
|
||||
|
||||
extern void Free_Symbols (SYMTAB *);
|
||||
|
||||
SYMTAB *Snarf_Symbols (FILE *f, struct exec *ep) {
|
||||
SYMTAB *tab;
|
||||
register SYM *sp;
|
||||
|
||||
@@ -31,6 +31,8 @@
|
||||
#include AOUT_H
|
||||
#include <sys/types.h>
|
||||
|
||||
extern void Free_Symbols (SYMTAB *);
|
||||
|
||||
SYMTAB *Snarf_Symbols (FILE *f, struct header *hp) {
|
||||
SYMTAB *tab;
|
||||
register SYM *sp, **nextp;
|
||||
|
||||
+11
-8
@@ -48,7 +48,7 @@ void Init_String () {
|
||||
Char_Map[i] = tolower (i);
|
||||
}
|
||||
|
||||
Object General_Make_String (char const *s, int len, int konst) {
|
||||
Object General_Make_String (char const *s, unsigned int len, int konst) {
|
||||
Object str;
|
||||
|
||||
str = Alloc_Object (len + sizeof (struct S_String) - 1, T_String, konst);
|
||||
@@ -59,11 +59,11 @@ Object General_Make_String (char const *s, int len, int konst) {
|
||||
return str;
|
||||
}
|
||||
|
||||
Object Make_String (char const *s, int len) {
|
||||
Object Make_String (char const *s, unsigned int len) {
|
||||
return General_Make_String (s, len, 0);
|
||||
}
|
||||
|
||||
Object Make_Const_String (char const *s, int len) {
|
||||
Object Make_Const_String (char const *s, unsigned int len) {
|
||||
return General_Make_String (s, len, 1);
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ Object P_Stringp (Object s) {
|
||||
}
|
||||
|
||||
Object P_Make_String (int argc, Object *argv) {
|
||||
register int len, c = ' ';
|
||||
register unsigned int len, c = ' ';
|
||||
Object str;
|
||||
register char *p;
|
||||
|
||||
@@ -150,9 +150,11 @@ Object P_Substring (Object s, Object a, Object b) {
|
||||
register int i, j;
|
||||
|
||||
Check_Type (s, T_String);
|
||||
if ((i = Get_Exact_Integer (a)) < 0 || i > STRING(s)->size)
|
||||
i = Get_Exact_Integer (a);
|
||||
if (i < 0 || i > (int)STRING(s)->size)
|
||||
Range_Error (a);
|
||||
if ((j = Get_Exact_Integer (b)) < 0 || j > STRING(s)->size)
|
||||
j = Get_Exact_Integer (b);
|
||||
if (j < 0 || j > (int)STRING(s)->size)
|
||||
Range_Error (b);
|
||||
if (i > j)
|
||||
Primitive_Error ("`end' less than `start'");
|
||||
@@ -198,7 +200,7 @@ Object P_List_To_String (Object list) {
|
||||
}
|
||||
|
||||
Object P_String_To_List (Object s) {
|
||||
register int i;
|
||||
register unsigned int i;
|
||||
Object list, tail, cell;
|
||||
GC_Node3;
|
||||
|
||||
@@ -223,7 +225,8 @@ Object P_Substring_Fill (Object s, Object a, Object b, Object c) {
|
||||
Check_Mutable (s);
|
||||
Check_Type (c, T_Character);
|
||||
i = Get_Index (a, s);
|
||||
if ((j = Get_Exact_Integer (b)) < 0 || j > STRING(s)->size)
|
||||
j = Get_Exact_Integer (b);
|
||||
if (j < 0 || j > (int)STRING(s)->size)
|
||||
Range_Error (b);
|
||||
if (i > j)
|
||||
Primitive_Error ("`end' less than `start'");
|
||||
|
||||
+6
-6
@@ -35,7 +35,7 @@
|
||||
|
||||
#include "kernel.h"
|
||||
|
||||
int Hash (char const *, int);
|
||||
int Hash (char const *, unsigned int);
|
||||
|
||||
Object Obarray;
|
||||
|
||||
@@ -91,7 +91,7 @@ Object P_Symbol_To_String (Object x) {
|
||||
return SYMBOL(x)->name;
|
||||
}
|
||||
|
||||
Object Obarray_Lookup (register char const *str, register int len) {
|
||||
Object Obarray_Lookup (register char const *str, register unsigned int len) {
|
||||
register int h;
|
||||
register struct S_String *s;
|
||||
register struct S_Symbol *sym;
|
||||
@@ -109,7 +109,7 @@ Object Obarray_Lookup (register char const *str, register int len) {
|
||||
|
||||
Object CI_Intern (char const *str) {
|
||||
Object s, *p, sym, ostr;
|
||||
register int len;
|
||||
register unsigned int len;
|
||||
register char const *src;
|
||||
char *dst;
|
||||
char buf[128];
|
||||
@@ -140,7 +140,7 @@ Object CI_Intern (char const *str) {
|
||||
|
||||
Object Intern (char const *str) {
|
||||
Object s, *p, sym, ostr;
|
||||
register int len;
|
||||
register unsigned int len;
|
||||
|
||||
if (Case_Insensitive)
|
||||
return CI_Intern (str);
|
||||
@@ -245,7 +245,7 @@ Object P_Symbol_Plist (Object sym) {
|
||||
return Copy_List (SYMBOL(sym)->plist);
|
||||
}
|
||||
|
||||
int Hash (char const *str, int len) {
|
||||
int Hash (char const *str, unsigned int len) {
|
||||
register int h;
|
||||
register char const *p, *ep;
|
||||
|
||||
@@ -325,7 +325,7 @@ Object Bits_To_Symbols (unsigned long int x, int mflag, SYMDESCR *stab) {
|
||||
if (mflag) {
|
||||
GC_Link2 (list, tail);
|
||||
for (list = tail = Null, syms = stab; syms->name; syms++)
|
||||
if ((x & syms->val) && syms->val != ~0) {
|
||||
if ((x & syms->val) && syms->val != ~0U) {
|
||||
Object z;
|
||||
|
||||
z = Intern (syms->name);
|
||||
|
||||
+7
-7
@@ -36,7 +36,7 @@
|
||||
|
||||
extern int Get_Index (Object, Object);
|
||||
|
||||
Object General_Make_Vector (int len, Object fill, int konst) {
|
||||
Object General_Make_Vector (unsigned int len, Object fill, int konst) {
|
||||
Object vec;
|
||||
register Object *op;
|
||||
GC_Node;
|
||||
@@ -52,16 +52,16 @@ Object General_Make_Vector (int len, Object fill, int konst) {
|
||||
return vec;
|
||||
}
|
||||
|
||||
Object Make_Vector (int len, Object fill) {
|
||||
Object Make_Vector (unsigned int len, Object fill) {
|
||||
return General_Make_Vector (len, fill, 0);
|
||||
}
|
||||
|
||||
Object Make_Const_Vector (int len, Object fill) {
|
||||
Object Make_Const_Vector (unsigned int len, Object fill) {
|
||||
return General_Make_Vector (len, fill, 1);
|
||||
}
|
||||
|
||||
Object P_Make_Vector (int argc, Object *argv) {
|
||||
register int len;
|
||||
register unsigned int len;
|
||||
|
||||
if ((len = Get_Exact_Integer (argv[0])) < 0)
|
||||
Range_Error (argv[0]);
|
||||
@@ -94,7 +94,7 @@ Object P_Vector_Ref (Object vec, Object n) {
|
||||
|
||||
Object P_Vector_Set (Object vec, Object n, Object new) {
|
||||
Object old;
|
||||
register int i;
|
||||
register unsigned int i;
|
||||
|
||||
Check_Type (vec, T_Vector);
|
||||
Check_Mutable (vec);
|
||||
@@ -107,7 +107,7 @@ Object P_Vector_Set (Object vec, Object n, Object new) {
|
||||
* because the latter can change during GC.
|
||||
*/
|
||||
Object P_Vector_To_List (Object vec) {
|
||||
register int i;
|
||||
register unsigned int i;
|
||||
Object list, tail, cell;
|
||||
GC_Node3;
|
||||
|
||||
@@ -147,7 +147,7 @@ Object P_List_To_Vector (Object list) {
|
||||
}
|
||||
|
||||
Object P_Vector_Fill (Object vec, Object fill) {
|
||||
register int i;
|
||||
register unsigned int i;
|
||||
|
||||
Check_Type (vec, T_Vector);
|
||||
Check_Mutable (vec);
|
||||
|
||||
Reference in New Issue
Block a user