From 080b1af7ee1f7d8bbd0c55df6f036e4fc640650c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Grubbstr=C3=B6m=20=28Grubba=29?= <grubba@grubba.org> Date: Thu, 10 Aug 2000 19:46:34 +0200 Subject: [PATCH] Fixed a few warnings. Rev: src/array.c:1.80 Rev: src/array.h:1.25 Rev: src/object.c:1.142 Rev: src/opcodes.c:1.83 Rev: src/operators.c:1.98 Rev: src/program.c:1.257 --- src/array.c | 6 +++--- src/array.h | 4 ++-- src/object.c | 7 ++++--- src/opcodes.c | 6 +++--- src/operators.c | 14 +++++++------- src/program.c | 4 ++-- 6 files changed, 21 insertions(+), 20 deletions(-) diff --git a/src/array.c b/src/array.c index ca59204d73..7bffabd288 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 a0c160f49c..88367f421d 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 decdc69000..440964ffc1 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 912ffdc739..d0c9bb16ea 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 8c774383ae..1b4ac26526 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 ac2c25b95f..587c9c3f42 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?) */ -- GitLab