fixes for various warnings identified by Visual C++
Gurusamy Sarathy [Tue, 7 May 2002 23:42:42 +0000 (23:42 +0000)]
p4raw-id: //depot/perl@16460

16 files changed:
bytecode.pl
ext/B/B.xs
ext/ByteLoader/bytecode.h
ext/ByteLoader/byterun.c
ext/Data/Dumper/Dumper.xs
ext/Encode/Encode.xs
ext/POSIX/POSIX.xs
malloc.c
win32/config.bc
win32/config.gc
win32/config.vc
win32/config_H.bc
win32/config_H.gc
win32/config_H.vc
win32/win32.c
win32/win32iop.h

index 9315739..fc16f17 100644 (file)
@@ -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
index 111116a..83c9c4a 100644 (file)
@@ -786,11 +786,11 @@ PMOP_pmoffset(o)
 
 #endif
 
-U16
+U32
 PMOP_pmflags(o)
        B::PMOP         o
 
-U16
+U32
 PMOP_pmpermflags(o)
        B::PMOP         o
 
index be5fddd..1c94b66 100644 (file)
@@ -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)                                                         \
index 3d680cd..ee06b1c 100644 (file)
@@ -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;
index 11a97d2..a129c3f 100644 (file)
@@ -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 {
index 4e95671..0f3f1d4 100644 (file)
@@ -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;
index c92c389..2eab956 100644 (file)
@@ -1,9 +1,5 @@
 #define PERL_EXT_POSIX
 
-#ifdef WIN32
-#define _POSIX_
-#endif
-
 #ifdef NETWARE
        #define _POSIX_
        /*
index aafe41d..00c387e 100644 (file)
--- 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
index 0952833..679cfdf 100644 (file)
@@ -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'
index 588a624..32bbf1c 100644 (file)
@@ -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'
index 1396fee..2b0aea0 100644 (file)
@@ -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'
index 5ccd4e8..a754aa9 100644 (file)
  *     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
index a4fb0aa..2a8c97b 100644 (file)
  *     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
index 9c9a214..9aa8c21 100644 (file)
  *     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
index f72acdd..4b60d0a 100644 (file)
@@ -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;
index ebfb6c2..1568a12 100644 (file)
@@ -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);