diff --git a/src/builtin_functions.c b/src/builtin_functions.c index c5fb9e7b07ac09a5dd6fa17eeab67276e9eb413e..bf01d916e552435c9023416772d8459e8003dc35 100644 --- a/src/builtin_functions.c +++ b/src/builtin_functions.c @@ -5,7 +5,7 @@ \*/ /**/ #include "global.h" -RCSID("$Id: builtin_functions.c,v 1.310 2000/09/03 23:21:13 mast Exp $"); +RCSID("$Id: builtin_functions.c,v 1.311 2000/09/07 11:35:17 grubba Exp $"); #include "interpret.h" #include "svalue.h" #include "pike_macros.h" @@ -1069,7 +1069,9 @@ PMOD_EXPORT void f_string_to_unicode(INT32 args) if (d_flag) { for(i = len; i--;) { if (out->str[i]) { - fatal("MEMSET didn't clear byte %d of %d\n", i+1, len); + fatal("MEMSET didn't clear byte %ld of %ld\n", + PTRDIFF_T_TO_LONG(i+1), + PTRDIFF_T_TO_LONG(len)); } } } @@ -1252,8 +1254,8 @@ void f_string_to_utf8(INT32 args) /* 32bit or more. */ if (!extended) { error("string_to_utf8(): " - "Value 0x%08x (index %d) is larger than 31 bits.\n", - c, i); + "Value 0x%08x (index %ld) is larger than 31 bits.\n", + c, PTRDIFF_T_TO_LONG(i)); } len++; /* FIXME: Needs fixing when we get 64bit chars... */ diff --git a/src/interpret.c b/src/interpret.c index f049a34a4154e55df96232f1f195650515a55515..8c136acea9061525f71e7ccc34e887cc8be0807f 100644 --- a/src/interpret.c +++ b/src/interpret.c @@ -5,7 +5,7 @@ \*/ /**/ #include "global.h" -RCSID("$Id: interpret.c,v 1.168 2000/08/24 13:55:23 grubba Exp $"); +RCSID("$Id: interpret.c,v 1.169 2000/09/07 11:28:37 grubba Exp $"); #include "interpret.h" #include "object.h" #include "program.h" @@ -439,7 +439,8 @@ PMOD_EXPORT void find_external_context(struct external_variable_context *loc, { struct program *p; INT32 e,off; - TRACE((4,"-find_external_context(%d, inherit=%d)\n",arg2,loc->inherit - loc->o->prog->inherits)); + TRACE((4, "-find_external_context(%d, inherit=%ld)\n", arg2, + DO_NOT_WARN((long)(loc->inherit - loc->o->prog->inherits)))); if(!loc->o) error("Current object is destructed\n"); @@ -531,10 +532,10 @@ PMOD_EXPORT void find_external_context(struct external_variable_context *loc, my_describe_inherit_structure(p); #endif - TRACE((5,"- Parent identifier = %d (%s), inherit # = %d\n", + TRACE((5,"- Parent identifier = %d (%s), inherit # = %ld\n", loc->parent_identifier, ID_FROM_INT(p, loc->parent_identifier)->name->str, - loc->inherit - p->inherits)); + DO_NOT_WARN((long)(loc->inherit - p->inherits)))); #ifdef DEBUG_MALLOC if (loc->inherit->storage_offset == 0x55555555) { diff --git a/src/mapping.c b/src/mapping.c index 1da6a0f4d19ded3a9e9aabe0ceab2998a368fd07..3df4e45fc663e62d86702e0dc5c1031edb7a155b 100644 --- a/src/mapping.c +++ b/src/mapping.c @@ -5,7 +5,7 @@ \*/ /**/ #include "global.h" -RCSID("$Id: mapping.c,v 1.99 2000/09/03 23:18:46 mast Exp $"); +RCSID("$Id: mapping.c,v 1.100 2000/09/07 11:31:05 grubba Exp $"); #include "main.h" #include "object.h" #include "mapping.h" @@ -1552,11 +1552,13 @@ void describe_mapping(struct mapping *m,struct processing *p,int indent) return; } } - - sprintf(buf, m->data->size == 1 ? "([ /* %ld element */\n" : - "([ /* %ld elements */\n", - (long)m->data->size); - my_strcat(buf); + + if (m->data->size == 1) { + my_strcat("([ /* 1 element */\n"); + } else { + sprintf(buf, "([ /* %ld elements */\n", (long)m->data->size); + my_strcat(buf); + } a = mapping_indices(m); SET_ONERROR(err, do_free_array, a); diff --git a/src/modules/_Image_TIFF/image_tiff.c b/src/modules/_Image_TIFF/image_tiff.c index 0ced22d07d3068f33f53c9cb90891af231df3b1c..a1fb4116163af6105bd835c57d160b4939ebc3fc 100644 --- a/src/modules/_Image_TIFF/image_tiff.c +++ b/src/modules/_Image_TIFF/image_tiff.c @@ -7,7 +7,7 @@ */ #ifdef HAVE_LIBTIFF -RCSID("$Id: image_tiff.c,v 1.20 2000/08/25 16:35:54 grubba Exp $"); +RCSID("$Id: image_tiff.c,v 1.21 2000/09/07 11:25:38 grubba Exp $"); #include "global.h" #include "machine.h" @@ -91,7 +91,9 @@ static void increase_buffer_size( struct buffer * buffer ) * in which case realloc() is wrong. */ new_d = realloc( buffer->str, buffer->len*2 ); - if(!new_d) error("Realloc (%d->%d) failed!\n", buffer->len,buffer->len*2); + if(!new_d) error("Realloc (%ld->%ld) failed!\n", + DO_NOT_WARN((long)buffer->len), + DO_NOT_WARN((long)buffer->len*2)); MEMSET(new_d+buffer->len, 0, buffer->len); buffer->str = new_d; buffer->len *= 2; @@ -146,14 +148,14 @@ static toff_t seek_buffer(thandle_t bh, toff_t seek, int seek_type ) switch(seek_type) { case SEEK_CUR: - while(buffer_handle->len < seek+buffer_handle->offset) + while(buffer_handle->len < (ptrdiff_t)(seek+buffer_handle->offset)) increase_buffer_size( buffer_handle ); buffer_handle->offset += seek; if(buffer_handle->offset > buffer_handle->real_len) buffer_handle->real_len = buffer_handle->offset; break; case SEEK_SET: - while(buffer_handle->len < seek) + while(buffer_handle->len < (ptrdiff_t)seek) increase_buffer_size( buffer_handle ); buffer_handle->offset = seek; if(buffer_handle->offset > buffer_handle->real_len) @@ -339,7 +341,8 @@ void low_image_tiff_decode( struct buffer *buf, TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &h); s = raster = (uint32 *)_TIFFmalloc(w*h*sizeof(uint32)); if (raster == NULL) - error("Malloc failed to allocate buffer for %dx%d image\n",w,h); + error("Malloc failed to allocate buffer for %ldx%ld image\n", + (long)w, (long)h); if(!TIFFReadRGBAImage(tif, w, h, raster, 0)) error("Failed to read TIFF data\n"); diff --git a/src/pike_types.h b/src/pike_types.h index 89847070eff2d44632cd6ddf6a93b29d8ab95f27..6879fbfd85b7de2beae2bb98dbd0c6ab6664ea90 100644 --- a/src/pike_types.h +++ b/src/pike_types.h @@ -5,7 +5,7 @@ \*/ /* - * $Id: pike_types.h,v 1.44 2000/08/16 10:26:51 grubba Exp $ + * $Id: pike_types.h,v 1.45 2000/09/07 11:33:09 grubba Exp $ */ #ifndef PIKE_TYPES_H #define PIKE_TYPES_H @@ -104,7 +104,8 @@ extern struct pike_string *weak_type_string; #define init_type_stack() type_stack_mark() #define exit_type_stack() do {\ ptrdiff_t q_q_q_q = pop_stack_mark(); \ - if(q_q_q_q) fatal("Type stack out of wack! %d\n", q_q_q_q); \ + if(q_q_q_q) fatal("Type stack out of wack! %ld\n", \ + PTRDIFF_T_TO_LONG(q_q_q_q)); \ } while(0) #else #define init_type_stack type_stack_mark