This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[gfortran, committed] Fix typos in rand.c and normalize.c


This patch fixes the rand intrinsic. We didn't actually call rand in it.
Fixing this involved Paul, Steven and myself, because a wrong comment in
normalize.c (also fixed) somewhat hampered our IRC conversation.

Built and tested on i686-pc-linux, approved by Paul on IRC.

- Tobi

Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/libgfortran/ChangeLog,v
retrieving revision 1.43
diff -u -p -r1.43 ChangeLog
--- ChangeLog   28 Jun 2004 01:30:25 -0000      1.43
+++ ChangeLog   29 Jun 2004 22:52:24 -0000
@@ -1,3 +1,10 @@
+2004-06-29  Tobias Schlueter  <tobias.schlueter@physik.uni-muenchen.de>
+       Paul Brook  <paul@codesourcery.com>
+
+       * runtime/normalize.c (normalize_r4_i4, normalize_r8_i8): Fix
+       comments.
+       * intrinsics/rand.c (rand): Call irand() in call to normalize_r4_i4.
+
 2004-06-27  Bud Davis  <bdavis9659@comcast.net>

        PR gfortran/12839
cvs diff: Diffing generated
cvs diff: Diffing intrinsics
Index: intrinsics/rand.c
===================================================================
RCS file: /cvs/gcc/gcc/libgfortran/intrinsics/rand.c,v
retrieving revision 1.2
diff -u -p -r1.2 rand.c
--- intrinsics/rand.c   13 Jun 2004 22:58:30 -0000      1.2
+++ intrinsics/rand.c   29 Jun 2004 22:52:24 -0000
@@ -82,5 +82,5 @@ prefix(irand) (GFC_INTEGER_4 *i)
 GFC_REAL_4
 prefix(rand) (GFC_INTEGER_4 *i)
 {
-  return normalize_r4_i4 (i - 1, GFC_RAND_M1);
+  return normalize_r4_i4 (irand (i) - 1, GFC_RAND_M1 - 1);
 }
cvs diff: Diffing io
cvs diff: Diffing m4
cvs diff: Diffing runtime
Index: runtime/normalize.c
===================================================================
RCS file: /cvs/gcc/gcc/libgfortran/runtime/normalize.c,v
retrieving revision 1.1
diff -u -p -r1.1 normalize.c
--- runtime/normalize.c 13 Jun 2004 22:58:30 -0000      1.1
+++ runtime/normalize.c 29 Jun 2004 22:52:24 -0000
@@ -81,7 +81,7 @@ almostone_r8 ()
 }


-/* Convert an unsigned integer in the range [0..x) into a
+/* Convert an unsigned integer in the range [0..x] into a
    real the range [0..1).  */

 GFC_REAL_4
@@ -96,7 +96,7 @@ normalize_r4_i4 (GFC_UINTEGER_4 i, GFC_U
 }


-/* Convert an unsigned integer in the range [0..x) into a
+/* Convert an unsigned integer in the range [0..x] into a
    real the range [0..1).  */

 GFC_REAL_8


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]