The unified diff between revisions [8b1818b2..] and [965528e6..] is displayed below. It can also be downloaded as a raw diff.

This diff has been restricted to the following files: 'checks/bench.cpp'

#
#
# patch "checks/bench.cpp"
#  from [380f38c3230ff1cc3599246b0c9152d77994f7a6]
#    to [194dc330534f8d0998eed9b5d92191844d30ea32]
#
============================================================
--- checks/bench.cpp	380f38c3230ff1cc3599246b0c9152d77994f7a6
+++ checks/bench.cpp	194dc330534f8d0998eed9b5d92191844d30ea32
@@ -5,7 +5,7 @@
 #include <string>
 #include <exception>

-#include <botan/rng.h>
+#include <botan/libstate.h>
 #include <botan/filters.h>
 using namespace Botan_types;
 using Botan::u64bit;
@@ -31,11 +31,11 @@ double bench_filter(std::string name, Bo
    static const u32bit BUFFERSIZE = 32*1024;
    byte buf[BUFFERSIZE];

-   Botan::Global_RNG::randomize(buf, BUFFERSIZE);
+   Botan::global_state().randomize(buf, BUFFERSIZE);

    u32bit iterations = 0;
    u64bit start = get_clock(), clocks_used = 0;
-   u64bit go_up_to = (u64bit)(seconds * get_ticks());
+   u64bit go_up_to = static_cast<u64bit>(seconds * get_ticks());

    while(clocks_used < go_up_to)
       {
@@ -44,8 +44,8 @@ double bench_filter(std::string name, Bo
       clocks_used = get_clock() - start;
       }

-   double bytes_per_sec = ((double)iterations * BUFFERSIZE) /
-                          ((double)clocks_used / get_ticks());
+   double bytes_per_sec = (static_cast<double>(iterations) * BUFFERSIZE) /
+                          (static_cast<double>(clocks_used) / get_ticks());
    double mbytes_per_sec = bytes_per_sec / (1024.0 * 1024.0);

    std::cout.setf(std::ios::fixed, std::ios::floatfield);
@@ -121,7 +121,7 @@ void benchmark(const std::string& what,
       if(html)
          std::cout << "</TABLE>\n\n";

-      double average = std::exp(sum / (double)how_many);
+      double average = std::exp(sum / static_cast<double>(how_many));

       if(what == "All" && html)
          std::cout << "\n<P>Overall speed average: " << average