From: <sv...@ww...> - 2006-04-16 00:22:16
|
Author: mkrose Date: 2006-04-15 17:22:09 -0700 (Sat, 15 Apr 2006) New Revision: 1900 Modified: trunk/csp/csplib/data/Date.cpp trunk/csp/csplib/data/Date.h trunk/csp/csplib/net/StopWatch.h trunk/csp/csplib/net/TaggedRecord.h trunk/csp/csplib/numeric/NumericalMethod.cpp trunk/csp/csplib/numeric/VectorField.h trunk/csp/csplib/spatial/QuadTree.h trunk/csp/csplib/util/Cache.h trunk/csp/csplib/util/LogStream.cpp trunk/csp/csplib/util/StringTools.cpp Log: Fix a few minor warnings (/W4) under Windows. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1900 Modified: trunk/csp/csplib/data/Date.cpp =================================================================== --- trunk/csp/csplib/data/Date.cpp 2006-04-16 00:20:46 UTC (rev 1899) +++ trunk/csp/csplib/data/Date.cpp 2006-04-16 00:22:09 UTC (rev 1900) @@ -318,15 +318,15 @@ return buffer; } -#define SEC2RAD 7.272205216643039903848712e-5L -#define EPOCH 2451545.0e+0L -#define DAYSEC 86400.0e+0L -#define CENDAY 36525.0e+0L -#define PI 3.141592653e+0L -#define COEFF0 24110.54841e+0L -#define COEFF1 8640184.812866e+0L -#define COEFF2 0.093104e+0L -#define COEFF3 -6.2e-6L +#define SEC2RAD 7.272205216643039903848712e-5 +#define EPOCH 2451545.0e+0 +#define DAYSEC 86400.0e+0 +#define CENDAY 36525.0e+0 +#define PI 3.141592653e+0 +#define COEFF0 24110.54841e+0 +#define COEFF1 8640184.812866e+0 +#define COEFF2 0.093104e+0 +#define COEFF3 -6.2e-6 /* DEPRECATED double DateZulu::getAccurateMST(radian_t longitude) const { Modified: trunk/csp/csplib/data/Date.h =================================================================== --- trunk/csp/csplib/data/Date.h 2006-04-16 00:20:46 UTC (rev 1899) +++ trunk/csp/csplib/data/Date.h 2006-04-16 00:22:09 UTC (rev 1900) @@ -63,10 +63,10 @@ CSP_NAMESPACE -#define CSP_F1p0_60p0 0.016666666666666667L -#define CSP_F1p0_24p0 0.041666666666666667L -#define CSP_F1p0_36525p0 0.000027378507871321L -#define CSP_F1p0_86400p0 0.000011574074074074L +#define CSP_F1p0_60p0 0.016666666666666667 +#define CSP_F1p0_24p0 0.041666666666666667 +#define CSP_F1p0_36525p0 0.000027378507871321 +#define CSP_F1p0_86400p0 0.000011574074074074 typedef double radian_t; Modified: trunk/csp/csplib/net/StopWatch.h =================================================================== --- trunk/csp/csplib/net/StopWatch.h 2006-04-16 00:20:46 UTC (rev 1899) +++ trunk/csp/csplib/net/StopWatch.h 2006-04-16 00:22:09 UTC (rev 1900) @@ -25,6 +25,7 @@ #ifndef __CSPLIB_NET_STOPWATCH_H__ #define __CSPLIB_NET_STOPWATCH_H__ +#include <csp/csplib/util/Properties.h> #include <csp/csplib/util/Timing.h> CSP_NAMESPACE @@ -60,7 +61,7 @@ * * @ingroup net */ -class CSPLIB_EXPORT StopWatch { +class CSPLIB_EXPORT StopWatch: NonCopyable { public: /** Internal timing data. Declare separate, persistent Data instance for each Modified: trunk/csp/csplib/net/TaggedRecord.h =================================================================== --- trunk/csp/csplib/net/TaggedRecord.h 2006-04-16 00:20:46 UTC (rev 1899) +++ trunk/csp/csplib/net/TaggedRecord.h 2006-04-16 00:22:09 UTC (rev 1900) @@ -42,8 +42,9 @@ #define __CSPLIB_NET_TAGGED_RECORD_H__ #include <csp/csplib/data/Archive.h> +#include <csp/csplib/util/Namespace.h> +#include <csp/csplib/util/Properties.h> #include <csp/csplib/util/Ref.h> -#include <csp/csplib/util/Namespace.h> #include <string> #include <stack> @@ -140,7 +141,7 @@ * of nested records. * @ingroup net */ -class CSPLIB_EXPORT TagBase { +class CSPLIB_EXPORT TagBase: NonCopyable { protected: std::stack<int> _tagstack; enum { TAG_END = 0 }; Modified: trunk/csp/csplib/numeric/NumericalMethod.cpp =================================================================== --- trunk/csp/csplib/numeric/NumericalMethod.cpp 2006-04-16 00:20:46 UTC (rev 1899) +++ trunk/csp/csplib/numeric/NumericalMethod.cpp 2006-04-16 00:22:09 UTC (rev 1900) @@ -245,7 +245,7 @@ static Vectord ytemp(m_Dimension); unsigned short i = 0; - register short int const dim = m_Dimension; + register short int const dim = static_cast<short int>(m_Dimension); for (; i < dim; ++i) { ytemp[i] = y[i] + b21 * h * dydx[i]; } Modified: trunk/csp/csplib/numeric/VectorField.h =================================================================== --- trunk/csp/csplib/numeric/VectorField.h 2006-04-16 00:20:46 UTC (rev 1899) +++ trunk/csp/csplib/numeric/VectorField.h 2006-04-16 00:22:09 UTC (rev 1900) @@ -26,7 +26,7 @@ #define __CSPSIM_VECTORFIELD_H__ #include <csp/csplib/util/Export.h> -#include <csp/csplib/util/Namespace.h> +#include <csp/csplib/util/Properties.h> #include <csp/csplib/numeric/Vector.h> CSP_NAMESPACE @@ -40,7 +40,7 @@ * field describing the kinetic parameters of a dynamical * system. */ -class CSPLIB_EXPORT VectorField { +class CSPLIB_EXPORT VectorField: NonCopyable { protected: typedef size_t size_type; size_type const m_Dimension; Modified: trunk/csp/csplib/spatial/QuadTree.h =================================================================== --- trunk/csp/csplib/spatial/QuadTree.h 2006-04-16 00:20:46 UTC (rev 1899) +++ trunk/csp/csplib/spatial/QuadTree.h 2006-04-16 00:22:09 UTC (rev 1900) @@ -283,8 +283,9 @@ * when traversing the tree. */ class CSPLIB_EXPORT TreeConstraint { - const uint32 _max_depth; - const uint32 _leaf_limit; + uint32 _max_depth; + uint32 _leaf_limit; + public: /** Construct a new TreeConstraint. Modified: trunk/csp/csplib/util/Cache.h =================================================================== --- trunk/csp/csplib/util/Cache.h 2006-04-16 00:20:46 UTC (rev 1899) +++ trunk/csp/csplib/util/Cache.h 2006-04-16 00:22:09 UTC (rev 1900) @@ -57,8 +57,8 @@ #include <cassert> #include <list> -#include <csp/csplib/util/Namespace.h> #include <csp/csplib/util/HashUtility.h> +#include <csp/csplib/util/Properties.h> CSP_NAMESPACE @@ -71,7 +71,7 @@ * items in the collection. */ template <typename KEY, typename TYPE, typename HASH_COMPARE = HashCompare<KEY> > -class MostRecentlyUsedCache { +class MostRecentlyUsedCache: NonCopyable { typedef TYPE DataType; typedef KEY CacheKey; typedef std::list<CacheKey> MostRecentlyUsedList; Modified: trunk/csp/csplib/util/LogStream.cpp =================================================================== --- trunk/csp/csplib/util/LogStream.cpp 2006-04-16 00:20:46 UTC (rev 1899) +++ trunk/csp/csplib/util/LogStream.cpp 2006-04-16 00:22:09 UTC (rev 1900) @@ -68,8 +68,8 @@ LogStreamRegistry *NamedLogStreamRegistry = 0; inline void writeDigits(char *&buffer, int value) { - *buffer++ = '0' + value / 10; - *buffer++ = '0' + value % 10; + *buffer++ = '0' + static_cast<char>(value / 10); + *buffer++ = '0' + static_cast<char>(value % 10); } // Replaced gmtime_r and strftime with logTime, mainly because gmtime_r isn't Modified: trunk/csp/csplib/util/StringTools.cpp =================================================================== --- trunk/csp/csplib/util/StringTools.cpp 2006-04-16 00:20:46 UTC (rev 1899) +++ trunk/csp/csplib/util/StringTools.cpp 2006-04-16 00:22:09 UTC (rev 1900) @@ -283,9 +283,9 @@ char *fill = fmt; *fill++ = '%'; *fill++ = '.'; - if (precision > 100) *fill++ = '0' + (precision / 100) % 10; - if (precision > 10) *fill++ = '0' + (precision / 10) % 10; - *fill++ = '0' + (precision % 10); + if (precision > 100) *fill++ = '0' + static_cast<char>((precision / 100) % 10); + if (precision > 10) *fill++ = '0' + static_cast<char>((precision / 10) % 10); + *fill++ = '0' + static_cast<char>(precision % 10); *fill++ = style; *fill = 0; // 128 bytes should be more than enough since we are doing alignment by hand. |