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. --- lexlib/WordList.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lexlib/WordList.cxx') diff --git a/lexlib/WordList.cxx b/lexlib/WordList.cxx index e789c0eaf..10b6fe349 100644 --- a/lexlib/WordList.cxx +++ b/lexlib/WordList.cxx @@ -13,6 +13,7 @@ #include +#include "StringCopy.h" #include "WordList.h" #ifdef SCI_NAMESPACE @@ -131,7 +132,7 @@ void WordList::Set(const char *s) { #else SortWordList(words, len); #endif - for (unsigned int k = 0; k < (sizeof(starts) / sizeof(starts[0])); k++) + for (unsigned int k = 0; k < ELEMENTS(starts); k++) starts[k] = -1; for (int l = len - 1; l >= 0; l--) { unsigned char indexChar = words[l][0]; -- cgit v1.2.3