apps: remove some #ifndef clutter
[openssl.git] / apps / speed.c
index e6bdc5dd2f7e9f6b8d5ad9d3641f96f70dcd2ea6..0e4d224dbb142d80782e0b5fcc8a8f5289ff73e2 100644 (file)
@@ -363,7 +363,7 @@ typedef enum OPTION_choice {
     OPT_MR, OPT_MB, OPT_MISALIGN, OPT_ASYNCJOBS
 } OPTION_CHOICE;
 
-OPTIONS speed_options[] = {
+const OPTIONS speed_options[] = {
     {OPT_HELP_STR, 1, '-', "Usage: %s [options] ciphers...\n"},
     {OPT_HELP_STR, 1, '-', "Valid options are:\n"},
     {"help", OPT_HELP, '-', "Display this summary"},
@@ -1187,8 +1187,8 @@ static int run_benchmark(int async_jobs,
                 continue;
 #endif
 
-            ret = ASYNC_start_job(&loopargs[i].inprogress_job, 
-                    loopargs[i].wait_ctx, &job_op_count, loop_function, 
+            ret = ASYNC_start_job(&loopargs[i].inprogress_job,
+                    loopargs[i].wait_ctx, &job_op_count, loop_function,
                     (void *)(loopargs + i), sizeof(loopargs_t));
             switch (ret) {
             case ASYNC_PAUSE:
@@ -1219,13 +1219,12 @@ static int run_benchmark(int async_jobs,
 
 int speed_main(int argc, char **argv)
 {
+    ENGINE *e = NULL;
     loopargs_t *loopargs = NULL;
     int async_init = 0;
     int loopargs_len = 0;
     char *prog;
-#ifndef OPENSSL_NO_ENGINE
     const char *engine_id = NULL;
-#endif
     const EVP_CIPHER *evp_cipher = NULL;
     double d = 0.0;
     OPTION_CHOICE o;
@@ -1399,9 +1398,7 @@ int speed_main(int argc, char **argv)
              * initialised by each child process, not by the parent.
              * So store the name here and run setup_engine() later on.
              */
-#ifndef OPENSSL_NO_ENGINE
             engine_id = opt_arg();
-#endif
             break;
         case OPT_MULTI:
 #ifndef NO_FORK
@@ -1566,7 +1563,7 @@ int speed_main(int argc, char **argv)
 #endif
 
     /* Initialize the engine after the fork */
-    (void)setup_engine(engine_id, 0);
+    e = setup_engine(engine_id, 0);
 
     /* No parameters; turn on everything. */
     if ((argc == 0) && !doit[D_EVP]) {
@@ -2819,6 +2816,7 @@ int speed_main(int argc, char **argv)
         ASYNC_cleanup_thread();
     }
     OPENSSL_free(loopargs);
+    release_engine(e);
     return (ret);
 }