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

Rémi Denis-Courmont remi at remlab.net
Fri Jul 31 17:03:02 CEST 2015


Le 2015-07-31 17:55, Steve Lhomme a écrit :
> ---
>  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);

This makes no sense.

>  }
>
>  typedef struct vlc_dictionary_entry_t

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



More information about the vlc-devel mailing list