diff --git a/src/array.c b/src/array.c index ca59204d73d8762d4554c744a89632ec5992766f..7bffabd28846a797c65ec49d25b70814285e619f 100644 --- a/src/array.c +++ b/src/array.c @@ -23,7 +23,7 @@ #include "stuff.h" #include "bignum.h" -RCSID("$Id: array.c,v 1.79 2000/07/28 17:16:54 hubbe Exp $"); +RCSID("$Id: array.c,v 1.80 2000/08/10 17:41:09 grubba Exp $"); PMOD_EXPORT struct array empty_array= { @@ -48,10 +48,10 @@ static struct array *gc_mark_array_pos = 0; * NOTE: the new array have zero references */ -PMOD_EXPORT struct array *low_allocate_array(INT32 size,INT32 extra_space) +PMOD_EXPORT struct array *low_allocate_array(ptrdiff_t size, ptrdiff_t extra_space) { struct array *v; - INT32 e; + ptrdiff_t e; if(size == 0) { diff --git a/src/array.h b/src/array.h index a0c160f49c7d6a5d771cfcbd80cbee9289d31807..88367f421d2199b25cf865a5e7851c6faa620dba 100644 --- a/src/array.h +++ b/src/array.h @@ -5,7 +5,7 @@ \*/ /* - * $Id: array.h,v 1.24 2000/08/09 12:49:27 grubba Exp $ + * $Id: array.h,v 1.25 2000/08/10 17:41:48 grubba Exp $ */ #ifndef ARRAY_H #define ARRAY_H @@ -89,7 +89,7 @@ typedef short_cmpfun (*cmpfun_getter)(TYPE_T); /* Prototypes begin here */ -PMOD_EXPORT struct array *low_allocate_array(INT32 size,INT32 extra_space); +PMOD_EXPORT struct array *low_allocate_array(ptrdiff_t size, ptrdiff_t extra_space); void really_free_array(struct array *v); PMOD_EXPORT void do_free_array(struct array *a); PMOD_EXPORT void array_index_no_free(struct svalue *s,struct array *v,INT32 index); diff --git a/src/object.c b/src/object.c index decdc6900027de8a1b699509eb0cccab2fe7d3b4..440964ffc15940b726e24e0a5c1f82896062bab3 100644 --- a/src/object.c +++ b/src/object.c @@ -5,7 +5,7 @@ \*/ /**/ #include "global.h" -RCSID("$Id: object.c,v 1.141 2000/08/10 14:57:41 grubba Exp $"); +RCSID("$Id: object.c,v 1.142 2000/08/10 17:37:38 grubba Exp $"); #include "object.h" #include "dynamic_buffer.h" #include "interpret.h" @@ -1346,7 +1346,8 @@ static inline void gc_check_object(struct object *o) #ifdef PIKE_DEBUG if(debug_gc_check(debug_malloc_pass(o->parent),T_OBJECT, debug_malloc_pass(o))==-2) - fprintf(stderr,"(in object at %lx -> parent)\n",(long)o); + fprintf(stderr,"(in object at %lx -> parent)\n", + DO_NOT_WARN((long)o)); #else gc_check(o->parent); #endif @@ -1613,7 +1614,7 @@ static void f_magic_set_index(INT32 args) void init_object(void) { - int offset; + ptrdiff_t offset; init_destroy_called_mark_hash(); start_new_program(); diff --git a/src/opcodes.c b/src/opcodes.c index 912ffdc739214d374dcf58ee3e9aac25cf0024fd..d0c9bb16ea0b19534d2179014a0c2bda778043d0 100644 --- a/src/opcodes.c +++ b/src/opcodes.c @@ -26,7 +26,7 @@ #include "bignum.h" #include "operators.h" -RCSID("$Id: opcodes.c,v 1.82 2000/08/10 09:51:51 per Exp $"); +RCSID("$Id: opcodes.c,v 1.83 2000/08/10 17:39:22 grubba Exp $"); void index_no_free(struct svalue *to,struct svalue *what,struct svalue *ind) { @@ -1564,7 +1564,7 @@ void o_sscanf(INT32 args) #endif INT32 e,i; int x; - long matched_chars; + ptrdiff_t matched_chars; struct svalue *save_sp=sp; if(sp[-args].type != T_STRING) @@ -1691,7 +1691,7 @@ PMOD_EXPORT void f_sscanf(INT32 args) #endif INT32 e,i; int x; - long matched_chars; + ptrdiff_t matched_chars; struct svalue *save_sp=sp; struct array *a; diff --git a/src/operators.c b/src/operators.c index 8c774383aedce2181aab0a32ac97fd77afa3a743..1b4ac26526c9223b1a8a5154ff648d2e9b3015b2 100644 --- a/src/operators.c +++ b/src/operators.c @@ -6,7 +6,7 @@ /**/ #include "global.h" #include <math.h> -RCSID("$Id: operators.c,v 1.97 2000/08/10 09:51:51 per Exp $"); +RCSID("$Id: operators.c,v 1.98 2000/08/10 17:44:56 grubba Exp $"); #include "interpret.h" #include "svalue.h" #include "multiset.h" @@ -1779,7 +1779,7 @@ PMOD_EXPORT void o_divide(void) for(last=sp[-2].u.string->len,e=0;e<size-1;e++) { - pos=sp[-2].u.string->len - (INT32)((e+1)*len); + pos=sp[-2].u.string->len - (ptrdiff_t)((e+1)*len); a->item[size-1-e].u.string=string_slice(sp[-2].u.string, pos, last-pos); @@ -1792,7 +1792,7 @@ PMOD_EXPORT void o_divide(void) last-pos); a->item[0].type=T_STRING; }else{ - size=(INT32)ceil( ((double)sp[-2].u.string->len) / len); + size=(ptrdiff_t)ceil( ((double)sp[-2].u.string->len) / len); a=allocate_array(size); for(last=0,e=0;e<size-1;e++) @@ -1868,7 +1868,7 @@ PMOD_EXPORT void o_divide(void) for(last=sp[-2].u.array->size,e=0;e<size-1;e++) { - pos=sp[-2].u.array->size - (INT32)((e+1)*len); + pos=sp[-2].u.array->size - (ptrdiff_t)((e+1)*len); a->item[size-1-e].u.array=friendly_slice_array(sp[-2].u.array, pos, last); @@ -1880,12 +1880,12 @@ PMOD_EXPORT void o_divide(void) last); a->item[0].type=T_ARRAY; }else{ - size=(INT32)ceil( ((double)sp[-2].u.array->size) / len); + size = (ptrdiff_t)ceil( ((double)sp[-2].u.array->size) / len); a=allocate_array(size); for(last=0,e=0;e<size-1;e++) { - pos=(INT32)((e+1)*len); + pos = (ptrdiff_t)((e+1)*len); a->item[e].u.array=friendly_slice_array(sp[-2].u.array, last, pos); @@ -2234,7 +2234,7 @@ PMOD_EXPORT void o_compl(void) case T_STRING: { struct pike_string *s; - INT32 len, i; + ptrdiff_t len, i; if(sp[-1].u.string->size_shift) { bad_arg_error("`~", sp-1, 1, 1, "string(0)", sp-1, diff --git a/src/program.c b/src/program.c index ac2c25b95fc920d06ced08d53a211640430338b3..587c9c3f42e6b83a49690bcea4984290d243bdef 100644 --- a/src/program.c +++ b/src/program.c @@ -5,7 +5,7 @@ \*/ /**/ #include "global.h" -RCSID("$Id: program.c,v 1.256 2000/08/10 14:51:50 grubba Exp $"); +RCSID("$Id: program.c,v 1.257 2000/08/10 17:46:34 grubba Exp $"); #include "program.h" #include "object.h" #include "dynamic_buffer.h" @@ -484,7 +484,7 @@ struct program *id_to_program(INT32 id) */ void optimize_program(struct program *p) { - SIZE_T size=0; + size_t size=0; char *data; /* Already done (shouldn't happen, but who knows?) */