Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/regress/lib/libc/randomid uint64_t may not be "unsigned long...



details:   https://anonhg.NetBSD.org/src/rev/ecfcf2945047
branches:  trunk
changeset: 555716:ecfcf2945047
user:      itojun <itojun%NetBSD.org@localhost>
date:      Tue Nov 25 23:14:48 2003 +0000

description:
uint64_t may not be "unsigned long long", so use of ULLONG_MAX is not
appropriate.
adjust max period (see randomid.3 1.2 -> 1.3)

diffstat:

 regress/lib/libc/randomid/idtest.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (33 lines):

diff -r 7349e97f61d6 -r ecfcf2945047 regress/lib/libc/randomid/idtest.c
--- a/regress/lib/libc/randomid/idtest.c        Tue Nov 25 23:11:54 2003 +0000
+++ b/regress/lib/libc/randomid/idtest.c        Tue Nov 25 23:14:48 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: idtest.c,v 1.1 2003/11/14 23:10:48 simonb Exp $ */
+/* $NetBSD: idtest.c,v 1.2 2003/11/25 23:14:48 itojun Exp $ */
 
 /* If defined, abort at first short period and only test REGRESS times. */
 #define        REGRESS         10000000                /* should be enough... */
@@ -10,7 +10,7 @@
 #include <limits.h>
 #include <randomid.h>
 
-#define        PERIOD          36000
+#define        PERIOD          12000
 
 uint64_t last[65536];
 
@@ -26,12 +26,12 @@
        memset(last, 0, sizeof(last));
        ctx = randomid_new(16, (long)3600);
 
-       lowest = ULLONG_MAX;
+       lowest = 0xffffffffffffffffULL;
        while (n < ULLONG_MAX) {
                id = randomid(ctx);
                if (last[id] > 0) {
                        if (n - last[id] <= lowest) {
-                               if (lowest != ULLONG_MAX) {
+                               if (lowest != 0xffffffffffffffffULL) {
                                        printf("id %5d  "
                                            "last call for id at %9lld, "
                                            "current call %9lld (diff %5lld)\n",



Home | Main Index | Thread Index | Old Index