From 2bd8a54e0624143ee5128d1e224b1635b2c5d1f4 Mon Sep 17 00:00:00 2001 From: Neil Hodgson Date: Tue, 21 Jan 2014 09:45:29 +1100 Subject: Added ELEMENTS macro and use it to clarify determining size of arrays. --- cocoa/PlatCocoa.mm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'cocoa') diff --git a/cocoa/PlatCocoa.mm b/cocoa/PlatCocoa.mm index 3c952e039..304798cbb 100644 --- a/cocoa/PlatCocoa.mm +++ b/cocoa/PlatCocoa.mm @@ -26,6 +26,7 @@ #include #include +#include "StringCopy.h" #include "XPM.h" #import @@ -1053,7 +1054,7 @@ XYPOSITION SurfaceImpl::AverageCharWidth(Font &font_) { if (!font_.GetID()) return 1; - const int sizeStringLength = (sizeof( sizeString ) / sizeof( sizeString[0] ) - 1); + const int sizeStringLength = ELEMENTS( sizeString ); int width = WidthText( font_, sizeString, sizeStringLength ); return (int) ((width / (float) sizeStringLength) + 0.5); -- cgit v1.2.3