StrLen: align implementations

There are two copies of `StrLen` in the RapidJSON code base
 * strfunc.h: rapidjson::internal::StrLen<Ch>
 * unittest.h: Strlen<Ch>

To hide a warning on MSVC, align both implementations to use
'unsigned/SizeType' as return type and add an explicit cast.
This commit is contained in:
Philipp A. Hartmann
2014-07-10 16:46:42 +02:00
committed by Philipp A. Hartmann
parent 4f40ed64b6
commit 7a2e6e79c6
2 changed files with 3 additions and 4 deletions

View File

@@ -27,10 +27,10 @@
#endif
template <typename Ch>
inline size_t StrLen(const Ch* s) {
inline unsigned StrLen(const Ch* s) {
const Ch* p = s;
while (*p) p++;
return p - s;
return unsigned(p - s);
}
template<typename Ch>