{
char *s;
if ((s = PerlEnv_getenv("PERL_DESTRUCT_LEVEL"))) {
- int i = atoi(s);
+ const int i = atoi(s);
if (destruct_level < i)
destruct_level = i;
}
bytes of stack longer than necessary
*/
STATIC void
-S_procself_val(pTHX_ SV *sv, char *arg0)
+S_procself_val(pTHX_ SV *sv, const char *arg0)
{
char buf[MAXPATHLEN];
int len = readlink(PROCSELFEXE_PATH, buf, sizeof(buf) - 1);
* the area we are able to modify is limited to the size of
* the original argv[0]. (See below for 'contiguous', though.)
* --jhi */
- char *s = NULL;
+ const char *s = NULL;
int i;
UV mask =
~(UV)(PTRSIZE == 4 ? 3 : PTRSIZE == 8 ? 7 : PTRSIZE == 16 ? 15 : 0);
S_parse_body(pTHX_ char **env, XSINIT_t xsinit)
{
int argc = PL_origargc;
- char **argv = PL_origargv;
- char *scriptname = NULL;
+ const char **argv = PL_origargv;
+ const char *scriptname = NULL;
VOL bool dosearch = FALSE;
- char *validarg = "";
+ const char *validarg = "";
register SV *sv;
register char *s;
- char *cddir = Nullch;
+ const char *cddir = Nullch;
bool minus_f = FALSE;
PL_fdscript = -1;
#endif
(s = PerlEnv_getenv("PERL5OPT")))
{
- char *popt = s;
+ const char *popt = s;
while (isSPACE(*s))
s++;
if (*s == '-' && *(s+1) == 'T') {
*/
I32
-Perl_call_argv(pTHX_ const char *sub_name, I32 flags, register char **argv)
+Perl_call_argv(pTHX_ const char *sub_name, I32 flags, register const char **argv)
/* See G_* flags in cop.h */
/* null terminated arg list */
}
STATIC void
-S_call_body(pTHX_ OP *myop, int is_eval)
+S_call_body(pTHX_ const OP *myop, int is_eval)
{
if (PL_op == myop) {
if (is_eval)
}
void
-Perl_magicname(pTHX_ char *sym, char *name, I32 namlen)
+Perl_magicname(pTHX_ const char *sym, const char *name, I32 namlen)
{
register GV *gv;
}
STATIC void
-S_usage(pTHX_ char *name) /* XXX move this out into a module ? */
+S_usage(pTHX_ const char *name) /* XXX move this out into a module ? */
{
/* This message really ought to be max 23 lines.
* Removed -h because the user already knows that option. Others? */
"\n",
NULL
};
- char **p = usage_msg;
+ const char **p = usage_msg;
PerlIO_printf(PerlIO_stdout(),
"\nUsage: %s [switches] [--] [programfile] [arguments]",
#ifdef DEBUGGING
int
-Perl_get_debug_opts(pTHX_ char **s, bool givehelp)
+Perl_get_debug_opts(pTHX_ const char **s, bool givehelp)
{
static const char *usage_msgd[] = {
" Debugging flag values: (see also -d)",
static const char debopts[] = "psltocPmfrxu HXDSTRJvCAq";
for (; isALNUM(**s); (*s)++) {
- char *d = strchr(debopts,**s);
+ const char *d = strchr(debopts,**s);
if (d)
i |= 1 << (d - debopts);
else if (ckWARN_d(WARN_DEBUGGING))
for (; isALNUM(**s); (*s)++) ;
}
else if (givehelp) {
- char **p = usage_msgd;
+ const char **p = usage_msgd;
while (*p) PerlIO_printf(PerlIO_stdout(), "%s\n", *p++);
}
# ifdef EBCDIC
if (*++s) {
char *start;
SV *sv;
- char *use = "use ";
+ const char *use = "use ";
/* -M-foo == 'no foo' */
if (*s == '-') { use = "no "; ++s; }
sv = newSVpv(use,0);
S_open_script(pTHX_ char *scriptname, bool dosearch, SV *sv)
{
#ifndef IAMSUID
- char *quote;
- char *code;
- char *cpp_discard_flag;
- char *perl;
+ const char *quote;
+ const char *code;
+ const char *cpp_discard_flag;
+ const char *perl;
#endif
PL_fdscript = -1;
PL_origfilename = scriptname = find_script(scriptname, dosearch, NULL, 1);
if (strnEQ(scriptname, "/dev/fd/", 8) && isDIGIT(scriptname[8]) ) {
- char *s = scriptname + 8;
+ const char *s = scriptname + 8;
PL_fdscript = atoi(s);
while (isDIGIT(*s))
s++;
#endif /* IAMSUID */
STATIC void
-S_validate_suid(pTHX_ char *validarg, char *scriptname)
+S_validate_suid(pTHX_ const char *validarg, const char *scriptname)
{
#ifdef IAMSUID
/* int which; */
* before even the options are parsed, so PL_tainting has
* not been initialized properly. */
bool
-Perl_doing_taint(int argc, char *argv[], char *envp[])
+Perl_doing_taint(int argc, const char *argv[], const char *envp[])
{
#ifndef PERL_IMPLICIT_SYS
/* If we have PERL_IMPLICIT_SYS we can't call getuid() et alia
}
STATIC void
-S_forbid_setid(pTHX_ char *s)
+S_forbid_setid(pTHX_ const char *s)
{
#ifdef SETUID_SCRIPTS_ARE_SECURE_NOW
if (PL_euid != PL_uid)
}
void
-Perl_init_argv_symbols(pTHX_ register int argc, register char **argv)
+Perl_init_argv_symbols(pTHX_ register int argc, register const char **argv)
{
char *s;
argc--,argv++; /* skip name of script */
}
STATIC void
-S_incpush(pTHX_ char *p, int addsubdirs, int addoldvers, int usesep,
+S_incpush(pTHX_ const char *p, int addsubdirs, int addoldvers, int usesep,
int canrelocate)
{
SV *subdir = Nullsv;
/* Break at all separators */
while (p && *p) {
SV *libdir = NEWSV(55,0);
- char *s;
+ const char *s;
/* skip any consecutive separators */
if (usesep) {
int ret;
dJMPENV;
- while (AvFILL(paramList) >= 0) {
+ while (av_len(paramList) >= 0) {
cv = (CV*)av_shift(paramList);
if (PL_savebegin) {
if (paramList == PL_beginav) {