From b0cbbcd3549667cfc8acd43dbe6819fb1ac3a511 Mon Sep 17 00:00:00 2001 From: weidai Date: Fri, 13 Mar 2009 02:55:23 +0000 Subject: fix compile on MSVC 6 git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@446 57ff6487-cd31-0410-9ec3-f628ee90f5f0 --- secblock.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'secblock.h') diff --git a/secblock.h b/secblock.h index 481533c..d66470e 100644 --- a/secblock.h +++ b/secblock.h @@ -98,7 +98,7 @@ public: if (n == 0) return NULL; - if (T_Align16 && n*sizeof(T) >= 16) + if (CRYPTOPP_BOOL_ALIGN16_ENABLED && T_Align16 && n*sizeof(T) >= 16) { byte *p; #ifdef CRYPTOPP_MM_MALLOC_AVAILABLE @@ -132,7 +132,7 @@ public: { memset_z(p, 0, n*sizeof(T)); - if (T_Align16 && n*sizeof(T) >= 16) + if (CRYPTOPP_BOOL_ALIGN16_ENABLED && T_Align16 && n*sizeof(T) >= 16) { #ifdef CRYPTOPP_MM_MALLOC_AVAILABLE _mm_free(p); @@ -262,8 +262,8 @@ private: T* GetAlignedArray() {return m_array;} T m_array[S]; #else - T* GetAlignedArray() {return T_Align16 ? (T*)(((byte *)m_array) + (0-(size_t)m_array)%16) : m_array;} - CRYPTOPP_ALIGN_DATA(8) T m_array[T_Align16 ? S+8/sizeof(T) : S]; + T* GetAlignedArray() {return (CRYPTOPP_BOOL_ALIGN16_ENABLED && T_Align16) ? (T*)(((byte *)m_array) + (0-(size_t)m_array)%16) : m_array;} + CRYPTOPP_ALIGN_DATA(8) T m_array[(CRYPTOPP_BOOL_ALIGN16_ENABLED && T_Align16) ? S+8/sizeof(T) : S]; #endif A m_fallbackAllocator; bool m_allocated; @@ -401,7 +401,7 @@ public: void CleanNew(size_type newSize) { New(newSize); - memset(m_ptr, 0, m_size*sizeof(T)); + memset_z(m_ptr, 0, m_size*sizeof(T)); } //! change size only if newSize > current size. contents are preserved @@ -447,7 +447,7 @@ public: }; typedef SecBlock SecByteBlock; -typedef SecBlock > AlignedSecByteBlock; +typedef SecBlock > AlignedSecByteBlock; typedef SecBlock SecWordBlock; //! a SecBlock with fixed size, allocated statically @@ -458,7 +458,7 @@ public: explicit FixedSizeSecBlock() : SecBlock(S) {} }; -template +template class FixedSizeAlignedSecBlock : public FixedSizeSecBlock, T_Align16> > { }; -- cgit v1.2.1