(svn r7146) -CodeChange: ST_CONST macro removed as it is no longer needed (Tron)
authorKUDr
Tue, 14 Nov 2006 12:02:36 +0000
changeset 5082 f5c258d60562
parent 5081 f71d1d2da6ed
child 5083 6da97b6fbbd6
(svn r7146) -CodeChange: ST_CONST macro removed as it is no longer needed (Tron)
stdafx.h
yapf/array.hpp
yapf/blob.hpp
yapf/fixedsizearray.hpp
yapf/hashtable.hpp
--- a/stdafx.h	Tue Nov 14 11:01:59 2006 +0000
+++ b/stdafx.h	Tue Nov 14 12:02:36 2006 +0000
@@ -301,15 +301,4 @@
 #define EXTERN_C_BEGIN extern "C" {
 #define EXTERN_C_END   }
 
-
-// workaround for VC6 bug: Error C2258 and error C2252 occur if you try
-//  to perform in-place initialization of static const integral member
-//  data in Visual C++ (see http://support.microsoft.com/kb/241569/)
-#if defined(_MSC_VER) && (_MSC_VER < 1300)
-# define ST_CONST(type, name_val) enum {name_val};
-#else
-# define ST_CONST(type, name_val) static const type name_val;
-#endif
-
-
 #endif /* STDAFX_H */
--- a/yapf/array.hpp	Tue Nov 14 11:01:59 2006 +0000
+++ b/yapf/array.hpp	Tue Nov 14 12:02:36 2006 +0000
@@ -18,9 +18,9 @@
 	CSuperArray     m_a; ///< array of arrays of items
 
 public:
-	ST_CONST(int, Tblock_size = Tblock_size_) ///< block size is now visible from outside
-	ST_CONST(int, Tnum_blocks = Tnum_blocks_) ///< number of blocks is now visible from outside
-	ST_CONST(int, Tcapacity = Tblock_size * Tnum_blocks) ///< total max number of items
+	static const int Tblock_size = Tblock_size_; ///< block size is now visible from outside
+	static const int Tnum_blocks = Tnum_blocks_; ///< number of blocks is now visible from outside
+	static const int Tcapacity   = Tblock_size * Tnum_blocks; ///< total max number of items
 
 	/** implicit constructor */
 	FORCEINLINE CArrayT() { }
--- a/yapf/blob.hpp	Tue Nov 14 11:01:59 2006 +0000
+++ b/yapf/blob.hpp	Tue Nov 14 12:02:36 2006 +0000
@@ -32,7 +32,7 @@
 	} ptr_u;
 
 public:
-	ST_CONST(int, Ttail_reserve = 4) // four extra bytes will be always allocated and zeroed at the end
+	static const int Ttail_reserve = 4; // four extra bytes will be always allocated and zeroed at the end
 
 	FORCEINLINE CBlobBaseSimple() { InitEmpty(); }
 	FORCEINLINE CBlobBaseSimple(const CBlobBaseSimple& src)
@@ -169,7 +169,7 @@
 	typedef Titem_ Titem;
 	typedef Tbase_ Tbase;
 
-	ST_CONST(int, Titem_size = sizeof(Titem))
+	static const int Titem_size = sizeof(Titem);
 
 	FORCEINLINE CBlobT() : Tbase() {}
 	FORCEINLINE CBlobT(const Tbase& src) : Tbase(src) {assert((RawSize() % Titem_size) == 0);}
--- a/yapf/fixedsizearray.hpp	Tue Nov 14 11:01:59 2006 +0000
+++ b/yapf/fixedsizearray.hpp	Tue Nov 14 12:02:36 2006 +0000
@@ -24,9 +24,9 @@
 	// make types and constants visible from outside
 	typedef Titem_ Titem; // type of array item
 
-	ST_CONST(int, Tcapacity = Tcapacity_) // the array capacity (maximum size)
-	ST_CONST(int, TitemSize = sizeof(Titem_)) // size of item
-	ST_CONST(int, ThdrSize  = sizeof(CHdr)) // size of header
+	static const int Tcapacity = Tcapacity_;     // the array capacity (maximum size)
+	static const int TitemSize = sizeof(Titem_); // size of item
+	static const int ThdrSize  = sizeof(CHdr);   // size of header
 
 	/** Default constructor. Preallocate space for items and header, then initialize header. */
 	CFixedSizeArrayT()
--- a/yapf/hashtable.hpp	Tue Nov 14 11:01:59 2006 +0000
+++ b/yapf/hashtable.hpp	Tue Nov 14 12:02:36 2006 +0000
@@ -118,10 +118,10 @@
 template <class Titem_, int Thash_bits_>
 class CHashTableT {
 public:
-	typedef Titem_ Titem;                       // make Titem_ visible from outside of class
-	typedef typename Titem_::Key Tkey;          // make Titem_::Key a property of HashTable
-	ST_CONST(int, Thash_bits = Thash_bits_)    // publish num of hash bits
-	ST_CONST(int, Tcapacity = 1 << Thash_bits) // and num of slots 2^bits
+	typedef Titem_ Titem;                         // make Titem_ visible from outside of class
+	typedef typename Titem_::Key Tkey;            // make Titem_::Key a property of HashTable
+	static const int Thash_bits = Thash_bits_;    // publish num of hash bits
+	static const int Tcapacity = 1 << Thash_bits; // and num of slots 2^bits
 
 protected:
 	/** each slot contains pointer to the first item in the list,