/* create and re-create @.*::SUPER::ISA on demand */
if (!av || !SvMAGIC(av)) {
- char* packname = HvNAME(stash);
+ const char* packname = HvNAME(stash);
STRLEN packlen = strlen(packname);
if (packlen >= 7 && strEQ(packname + packlen - 7, "::SUPER")) {
GV *gv = gv_fetchmeth(stash, name, len, level);
if (!gv) {
- char autoload[] = "AUTOLOAD";
+ const char autoload[] = "AUTOLOAD";
STRLEN autolen = sizeof(autoload)-1;
CV *cv;
GV **gvp;
Perl_gv_autoload4(pTHX_ HV *stash, const char *name, STRLEN len, I32 method)
{
dVAR;
- char autoload[] = "AUTOLOAD";
- STRLEN autolen = sizeof(autoload)-1;
+ const char autoload[] = "AUTOLOAD";
+ const STRLEN autolen = sizeof(autoload)-1;
GV* gv;
CV* cv;
HV* varstash;
HV*
Perl_gv_stashsv(pTHX_ SV *sv, I32 create)
{
- register char *ptr;
STRLEN len;
- ptr = SvPV(sv,len);
+ const char *ptr = SvPV(sv,len);
return gv_stashpvn(ptr, len, create);
}
GV *
Perl_gv_fetchpv(pTHX_ const char *nambeg, I32 add, I32 sv_type) {
- STRLEN len = strlen (nambeg);
- return gv_fetchpvn_flags(nambeg, len, add, sv_type);
+ return gv_fetchpvn_flags(nambeg, strlen(nambeg), add, sv_type);
}
GV *
IO *
Perl_newIO(pTHX)
{
- IO *io;
GV *iogv;
+ IO * const io = (IO*)NEWSV(0,0);
- io = (IO*)NEWSV(0,0);
sv_upgrade((SV *)io,SVt_PVIO);
SvREFCNT(io) = 1;
SvOBJECT_on(io);
Perl_gv_check(pTHX_ HV *stash)
{
register I32 i;
- register GV *gv;
- HV *hv;
if (!HvARRAY(stash))
return;
for (i = 0; i <= (I32) HvMAX(stash); i++) {
const HE *entry;
for (entry = HvARRAY(stash)[i]; entry; entry = HeNEXT(entry)) {
+ register GV *gv;
+ HV *hv;
if (HeKEY(entry)[HeKLEN(entry)-1] == ':' &&
(gv = (GV*)HeVAL(entry)) && isGV(gv) && (hv = GvHV(gv)))
{
{
MAGIC *mg;
AMT *amtp;
- CV *ret;
if (!stash || !HvNAME(stash))
return Nullcv;
|| amtp->was_ok_sub != PL_sub_generation )
goto do_update;
if (AMT_AMAGIC(amtp)) {
- ret = amtp->table[id];
+ CV * const ret = amtp->table[id];
if (ret && isGV(ret)) { /* Autoloading stab */
/* Passing it through may have resulted in a warning
"Inherited AUTOLOAD for a non-method deprecated", since
case string_amg:
(void)((cv = cvp[off=numer_amg]) || (cv = cvp[off=bool__amg]));
break;
- case not_amg:
- (void)((cv = cvp[off=bool__amg])
- || (cv = cvp[off=numer_amg])
- || (cv = cvp[off=string_amg]));
- postpr = 1;
- break;
+ case not_amg:
+ (void)((cv = cvp[off=bool__amg])
+ || (cv = cvp[off=numer_amg])
+ || (cv = cvp[off=string_amg]));
+ postpr = 1;
+ break;
case copy_amg:
{
/*
dSP;
BINOP myop;
SV* res;
- bool oldcatch = CATCH_GET;
+ const bool oldcatch = CATCH_GET;
CATCH_SET(TRUE);
Zero(&myop, 1, BINOP);
CATCH_SET(oldcatch);
if (postpr) {
- int ans=0;
+ int ans;
switch (method) {
case le_amg:
case sle_amg:
SvSetSV(left,res); return left;
case not_amg:
ans=!SvTRUE(res); break;
+ default:
+ ans=0; break;
}
return boolSV(ans);
} else if (method==copy_amg) {
my_vars = my_plvarsp = plvarsp;
# endif
#endif /* PERL_GLOBAL_STRUCT */
-
+
+ (void)argc; /* PERL_SYS_INIT3 may #define away their use */
+ (void)argv;
PERL_SYS_INIT3(&argc,&argv,&env);
my_perl = perl_alloc();
SV** ppad = AvARRAY(protopad);
const I32 fname = AvFILLp(protopad_name);
const I32 fpad = AvFILLp(protopad);
- AV* comppadlist;
CV* cv;
SV** outpad;
CV* outside;
if (SvPOK(proto))
sv_setpvn((SV*)cv, SvPVX(proto), SvCUR(proto));
- CvPADLIST(cv) = comppadlist = pad_new(padnew_CLONE|padnew_SAVE);
+ CvPADLIST(cv) = pad_new(padnew_CLONE|padnew_SAVE);
av_fill(PL_comppad, fpad);
for (ix = fname; ix >= 0; ix--)
destruct_level = PL_perl_destruct_level;
#ifdef DEBUGGING
{
- char *s;
+ const char *s;
if ((s = PerlEnv_getenv("PERL_DESTRUCT_LEVEL"))) {
const int i = atoi(s);
if (destruct_level < i)
#ifndef __attribute__format__
# ifdef CHECK_FORMAT
-# define __attribute__format__(x,y,z) __attribute__((__format__(x,y,z)))
+# define __attribute__format__(x,y,z) __attribute__((format(x,y,z)))
# else
# define __attribute__format__(x,y,z)
# endif
#endif
-
+
/* Some unistd.h's give a prototype for pause() even though
HAS_PAUSE ends up undefined. This causes the #define
below to be rejected by the compiler. Sigh.
else
return 0;
# else
+ (void)fp;
+ (void)iotype;
+ (void)mode;
return 1;
# endif
#endif
PerlIO_binmode(pTHX_ PerlIO *fp, int iotype, int mode, const char *names)
{
#ifdef USE_SFIO
+ (void)iotype;
+ (void)mode;
+ (void)names;
return 1;
#else
return perlsio_binmode(fp, iotype, mode);
START_EXTERN_C
#ifndef __attribute__format__
-#ifdef CHECK_FORMAT
-#define __attribute__format__(x,y,z) __attribute__((__format__(x,y,z)))
-#else
-#define __attribute__format__(x,y,z)
+# ifdef CHECK_FORMAT
+# define __attribute__format__(x,y,z) __attribute__((format(x,y,z)))
+# else
+# define __attribute__format__(x,y,z)
#endif
#endif
#ifndef NEXT30_NO_ATTRIBUTE
PerlIO_list_t *layers, IV n, IV max);
PERL_EXPORT_C int PerlIO_parse_layers(pTHX_ PerlIO_list_t *av, const char *names);
PERL_EXPORT_C PerlIO_funcs *PerlIO_layer_fetch(pTHX_ PerlIO_list_t *av, IV n, PerlIO_funcs *def);
-PERL_EXPORT_C void PerlIO_debug(const char *fmt, ...)
- __attribute__format__(__printf__, 1, 2);
PERL_EXPORT_C SV *PerlIO_sv_dup(pTHX_ SV *arg, CLONE_PARAMS *param);
PERL_EXPORT_C PerlIO_funcs * PerlIO_default_layer(pTHX_ I32 n);
PERL_EXPORT_C PerlIO_list_t * PerlIO_default_layers(pTHX);
PERL_EXPORT_C PerlIO * PerlIO_reopen(const char *path, const char *mode, PerlIO *f);
-PERL_EXPORT_C int PerlIO_vsprintf(char *s, int n, const char *fmt, va_list ap);
+PERL_EXPORT_C int PerlIO_vsprintf(char *s, int n, const char *fmt, va_list ap)
+ __attribute__format__(__printf__,3,0);
PERL_EXPORT_C PerlIO_list_t *PerlIO_list_alloc(pTHX);
PERL_EXPORT_C PerlIO_list_t *PerlIO_clone_list(pTHX_ PerlIO_list_t *proto, CLONE_PARAMS *param);
{
const char* patptr = symptr->patptr;
const char* patend = symptr->patend;
- const char *allowed = "";
symptr->flags &= ~FLAG_SLASH;
/* look for modifiers */
while (patptr < patend) {
- I32 modifier = 0;
+ const char *allowed;
+ I32 modifier;
switch (*patptr) {
case '!':
modifier = TYPE_IS_SHRIEKING;
break;
#endif /* PERL_PACK_CAN_BYTEORDER */
default:
+ allowed = "";
+ modifier = 0;
break;
}
}
-void
+static void
S_sortsv_desc(pTHX_ SV **array, size_t nmemb, SVCOMPARE_t cmp)
{
void (*sortsvp)(pTHX_ SV **array, size_t nmemb, SVCOMPARE_t cmp, U32 flags)
}
void
-croak(char *pat,...)
+croak(const char *pat,...)
{
#if defined(HAS_VPRINTF)
va_list args;
}
void
-fatal(char *pat,...)
+fatal(const char *pat,...)
{
#if defined(HAS_VPRINTF)
va_list args;
__private_extern__ /* warn() conflicts with libc */
#endif
void
-warn(char *pat,...)
+warn(const char *pat,...)
{
#if defined(HAS_VPRINTF)
va_list args;
int eaccess();
#endif
-char *getwd();
-int makedir();
-
char * cpy2 ( char *to, char *from, int delim );
char * cpytill ( char *to, char *from, int delim );
void growstr ( char **strptr, int *curlen, int newlen );
char * instr ( char *big, char *little );
char * safecpy ( char *to, char *from, int len );
char * savestr ( char *str );
-void croak ( char *pat, ... );
-void fatal ( char *pat, ... );
-void warn ( char *pat, ... );
+void croak ( const char *pat, ... );
+void fatal ( const char *pat, ... );
+void warn ( const char *pat, ... );
int prewalk ( int numit, int level, int node, int *numericptr );
Malloc_t safemalloc (MEM_SIZE nbytes);