diff -r e1b950c65cb4 -r 837f303aceeb epoc32/include/stdapis/stlportv5/stl/_string_hash.h --- a/epoc32/include/stdapis/stlportv5/stl/_string_hash.h Wed Mar 31 12:27:01 2010 +0100 +++ b/epoc32/include/stdapis/stlportv5/stl/_string_hash.h Wed Mar 31 12:33:34 2010 +0100 @@ -2,13 +2,13 @@ * Copyright (c) 1997-1999 * Silicon Graphics Computer Systems, Inc. * - * Copyright (c) 1999 + * Copyright (c) 1999 * Boris Fomitchev * * This material is provided "as is", with absolutely no warranty expressed * or implied. Any use is at your own risk. * - * Permission to use or copy this software for any purpose is hereby granted + * Permission to use or copy this software for any purpose is hereby granted * without fee, provided the above notices are retained on all copies. * Permission to modify the code and to distribute modified code is granted, * provided the above notices are retained, and a notice that the code was @@ -17,13 +17,13 @@ */ #ifndef _STLP_STRING_HASH_H -# define _STLP_STRING_HASH_H +#define _STLP_STRING_HASH_H #ifndef _STLP_HASH_FUN_H # include #endif -#ifndef _STLP_STRING_H +#ifndef _STLP_INTERNAL_STRING_H # include #endif @@ -33,15 +33,14 @@ _STLP_INLINE_LOOP size_t __stl_string_hash(const basic_string<_CharT,_Traits,_Alloc>& __s) { unsigned long __h = 0; - typedef typename basic_string<_CharT,_Traits,_Alloc>::const_pointer const_ptr; size_t __len = __s.size(); const _CharT* __data = __s.data(); for ( size_t __i = 0; __i < __len; ++__i) - __h = 5*__h + __data[__i]; + __h = /* 5 *__h */(__h << 2) + __h + __data[__i]; return size_t(__h); } -#ifdef _STLP_CLASS_PARTIAL_SPECIALIZATION +#if defined (_STLP_CLASS_PARTIAL_SPECIALIZATION) template struct hash > { @@ -51,17 +50,19 @@ #else -_STLP_TEMPLATE_NULL struct _STLP_CLASS_DECLSPEC hash { +_STLP_TEMPLATE_NULL +struct _STLP_CLASS_DECLSPEC hash { size_t operator()(const string& __s) const { return __stl_string_hash(__s); } }; -# if defined (_STLP_HAS_WCHAR_T) -_STLP_TEMPLATE_NULL struct _STLP_CLASS_DECLSPEC hash { +# if defined (_STLP_HAS_WCHAR_T) +_STLP_TEMPLATE_NULL +struct _STLP_CLASS_DECLSPEC hash { size_t operator()(const wstring& __s) const { return __stl_string_hash(__s); } }; -# endif +# endif #endif /* _STLP_CLASS_PARTIAL_SPECIALIZATION */