From c5661c80adf757c3cf464bf5f538fe5082b73584 Mon Sep 17 00:00:00 2001 From: Marcus Holland-Moritz Date: Wed, 11 Jun 2003 00:10:47 +0200 Subject: [PATCH] Integrate from maint: [ 19738] Subject: Re: [PATCH: maint @ 19733] CL compiler warnings on MSWin32 From: "Marcus Holland-Moritz" Message-ID: <011701c32f8c$62d85ee0$0c2f1fac@R2D2> p4raw-link: @19738 on //depot/perl: 5a1dd2ab5c9ca51eda95e7e0025702bdfcd91d9fon //depot/maint-5.8/perl: c43a4d73e4c3d92928dd743544b60e43ce02ee9c p4raw-id: //depot/perl@19739 p4raw-integrated: from //depot/maint-5.8/perl@19738 'copy in' ext/Encode/encengine.c (@18665..) ext/List/Util/Util.xs (@18791..) ext/Storable/Storable.xs (@19551..) ext/POSIX/POSIX.xs (@19704..) ext/threads/threads.xs (@19722..) 'merge in' ext/Thread/Thread.xs (@18145..) pp.h (@19400..) sv.c (@19653..) perl.c (@19704..) op.c (@19732..) --- ext/Encode/encengine.c | 2 +- ext/List/Util/Util.xs | 6 +++--- ext/POSIX/POSIX.xs | 2 +- ext/Storable/Storable.xs | 4 ++-- ext/Thread/Thread.xs | 9 +++++++-- ext/threads/threads.xs | 1 + op.c | 4 ++-- perl.c | 2 +- pp.h | 4 ++-- sv.c | 4 ++-- 10 files changed, 22 insertions(+), 16 deletions(-) diff --git a/ext/Encode/encengine.c b/ext/Encode/encengine.c index 6a08cfd..4ea0667 100644 --- a/ext/Encode/encengine.c +++ b/ext/Encode/encengine.c @@ -133,7 +133,7 @@ do_encode(encpage_t * enc, const U8 * src, STRLEN * slen, U8 * dst, if (approx && (e->slen & 0x80)) code = ENCODE_FALLBACK; last = s; - if (term && d-dlast == tlen && memEQ(dlast, term, tlen)) { + if (term && (STRLEN)(d-dlast) == tlen && memEQ(dlast, term, tlen)) { code = ENCODE_FOUND_TERM; break; } diff --git a/ext/List/Util/Util.xs b/ext/List/Util/Util.xs index 412fa3f..de0da94 100644 --- a/ext/List/Util/Util.xs +++ b/ext/List/Util/Util.xs @@ -215,7 +215,7 @@ CODE: PERL_CONTEXT *cx; SV** newsp; I32 gimme = G_SCALAR; - I32 hasargs = 0; + U8 hasargs = 0; bool oldcatch = CATCH_GET; if(items <= 1) { @@ -270,7 +270,7 @@ CODE: PERL_CONTEXT *cx; SV** newsp; I32 gimme = G_SCALAR; - I32 hasargs = 0; + U8 hasargs = 0; bool oldcatch = CATCH_GET; if(items <= 1) { @@ -481,7 +481,7 @@ CODE: OUTPUT: RETVAL -SV* +void set_prototype(subref, proto) SV *subref SV *proto diff --git a/ext/POSIX/POSIX.xs b/ext/POSIX/POSIX.xs index d6318aa..3cf6ab5 100644 --- a/ext/POSIX/POSIX.xs +++ b/ext/POSIX/POSIX.xs @@ -1386,7 +1386,7 @@ lseek(fd, offset, whence) OUTPUT: RETVAL -SV * +void nice(incr) int incr PPCODE: diff --git a/ext/Storable/Storable.xs b/ext/Storable/Storable.xs index a1208de..19470cb 100644 --- a/ext/Storable/Storable.xs +++ b/ext/Storable/Storable.xs @@ -2380,7 +2380,7 @@ static int store_code(stcxt_t *cxt, CV *cv) #else dSP; I32 len; - int ret, count, reallen; + int count, reallen; SV *text, *bdeparse; TRACEME(("store_code (0x%"UVxf")", PTR2UV(cv))); @@ -4961,7 +4961,7 @@ static SV *retrieve_code(stcxt_t *cxt, char *cname) dSP; int type, count; SV *cv; - SV *sv, *text, *sub, *errsv; + SV *sv, *text, *sub; TRACEME(("retrieve_code (#%d)", cxt->tagnum)); diff --git a/ext/Thread/Thread.xs b/ext/Thread/Thread.xs index 1474009..9797303 100644 --- a/ext/Thread/Thread.xs +++ b/ext/Thread/Thread.xs @@ -75,8 +75,11 @@ new(classname, startsv, ...) void join(t) Thread t - AV * av = NO_INIT - int i = NO_INIT + PREINIT: +#ifdef USE_5005THREADS + AV * av; + int i; +#endif PPCODE: void @@ -105,7 +108,9 @@ void self(classname) char * classname PREINIT: +#ifdef USE_5005THREADS SV *sv; +#endif PPCODE: U32 diff --git a/ext/threads/threads.xs b/ext/threads/threads.xs index c65d3ce..d9d2d27 100755 --- a/ext/threads/threads.xs +++ b/ext/threads/threads.xs @@ -519,6 +519,7 @@ Perl_ithread_self (pTHX_ SV *obj, char* Class) return ithread_to_SV(aTHX_ obj, thread, Class, TRUE); else Perl_croak(aTHX_ "panic: cannot find thread data"); + return NULL; /* silence compiler warning */ } /* diff --git a/op.c b/op.c index a095fb9..2eadb10 100644 --- a/op.c +++ b/op.c @@ -194,7 +194,7 @@ Perl_allocmy(pTHX_ char *name) /* check for duplicate declaration */ pad_check_dup(name, - PL_in_my == KEY_our, + (bool)(PL_in_my == KEY_our), (PL_curstash ? PL_curstash : PL_defstash) ); @@ -3744,7 +3744,7 @@ Perl_newFOROP(pTHX_ I32 flags,char *label,line_t forline,OP *sv,OP *expr,OP *blo assert(!loop->op_next); /* for my $x () sets OPpLVAL_INTRO; * for our $x () sets OPpOUR_INTRO; both only used by Deparse.pm */ - loop->op_private = iterpflags; + loop->op_private = (U8)iterpflags; #ifdef PL_OP_SLAB_ALLOC { LOOP *tmp; diff --git a/perl.c b/perl.c index 0c6b4d3..9914935 100644 --- a/perl.c +++ b/perl.c @@ -2189,7 +2189,7 @@ Perl_moreswitches(pTHX_ char *s) s--; } PL_rs = newSVpvn("", 0); - SvGROW(PL_rs, UNISKIP(rschar) + 1); + SvGROW(PL_rs, (STRLEN)(UNISKIP(rschar) + 1)); tmps = (U8*)SvPVX(PL_rs); uvchr_to_utf8(tmps, rschar); SvCUR_set(PL_rs, UNISKIP(rschar)); diff --git a/pp.h b/pp.h index 700d91a..8986db9 100644 --- a/pp.h +++ b/pp.h @@ -205,12 +205,12 @@ See C. =cut */ -#define EXTEND(p,n) STMT_START { if (PL_stack_max - p < (n)) { \ +#define EXTEND(p,n) STMT_START { if (PL_stack_max - p < (int)(n)) { \ sp = stack_grow(sp,p, (int) (n)); \ } } STMT_END /* Same thing, but update mark register too. */ -#define MEXTEND(p,n) STMT_START {if (PL_stack_max - p < (n)) { \ +#define MEXTEND(p,n) STMT_START {if (PL_stack_max - p < (int)(n)) { \ int markoff = mark - PL_stack_base; \ sp = stack_grow(sp,p,(int) (n)); \ mark = PL_stack_base + markoff; \ diff --git a/sv.c b/sv.c index d7487ee..932438b 100644 --- a/sv.c +++ b/sv.c @@ -5918,13 +5918,13 @@ Perl_sv_pos_b2u(pTHX_ register SV* sv, I32* offsetp) mg = mg_find(sv, PERL_MAGIC_utf8); if (mg && mg->mg_ptr) { cache = (STRLEN *) mg->mg_ptr; - if (cache[1] == *offsetp) { + if (cache[1] == (STRLEN)*offsetp) { /* An exact match. */ *offsetp = cache[0]; return; } - else if (cache[1] < *offsetp) { + else if (cache[1] < (STRLEN)*offsetp) { /* We already know part of the way. */ len = cache[0]; s += cache[1]; -- 2.7.4