Add an additional value to nsOverflowType so that compilers (in particular, gcc 4.5.*) know that one past the end is a value they'll need to deal with. (Bug 602826) r=roc a2.0=blocking
authorL. David Baron <dbaron@dbaron.org>
Mon, 11 Oct 2010 19:20:57 -0700
changeset 55334 e84f3fb9fd5633d5eceb38b2fb33bcf573445c59
parent 55333 d367799021490bcc50417956333032536baceb1b
child 55335 002f8bd6526e65b51349346ca2774391caac2d1f
push idunknown
push userunknown
push dateunknown
reviewersroc
bugs602826
milestone2.0b8pre
Add an additional value to nsOverflowType so that compilers (in particular, gcc 4.5.*) know that one past the end is a value they'll need to deal with. (Bug 602826) r=roc a2.0=blocking
layout/generic/nsHTMLReflowMetrics.h
--- a/layout/generic/nsHTMLReflowMetrics.h
+++ b/layout/generic/nsHTMLReflowMetrics.h
@@ -52,18 +52,23 @@
 // Option flags
 #ifdef MOZ_MATHML
 #define NS_REFLOW_CALC_BOUNDING_METRICS  0x0001
 #endif
 
 /**
  * When we store overflow areas as an array of scrollable and visual
  * overflow, we use these indices.
+ *
+ * eOverflowType_LENGTH is needed (for gcc 4.5.*, at least) to ensure
+ * that 2 is a valid value of nsOverflowType for use in
+ * NS_FOR_FRAME_OVERFLOW_TYPES.
  */
-enum nsOverflowType { eVisualOverflow, eScrollableOverflow };
+enum nsOverflowType { eVisualOverflow, eScrollableOverflow,
+                      eOverflowType_LENGTH };
 
 #define NS_FOR_FRAME_OVERFLOW_TYPES(var_)                                     \
   for (nsOverflowType var_ = nsOverflowType(0); var_ < 2;                     \
        var_ = nsOverflowType(var_ + 1))
 
 struct nsOverflowAreas {
 private:
   nsRect mRects[2];