diff options
author | lloyd <[email protected]> | 2010-05-21 16:35:28 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-05-21 16:35:28 +0000 |
commit | 211d835a356f55e037ff8035017d79c458f13615 (patch) | |
tree | 10f090ff7eb49f62f7c869fb55334478a0cefa28 /src | |
parent | d3d0a5d3872653f71529bb546c8116f663ae8b32 (diff) |
Add a couple of small patches from Thomas Capricelli <[email protected]>
that enable botan to be built under the clang C++ compiler.
Diffstat (limited to 'src')
-rw-r--r-- | src/algo_factory/algo_factory.cpp | 16 | ||||
-rw-r--r-- | src/alloc/secmem.h | 24 |
2 files changed, 26 insertions, 14 deletions
diff --git a/src/algo_factory/algo_factory.cpp b/src/algo_factory/algo_factory.cpp index 030a32b9f..e8a2a0913 100644 --- a/src/algo_factory/algo_factory.cpp +++ b/src/algo_factory/algo_factory.cpp @@ -1,6 +1,6 @@ /* * Algorithm Factory -* (C) 2008 Jack Lloyd +* (C) 2008-2010 Jack Lloyd * * Distributed under the terms of the Botan license */ @@ -26,22 +26,26 @@ namespace { * Template functions for the factory prototype/search algorithm */ template<typename T> -T* engine_get_algo(Engine* engine, const SCAN_Name& request, - Algorithm_Factory& af) +T* engine_get_algo(Engine*, + const SCAN_Name&, + Algorithm_Factory&) { return 0; } template<> -BlockCipher* engine_get_algo(Engine* engine, const SCAN_Name& request, +BlockCipher* engine_get_algo(Engine* engine, + const SCAN_Name& request, Algorithm_Factory& af) { return engine->find_block_cipher(request, af); } template<> -StreamCipher* engine_get_algo(Engine* engine, const SCAN_Name& request, +StreamCipher* engine_get_algo(Engine* engine, + const SCAN_Name& request, Algorithm_Factory& af) { return engine->find_stream_cipher(request, af); } template<> -HashFunction* engine_get_algo(Engine* engine, const SCAN_Name& request, +HashFunction* engine_get_algo(Engine* engine, + const SCAN_Name& request, Algorithm_Factory& af) { return engine->find_hash(request, af); } diff --git a/src/alloc/secmem.h b/src/alloc/secmem.h index c50df924d..b3b3fa973 100644 --- a/src/alloc/secmem.h +++ b/src/alloc/secmem.h @@ -292,6 +292,10 @@ template<typename T> class MemoryVector : public MemoryRegion<T> { public: + using MemoryRegion<T>::set; + using MemoryRegion<T>::init; + using MemoryRegion<T>::append; + /** * Copy the contents of another buffer into this buffer. * @param in the buffer to copy the contents from @@ -304,7 +308,7 @@ class MemoryVector : public MemoryRegion<T> * Create a buffer of the specified length. * @param n the length of the buffer to create. */ - MemoryVector(u32bit n = 0) { MemoryRegion<T>::init(false, n); } + MemoryVector(u32bit n = 0) { init(false, n); } /** * Create a buffer with the specified contents. @@ -313,13 +317,13 @@ class MemoryVector : public MemoryRegion<T> * @param n the size of the arry in */ MemoryVector(const T in[], u32bit n) - { MemoryRegion<T>::init(false); set(in, n); } + { init(false); set(in, n); } /** * Copy constructor. */ MemoryVector(const MemoryRegion<T>& in) - { MemoryRegion<T>::init(false); set(in); } + { init(false); set(in); } /** * Create a buffer whose content is the concatenation of two other @@ -328,7 +332,7 @@ class MemoryVector : public MemoryRegion<T> * @param in2 the contents to be appended to in1 */ MemoryVector(const MemoryRegion<T>& in1, const MemoryRegion<T>& in2) - { MemoryRegion<T>::init(false); set(in1); append(in2); } + { init(false); set(in1); append(in2); } }; /** @@ -341,6 +345,10 @@ template<typename T, u32bit INITIAL_LEN = 0> class SecureVector : public MemoryRegion<T> { public: + using MemoryRegion<T>::set; + using MemoryRegion<T>::init; + using MemoryRegion<T>::append; + /** * Copy the contents of another buffer into this buffer. * @param in the buffer to copy the contents from @@ -354,7 +362,7 @@ class SecureVector : public MemoryRegion<T> * @param n the length of the buffer to create. */ SecureVector(u32bit n = INITIAL_LEN) - { MemoryRegion<T>::init(true, n); } + { init(true, n); } /** * Create a buffer with the specified contents. @@ -363,7 +371,7 @@ class SecureVector : public MemoryRegion<T> * @param n the size of the array in */ SecureVector(const T in[], u32bit n) - { MemoryRegion<T>::init(true); set(in, n); } + { init(true); set(in, n); } /** * Create a buffer with contents specified contents. @@ -371,7 +379,7 @@ class SecureVector : public MemoryRegion<T> * copied into the newly created buffer. */ SecureVector(const MemoryRegion<T>& in) - { MemoryRegion<T>::init(true); set(in); } + { init(true); set(in); } /** * Create a buffer whose content is the concatenation of two other @@ -380,7 +388,7 @@ class SecureVector : public MemoryRegion<T> * @param in2 the contents to be appended to in1 */ SecureVector(const MemoryRegion<T>& in1, const MemoryRegion<T>& in2) - { MemoryRegion<T>::init(true); set(in1); append(in2); } + { init(true); set(in1); append(in2); } }; } |