summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2002-04-21 19:53:08 +0000
committerGurusamy Sarathy <gsar@cpan.org>2002-04-21 19:53:08 +0000
commiteb160463266f58ba83ae9bb9ae8bbdc8f0c3027b (patch)
tree41330a73ec92d9224b0fa008fcbc23fdc6593417 /toke.c
parentb8778c7c6345cf412905d167e9498cfd0d4983ea (diff)
downloadperl-eb160463266f58ba83ae9bb9ae8bbdc8f0c3027b.tar.gz
fixes for all the warnings reported by Visual C (most of this
change is from change#12026) p4raw-link: @12026 on //depot/maint-5.6/perl: ff42b73b40f5a895aef4bed81c794f468e0609bc p4raw-id: //depot/perl@16048
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/toke.c b/toke.c
index 2e862b47f2..cf04cfa68e 100644
--- a/toke.c
+++ b/toke.c
@@ -302,7 +302,7 @@ S_missingterm(pTHX_ char *s)
s = tmpbuf;
}
else {
- *tmpbuf = PL_multi_close;
+ *tmpbuf = (char)PL_multi_close;
tmpbuf[1] = '\0';
s = tmpbuf;
}
@@ -711,7 +711,7 @@ S_lop(pTHX_ I32 f, int x, char *s)
PL_expect = x;
PL_bufptr = s;
PL_last_lop = PL_oldbufptr;
- PL_last_lop_op = f;
+ PL_last_lop_op = (OPCODE)f;
if (PL_nexttoke)
return LSTOP;
if (*s == '(')
@@ -1069,7 +1069,7 @@ S_sublex_push(pTHX)
*PL_lex_casestack = '\0';
PL_lex_starts = 0;
PL_lex_state = LEX_INTERPCONCAT;
- CopLINE_set(PL_curcop, PL_multi_start);
+ CopLINE_set(PL_curcop, (line_t)PL_multi_start);
PL_lex_inwhat = PL_sublex_info.sub_inwhat;
if (PL_lex_inwhat == OP_MATCH || PL_lex_inwhat == OP_QR || PL_lex_inwhat == OP_SUBST)
@@ -1288,7 +1288,7 @@ S_scan_const(pTHX_ char *start)
else
#endif
for (i = min; i <= max; i++)
- *d++ = i;
+ *d++ = (char)i;
/* mark the range as done, and continue */
dorange = FALSE;
@@ -1496,8 +1496,8 @@ S_scan_const(pTHX_ char *start)
while (src >= (U8 *)SvPVX(sv)) {
if (!NATIVE_IS_INVARIANT(*src)) {
U8 ch = NATIVE_TO_ASCII(*src);
- *dst-- = UTF8_EIGHT_BIT_LO(ch);
- *dst-- = UTF8_EIGHT_BIT_HI(ch);
+ *dst-- = (U8)UTF8_EIGHT_BIT_LO(ch);
+ *dst-- = (U8)UTF8_EIGHT_BIT_HI(ch);
}
else {
*dst-- = *src;
@@ -1573,11 +1573,11 @@ S_scan_const(pTHX_ char *start)
*d = '\0';
sv_utf8_upgrade(sv);
/* this just broke our allocation above... */
- SvGROW(sv, send - start);
+ SvGROW(sv, (STRLEN)(send - start));
d = SvPVX(sv) + SvCUR(sv);
has_utf8 = TRUE;
}
- if (len > e - s + 4) { /* I _guess_ 4 is \N{} --jhi */
+ if (len > (STRLEN)(e - s + 4)) { /* I _guess_ 4 is \N{} --jhi */
char *odest = SvPVX(sv);
SvGROW(sv, (SvLEN(sv) + len - (e - s + 4)));
@@ -2039,7 +2039,7 @@ Perl_filter_read(pTHX_ int idx, SV *buf_sv, int maxlen)
int old_len = SvCUR(buf_sv) ;
/* ensure buf_sv is large enough */
- SvGROW(buf_sv, old_len + maxlen) ;
+ SvGROW(buf_sv, (STRLEN)(old_len + maxlen)) ;
if ((len = PerlIO_read(PL_rsfp, SvPVX(buf_sv) + old_len, maxlen)) <= 0){
if (PerlIO_error(PL_rsfp))
return -1; /* error */
@@ -2251,7 +2251,7 @@ Perl_yylex(pTHX)
"### Saw case modifier at '%s'\n", PL_bufptr); });
s = PL_bufptr + 1;
if (strnEQ(s, "L\\u", 3) || strnEQ(s, "U\\l", 3))
- tmp = *s, *s = s[2], s[2] = tmp; /* misordered... */
+ tmp = *s, *s = s[2], s[2] = (char)tmp; /* misordered... */
if (strchr("LU", *s) &&
(strchr(PL_lex_casestack, 'L') || strchr(PL_lex_casestack, 'U')))
{
@@ -2535,7 +2535,7 @@ Perl_yylex(pTHX)
if (!PL_preprocess)
bof = PerlIO_tell(PL_rsfp) == SvCUR(PL_linestr);
#else
- bof = PerlIO_tell(PL_rsfp) == SvCUR(PL_linestr);
+ bof = PerlIO_tell(PL_rsfp) == (Off_t)SvCUR(PL_linestr);
#endif
if (bof) {
PL_bufend = SvPVX(PL_linestr) + SvCUR(PL_linestr);
@@ -2830,7 +2830,7 @@ Perl_yylex(pTHX)
break;
}
if (ftst) {
- PL_last_lop_op = ftst;
+ PL_last_lop_op = (OPCODE)ftst;
DEBUG_T( { PerlIO_printf(Perl_debug_log,
"### Saw file test %c\n", (int)ftst);
} );
@@ -6523,7 +6523,7 @@ S_scan_heredoc(pTHX_ register char *s)
CopLINE_inc(PL_curcop);
}
if (s >= bufend) {
- CopLINE_set(PL_curcop, PL_multi_start);
+ CopLINE_set(PL_curcop, (line_t)PL_multi_start);
missingterm(PL_tokenbuf);
}
sv_setpvn(herewas,bufptr,d-bufptr+1);
@@ -6543,7 +6543,7 @@ S_scan_heredoc(pTHX_ register char *s)
CopLINE_inc(PL_curcop);
}
if (s >= PL_bufend) {
- CopLINE_set(PL_curcop, PL_multi_start);
+ CopLINE_set(PL_curcop, (line_t)PL_multi_start);
missingterm(PL_tokenbuf);
}
sv_setpvn(tmpstr,d+1,s-d);
@@ -6561,7 +6561,7 @@ S_scan_heredoc(pTHX_ register char *s)
while (s >= PL_bufend) { /* multiple line string? */
if (!outer ||
!(PL_oldoldbufptr = PL_oldbufptr = s = PL_linestart = filter_gets(PL_linestr, PL_rsfp, 0))) {
- CopLINE_set(PL_curcop, PL_multi_start);
+ CopLINE_set(PL_curcop, (line_t)PL_multi_start);
missingterm(PL_tokenbuf);
}
CopLINE_inc(PL_curcop);
@@ -6954,7 +6954,7 @@ S_scan_str(pTHX_ char *start, int keep_quoted, int keep_delims)
if (!PL_rsfp ||
!(PL_oldoldbufptr = PL_oldbufptr = s = PL_linestart = filter_gets(PL_linestr, PL_rsfp, 0))) {
sv_free(sv);
- CopLINE_set(PL_curcop, PL_multi_start);
+ CopLINE_set(PL_curcop, (line_t)PL_multi_start);
return Nullch;
}
/* we read a line, so increment our line counter */