Fixed all warnings while compiling with -Wall
This commit is contained in:
parent
9f7196d11a
commit
81db526510
|
@ -373,7 +373,7 @@ extern void verify_integrity(ikpcb* pcb, char*);
|
||||||
|
|
||||||
|
|
||||||
ikpcb*
|
ikpcb*
|
||||||
ik_collect(int mem_req, ikpcb* pcb){
|
ik_collect(unsigned long int mem_req, ikpcb* pcb){
|
||||||
// fprintf(stderr, "ik_collect\n");
|
// fprintf(stderr, "ik_collect\n");
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
verify_integrity(pcb, "entry");
|
verify_integrity(pcb, "entry");
|
||||||
|
@ -400,10 +400,9 @@ ik_collect(int mem_req, ikpcb* pcb){
|
||||||
gc.collect_gen_tag = next_gen_tag[gc.collect_gen];
|
gc.collect_gen_tag = next_gen_tag[gc.collect_gen];
|
||||||
pcb->collection_id++;
|
pcb->collection_id++;
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
fprintf(stderr, "ik_collect entry %d free=%d (collect gen=%d/id=%d)\n",
|
fprintf(stderr, "ik_collect entry %ld free=%ld (collect gen=%d/id=%d)\n",
|
||||||
mem_req,
|
mem_req,
|
||||||
(unsigned int) pcb->allocation_redline
|
pcb->allocation_redline - pcb->allocation_pointer,
|
||||||
- (unsigned int) pcb->allocation_pointer,
|
|
||||||
gc.collect_gen, pcb->collection_id-1);
|
gc.collect_gen, pcb->collection_id-1);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -498,12 +497,12 @@ ik_collect(int mem_req, ikpcb* pcb){
|
||||||
old_heap_pages = 0;
|
old_heap_pages = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
long int free_space =
|
unsigned long int free_space =
|
||||||
((unsigned long int)pcb->allocation_redline) -
|
((unsigned long int)pcb->allocation_redline) -
|
||||||
((unsigned long int)pcb->allocation_pointer);
|
((unsigned long int)pcb->allocation_pointer);
|
||||||
if((free_space <= mem_req) || (pcb->heap_size < IK_HEAPSIZE)){
|
if((free_space <= mem_req) || (pcb->heap_size < IK_HEAPSIZE)){
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
fprintf(stderr, "REQ=%d, got %d\n", mem_req, free_space);
|
fprintf(stderr, "REQ=%ld, got %ld\n", mem_req, free_space);
|
||||||
#endif
|
#endif
|
||||||
long int memsize = (mem_req > IK_HEAPSIZE) ? mem_req : IK_HEAPSIZE;
|
long int memsize = (mem_req > IK_HEAPSIZE) ? mem_req : IK_HEAPSIZE;
|
||||||
memsize = align_to_next_page(memsize);
|
memsize = align_to_next_page(memsize);
|
||||||
|
@ -972,11 +971,11 @@ add_list(gc_t* gc, unsigned int t, ikptr x, ikptr* loc){
|
||||||
|
|
||||||
static ikptr
|
static ikptr
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
add_object_proc(gc_t* gc, ikptr x, char* caller)
|
add_object_proc(gc_t* gc, ikptr x, char* caller) {
|
||||||
|
caller = caller;
|
||||||
#else
|
#else
|
||||||
add_object_proc(gc_t* gc, ikptr x)
|
add_object_proc(gc_t* gc, ikptr x) {
|
||||||
#endif
|
#endif
|
||||||
{
|
|
||||||
if(is_fixnum(x)){
|
if(is_fixnum(x)){
|
||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
|
@ -1143,7 +1142,7 @@ add_object_proc(gc_t* gc, ikptr x)
|
||||||
ikptr size = ref(x, off_continuation_size);
|
ikptr size = ref(x, off_continuation_size);
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
if(size > 4096){
|
if(size > 4096){
|
||||||
fprintf(stderr, "large cont size=0x%08x\n", size);
|
fprintf(stderr, "large cont size=0x%016lx\n", size);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
ikptr next = ref(x, off_continuation_next);
|
ikptr next = ref(x, off_continuation_next);
|
||||||
|
@ -1173,8 +1172,8 @@ add_object_proc(gc_t* gc, ikptr x)
|
||||||
ref(y,off_tcbucket_val) = ref(x, off_tcbucket_val);
|
ref(y,off_tcbucket_val) = ref(x, off_tcbucket_val);
|
||||||
ref(y,off_tcbucket_next) = ref(x, off_tcbucket_next);
|
ref(y,off_tcbucket_next) = ref(x, off_tcbucket_next);
|
||||||
if((! is_fixnum(key)) && (tagof(key) != immediate_tag)){
|
if((! is_fixnum(key)) && (tagof(key) != immediate_tag)){
|
||||||
unsigned int kt = gc->segment_vector[page_index(key)];
|
int gen = gc->segment_vector[page_index(key)] & gen_mask;
|
||||||
if((kt & gen_mask) <= gc->collect_gen){
|
if(gen <= gc->collect_gen){
|
||||||
/* key will be moved */
|
/* key will be moved */
|
||||||
gc_tconc_push(gc, y);
|
gc_tconc_push(gc, y);
|
||||||
}
|
}
|
||||||
|
@ -1657,7 +1656,7 @@ scan_dirty_pointers_page(gc_t* gc, long int page_idx, int mask){
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
scan_dirty_code_page(gc_t* gc, long int page_idx, unsigned int mask){
|
scan_dirty_code_page(gc_t* gc, long int page_idx){
|
||||||
ikptr p = (ikptr)(page_idx << pageshift);
|
ikptr p = (ikptr)(page_idx << pageshift);
|
||||||
ikptr start = p;
|
ikptr start = p;
|
||||||
ikptr q = p + pagesize;
|
ikptr q = p + pagesize;
|
||||||
|
@ -1679,7 +1678,7 @@ scan_dirty_code_page(gc_t* gc, long int page_idx, unsigned int mask){
|
||||||
ikptr rvec = ref(p, disp_code_reloc_vector);
|
ikptr rvec = ref(p, disp_code_reloc_vector);
|
||||||
ikptr len = ref(rvec, off_vector_length);
|
ikptr len = ref(rvec, off_vector_length);
|
||||||
assert(((long)len) >= 0);
|
assert(((long)len) >= 0);
|
||||||
long int i;
|
unsigned long int i;
|
||||||
unsigned long int code_d = segment_vec[page_index(rvec)];
|
unsigned long int code_d = segment_vec[page_index(rvec)];
|
||||||
for(i=0; i<len; i+=wordsize){
|
for(i=0; i<len; i+=wordsize){
|
||||||
ikptr r = ref(rvec, i+off_vector_data);
|
ikptr r = ref(rvec, i+off_vector_data);
|
||||||
|
@ -1718,7 +1717,8 @@ scan_dirty_pages(gc_t* gc){
|
||||||
unsigned int d = dirty_vec[i];
|
unsigned int d = dirty_vec[i];
|
||||||
if(d & mask){
|
if(d & mask){
|
||||||
unsigned int t = segment_vec[i];
|
unsigned int t = segment_vec[i];
|
||||||
if((t & gen_mask) > collect_gen){
|
int tgen = t & gen_mask;
|
||||||
|
if(tgen > collect_gen){
|
||||||
int type = t & type_mask;
|
int type = t & type_mask;
|
||||||
if(type == pointers_type){
|
if(type == pointers_type){
|
||||||
scan_dirty_pointers_page(gc, i, mask);
|
scan_dirty_pointers_page(gc, i, mask);
|
||||||
|
@ -1736,12 +1736,10 @@ scan_dirty_pages(gc_t* gc){
|
||||||
segment_vec = (unsigned int*)(long)pcb->segment_vector;
|
segment_vec = (unsigned int*)(long)pcb->segment_vector;
|
||||||
}
|
}
|
||||||
else if (type == code_type){
|
else if (type == code_type){
|
||||||
if((t & gen_mask) > collect_gen){
|
scan_dirty_code_page(gc, i);
|
||||||
scan_dirty_code_page(gc, i, mask);
|
|
||||||
dirty_vec = (unsigned int*)(long)pcb->dirty_vector;
|
dirty_vec = (unsigned int*)(long)pcb->dirty_vector;
|
||||||
segment_vec = (unsigned int*)(long)pcb->segment_vector;
|
segment_vec = (unsigned int*)(long)pcb->segment_vector;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else if (t & scannable_mask) {
|
else if (t & scannable_mask) {
|
||||||
fprintf(stderr, "BUG: unhandled scan of type 0x%08x\n", t);
|
fprintf(stderr, "BUG: unhandled scan of type 0x%08x\n", t);
|
||||||
exit(-1);
|
exit(-1);
|
||||||
|
|
|
@ -146,14 +146,14 @@ typedef struct ikpcb{
|
||||||
ikptr weak_pairs_ap;
|
ikptr weak_pairs_ap;
|
||||||
ikptr weak_pairs_ep;
|
ikptr weak_pairs_ep;
|
||||||
ikptr heap_base;
|
ikptr heap_base;
|
||||||
int heap_size;
|
unsigned long int heap_size;
|
||||||
ikpages* heap_pages;
|
ikpages* heap_pages;
|
||||||
ikpage* cached_pages; /* pages cached so that we don't map/unmap */
|
ikpage* cached_pages; /* pages cached so that we don't map/unmap */
|
||||||
ikpage* uncached_pages; /* ikpages cached so that we don't malloc/free */
|
ikpage* uncached_pages; /* ikpages cached so that we don't malloc/free */
|
||||||
ikptr cached_pages_base;
|
ikptr cached_pages_base;
|
||||||
int cached_pages_size;
|
int cached_pages_size;
|
||||||
ikptr stack_base;
|
ikptr stack_base;
|
||||||
int stack_size;
|
unsigned long int stack_size;
|
||||||
ikptr symbol_table;
|
ikptr symbol_table;
|
||||||
ikptr gensym_table;
|
ikptr gensym_table;
|
||||||
ik_ptr_page* protected_list[generation_count];
|
ik_ptr_page* protected_list[generation_count];
|
||||||
|
@ -169,7 +169,7 @@ typedef struct ikpcb{
|
||||||
struct timeval collect_rtime;
|
struct timeval collect_rtime;
|
||||||
} ikpcb;
|
} ikpcb;
|
||||||
|
|
||||||
ikpcb* ik_collect(int req, ikpcb* pcb);
|
ikpcb* ik_collect(unsigned long int, ikpcb*);
|
||||||
void ikarus_usage_short(void);
|
void ikarus_usage_short(void);
|
||||||
|
|
||||||
void* ik_malloc(int);
|
void* ik_malloc(int);
|
||||||
|
@ -182,7 +182,7 @@ ikptr ik_mmap_data(int size, int gen, ikpcb*);
|
||||||
ikptr ik_mmap_code(int size, int gen, ikpcb*);
|
ikptr ik_mmap_code(int size, int gen, ikpcb*);
|
||||||
ikptr ik_mmap_mixed(int size, ikpcb*);
|
ikptr ik_mmap_mixed(int size, ikpcb*);
|
||||||
void ik_munmap(ikptr, int);
|
void ik_munmap(ikptr, int);
|
||||||
void ik_munmap_from_segment(ikptr, int, ikpcb*);
|
void ik_munmap_from_segment(ikptr, unsigned long int, ikpcb*);
|
||||||
ikpcb* ik_make_pcb();
|
ikpcb* ik_make_pcb();
|
||||||
void ik_delete_pcb(ikpcb*);
|
void ik_delete_pcb(ikpcb*);
|
||||||
void ik_free_symbol_table(ikpcb* pcb);
|
void ik_free_symbol_table(ikpcb* pcb);
|
||||||
|
@ -208,7 +208,7 @@ ikptr ik_safe_alloc(ikpcb* pcb, int size);
|
||||||
#define IK_HEAP_EXT_SIZE (32 * 4096)
|
#define IK_HEAP_EXT_SIZE (32 * 4096)
|
||||||
#define IK_HEAPSIZE (1024 * ((wordsize==4)?1:2) * 4096) /* 4/8 MB */
|
#define IK_HEAPSIZE (1024 * ((wordsize==4)?1:2) * 4096) /* 4/8 MB */
|
||||||
|
|
||||||
#define wordsize (sizeof(ikptr))
|
#define wordsize ((int)(sizeof(ikptr)))
|
||||||
#define wordshift ((wordsize == 4)?2:3)
|
#define wordshift ((wordsize == 4)?2:3)
|
||||||
#define align_shift (wordshift + 1)
|
#define align_shift (wordshift + 1)
|
||||||
#define align_size (2 * wordsize)
|
#define align_size (2 * wordsize)
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
extern ikptr ik_errno_to_code();
|
extern ikptr ik_errno_to_code();
|
||||||
|
|
||||||
ikptr
|
ikptr
|
||||||
ikrt_close_fd(ikptr fd, ikpcb* pcb){
|
ikrt_close_fd(ikptr fd /*, ikpcb* pcb */){
|
||||||
int err = close(unfix(fd));
|
int err = close(unfix(fd));
|
||||||
if(err == -1){
|
if(err == -1){
|
||||||
return ik_errno_to_code();
|
return ik_errno_to_code();
|
||||||
|
@ -42,7 +42,7 @@ ikrt_close_fd(ikptr fd, ikpcb* pcb){
|
||||||
}
|
}
|
||||||
|
|
||||||
ikptr
|
ikptr
|
||||||
ikrt_open_input_fd(ikptr fn, ikpcb* pcb){
|
ikrt_open_input_fd(ikptr fn /*, ikpcb* pcb */){
|
||||||
int fh = open((char*)(long)(fn+off_bytevector_data), O_RDONLY, 0);
|
int fh = open((char*)(long)(fn+off_bytevector_data), O_RDONLY, 0);
|
||||||
if(fh >= 0){
|
if(fh >= 0){
|
||||||
return fix(fh);
|
return fix(fh);
|
||||||
|
@ -52,7 +52,7 @@ ikrt_open_input_fd(ikptr fn, ikpcb* pcb){
|
||||||
}
|
}
|
||||||
|
|
||||||
ikptr
|
ikptr
|
||||||
ikrt_open_output_fd(ikptr fn, ikptr ikopts, ikpcb* pcb){
|
ikrt_open_output_fd(ikptr fn, ikptr ikopts /*, ikpcb* pcb */){
|
||||||
int opts = unfix(ikopts);
|
int opts = unfix(ikopts);
|
||||||
int mode = 0;
|
int mode = 0;
|
||||||
switch (opts){
|
switch (opts){
|
||||||
|
@ -81,7 +81,7 @@ ikrt_open_output_fd(ikptr fn, ikptr ikopts, ikpcb* pcb){
|
||||||
|
|
||||||
|
|
||||||
ikptr
|
ikptr
|
||||||
ikrt_read_fd(ikptr fd, ikptr bv, ikptr off, ikptr cnt, ikpcb* pcb){
|
ikrt_read_fd(ikptr fd, ikptr bv, ikptr off, ikptr cnt /*, ikpcb* pcb */){
|
||||||
#if 0
|
#if 0
|
||||||
fprintf(stderr, "READ: %d\n", unfix(fd));
|
fprintf(stderr, "READ: %d\n", unfix(fd));
|
||||||
#endif
|
#endif
|
||||||
|
@ -100,7 +100,7 @@ ikrt_read_fd(ikptr fd, ikptr bv, ikptr off, ikptr cnt, ikpcb* pcb){
|
||||||
}
|
}
|
||||||
|
|
||||||
ikptr
|
ikptr
|
||||||
ikrt_write_fd(ikptr fd, ikptr bv, ikptr off, ikptr cnt, ikpcb* pcb){
|
ikrt_write_fd(ikptr fd, ikptr bv, ikptr off, ikptr cnt /*, ikpcb* pcb */){
|
||||||
#if 0
|
#if 0
|
||||||
if (0) {
|
if (0) {
|
||||||
fprintf(stderr, "WRITE %d, %p %d %d %d\n",
|
fprintf(stderr, "WRITE %d, %p %d %d %d\n",
|
||||||
|
@ -170,17 +170,17 @@ do_connect(ikptr host, ikptr srvc, int socket_type){
|
||||||
}
|
}
|
||||||
|
|
||||||
ikptr
|
ikptr
|
||||||
ikrt_tcp_connect(ikptr host, ikptr srvc, ikpcb* pcb){
|
ikrt_tcp_connect(ikptr host, ikptr srvc /*, ikpcb* pcb */){
|
||||||
return do_connect(host, srvc, SOCK_STREAM);
|
return do_connect(host, srvc, SOCK_STREAM);
|
||||||
}
|
}
|
||||||
|
|
||||||
ikptr
|
ikptr
|
||||||
ikrt_udp_connect(ikptr host, ikptr srvc, ikpcb* pcb){
|
ikrt_udp_connect(ikptr host, ikptr srvc /*, ikpcb* pcb */){
|
||||||
return do_connect(host, srvc, SOCK_DGRAM);
|
return do_connect(host, srvc, SOCK_DGRAM);
|
||||||
}
|
}
|
||||||
|
|
||||||
ikptr
|
ikptr
|
||||||
ikrt_make_fd_nonblocking(ikptr fdptr, ikpcb* pcb){
|
ikrt_make_fd_nonblocking(ikptr fdptr /*, ikpcb* pcb */){
|
||||||
int fd = unfix(fdptr);
|
int fd = unfix(fdptr);
|
||||||
int err = fcntl(fd, F_SETFL, O_NONBLOCK);
|
int err = fcntl(fd, F_SETFL, O_NONBLOCK);
|
||||||
if(err == -1){
|
if(err == -1){
|
||||||
|
@ -190,7 +190,7 @@ ikrt_make_fd_nonblocking(ikptr fdptr, ikpcb* pcb){
|
||||||
}
|
}
|
||||||
|
|
||||||
ikptr
|
ikptr
|
||||||
ikrt_select(ikptr fds, ikptr rfds, ikptr wfds, ikptr xfds, ikpcb* pcb){
|
ikrt_select(ikptr fds, ikptr rfds, ikptr wfds, ikptr xfds /*, ikpcb* pcb */){
|
||||||
int rv = select(unfix(fds),
|
int rv = select(unfix(fds),
|
||||||
(fd_set*)(rfds + off_bytevector_data),
|
(fd_set*)(rfds + off_bytevector_data),
|
||||||
(fd_set*)(wfds + off_bytevector_data),
|
(fd_set*)(wfds + off_bytevector_data),
|
||||||
|
@ -203,7 +203,7 @@ ikrt_select(ikptr fds, ikptr rfds, ikptr wfds, ikptr xfds, ikpcb* pcb){
|
||||||
}
|
}
|
||||||
|
|
||||||
ikptr
|
ikptr
|
||||||
ikrt_listen(ikptr port, ikpcb* pcb){
|
ikrt_listen(ikptr port /*, ikpcb* pcb */){
|
||||||
|
|
||||||
int sock = socket(AF_INET, SOCK_STREAM, 0);
|
int sock = socket(AF_INET, SOCK_STREAM, 0);
|
||||||
if(sock < 0){
|
if(sock < 0){
|
||||||
|
@ -259,7 +259,7 @@ ikrt_getsockname(ikptr s, ikpcb* pcb){
|
||||||
|
|
||||||
|
|
||||||
ikptr
|
ikptr
|
||||||
ikrt_accept(ikptr s, ikptr bv, ikpcb* pcb){
|
ikrt_accept(ikptr s, ikptr bv /*, ikpcb* pcb */){
|
||||||
socklen_t addrlen = unfix(ref(bv, off_bytevector_length));
|
socklen_t addrlen = unfix(ref(bv, off_bytevector_length));
|
||||||
int sock = accept(unfix(s),
|
int sock = accept(unfix(s),
|
||||||
(struct sockaddr*) (bv+off_bytevector_data),
|
(struct sockaddr*) (bv+off_bytevector_data),
|
||||||
|
|
|
@ -218,6 +218,7 @@ Notice how the bsd manpages have incorrect type for the handler.
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void handler(int signo, siginfo_t* info, void* uap){
|
void handler(int signo, siginfo_t* info, void* uap){
|
||||||
|
signo=signo; info=info; uap=uap; /* no warning */
|
||||||
the_pcb->engine_counter = fix(-1);
|
the_pcb->engine_counter = fix(-1);
|
||||||
the_pcb->interrupted = 1;
|
the_pcb->interrupted = 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,14 +40,14 @@
|
||||||
static ikptr
|
static ikptr
|
||||||
verify_bignum(ikptr x, char* caller){
|
verify_bignum(ikptr x, char* caller){
|
||||||
if(tagof(x) != vector_tag){
|
if(tagof(x) != vector_tag){
|
||||||
fprintf(stderr, "Error in (%s) invalid primary tag %p\n", caller, x);
|
fprintf(stderr, "Error in (%s) invalid primary tag 0x%016lx\n", caller, x);
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
ikptr fst = ref(x, -vector_tag);
|
ikptr fst = ref(x, -vector_tag);
|
||||||
long int limb_count = ((unsigned long int) fst) >> bignum_length_shift;
|
long int limb_count = ((unsigned long int) fst) >> bignum_length_shift;
|
||||||
if(limb_count <= 0){
|
if(limb_count <= 0){
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"Error in (%s) invalid limb count in fst=0x%08x\n",
|
"Error in (%s) invalid limb count in fst=0x%016lx\n",
|
||||||
caller, (long int)fst);
|
caller, (long int)fst);
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
@ -61,21 +61,21 @@ verify_bignum(ikptr x, char* caller){
|
||||||
(mp_limb_t) ref(x, off_bignum_data + (limb_count - 1) * wordsize);
|
(mp_limb_t) ref(x, off_bignum_data + (limb_count - 1) * wordsize);
|
||||||
if(last_limb == 0){
|
if(last_limb == 0){
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"Error in (%s) invalid last limb = 0x%08x", caller, last_limb);
|
"Error in (%s) invalid last limb = 0x%016lx", caller, last_limb);
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
if(limb_count == 1){
|
if(limb_count == 1){
|
||||||
if(pos){
|
if(pos){
|
||||||
if(last_limb <= most_positive_fixnum){
|
if(last_limb <= most_positive_fixnum){
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"Error in (%s) should be a positive fixnum: 0x%08x\n",
|
"Error in (%s) should be a positive fixnum: 0x%016lx\n",
|
||||||
caller, last_limb);
|
caller, last_limb);
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if(last_limb <= most_negative_fixnum){
|
if(last_limb <= most_negative_fixnum){
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"Error in (%s) should be a negative fixnum: 0x%08x\n",
|
"Error in (%s) should be a negative fixnum: 0x%016lx\n",
|
||||||
caller, last_limb);
|
caller, last_limb);
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
@ -1045,7 +1045,7 @@ static inline int
|
||||||
count_leading_ffs(int n, mp_limb_t* x){
|
count_leading_ffs(int n, mp_limb_t* x){
|
||||||
int idx;
|
int idx;
|
||||||
for(idx=0; idx<n; idx++){
|
for(idx=0; idx<n; idx++){
|
||||||
if(x[idx] != -1){
|
if(x[idx] != (mp_limb_t)-1){
|
||||||
return idx;
|
return idx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1189,7 +1189,7 @@ ikrt_bnlognot(ikptr x, ikpcb* pcb){
|
||||||
/* positive */
|
/* positive */
|
||||||
long int i;
|
long int i;
|
||||||
mp_limb_t* s1 = (mp_limb_t*)(long)(x+disp_bignum_data-vector_tag);
|
mp_limb_t* s1 = (mp_limb_t*)(long)(x+disp_bignum_data-vector_tag);
|
||||||
for(i=0; (i<n) && (s1[i] == -1); i++) {/*nothing*/}
|
for(i=0; (i<n) && (s1[i] == (mp_limb_t)-1); i++) {/*nothing*/}
|
||||||
if(i==n){
|
if(i==n){
|
||||||
pcb->root0 = &x;
|
pcb->root0 = &x;
|
||||||
ikptr r = ik_safe_alloc(pcb, align(disp_bignum_data + (n+1)*wordsize));
|
ikptr r = ik_safe_alloc(pcb, align(disp_bignum_data + (n+1)*wordsize));
|
||||||
|
@ -1789,7 +1789,7 @@ ikrt_bnfxdivrem(ikptr x, ikptr y, ikpcb* pcb){
|
||||||
}
|
}
|
||||||
|
|
||||||
ikptr
|
ikptr
|
||||||
ikrt_bnfx_modulo(ikptr x, ikptr y, ikpcb* pcb){
|
ikrt_bnfx_modulo(ikptr x, ikptr y /*, ikpcb* pcb */){
|
||||||
int yint = unfix(y);
|
int yint = unfix(y);
|
||||||
mp_limb_t* s2p = (mp_limb_t*)(long)(x+off_bignum_data);
|
mp_limb_t* s2p = (mp_limb_t*)(long)(x+off_bignum_data);
|
||||||
ikptr fst = ref(x, -vector_tag);
|
ikptr fst = ref(x, -vector_tag);
|
||||||
|
@ -1838,7 +1838,7 @@ ikrt_bignum_length(ikptr x){
|
||||||
int n0 = limb_length(last);
|
int n0 = limb_length(last);
|
||||||
if(((unsigned long int) fst) & bignum_sign_mask){
|
if(((unsigned long int) fst) & bignum_sign_mask){
|
||||||
/* negative */
|
/* negative */
|
||||||
if (last == (1<<(n0-1))){
|
if (last == (mp_limb_t)(1<<(n0-1))){
|
||||||
/* single bit set in last limb */
|
/* single bit set in last limb */
|
||||||
int i;
|
int i;
|
||||||
for(i=0; i<(sn-1); i++){
|
for(i=0; i<(sn-1); i++){
|
||||||
|
|
|
@ -52,7 +52,7 @@ list_to_vec(ikptr x){
|
||||||
}
|
}
|
||||||
|
|
||||||
ikptr
|
ikptr
|
||||||
ikrt_process(ikptr rvec, ikptr cmd, ikptr argv, ikpcb* pcb){
|
ikrt_process(ikptr rvec, ikptr cmd, ikptr argv /*, ikpcb* pcb */){
|
||||||
int infds[2];
|
int infds[2];
|
||||||
int outfds[2];
|
int outfds[2];
|
||||||
int errfds[2];
|
int errfds[2];
|
||||||
|
@ -92,7 +92,7 @@ ikrt_process(ikptr rvec, ikptr cmd, ikptr argv, ikpcb* pcb){
|
||||||
}
|
}
|
||||||
|
|
||||||
ikptr
|
ikptr
|
||||||
ikrt_waitpid(ikptr pid, ikpcb* pcb){
|
ikrt_waitpid(ikptr pid /*, ikpcb* pcb */){
|
||||||
int status;
|
int status;
|
||||||
pid_t r = waitpid(unfix(pid), &status, 0);
|
pid_t r = waitpid(unfix(pid), &status, 0);
|
||||||
if(r >= 0){
|
if(r >= 0){
|
||||||
|
|
|
@ -54,7 +54,7 @@ ikptr ik_mmap(int size);
|
||||||
void ik_munmap(ikptr mem, int size);
|
void ik_munmap(ikptr mem, int size);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
extend_table_maybe(ikptr p, int size, ikpcb* pcb){
|
extend_table_maybe(ikptr p, unsigned long int size, ikpcb* pcb){
|
||||||
assert(size == align_to_next_page(size));
|
assert(size == align_to_next_page(size));
|
||||||
ikptr q = p + size;
|
ikptr q = p + size;
|
||||||
if(p < pcb->memory_base){
|
if(p < pcb->memory_base){
|
||||||
|
@ -107,7 +107,7 @@ extend_table_maybe(ikptr p, int size, ikpcb* pcb){
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
set_segment_type(ikptr base, int size, unsigned int type, ikpcb* pcb){
|
set_segment_type(ikptr base, unsigned long int size, unsigned int type, ikpcb* pcb){
|
||||||
assert(base >= pcb->memory_base);
|
assert(base >= pcb->memory_base);
|
||||||
assert((base+size) <= pcb->memory_end);
|
assert((base+size) <= pcb->memory_end);
|
||||||
assert(size == align_to_next_page(size));
|
assert(size == align_to_next_page(size));
|
||||||
|
@ -120,7 +120,7 @@ set_segment_type(ikptr base, int size, unsigned int type, ikpcb* pcb){
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ik_munmap_from_segment(ikptr base, int size, ikpcb* pcb){
|
ik_munmap_from_segment(ikptr base, unsigned long int size, ikpcb* pcb){
|
||||||
assert(base >= pcb->memory_base);
|
assert(base >= pcb->memory_base);
|
||||||
assert((base+size) <= pcb->memory_end);
|
assert((base+size) <= pcb->memory_end);
|
||||||
assert(size == align_to_next_page(size));
|
assert(size == align_to_next_page(size));
|
||||||
|
@ -557,7 +557,7 @@ ikptr ik_uuid(ikptr bv){
|
||||||
|
|
||||||
|
|
||||||
ikptr
|
ikptr
|
||||||
ikrt_stat(ikptr filename, ikptr follow, ikpcb* pcb){
|
ikrt_stat(ikptr filename, ikptr follow /*, ikpcb* pcb */){
|
||||||
char* fn = (char*)(filename + off_bytevector_data);
|
char* fn = (char*)(filename + off_bytevector_data);
|
||||||
struct stat s;
|
struct stat s;
|
||||||
int r;
|
int r;
|
||||||
|
@ -587,8 +587,8 @@ ikrt_stat(ikptr filename, ikptr follow, ikpcb* pcb){
|
||||||
/* ikrt_file_exists needs to be removed.
|
/* ikrt_file_exists needs to be removed.
|
||||||
This is here only to be able to use old ikarus.boot.prebuilt */
|
This is here only to be able to use old ikarus.boot.prebuilt */
|
||||||
ikptr
|
ikptr
|
||||||
ikrt_file_exists(ikptr filename, ikpcb* pcb){
|
ikrt_file_exists(ikptr filename /*, ikpcb* pcb */){
|
||||||
switch (ikrt_stat(filename, true_object, pcb)){
|
switch (ikrt_stat(filename, true_object /*, pcb */)){
|
||||||
case fix(0):
|
case fix(0):
|
||||||
case fix(1):
|
case fix(1):
|
||||||
case fix(2):
|
case fix(2):
|
||||||
|
@ -648,7 +648,7 @@ ikrt_directory_list(ikptr filename, ikpcb* pcb){
|
||||||
}
|
}
|
||||||
|
|
||||||
ikptr
|
ikptr
|
||||||
ikrt_mkdir(ikptr path, ikptr mode, ikpcb* pcb){
|
ikrt_mkdir(ikptr path, ikptr mode /*, ikpcb* pcb */){
|
||||||
int r = mkdir((char*)(path+off_bytevector_data), unfix(mode));
|
int r = mkdir((char*)(path+off_bytevector_data), unfix(mode));
|
||||||
if(r == 0){
|
if(r == 0){
|
||||||
return true_object;
|
return true_object;
|
||||||
|
@ -657,7 +657,7 @@ ikrt_mkdir(ikptr path, ikptr mode, ikpcb* pcb){
|
||||||
}
|
}
|
||||||
|
|
||||||
ikptr
|
ikptr
|
||||||
ikrt_rmdir(ikptr path, ikpcb* pcb){
|
ikrt_rmdir(ikptr path /*, ikpcb* pcb */){
|
||||||
int r = rmdir((char*)(path+off_bytevector_data));
|
int r = rmdir((char*)(path+off_bytevector_data));
|
||||||
if(r == 0){
|
if(r == 0){
|
||||||
return true_object;
|
return true_object;
|
||||||
|
@ -666,7 +666,7 @@ ikrt_rmdir(ikptr path, ikpcb* pcb){
|
||||||
}
|
}
|
||||||
|
|
||||||
ikptr
|
ikptr
|
||||||
ikrt_chmod(ikptr path, ikptr mode, ikpcb* pcb){
|
ikrt_chmod(ikptr path, ikptr mode /*, ikpcb* pcb */){
|
||||||
int r = chmod((char*)(path+off_bytevector_data), (mode_t)unfix(mode));
|
int r = chmod((char*)(path+off_bytevector_data), (mode_t)unfix(mode));
|
||||||
if(r == 0){
|
if(r == 0){
|
||||||
return true_object;
|
return true_object;
|
||||||
|
@ -675,7 +675,7 @@ ikrt_chmod(ikptr path, ikptr mode, ikpcb* pcb){
|
||||||
}
|
}
|
||||||
|
|
||||||
ikptr
|
ikptr
|
||||||
ikrt_symlink(ikptr to, ikptr path, ikpcb* pcb){
|
ikrt_symlink(ikptr to, ikptr path /*, ikpcb* pcb */){
|
||||||
int r = symlink((char*)(to+off_bytevector_data), (char*)(path+off_bytevector_data));
|
int r = symlink((char*)(to+off_bytevector_data), (char*)(path+off_bytevector_data));
|
||||||
if(r == 0){
|
if(r == 0){
|
||||||
return true_object;
|
return true_object;
|
||||||
|
@ -998,17 +998,21 @@ ikrt_exit(ikptr status, ikpcb* pcb){
|
||||||
}
|
}
|
||||||
|
|
||||||
ikptr
|
ikptr
|
||||||
ikrt_nanosleep(ikptr secs, ikptr nsecs, ikpcb* pcb){
|
ikrt_nanosleep(ikptr secs, ikptr nsecs /*, ikpcb* pcb */){
|
||||||
struct timespec t;
|
struct timespec t;
|
||||||
t.tv_sec =
|
t.tv_sec =
|
||||||
is_fixnum(secs) ? unfix(secs) : ref(secs, off_bignum_data);
|
is_fixnum(secs)
|
||||||
|
? (unsigned long) unfix(secs)
|
||||||
|
: ref(secs, off_bignum_data);
|
||||||
t.tv_nsec =
|
t.tv_nsec =
|
||||||
is_fixnum(nsecs) ? unfix(nsecs) : ref(nsecs, off_bignum_data);
|
is_fixnum(nsecs)
|
||||||
|
? (unsigned long) unfix(nsecs)
|
||||||
|
: ref(nsecs, off_bignum_data);
|
||||||
return fix(nanosleep(&t, NULL));
|
return fix(nanosleep(&t, NULL));
|
||||||
}
|
}
|
||||||
|
|
||||||
ikptr
|
ikptr
|
||||||
ikrt_chdir(ikptr pathbv, ikpcb* pcb){
|
ikrt_chdir(ikptr pathbv /*, ikpcb* pcb */){
|
||||||
int err = chdir(off_bytevector_data+(char*)pathbv);
|
int err = chdir(off_bytevector_data+(char*)pathbv);
|
||||||
if(err == 0){
|
if(err == 0){
|
||||||
return true_object;
|
return true_object;
|
||||||
|
|
|
@ -74,7 +74,7 @@ verify_code(char* x, char* base, unsigned int* svec, unsigned int* dvec){
|
||||||
|
|
||||||
static void
|
static void
|
||||||
verify_object(ikptr x, char* base, unsigned int* svec, unsigned int* dvec){
|
verify_object(ikptr x, char* base, unsigned int* svec, unsigned int* dvec){
|
||||||
|
x=x; base=base; svec=svec; dvec=dvec; /* no warning */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -82,6 +82,7 @@ static char*
|
||||||
verify_code_small(char* p, int s, unsigned int d,
|
verify_code_small(char* p, int s, unsigned int d,
|
||||||
char* base, unsigned int* svec, unsigned int* dvec){
|
char* base, unsigned int* svec, unsigned int* dvec){
|
||||||
char* q = p + pagesize;
|
char* q = p + pagesize;
|
||||||
|
s=s; d=d; /* no warning */
|
||||||
while(p < q){
|
while(p < q){
|
||||||
ikptr fst = ref(p, 0);
|
ikptr fst = ref(p, 0);
|
||||||
if(fst == code_tag){
|
if(fst == code_tag){
|
||||||
|
@ -104,6 +105,7 @@ verify_code_small(char* p, int s, unsigned int d,
|
||||||
static char*
|
static char*
|
||||||
verify_code_large(char* p, unsigned int s, unsigned int d,
|
verify_code_large(char* p, unsigned int s, unsigned int d,
|
||||||
char* base, unsigned int* svec, unsigned int* dvec){
|
char* base, unsigned int* svec, unsigned int* dvec){
|
||||||
|
s=s; d=d; /* no warning */
|
||||||
ikptr fst = ref(p, 0);
|
ikptr fst = ref(p, 0);
|
||||||
fst += 0;
|
fst += 0;
|
||||||
assert(fst == code_tag);
|
assert(fst == code_tag);
|
||||||
|
@ -144,6 +146,7 @@ verify_code_page(char* p, unsigned int s, unsigned int d,
|
||||||
static char*
|
static char*
|
||||||
verify_pointers_page(char* p, unsigned int s, unsigned int d,
|
verify_pointers_page(char* p, unsigned int s, unsigned int d,
|
||||||
char* base, unsigned int* svec, unsigned int* dvec){
|
char* base, unsigned int* svec, unsigned int* dvec){
|
||||||
|
s=s; d=d; /* no warning */
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
while(i < pagesize){
|
while(i < pagesize){
|
||||||
|
|
Loading…
Reference in New Issue