[vlc-devel] [PATCH 3/4] vlc_arrays: DictHash output is always used as an int

Rémi Denis-Courmont remi at remlab.net
Mon Jul 20 14:51:49 CEST 2015


Le 2015-07-20 15:15, Steve Lhomme a écrit :
> From: Steve Lhomme <robUx4 at gmail.com>
>
> ---
>  include/vlc_arrays.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/include/vlc_arrays.h b/include/vlc_arrays.h
> index 91f5405..d5802ee 100644
> --- a/include/vlc_arrays.h
> +++ b/include/vlc_arrays.h
> @@ -375,7 +375,7 @@ vlc_array_remove( vlc_array_t * p_array, int 
> i_index )
>   * fast and not suck too much. This one is pretty fast and did 0 
> collisions
>   * in wenglish's dictionary.
>   */
> -static inline uint64_t DictHash( const char *psz_string, int 
> hashsize )
> +static inline int DictHash( const char *psz_string, int hashsize )
>  {
>      uint64_t i_hash = 0;
>      if( psz_string )
> @@ -387,7 +387,7 @@ static inline uint64_t DictHash( const char
> *psz_string, int hashsize )
>              i_hash ^= i_hash >> 8;
>          }
>      }
> -    return i_hash % hashsize;
> +    return (int) (i_hash % hashsize);

Same comments as 3/4.

>  }
>
>  typedef struct vlc_dictionary_entry_t

-- 
Rémi Denis-Courmont
http://www.remlab.net/



More information about the vlc-devel mailing list