Remove redundant ifdef.
[openssl.git] / crypto / des / speed.c
index 250b697135ed0615bb80dedcbc291410ac37cc76..f9497093e33cfdf1067cc19615e85621c9a31926 100644 (file)
@@ -1,5 +1,5 @@
 /* crypto/des/speed.c */
-/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
  * All rights reserved.
  *
  * This package is an SSL implementation written
@@ -59,7 +59,7 @@
 /* 11-Sep-92 Andrew Daviel   Support for Silicon Graphics IRIX added */
 /* 06-Apr-92 Luke Brennan    Support for VMS and add extra signal calls */
 
-#ifndef MSDOS
+#if !defined(MSDOS) && (!defined(VMS) || defined(__DECC))
 #define TIMES
 #endif
 
@@ -71,7 +71,6 @@
 extern int exit();
 #endif
 #include <signal.h>
-#ifndef VMS
 #ifndef _IRIX
 #include <time.h>
 #endif
@@ -79,35 +78,32 @@ extern int exit();
 #include <sys/types.h>
 #include <sys/times.h>
 #endif
-#else /* VMS */
-#include <types.h>
-struct tms {
-       time_t tms_utime;
-       time_t tms_stime;
-       time_t tms_uchild;      /* I dunno...  */
-       time_t tms_uchildsys;   /* so these names are a guess :-) */
-       }
+
+/* Depending on the VMS version, the tms structure is perhaps defined.
+   The __TMS macro will show if it was.  If it wasn't defined, we should
+   undefine TIMES, since that tells the rest of the program how things
+   should be handled.                          -- Richard Levitte */
+#if defined(VMS) && defined(__DECC) && !defined(__TMS)
+#undef TIMES
 #endif
+
 #ifndef TIMES
 #include <sys/timeb.h>
 #endif
 
-#ifdef sun
+#if defined(sun) || defined(__ultrix)
+#define _POSIX_SOURCE
 #include <limits.h>
 #include <sys/param.h>
 #endif
 
-#include "des.h"
+#include <openssl/des.h>
 
 /* The following if from times(3) man page.  It may need to be changed */
 #ifndef HZ
 # ifndef CLK_TCK
 #  ifndef _BSD_CLK_TCK_ /* FreeBSD fix */
-#   ifndef VMS
-#    define HZ 100.0
-#   else /* VMS */
-#    define HZ 100.0
-#   endif
+#   define HZ  100.0
 #  else /* _BSD_CLK_TCK_ */
 #   define HZ ((double)_BSD_CLK_TCK_)
 #  endif
@@ -119,12 +115,7 @@ struct tms {
 #define BUFSIZE        ((long)1024)
 long run=0;
 
-#ifndef NOPROTO
 double Time_F(int s);
-#else
-double Time_F();
-#endif
-
 #ifdef SIGALRM
 #if defined(__STDC__) || defined(sgi) || defined(_AIX)
 #define SIGRETTYPE void
@@ -132,14 +123,8 @@ double Time_F();
 #define SIGRETTYPE int
 #endif
 
-#ifndef NOPROTO
 SIGRETTYPE sig_done(int sig);
-#else
-SIGRETTYPE sig_done();
-#endif
-
-SIGRETTYPE sig_done(sig)
-int sig;
+SIGRETTYPE sig_done(int sig)
        {
        signal(SIGALRM,sig_done);
        run=0;
@@ -152,8 +137,7 @@ int sig;
 #define START  0
 #define STOP   1
 
-double Time_F(s)
-int s;
+double Time_F(int s)
        {
        double ret;
 #ifdef TIMES
@@ -189,9 +173,7 @@ int s;
 #endif
        }
 
-int main(argc,argv)
-int argc;
-char **argv;
+int main(int argc, char **argv)
        {
        long count;
        static unsigned char buf[BUFSIZE];
@@ -317,11 +299,11 @@ char **argv;
        printf("%ld crypts in %.2f second\n",count,e);
        e=((double)COUNT(ce))/e;
 
-       printf("set_key            per sec = %12.2f (%5.1fuS)\n",a,1.0e6/a);
-       printf("DES raw ecb bytes  per sec = %12.2f (%5.1fuS)\n",b,8.0e6/b);
-       printf("DES cbc bytes      per sec = %12.2f (%5.1fuS)\n",c,8.0e6/c);
-       printf("DES ede cbc bytes  per sec = %12.2f (%5.1fuS)\n",d,8.0e6/d);
-       printf("crypt              per sec = %12.2f (%5.1fuS)\n",e,1.0e6/e);
+       printf("set_key            per sec = %12.2f (%9.3fuS)\n",a,1.0e6/a);
+       printf("DES raw ecb bytes  per sec = %12.2f (%9.3fuS)\n",b,8.0e6/b);
+       printf("DES cbc bytes      per sec = %12.2f (%9.3fuS)\n",c,8.0e6/c);
+       printf("DES ede cbc bytes  per sec = %12.2f (%9.3fuS)\n",d,8.0e6/d);
+       printf("crypt              per sec = %12.2f (%9.3fuS)\n",e,1.0e6/e);
        exit(0);
 #if defined(LINT) || defined(MSDOS)
        return(0);