Remove some unnecessary(?) casting.
[openssl.git] / crypto / bn / bnspeed.c
index f7c2790fff43b08e198e8f7051fd3b5f30c2b44a..af4ebe7986c44d8c5b0a791ad0b031fcb7cce593 100644 (file)
@@ -94,7 +94,8 @@ struct tms {
 #include <sys/timeb.h>
 #endif
 
-#ifdef sun
+#if defined(sun) || defined(__ultrix)
+#define _POSIX_SOURCE
 #include <limits.h>
 #include <sys/param.h>
 #endif
@@ -132,8 +133,7 @@ static double Time_F();
 #define START  0
 #define STOP   1
 
-static double Time_F(s)
-int s;
+static double Time_F(int s)
        {
        double ret;
 #ifdef TIMES
@@ -175,27 +175,20 @@ static int sizes[NUM_SIZES]={128,256,512,1024,2048};
 
 void do_mul(BIGNUM *r,BIGNUM *a,BIGNUM *b,BN_CTX *ctx); 
 
-int main(argc,argv)
-int argc;
-char **argv;
+int main(int argc, char **argv)
        {
        BN_CTX *ctx;
-       BIGNUM *a,*b,*c,*r;
+       BIGNUM a,b,c;
 
        ctx=BN_CTX_new();
-       a=BN_new();
-       b=BN_new();
-       c=BN_new();
-       r=BN_new();
+       BN_init(&a);
+       BN_init(&b);
+       BN_init(&c);
 
-       do_mul(a,b,c,ctx);
+       do_mul(&a,&b,&c,ctx);
        }
 
-void do_mul(r,a,b,ctx)
-BIGNUM *r;
-BIGNUM *a;
-BIGNUM *b;
-BN_CTX *ctx;
+void do_mul(BIGNUM *r, BIGNUM *a, BIGNUM *b, BN_CTX *ctx)
        {
        int i,j,k;
        double tm;
@@ -211,7 +204,7 @@ BN_CTX *ctx;
                        BN_rand(b,sizes[j],1,0);
                        Time_F(START);
                        for (k=0; k<num; k++)
-                               BN_mul(r,b,a);
+                               BN_mul(r,b,a,ctx);
                        tm=Time_F(STOP);
                        printf("mul %4d x %4d -> %8.3fms\n",sizes[i],sizes[j],tm*1000.0/num);
                        }