Index: base/metrics/histogram_macros.h |
diff --git a/base/metrics/histogram_macros.h b/base/metrics/histogram_macros.h |
index dcde7255c8dafee8e28c09e21baf492408ea8682..dee18cdfeaca0780ab7dc06f4e8a56351a24c2c4 100644 |
--- a/base/metrics/histogram_macros.h |
+++ b/base/metrics/histogram_macros.h |
@@ -8,6 +8,7 @@ |
#include "base/atomicops.h" |
#include "base/logging.h" |
#include "base/metrics/histogram.h" |
+#include "base/template_util.h" |
#include "base/time/time.h" |
// Macros for efficient use of histograms. See documentation in histogram.h. |
@@ -149,9 +150,11 @@ |
// values >= boundary_value so that mistakes in calling the UMA enumeration |
// macros can be detected. |
#define HISTOGRAM_ENUMERATION_WITH_FLAG(name, sample, boundary, flag) \ |
- STATIC_HISTOGRAM_POINTER_BLOCK(name, Add(sample), \ |
- base::LinearHistogram::FactoryGet(name, 1, boundary, boundary + 1, \ |
- flag)) |
+ STATIC_HISTOGRAM_POINTER_BLOCK( \ |
+ name, Add(base::underlying_number(sample)), \ |
+ base::LinearHistogram::FactoryGet( \ |
+ name, 1, base::underlying_number(boundary), \ |
+ base::underlying_number(boundary) + 1, flag)) |
#define LOCAL_HISTOGRAM_PERCENTAGE(name, under_one_hundred) \ |
LOCAL_HISTOGRAM_ENUMERATION(name, under_one_hundred, 101) |