View | Details | Raw Unified | Return to bug 238691 | Differences between
and this patch

Collapse All | Expand All

(-)Makefile (+1 lines)
Lines 3-8 Link Here
3
3
4
PORTNAME=	diehard
4
PORTNAME=	diehard
5
PORTVERSION=	0.1
5
PORTVERSION=	0.1
6
PORTREVISION=	1
6
CATEGORIES=	math
7
CATEGORIES=	math
7
MASTER_SITES=	http://stat.fsu.edu/pub/diehard/
8
MASTER_SITES=	http://stat.fsu.edu/pub/diehard/
8
DISTNAME=	die-c
9
DISTNAME=	die-c
(-)files/patch-cdbday.c (+31 lines)
Line 0 Link Here
1
--- cdbday.c.orig	2019-08-03 11:00:43 UTC
2
+++ cdbday.c
3
@@ -83,8 +83,8 @@ void bday(char *filename)
4
   puts("\t|------------------------------------------------------------ |\n");
5
  
6
   printf("\t\tRESULTS OF BIRTHDAY SPACINGS TEST FOR %s\n", filename);
7
-  printf("\t(no_bdays=%d, no_days/yr=2^%d,",no_bday, no_bits);
8
-  printf(" lambda=%.2f, sample size=%d)\n\n", lambda, no_obs);
9
+  printf("\t(no_bdays=%lu, no_days/yr=2^%lu,",no_bday, no_bits);
10
+  printf(" lambda=%.2f, sample size=%lu)\n\n", lambda, no_obs);
11
   printf("\tBits used\tmean\t\tchisqr\t\tp-value\n");
12
 
13
   obs=(counter*)malloc(no_obs*sizeof(counter));
14
@@ -121,7 +121,7 @@ void bday(char *filename)
15
 
16
     p[rt]=P_fit(lambda, obs, no_obs);
17
 
18
-    printf("\t %d to %d", 33-no_bits-rt,32-rt);
19
+    printf("\t %lu to %d", 33-no_bits-rt,32-rt);
20
     printf("\t%.2f\t\t%.4f\t\t%f\n", (real)sum/no_obs, chi_fit, p[rt]);   
21
 
22
   }
23
@@ -134,7 +134,7 @@ void bday(char *filename)
24
 
25
   printf("\n\t\t\tdegree of freedoms is: %d\n", dgf);
26
   puts("\t---------------------------------------------------------------");
27
-  printf("\t\tp-value for KStest on those %d p-values: %f",32-no_bits+1,pvalue);
28
+  printf("\t\tp-value for KStest on those %lu p-values: %f",32-no_bits+1,pvalue);
29
   puts("\n"); 
30
 
31
   free(p);
(-)files/patch-cdbinrnk.c (+20 lines)
Line 0 Link Here
1
--- cdbinrnk.c.orig	2019-08-03 09:50:12 UTC
2
+++ cdbinrnk.c
3
@@ -13,6 +13,8 @@ typedef struct binmatrix {
4
 
5
 } binmatrix;
6
 
7
+#include <string.h>
8
+
9
 /*print the title*/
10
 void rnk_ttl(char *fn, char *test)
11
 {
12
@@ -162,7 +164,7 @@ real rnk_stat(char *fn, counter no_mtr, 
13
     Ef=no_mtr* ( *(p+i) );
14
     tmp=(f[i]-Ef)*(f[i]-Ef)/Ef;
15
     chsq+=tmp;
16
-    printf("\t%s%d\t%-12d\t%-12.1f", cat[MIN(1,i)], i+llim, f[i], Ef);
17
+    printf("\t%s%lu\t%-12lu\t%-12.1f", cat[MIN(1,i)], i+llim, f[i], Ef);
18
     printf("\t%-12.3f\t%-12.3f\n", tmp, chsq);
19
   }
20
   uni("close");
(-)files/patch-cdbitst.c (+22 lines)
Line 0 Link Here
1
--- cdbitst.c.orig	2019-08-03 10:34:33 UTC
2
+++ cdbitst.c
3
@@ -41,8 +41,8 @@ void bitst(char *filename)
4
   puts("\t|-------------------------------------------------------------|\n");
5
 
6
   printf("\t\tTHE OVERLAPPING 20-TUPLES BITSTREAM  TEST for %s\n", filename);
7
-  printf("\t (%d bits/word, %d words", nb_pw, no_wds);
8
-  printf(" %d bitstreams.", no_obs );
9
+  printf("\t (%lu bits/word, %lu words", nb_pw, no_wds);
10
+  printf(" %lu bitstreams.", no_obs );
11
   printf(" No. missing words \n\t  should average %.2f", mean);
12
   printf(" with sigma=%.2f.)\n", std);
13
   puts("\t----------------------------------------------------------------");
14
@@ -80,7 +80,7 @@ void bitst(char *filename)
15
     }
16
 
17
     z=(no_mswds-mean)/std;
18
-    printf("\t   %d\t\t%d \t\t\t% .2f\t\t%f\n", i, no_mswds, z, 1-Phi(z));
19
+    printf("\t   %lu\t\t%lu \t\t\t% .2f\t\t%f\n", i, no_mswds, z, 1-Phi(z));
20
   }
21
 
22
   uni("close");
(-)files/patch-cdomso.c (-7 / +30 lines)
Lines 1-11 Link Here
1
--- cdomso.c.orig	1998-04-02 15:29:02 UTC
1
--- cdomso.c.orig	2019-08-03 10:18:08 UTC
2
+++ cdomso.c
2
+++ cdomso.c
3
@@ -89,7 +89,7 @@ unsigned long get_w(char *fn, short bits
3
@@ -138,7 +138,7 @@ real monky_stat(char *filename, char *te
4
       }
5
 
6
       z=(no_mswds-mean)/std;
7
-      printf("\t%d to %d  \t\t%d ", 33-rt-bits_pl, 32-rt, no_mswds);
8
+      printf("\t%lu to %lu  \t\t%lu ", 33-rt-bits_pl, 32-rt, no_mswds);
9
       printf("\t\t% .4f\t\t%f\n", z, 1-Phi(z));
10
     }
11
  
12
@@ -151,11 +151,11 @@ real monky_stat(char *filename, char *te
13
   printf("\t------------------------------");
14
   printf("-----------------------------------\n");
15
   
16
-  return;
17
+  return 0;
4
 }
18
 }
5
 
19
 
20
 /* type "OPSO" for OPSO test and so on */
21
-void monky(char *filename, char *test)
22
+int monky(char *filename, char *test)
23
 {
24
   const int no_tests=1;
6
 
25
 
7
-real monky_stat(char *filename, char *test, int no_tests)
26
@@ -165,7 +165,7 @@ void monky(char *filename, char *test)
8
+void monky_stat(char *filename, char *test, int no_tests)
27
 
9
 {
28
   monky_stat(filename, test, no_tests);
10
   const real bits_pw=20, mean=pow(2, bits_pw)*exp(-2);
29
 
11
   const counter dim=pow(2, bits_pw-5);
30
-  return;
31
+  return 0;
32
 
33
 }
34
 
(-)files/patch-cdoperm5.c (+27 lines)
Line 0 Link Here
1
--- cdoperm5.c.orig	2019-08-03 10:52:40 UTC
2
+++ cdoperm5.c
3
@@ -71,21 +71,21 @@ void operm5(char *filename)
4
   puts("\t|rank 99).  This version uses 1,000,000 integers, twice.      |");
5
   puts("\t|-------------------------------------------------------------|\n");
6
 
7
-  printf("\t\t\tOPERM5 test for file \n", filename);
8
+  printf("%s \t\t\tOPERM5 test for file \n", filename);
9
   puts("\t\t  (For samples of 1,000,000 consecutive 5-tuples)\n");
10
 
11
   infile=fopen("operm5.cov", "r");
12
 
13
   for(i=0; i<60; ++i){
14
     for(j=i; j<60; ++j){
15
-      fscanf(infile, "%d", &A[i][j]);
16
+      fscanf(infile, "%lu", &A[i][j]);
17
       A[j][i]=A[i][j];
18
     }
19
   }
20
 
21
   for(i=0; i<60; ++i){
22
     for(j=i; j<60; ++j){
23
-      fscanf(infile, "%d", &B[i][j]);
24
+      fscanf(infile, "%lu", &B[i][j]);
25
       B[j][i]=B[i][j];
26
     }
27
   }
(-)files/patch-cdosum.c (+20 lines)
Line 0 Link Here
1
--- cdosum.c.orig	2019-08-03 10:56:11 UTC
2
+++ cdosum.c
3
@@ -64,7 +64,7 @@ void osum(char *filename)
4
     }
5
 
6
     pv[i-1]=KStest(p, no_num);
7
-    printf("\t\t\t  %d \t\t\t%f\n", i, pv[i-1]);
8
+    printf("\t\t\t  %lu \t\t\t%f\n", i, pv[i-1]);
9
   }
10
   uni("close");
11
 
12
@@ -75,7 +75,7 @@ void osum(char *filename)
13
   tmp=KStest(pv, no_obs);
14
   free(pv);
15
 
16
-  printf("\t\tp-value for %d kstests on %d kstests:%f\n", no_obs, no_sum, tmp);
17
+  printf("\t\tp-value for %lu kstests on %lu kstests:%f\n", no_obs, no_sum, tmp);
18
 
19
   return;
20
 }
(-)files/patch-cdpark.c (+36 lines)
Line 0 Link Here
1
--- cdpark.c.orig	2019-08-03 10:37:50 UTC
2
+++ cdpark.c
3
@@ -36,8 +36,8 @@ void park(char *filename)
4
   puts("\t|ble, provides input to a KSTEST based on a sample of 10.     |");
5
   puts("\t|-------------------------------------------------------------|\n");
6
   
7
-  printf("\t\tCDPARK: result of %d tests on file %s\n", no_obs, filename);
8
-  printf("\t  (Of %d tries, the average no. of successes", no_trials);
9
+  printf("\t\tCDPARK: result of %lu tests on file %s\n", no_obs, filename);
10
+  printf("\t  (Of %lu tries, the average no. of successes", no_trials);
11
   printf(" should be \n\t   %.1f with sigma=%.1f)\n\n", mu, sigma);
12
   printf("\t   No. succeses\t\tz-score\t\tp-value\n");
13
 
14
@@ -79,7 +79,7 @@ void park(char *filename)
15
     z=(no_succ-mu)/sigma;
16
     p[i-1]=1-Phi(z);
17
 
18
-    printf("\t\t%d\t\t% .4f\t\t%f\n", no_succ, z, p[i-1]);
19
+    printf("\t\t%lu\t\t% .4f\t\t%f\n", no_succ, z, p[i-1]);
20
   }
21
   uni("close");
22
 
23
@@ -88,11 +88,11 @@ void park(char *filename)
24
   mean=(real)sum/no_obs;
25
   var=(real)ss/no_obs-mean*mean;
26
 
27
-  printf("\t  Square side=%d, avg. no. parked=%.2f", side, mean);
28
+  printf("\t  Square side=%lu, avg. no. parked=%.2f", side, mean);
29
   printf(" sample std.=%.2f\n", sqrt(var)); 
30
  
31
   pvalue=KStest(p, no_obs);
32
-  printf("\t     p-value of the KSTEST for those %d", no_obs); 
33
+  printf("\t     p-value of the KSTEST for those %lu", no_obs); 
34
   printf(" p-values: %f\n\n", pvalue);
35
     
36
   return;
(-)files/patch-cnt1s (+17 lines)
Line 0 Link Here
1
--- cnt1s.c.orig	2019-08-03 10:00:05 UTC
2
+++ cnt1s.c
3
@@ -1,4 +1,5 @@
4
 #include "header.h"
5
+#include <string.h>
6
 
7
 typedef enum {A,B,C,D,E} letters;
8
 
9
@@ -192,7 +193,7 @@ void cnt1s(char *filename, char *test)
10
 
11
   cnt_ttl(filename, test);
12
       
13
-  printf("\t  (Degrees of freedom: 5^4-5^3=2500; sample size: %d)\n\n", no_wds);
14
+  printf("\t  (Degrees of freedom: 5^4-5^3=2500; sample size: %lu)\n\n", no_wds);
15
   printf("\t%s\tchisquare\tz-score\t\tp-value\n", s);
16
 
17
   do{
(-)files/patch-craptest.c (+20 lines)
Line 0 Link Here
1
--- craptest.c.orig	2019-08-03 10:04:26 UTC
2
+++ craptest.c
3
@@ -77,7 +77,7 @@ void craptest(char *filename)
4
 
5
   printf("\t\tRESULTS OF CRAPS TEST FOR %s \n", filename);
6
   printf("\tNo. of wins:  Observed\tExpected\n");
7
-  printf("\t                 %d        %f\n", no_win, mean);
8
+  printf("\t                 %lu       %f\n", no_win, mean);
9
 
10
   pvalue_w=1-Phi(t);
11
   printf("\t\tz-score=%6.3f, pvalue=%7.5f\n", t, pvalue_w);
12
@@ -93,7 +93,7 @@ void craptest(char *filename)
13
     mean=no_games*Ef[i];
14
     t=(f[i]-mean)*(f[i]-mean)/mean;
15
     sum+=t;     
16
-    printf("\t%d\t%d\t\t%.1f",i+1, f[i], mean);
17
+    printf("\t%lu\t%lu\t\t%.1f",i+1, f[i], mean);
18
     printf("\t\t%.3f\t\t%.3f\n", t, sum);
19
   }
20
 
(-)files/patch-d3sphere.c (+20 lines)
Line 0 Link Here
1
--- d3sphere.c.orig	2019-08-03 10:59:28 UTC
2
+++ d3sphere.c
3
@@ -61,7 +61,7 @@ void sphere(char *filename)
4
 
5
       r3=dmin*sqrt(dmin);
6
       p[i-1]=1-exp(-MIN(r3/30., 20));
7
-      printf("\t\t   %d\t\t%.3f\t\t%f\n", i, r3, p[i-1]);
8
+      printf("\t\t   %lu\t\t%.3f\t\t%f\n", i, r3, p[i-1]);
9
   }
10
   uni("close");
11
 
12
@@ -69,7 +69,7 @@ void sphere(char *filename)
13
   
14
   puts("\t--------------------------------------------------------------");
15
   pvalue=KStest(p,no_obs);
16
-  printf("\t\tp-value for KS test on those %d p-values: %f", no_obs, pvalue);
17
+  printf("\t\tp-value for KS test on those %lu p-values: %f", no_obs, pvalue);
18
   puts("\n");
19
     
20
   free(p);
(-)files/patch-diehard.c (-1 / +10 lines)
Lines 1-5 Link Here
1
--- diehard.c.orig	1998-04-02 15:29:40 UTC
1
--- diehard.c.orig	2019-09-01 17:00:11 UTC
2
+++ diehard.c
2
+++ diehard.c
3
@@ -117,7 +117,7 @@ void diehard()
4
5
   ungetc(c, stdin);
6
7
-  gets(fn);
8
+  fgets(fn,100,stdin);
9
 
10
   puts("\n\t\tHERE ARE YOUR CHOICES:\n");
11
   puts("\t\t1   Birthday Spacings");
3
@@ -153,5 +153,5 @@ main()
12
@@ -153,5 +153,5 @@ main()
4
 {
13
 {
5
   diehard();
14
   diehard();

Return to bug 238691