aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlloyd <[email protected]>2009-11-17 05:51:34 +0000
committerlloyd <[email protected]>2009-11-17 05:51:34 +0000
commit471847e2148776e62e4f580ade95572fc525c751 (patch)
treed4d44bab68b9a95690d8d1a6275f47c4359312f7
parentc12e0e4f45497f8ecb628ba7d753f87aa8db0813 (diff)
Fix some examples for changed APIs in C++0x branch
-rw-r--r--doc/examples/GNUmakefile4
-rw-r--r--doc/examples/bench.cpp3
-rw-r--r--doc/examples/benchmark.cpp3
-rw-r--r--doc/examples/ca.cpp2
-rw-r--r--doc/examples/gen_certs.cpp2
-rw-r--r--doc/examples/hash_quickly.cpp4
6 files changed, 7 insertions, 11 deletions
diff --git a/doc/examples/GNUmakefile b/doc/examples/GNUmakefile
index 44fcfeea5..a96e8d65d 100644
--- a/doc/examples/GNUmakefile
+++ b/doc/examples/GNUmakefile
@@ -1,8 +1,8 @@
BOTAN_CONFIG = botan-config
-CXX = g++
-CFLAGS = -O2 -ansi -W -Wall -I../../build/include
+CXX = g++-4.5-20091112
+CFLAGS = -O2 -ansi -std=c++0x -W -Wall -I../../build/include
LIBS = -L../.. -lbotan
SRCS=$(wildcard *.cpp)
diff --git a/doc/examples/bench.cpp b/doc/examples/bench.cpp
index db2170dc4..7d53e0557 100644
--- a/doc/examples/bench.cpp
+++ b/doc/examples/bench.cpp
@@ -60,8 +60,7 @@ const std::string algos[] = {
"",
};
-void benchmark_algo(const std::string& algo,
- RandomNumberGenerator& rng)
+int main()
{
LibraryInitializer init;
diff --git a/doc/examples/benchmark.cpp b/doc/examples/benchmark.cpp
index d046e8d20..fa91726e5 100644
--- a/doc/examples/benchmark.cpp
+++ b/doc/examples/benchmark.cpp
@@ -17,7 +17,6 @@ int main(int argc, char* argv[])
Botan::LibraryInitializer init;
Botan::AutoSeeded_RNG rng;
- Botan::Default_Benchmark_Timer timer;
Botan::Algorithm_Factory& af = Botan::global_state().algorithm_factory();
@@ -28,7 +27,7 @@ int main(int argc, char* argv[])
std::string algo = argv[i];
std::map<std::string, double> results =
- Botan::algorithm_benchmark(algo, ms, timer, rng, af);
+ Botan::algorithm_benchmark(algo, ms, rng, af);
std::cout << algo << ":\n";
for(std::map<std::string, double>::iterator r = results.begin();
diff --git a/doc/examples/ca.cpp b/doc/examples/ca.cpp
index 9195be418..f5eccdde9 100644
--- a/doc/examples/ca.cpp
+++ b/doc/examples/ca.cpp
@@ -15,7 +15,7 @@
#include <botan/botan.h>
#include <botan/x509_ca.h>
-#include <botan/util.h>
+#include <botan/time.h>
using namespace Botan;
#include <iostream>
diff --git a/doc/examples/gen_certs.cpp b/doc/examples/gen_certs.cpp
index 90cb80038..80cb5f54a 100644
--- a/doc/examples/gen_certs.cpp
+++ b/doc/examples/gen_certs.cpp
@@ -5,9 +5,9 @@
#include <botan/botan.h>
#include <botan/rsa.h>
-#include <botan/util.h>
#include <botan/x509self.h>
#include <botan/x509_ca.h>
+#include <botan/time.h>
using namespace Botan;
diff --git a/doc/examples/hash_quickly.cpp b/doc/examples/hash_quickly.cpp
index e719a7178..c8c8ca5fb 100644
--- a/doc/examples/hash_quickly.cpp
+++ b/doc/examples/hash_quickly.cpp
@@ -23,12 +23,10 @@ void set_fastest_implementation(const std::string& algo,
Botan::RandomNumberGenerator& rng,
double ms = 30)
{
- Botan::Default_Benchmark_Timer timer;
-
Botan::Algorithm_Factory& af = Botan::global_state().algorithm_factory();
std::map<std::string, double> results =
- Botan::algorithm_benchmark(algo, ms, timer, rng, af);
+ Botan::algorithm_benchmark(algo, ms, rng, af);
std::string fastest_provider = "";
double best_res = 0;