From: Gurusamy Sarathy Date: Tue, 7 May 2002 23:42:42 +0000 (+0000) Subject: fixes for various warnings identified by Visual C++ X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6e21dc912fff1c74f60032b406b7b96bd0c3ee86;p=p5sagit%2Fp5-mst-13.2.git fixes for various warnings identified by Visual C++ p4raw-id: //depot/perl@16460 --- diff --git a/bytecode.pl b/bytecode.pl index 9315739..fc16f17 100644 --- a/bytecode.pl +++ b/bytecode.pl @@ -338,7 +338,7 @@ newopn PL_op U8 x newpv none PV pv_cur bstate->bs_pv.xpv_cur STRLEN pv_free bstate->bs_pv none x -sv_upgrade bstate->bs_sv char x +sv_upgrade bstate->bs_sv U8 x sv_refcnt SvREFCNT(bstate->bs_sv) U32 sv_refcnt_add SvREFCNT(bstate->bs_sv) I32 x sv_flags SvFLAGS(bstate->bs_sv) U32 diff --git a/ext/B/B.xs b/ext/B/B.xs index 111116a..83c9c4a 100644 --- a/ext/B/B.xs +++ b/ext/B/B.xs @@ -786,11 +786,11 @@ PMOP_pmoffset(o) #endif -U16 +U32 PMOP_pmflags(o) B::PMOP o -U16 +U32 PMOP_pmpermflags(o) B::PMOP o diff --git a/ext/ByteLoader/bytecode.h b/ext/ByteLoader/bytecode.h index be5fddd..1c94b66 100644 --- a/ext/ByteLoader/bytecode.h +++ b/ext/ByteLoader/bytecode.h @@ -197,7 +197,7 @@ typedef IV IV64; av_push(PL_beginav, cv); \ call_list(oldscope, PL_beginav); \ PL_curcop = &PL_compiling; \ - PL_compiling.op_private = PL_hints; \ + PL_compiling.op_private = (U8)(PL_hints & HINT_PRIVATE_MASK);\ LEAVE; \ } STMT_END #define BSET_push_init(ary,cv) \ diff --git a/ext/ByteLoader/byterun.c b/ext/ByteLoader/byterun.c index 3d680cd..ee06b1c 100644 --- a/ext/ByteLoader/byterun.c +++ b/ext/ByteLoader/byterun.c @@ -163,7 +163,7 @@ byterun(pTHX_ register struct byteloader_state *bstate) } case INSN_SV_UPGRADE: /* 14 */ { - char arg; + U8 arg; BGET_U8(arg); BSET_sv_upgrade(bstate->bs_sv, arg); break; diff --git a/ext/Data/Dumper/Dumper.xs b/ext/Data/Dumper/Dumper.xs index 11a97d2..a129c3f 100644 --- a/ext/Data/Dumper/Dumper.xs +++ b/ext/Data/Dumper/Dumper.xs @@ -595,7 +595,7 @@ DD_dump(pTHX_ SV *val, char *name, STRLEN namelen, SV *retval, HV *seenhv, keysv = svp ? *svp : sv_mortalcopy(&PL_sv_undef); key = SvPV(keysv, keylen); svp = hv_fetch((HV*)ival, key, - SvUTF8(keysv) ? -keylen : keylen, 0); + SvUTF8(keysv) ? -(I32)keylen : keylen, 0); hval = svp ? *svp : sv_mortalcopy(&PL_sv_undef); } else { diff --git a/ext/Encode/Encode.xs b/ext/Encode/Encode.xs index 4e95671..0f3f1d4 100644 --- a/ext/Encode/Encode.xs +++ b/ext/Encode/Encode.xs @@ -106,7 +106,7 @@ encode_method(pTHX_ encode_t * enc, encpage_t * dir, SV * src, more = (1.0*tlen*SvLEN(dst)+sdone-1)/sdone - SvLEN(dst); #elif ENCODE_XS_USEFP - more = (1.0*SvLEN(dst)+1)/sdone * sleft; + more = (STRLEN)((1.0*SvLEN(dst)+1)/sdone * sleft); #else /* safe until SvLEN(dst) == MAX_INT/16 */ more = (16*SvLEN(dst)+1)/sdone/16 * sleft; diff --git a/ext/POSIX/POSIX.xs b/ext/POSIX/POSIX.xs index c92c389..2eab956 100644 --- a/ext/POSIX/POSIX.xs +++ b/ext/POSIX/POSIX.xs @@ -1,9 +1,5 @@ #define PERL_EXT_POSIX -#ifdef WIN32 -#define _POSIX_ -#endif - #ifdef NETWARE #define _POSIX_ /* diff --git a/malloc.c b/malloc.c index aafe41d..00c387e 100644 --- a/malloc.c +++ b/malloc.c @@ -930,7 +930,7 @@ static u_int goodsbrk; static char *emergency_buffer; static MEM_SIZE emergency_buffer_size; -static int no_mem; /* 0 if the last request for more memory succeeded. +static MEM_SIZE no_mem; /* 0 if the last request for more memory succeeded. Otherwise the size of the failing request. */ static Malloc_t @@ -1167,7 +1167,7 @@ Perl_malloc(register size_t nbytes) static char *last_sbrk_top; static char *last_op; /* This arena can be easily extended. */ -static int sbrked_remains; +static MEM_SIZE sbrked_remains; static int sbrk_good = SBRK_ALLOW_FAILURES * SBRK_FAILURE_PRICE; #ifdef DEBUGGING_MSTATS diff --git a/win32/config.bc b/win32/config.bc index 0952833..679cfdf 100644 --- a/win32/config.bc +++ b/win32/config.bc @@ -157,7 +157,7 @@ d_finite='undef' d_finitel='undef' d_flexfnam='define' d_flock='define' -d_flockproto='undef' +d_flockproto='define' d_fork='undef' d_fp_class='undef' d_fpathconf='undef' diff --git a/win32/config.gc b/win32/config.gc index 588a624..32bbf1c 100644 --- a/win32/config.gc +++ b/win32/config.gc @@ -241,7 +241,7 @@ d_finite='undef' d_finitel='undef' d_flexfnam='define' d_flock='define' -d_flockproto='undef' +d_flockproto='define' d_fork='undef' d_fp_class='undef' d_fpathconf='undef' diff --git a/win32/config.vc b/win32/config.vc index 1396fee..2b0aea0 100644 --- a/win32/config.vc +++ b/win32/config.vc @@ -157,7 +157,7 @@ d_finite='undef' d_finitel='undef' d_flexfnam='define' d_flock='define' -d_flockproto='undef' +d_flockproto='define' d_fork='undef' d_fp_class='undef' d_fpathconf='undef' diff --git a/win32/config_H.bc b/win32/config_H.bc index 5ccd4e8..a754aa9 100644 --- a/win32/config_H.bc +++ b/win32/config_H.bc @@ -3464,7 +3464,7 @@ * to the program to supply one. A good guess is * extern int flock(int, int); */ -/*#define HAS_FLOCK_PROTO /**/ +#define HAS_FLOCK_PROTO /**/ /* HAS_FPCLASSL: * This symbol, if defined, indicates that the fpclassl routine is diff --git a/win32/config_H.gc b/win32/config_H.gc index a4fb0aa..2a8c97b 100644 --- a/win32/config_H.gc +++ b/win32/config_H.gc @@ -3464,7 +3464,7 @@ * to the program to supply one. A good guess is * extern int flock(int, int); */ -/*#define HAS_FLOCK_PROTO /**/ +#define HAS_FLOCK_PROTO /**/ /* HAS_FPCLASSL: * This symbol, if defined, indicates that the fpclassl routine is diff --git a/win32/config_H.vc b/win32/config_H.vc index 9c9a214..9aa8c21 100644 --- a/win32/config_H.vc +++ b/win32/config_H.vc @@ -3464,7 +3464,7 @@ * to the program to supply one. A good guess is * extern int flock(int, int); */ -/*#define HAS_FLOCK_PROTO /**/ +#define HAS_FLOCK_PROTO /**/ /* HAS_FPCLASSL: * This symbol, if defined, indicates that the fpclassl routine is diff --git a/win32/win32.c b/win32/win32.c index f72acdd..4b60d0a 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -4021,7 +4021,7 @@ win32_free(void *block) } -int +DllExport int win32_open_osfhandle(intptr_t handle, int flags) { #ifdef USE_FIXED_OSFHANDLE @@ -4031,13 +4031,13 @@ win32_open_osfhandle(intptr_t handle, int flags) return _open_osfhandle(handle, flags); } -intptr_t +DllExport intptr_t win32_get_osfhandle(int fd) { return (intptr_t)_get_osfhandle(fd); } -FILE * +DllExport FILE * win32_fdupopen(FILE *pf) { FILE* pfdup; diff --git a/win32/win32iop.h b/win32/win32iop.h index ebfb6c2..1568a12 100644 --- a/win32/win32iop.h +++ b/win32/win32iop.h @@ -113,6 +113,7 @@ DllExport void win32_free(void *block); DllExport int win32_open_osfhandle(intptr_t handle, int flags); DllExport intptr_t win32_get_osfhandle(int fd); +DllExport FILE* win32_fdupopen(FILE *pf); DllExport DIR* win32_opendir(char *filename); DllExport struct direct* win32_readdir(DIR *dirp);