develooper Front page | perl.vmsperl | Postings from December 2001

[PATCH Perl@13462, on top of prev. multiplicity patch] MY_RAND workaround update

From:
lane
Date:
December 6, 2001 08:38
Subject:
[PATCH Perl@13462, on top of prev. multiplicity patch] MY_RAND workaround update
Message ID:
011206114105.67cab@DUPHY4.Physics.Drexel.Edu
My fix of a few months ago for RAND_MAX creating problems with my old DECC
seems to not quite be robust enough, at least for an optimized, non-debugging,
somewhat less complex initialization Perl.

So here's a tiny patch to fix it up again. And hopefully it will be the
LAST time it is necessary to do so.

diff -uBb vms/vms.c-orig2 vms/vms.c
--- vms/vms.c-orig2	Thu Dec  6 11:24:32 2001
+++ vms/vms.c	Thu Dec  6 11:15:12 2001
@@ -7251,8 +7251,8 @@
 void  
 Perl_sys_intern_init(pTHX)
 {
-    int ix = RAND_MAX;
-    float x;
+    unsigned int ix = RAND_MAX;
+    double x;
 
     VMSISH_HUSHED = 0;
 
diff -uBb vms/vmsish.h-orig2 vms/vmsish.h
--- vms/vmsish.h-orig2	Thu Dec  6 11:24:39 2001
+++ vms/vmsish.h	Thu Dec  6 11:15:13 2001
@@ -298,7 +298,7 @@
 #define HAVE_INTERP_INTERN
 struct interp_intern {
     int    hushed;
-    float  inv_rand_max;
+    double inv_rand_max;
 };
 #define VMSISH_HUSHED     (PL_sys_intern.hushed)
 #define MY_INV_RAND_MAX   (PL_sys_intern.inv_rand_max)
--
 Drexel University       \V                    --Chuck Lane
======]---------->--------*------------<-------[===========
     (215) 895-1545     _/ \  Particle Physics
FAX: (215) 895-5934     /\ /~~~~~~~~~~~        lane@duphy4.physics.drexel.edu



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About