if (fd == -1)
fp = NULL;
else {
- char *fpmode;
+ const char *fpmode;
if (result == O_RDONLY)
fpmode = "r";
#ifdef O_APPEND
|I32 minbits|I32 none
p |UV |swash_fetch |SV *sv|U8 *ptr
p |void |taint_env
-p |void |taint_proper |const char* f|char* s
+p |void |taint_proper |const char* f|const char* s
p |UV |to_utf8_lower |U8 *p
p |UV |to_utf8_upper |U8 *p
p |UV |to_utf8_title |U8 *p
s |I32 |sublex_push
s |I32 |sublex_start
s |char * |filter_gets |SV *sv|PerlIO *fp|STRLEN append
-s |SV* |new_constant |char *s|STRLEN len|char *key|SV *sv \
- |SV *pv|char *type
+s |SV* |new_constant |char *s|STRLEN len|const char *key|SV *sv \
+ |SV *pv|const char *type
s |int |ao |int toketype
s |void |depcom
s |char* |incl_perldb
Perl_magic_nextpack(pTHX_ SV *sv, MAGIC *mg, SV *key)
{
dSP;
- char *meth = SvOK(key) ? "NEXTKEY" : "FIRSTKEY";
+ const char *meth = SvOK(key) ? "NEXTKEY" : "FIRSTKEY";
ENTER;
SAVETMPS;
char *desc = PL_op_desc[(right->op_type == OP_SUBST ||
right->op_type == OP_TRANS)
? right->op_type : OP_MATCH];
- char *sample = ((left->op_type == OP_RV2AV ||
- left->op_type == OP_PADAV)
- ? "@array" : "%hash");
+ const char *sample = ((left->op_type == OP_RV2AV ||
+ left->op_type == OP_PADAV)
+ ? "@array" : "%hash");
Perl_warner(aTHX_ WARN_UNSAFE,
"Applying %s to %s will act on scalar(%s)",
desc, sample, sample);
case '0':
{
dTHR;
- rschar = scan_oct(s, 4, &numlen);
+ rschar = (U32)scan_oct(s, 4, &numlen);
SvREFCNT_dec(PL_nrs);
if (rschar & ~((U8)~0))
PL_nrs = &PL_sv_undef;
if (isDIGIT(*s)) {
PL_ors = savepv("\n");
PL_orslen = 1;
- *PL_ors = scan_oct(s, 3 + (*s == '0'), &numlen);
+ *PL_ors = (char)scan_oct(s, 3 + (*s == '0'), &numlen);
s += numlen;
}
else {
#undef Perl_taint_proper
void
-Perl_taint_proper(pTHXo_ const char* f, char* s)
+Perl_taint_proper(pTHXo_ const char* f, const char* s)
{
((CPerlObj*)pPerl)->Perl_taint_proper(f, s);
}
VIRTUAL SV* Perl_swash_init(pTHX_ char* pkg, char* name, SV* listsv, I32 minbits, I32 none);
VIRTUAL UV Perl_swash_fetch(pTHX_ SV *sv, U8 *ptr);
VIRTUAL void Perl_taint_env(pTHX);
-VIRTUAL void Perl_taint_proper(pTHX_ const char* f, char* s);
+VIRTUAL void Perl_taint_proper(pTHX_ const char* f, const char* s);
VIRTUAL UV Perl_to_utf8_lower(pTHX_ U8 *p);
VIRTUAL UV Perl_to_utf8_upper(pTHX_ U8 *p);
VIRTUAL UV Perl_to_utf8_title(pTHX_ U8 *p);
STATIC I32 S_sublex_push(pTHX);
STATIC I32 S_sublex_start(pTHX);
STATIC char * S_filter_gets(pTHX_ SV *sv, PerlIO *fp, STRLEN append);
-STATIC SV* S_new_constant(pTHX_ char *s, STRLEN len, char *key, SV *sv, SV *pv, char *type);
+STATIC SV* S_new_constant(pTHX_ char *s, STRLEN len, const char *key, SV *sv, SV *pv, const char *type);
STATIC int S_ao(pTHX_ int toketype);
STATIC void S_depcom(pTHX);
STATIC char* S_incl_perldb(pTHX);
if (!e)
FAIL("Missing right brace on \\x{}");
else if (UTF) {
- ender = scan_hex(p + 1, e - p, &numlen);
+ ender = (UV)scan_hex(p + 1, e - p, &numlen);
if (numlen + len >= 127) { /* numlen is generous */
p--;
goto loopdone;
FAIL("Can't use \\x{} without 'use utf8' declaration");
}
else {
- ender = scan_hex(p, 2, &numlen);
+ ender = (UV)scan_hex(p, 2, &numlen);
p += numlen;
}
break;
case '5': case '6': case '7': case '8':case '9':
if (*p == '0' ||
(isDIGIT(p[1]) && atoi(p) >= PL_regnpar) ) {
- ender = scan_oct(p, 3, &numlen);
+ ender = (UV)scan_oct(p, 3, &numlen);
p += numlen;
}
else {
{
dTHR;
register char *opnd, *s;
- register I32 value;
+ register UV value;
register I32 lastvalue = OOB_CHAR8;
register I32 range = 0;
register regnode *ret;
case 'e': value = '\033'; break;
case 'a': value = '\007'; break;
case 'x':
- value = scan_hex(PL_regcomp_parse, 2, &numlen);
+ value = (UV)scan_hex(PL_regcomp_parse, 2, &numlen);
PL_regcomp_parse += numlen;
break;
case 'c':
break;
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
- value = scan_oct(--PL_regcomp_parse, 3, &numlen);
+ value = (UV)scan_oct(--PL_regcomp_parse, 3, &numlen);
PL_regcomp_parse += numlen;
break;
default:
{
dTHR;
register char *opnd, *e;
- register U32 value;
+ register UV value;
register U32 lastvalue = OOB_UTF8;
register I32 range = 0;
register regnode *ret;
e = strchr(PL_regcomp_parse++, '}');
if (!e)
FAIL("Missing right brace on \\x{}");
- value = scan_hex(PL_regcomp_parse,
+ value = (UV)scan_hex(PL_regcomp_parse,
e - PL_regcomp_parse,
&numlen);
PL_regcomp_parse = e + 1;
}
else {
- value = scan_hex(PL_regcomp_parse, 2, &numlen);
+ value = (UV)scan_hex(PL_regcomp_parse, 2, &numlen);
PL_regcomp_parse += numlen;
}
break;
break;
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
- value = scan_oct(--PL_regcomp_parse, 3, &numlen);
+ value = (UV)scan_oct(--PL_regcomp_parse, 3, &numlen);
PL_regcomp_parse += numlen;
break;
default:
case 16:
if (!uv)
alt = FALSE;
- p = (c == 'X') ? "0123456789ABCDEF" : "0123456789abcdef";
+ p = (char*)((c == 'X')
+ ? "0123456789ABCDEF" : "0123456789abcdef");
do {
dig = uv & 15;
*--eptr = p[dig];
#include "perl.h"
void
-Perl_taint_proper(pTHX_ const char *f, char *s)
+Perl_taint_proper(pTHX_ const char *f, const char *s)
{
dTHR; /* just for taint */
char *ug;
? (PL_sublex_info.sub_op->op_private & (PL_lex_repl ?
OPpTRANS_FROM_UTF : OPpTRANS_TO_UTF))
: UTF;
- char *leaveit = /* set of acceptably-backslashed characters */
+ const char *leaveit = /* set of acceptably-backslashed characters */
PL_lex_inpat
? "\\.^$@AGZdDwWsSbBpPXC+*?|()-nrtfeaxcz0123456789[{]} \t\n\r\f\v#"
: "";
/* \132 indicates an octal constant */
case '0': case '1': case '2': case '3':
case '4': case '5': case '6': case '7':
- *d++ = scan_oct(s, 3, &len);
+ *d++ = (char)scan_oct(s, 3, &len);
s += len;
continue;
}
/* note: utf always shorter than hex */
d = (char*)uv_to_utf8((U8*)d,
- scan_hex(s + 1, e - s - 1, &len));
+ (UV)scan_hex(s + 1, e - s - 1, &len));
s = e + 1;
}
else {
and type is used with error messages only. */
STATIC SV *
-S_new_constant(pTHX_ char *s, STRLEN len, char *key, SV *sv, SV *pv, char *type)
+S_new_constant(pTHX_ char *s, STRLEN len, const char *key, SV *sv, SV *pv,
+ const char *type)
{
dSP;
HV *table = GvHV(PL_hintgv); /* ^H */
SV *res;
SV **cvp;
SV *cv, *typesv;
- char *why, *why1, *why2;
+ const char *why, *why1, *why2;
if (!(PL_hints & HINT_LOCALIZE_HH)) {
SV *msg;
if ((*s == '[' || (*s == '{' && strNE(dest, "sub")))) {
dTHR; /* only for ckWARN */
if (ckWARN(WARN_AMBIGUOUS) && keyword(dest, d - dest)) {
- char *brack = *s == '[' ? "[...]" : "{...}";
+ const char *brack = *s == '[' ? "[...]" : "{...}";
Perl_warner(aTHX_ WARN_AMBIGUOUS,
"Ambiguous use of %c{%s%s} resolved to %c%s%s",
funny, dest, brack, funny, dest, brack);
#endif
static void get_shell(void);
-static long tokenize(char *str, char **dest, char ***destv);
+static long tokenize(const char *str, char **dest, char ***destv);
int do_spawn2(char *cmd, int exectype);
static BOOL has_shell_metachars(char *ptr);
static long filetime_to_clock(PFILETIME ft);
* Returns number of words in result buffer.
*/
static long
-tokenize(char *str, char **dest, char ***destv)
+tokenize(const char *str, char **dest, char ***destv)
{
char *retstart = Nullch;
char **retvstart = 0;
* interactive use (which is what most programs look in COMSPEC
* for).
*/
- char* defaultshell = (IsWinNT() ? "cmd.exe /x/c" : "command.com /c");
- char *usershell = getenv("PERL5SHELL");
+ const char* defaultshell = (IsWinNT()
+ ? "cmd.exe /x/c" : "command.com /c");
+ const char *usershell = getenv("PERL5SHELL");
w32_perlshell_items = tokenize(usershell ? usershell : defaultshell,
&w32_perlshell_tokens,
&w32_perlshell_vec);