This is the residue of the warning fixes I have made and which haven't been applied before I start a new working copy :)
Index: chartype.c =================================================================== RCS file: /home/perlcvs/parrot/chartype.c,v retrieving revision 1.5 diff -u -r1.5 chartype.c --- chartype.c 30 Mar 2002 03:07:12 -0000 1.5 +++ chartype.c 3 Apr 2002 08:42:41 -0000 @@ -28,6 +28,7 @@ } else { internal_exception(INVALID_CHARTYPE, "Invalid chartype '%s'\n", name); + return NULL; } } Index: encoding.c =================================================================== RCS file: /home/perlcvs/parrot/encoding.c,v retrieving revision 1.5 diff -u -r1.5 encoding.c --- encoding.c 30 Mar 2002 03:07:12 -0000 1.5 +++ encoding.c 3 Apr 2002 08:42:41 -0000 @@ -36,6 +36,7 @@ } else { internal_exception(INVALID_ENCODING, "Invalid encoding '%s'\n", name); + return NULL; } } Index: packfile.c =================================================================== RCS file: /home/perlcvs/parrot/packfile.c,v retrieving revision 1.37 diff -u -r1.37 packfile.c --- packfile.c 28 Mar 2002 08:02:02 -0000 1.37 +++ packfile.c 3 Apr 2002 08:42:41 -0000 @@ -125,8 +125,8 @@ if (segment_size % sizeof(opcode_t)) { fprintf(stderr, - "PackFile_unpack: Illegal %s table segment size %ld (must be multiple of %i)!\n", - debug, segment_size, sizeof(opcode_t)); + "PackFile_unpack: Illegal %s table segment size %ld (must be multiple +of %ld)!\n", + debug, segment_size, (long)sizeof(opcode_t)); return 0; } return 1; Index: string.c =================================================================== RCS file: /home/perlcvs/parrot/string.c,v retrieving revision 1.65 diff -u -r1.65 string.c --- string.c 30 Mar 2002 03:04:37 -0000 1.65 +++ string.c 3 Apr 2002 08:42:41 -0000 @@ -191,8 +191,8 @@ STRING *dest; CHARTYPE_TRANSCODER transcoder1 = (CHARTYPE_TRANSCODER)NULLfunc; CHARTYPE_TRANSCODER transcoder2 = (CHARTYPE_TRANSCODER)NULLfunc; - char *srcstart; - char *srcend; + const char *srcstart; + const char *srcend; char *deststart; char *destend; @@ -384,11 +384,11 @@ true_length = (UINTVAL)(src->strlen - true_offset); } - substart_off = (char *)src->encoding->skip_forward(src->bufstart, + substart_off = (const char *)src->encoding->skip_forward(src->bufstart, true_offset) - (char *)src->bufstart; subend_off = - (char *)src->encoding->skip_forward((char *)src->bufstart + + (const char *)src->encoding->skip_forward((char *)src->bufstart + substart_off, true_length) - (char *)src->bufstart; @@ -539,8 +539,8 @@ STRING * string_chopn(STRING *s, INTVAL n) { - char *bufstart = s->bufstart; - char *bufend = bufstart + s->bufused; + const char *bufstart = s->bufstart; + const char *bufend = bufstart + s->bufused; UINTVAL true_n; true_n = (UINTVAL)n; @@ -566,10 +566,10 @@ string_compare(struct Parrot_Interp *interpreter, const STRING *s1, const STRING *s2) { - char *s1start; - char *s1end; - char *s2start; - char *s2end; + const char *s1start; + const char *s1end; + const char *s2start; + const char *s2end; INTVAL cmp = 0; if (s1 && !s2) { @@ -655,8 +655,8 @@ INTVAL i = 0; if (s) { - char *start = s->bufstart; - char *end = start + s->bufused; + const char *start = s->bufstart; + const char *end = start + s->bufused; int sign = 1; BOOLVAL in_number = 0; @@ -695,8 +695,8 @@ FLOATVAL f = 0.0; if (s) { - char *start = s->bufstart; - char *end = start + s->bufused; + const char *start = s->bufstart; + const char *end = start + s->bufused; int sign = 1; BOOLVAL seen_dot = 0; BOOLVAL seen_e = 0; Index: encodings/singlebyte.c =================================================================== RCS file: /home/perlcvs/parrot/encodings/singlebyte.c,v retrieving revision 1.14 diff -u -r1.14 singlebyte.c --- encodings/singlebyte.c 12 Mar 2002 11:34:01 -0000 1.14 +++ encodings/singlebyte.c 3 Apr 2002 08:42:41 -0000 @@ -43,18 +43,18 @@ return bptr + 1; } -static void * +static const void * singlebyte_skip_forward(const void *ptr, UINTVAL n) { - byte_t *bptr = (byte_t *)ptr; + const byte_t *bptr = (const byte_t *)ptr; return bptr + n; } -static void * +static const void * singlebyte_skip_backward(const void *ptr, UINTVAL n) { - byte_t *bptr = (byte_t *)ptr; + const byte_t *bptr = (const byte_t *)ptr; return bptr - n; } Index: encodings/utf16.c =================================================================== RCS file: /home/perlcvs/parrot/encodings/utf16.c,v retrieving revision 1.11 diff -u -r1.11 utf16.c --- encodings/utf16.c 12 Mar 2002 11:34:01 -0000 1.11 +++ encodings/utf16.c 3 Apr 2002 08:42:41 -0000 @@ -81,10 +81,10 @@ return u16ptr; } -static void * +static const void * utf16_skip_forward(const void *ptr, UINTVAL n) { - utf16_t *u16ptr = (utf16_t *)ptr; + const utf16_t *u16ptr = (const utf16_t *)ptr; while (n-- > 0) { if (UNICODE_IS_HIGH_SURROGATE(*u16ptr)) { @@ -106,10 +106,10 @@ return u16ptr; } -static void * +static const void * utf16_skip_backward(const void *ptr, UINTVAL n) { - utf16_t *u16ptr = (utf16_t *)ptr; + const utf16_t *u16ptr = (const utf16_t *)ptr; while (n-- > 0) { u16ptr--; Index: encodings/utf32.c =================================================================== RCS file: /home/perlcvs/parrot/encodings/utf32.c,v retrieving revision 1.9 diff -u -r1.9 utf32.c --- encodings/utf32.c 12 Mar 2002 11:34:01 -0000 1.9 +++ encodings/utf32.c 3 Apr 2002 08:42:41 -0000 @@ -48,18 +48,18 @@ return u32ptr + 1; } -static void * +static const void * utf32_skip_forward(const void *ptr, UINTVAL n) { - utf32_t *u32ptr = (utf32_t *)ptr; + const utf32_t *u32ptr = (const utf32_t *)ptr; return u32ptr + n; } -static void * +static const void * utf32_skip_backward(const void *ptr, UINTVAL n) { - utf32_t *u32ptr = (utf32_t *)ptr; + const utf32_t *u32ptr = (const utf32_t *)ptr; return u32ptr - n; } Index: encodings/utf8.c =================================================================== RCS file: /home/perlcvs/parrot/encodings/utf8.c,v retrieving revision 1.12 diff -u -r1.12 utf8.c --- encodings/utf8.c 12 Mar 2002 11:34:01 -0000 1.12 +++ encodings/utf8.c 3 Apr 2002 08:42:41 -0000 @@ -107,10 +107,10 @@ return u8ptr + len; } -static void * +static const void * utf8_skip_forward(const void *ptr, UINTVAL n) { - utf8_t *u8ptr = (utf8_t *)ptr; + const utf8_t *u8ptr = (const utf8_t *)ptr; while (n-- > 0) { u8ptr += UTF8SKIP(u8ptr); @@ -119,10 +119,10 @@ return u8ptr; } -static void * +static const void * utf8_skip_backward(const void *ptr, UINTVAL n) { - utf8_t *u8ptr = (utf8_t *)ptr; + const utf8_t *u8ptr = (const utf8_t *)ptr; while (n-- > 0) { u8ptr--; Index: include/parrot/encoding.h =================================================================== RCS file: /home/perlcvs/parrot/include/parrot/encoding.h,v retrieving revision 1.12 diff -u -r1.12 encoding.h --- include/parrot/encoding.h 17 Mar 2002 06:44:44 -0000 1.12 +++ include/parrot/encoding.h 3 Apr 2002 08:42:42 -0000 @@ -28,8 +28,8 @@ Parrot_UInt(*characters) (const void *ptr, Parrot_UInt bytes); Parrot_UInt(*decode) (const void *ptr); void *(*encode) (void *ptr, Parrot_UInt c); - void *(*skip_forward) (const void *ptr, Parrot_UInt n); - void *(*skip_backward) (const void *ptr, Parrot_UInt n); + const void *(*skip_forward) (const void *ptr, Parrot_UInt n); + const void *(*skip_backward) (const void *ptr, Parrot_UInt n); }; #define Parrot_Encoding struct parrot_encoding_t * /J\ -- Jonathan Stowe | <http://www.gellyfish.com> | This space for rent |