summaryrefslogtreecommitdiff
path: root/ace/Stats.cpp
diff options
context:
space:
mode:
authorlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-05-22 12:25:27 +0000
committerlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-05-22 12:25:27 +0000
commite2b311f3ad4035c7a4bbd22ea4fddcb98e0f0ebc (patch)
treee17a69bd5d4aa6523cca86e1d3740523766ed021 /ace/Stats.cpp
parent258bbc50c474cfdb8b14ab9a2c931480606de5f3 (diff)
downloadATCD-e2b311f3ad4035c7a4bbd22ea4fddcb98e0f0ebc.tar.gz
added some casts to avoid MSVC++ warnings about narrowing
Diffstat (limited to 'ace/Stats.cpp')
-rw-r--r--ace/Stats.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/ace/Stats.cpp b/ace/Stats.cpp
index 1acb1ce6e57..b3070946f35 100644
--- a/ace/Stats.cpp
+++ b/ace/Stats.cpp
@@ -1,4 +1,5 @@
// $Id$
+
#define ACE_BUILD_DLL
#include "ace/Stats.h"
@@ -157,7 +158,7 @@ ACE_Stats::reset (void)
overflow_ = 0u;
samples_ = 0u;
min_ = 0x7FFFFFFF;
- max_ = -0x80000000;
+ max_ = -0x8000 * 0x10000;
sum_ = ACE_STATS_INTERNAL_OFFSET;
sum_of_squares_ = 0u;
}
@@ -224,14 +225,16 @@ ACE_Stats::quotient (const ACE_UINT64 dividend,
ACE_Stats_Value &quotient)
{
// The whole part of the division comes from simple integer division.
- quotient.whole (divisor == 0 ? 0 : dividend / divisor);
+ quotient.whole (ACE_static_cast (ACE_UINT32,
+ divisor == 0 ? 0 : dividend / divisor));
if (quotient.precision () > 0 || divisor == 0)
{
const ACE_UINT32 field = quotient.fractional_field ();
// Fractional = (dividend % divisor) * 10^precision / divisor.
- quotient.fractional (dividend % divisor * field / divisor);
+ quotient.fractional (ACE_static_cast (ACE_UINT32,
+ dividend % divisor * field / divisor));
}
else
// No fractional portion is requested, so don't bother