[josh-003.patch]
This patch adds some missing const's to silence a number of gcc warnings. --Josh Index: include/parrot/warnings.h =================================================================== RCS file: /home/perlcvs/parrot/include/parrot/warnings.h,v retrieving revision 1.1 diff -u -r1.1 warnings.h --- include/parrot/warnings.h 5 Feb 2002 09:20:16 -0000 1.1 +++ include/parrot/warnings.h 18 Feb 2002 04:28:27 -0000 @@ -15,7 +15,7 @@ #define PARROT_WARNINGS_test(interp, flag) interp->warns->classes & flag INTVAL -Parrot_warn(struct Parrot_Interp *, INTVAL warnclass, char* message, ...); +Parrot_warn(struct Parrot_Interp *, INTVAL warnclass, const char* message, ...); INTVAL Parrot_warn_s(struct Parrot_Interp *, INTVAL warnclass, STRING* message, ...); Index: include/parrot/misc.h =================================================================== RCS file: /home/perlcvs/parrot/include/parrot/misc.h,v retrieving revision 1.2 diff -u -r1.2 misc.h --- include/parrot/misc.h 5 Feb 2002 10:04:10 -0000 1.2 +++ include/parrot/misc.h 18 Feb 2002 04:28:27 -0000 @@ -6,19 +6,19 @@ STRING* Parrot_vsprintf_s(struct Parrot_Interp *, STRING* pat, va_list *); -STRING* Parrot_vsprintf_c(struct Parrot_Interp *, char * pat, va_list *); +STRING* Parrot_vsprintf_c(struct Parrot_Interp *, const char * pat, va_list *); -void Parrot_vsprintf(struct Parrot_Interp *, char *targ, char *pat, va_list *); +void Parrot_vsprintf(struct Parrot_Interp *, char *targ, const char *pat, va_list *); -void Parrot_vsnprintf(struct Parrot_Interp *, char *targ, UINTVAL len, char *pat, va_list *); +void Parrot_vsnprintf(struct Parrot_Interp *, char *targ, UINTVAL len, const char +*pat, va_list *); STRING* Parrot_sprintf_s(struct Parrot_Interp *, STRING* pat, ...); -STRING* Parrot_sprintf_c(struct Parrot_Interp *, char * pat, ...); +STRING* Parrot_sprintf_c(struct Parrot_Interp *, const char * pat, ...); -void Parrot_sprintf(struct Parrot_Interp *, char *targ, char *pat, ...); +void Parrot_sprintf(struct Parrot_Interp *, char *targ, const char *pat, ...); -void Parrot_snprintf(struct Parrot_Interp *, char *targ, UINTVAL len, char *pat, ...); +void Parrot_snprintf(struct Parrot_Interp *, char *targ, UINTVAL len, const char +*pat, ...); #endif Index: warnings.c =================================================================== RCS file: /home/perlcvs/parrot/warnings.c,v retrieving revision 1.2 diff -u -r1.2 warnings.c --- warnings.c 6 Feb 2002 17:59:00 -0000 1.2 +++ warnings.c 18 Feb 2002 04:28:27 -0000 @@ -3,7 +3,7 @@ #include <stdarg.h> INTVAL -Parrot_warn(struct Parrot_Interp *interpreter, INTVAL warnclass, char* message, ...) { +Parrot_warn(struct Parrot_Interp *interpreter, INTVAL warnclass, const char* message, +...) { STRING * targ; va_list args; Index: misc.c =================================================================== RCS file: /home/perlcvs/parrot/misc.c,v retrieving revision 1.11 diff -u -r1.11 misc.c --- misc.c 15 Feb 2002 02:30:02 -0000 1.11 +++ misc.c 18 Feb 2002 04:28:31 -0000 @@ -277,6 +277,7 @@ info.phase = PHASE_WIDTH; goto AGAIN; } + break; case PHASE_WIDTH: switch (ch) { @@ -301,6 +302,7 @@ info.phase = PHASE_PREC; goto AGAIN; } + break; case PHASE_PREC: switch (ch) { @@ -321,6 +323,7 @@ info.phase = PHASE_TYPE; goto AGAIN; } + break; case PHASE_TYPE: switch (ch) { @@ -496,7 +499,7 @@ } -STRING *Parrot_vsprintf_c(struct Parrot_Interp * interpreter, char *pat, +STRING *Parrot_vsprintf_c(struct Parrot_Interp * interpreter, const char *pat, va_list * args) { STRING *realpat = @@ -505,7 +508,7 @@ return Parrot_vsprintf_s(interpreter, realpat, args); } void -Parrot_vsprintf(struct Parrot_Interp *interpreter, char *targ, char *pat, +Parrot_vsprintf(struct Parrot_Interp *interpreter, char *targ, const char *pat, va_list * args) { STRING *ret = Parrot_vsprintf_c(interpreter, pat, args); @@ -517,7 +520,7 @@ void Parrot_vsnprintf(struct Parrot_Interp *interpreter, char *targ, - UINTVAL len, char *pat, va_list * args) + UINTVAL len, const char *pat, va_list * args) { STRING *ret = Parrot_vsprintf_c(interpreter, pat, args); string_transcode(interpreter, ret, NULL, NULL, &ret); @@ -545,7 +548,7 @@ return ret; } -STRING *Parrot_sprintf_c(struct Parrot_Interp * interpreter, char *pat, +STRING *Parrot_sprintf_c(struct Parrot_Interp * interpreter, const char *pat, ...) { STRING *ret; @@ -561,7 +564,7 @@ } void -Parrot_sprintf(struct Parrot_Interp *interpreter, char *targ, char *pat, +Parrot_sprintf(struct Parrot_Interp *interpreter, char *targ, const char *pat, ...) { va_list args; @@ -575,7 +578,7 @@ void Parrot_snprintf(struct Parrot_Interp *interpreter, char *targ, UINTVAL len, - char *pat, ...) + const char *pat, ...) { va_list args;