From: Orvid King Date: Mon, 27 Jul 2015 22:17:32 +0000 (-0700) Subject: Fix the size of the enum in FBString.h under MSVC X-Git-Tag: v0.53.0~56 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=51eee59bc7907f959684194514bb5368fb4aa4c9;p=folly.git Fix the size of the enum in FBString.h under MSVC Summary: MSVC defaults enum sizes to int, so explicitly use `size_t` as the base to have it correctly sized. Closes #246 Reviewed By: @yfeldblum Differential Revision: D2282816 Pulled By: @sgolemon --- diff --git a/folly/FBString.h b/folly/FBString.h index c43460a2..53ade9b7 100644 --- a/folly/FBString.h +++ b/folly/FBString.h @@ -810,7 +810,7 @@ private: MediumLarge ml_; }; - enum { + enum : size_t { lastChar = sizeof(MediumLarge) - 1, maxSmallSize = lastChar / sizeof(Char), maxMediumSize = 254 / sizeof(Char), // coincides with the small