[vlc-devel] [PATCH 2/2] vlc_arrays.h: Dictionary: Use the correct type to store hash
Hugo Beauzée-Luyssen
hugo at beauzee.fr
Fri Dec 4 10:31:32 CET 2020
---
include/vlc_arrays.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/include/vlc_arrays.h b/include/vlc_arrays.h
index a7469359bb..44d9e5de6d 100644
--- a/include/vlc_arrays.h
+++ b/include/vlc_arrays.h
@@ -456,7 +456,7 @@ vlc_dictionary_has_key( const vlc_dictionary_t * p_dict, const char * psz_key )
if( !p_dict->p_entries )
return 0;
- int i_pos = DictHash( psz_key, p_dict->i_size );
+ size_t i_pos = DictHash( psz_key, p_dict->i_size );
const vlc_dictionary_entry_t * p_entry = p_dict->p_entries[i_pos];
for( ; p_entry != NULL; p_entry = p_entry->p_next )
{
@@ -472,7 +472,7 @@ vlc_dictionary_value_for_key( const vlc_dictionary_t * p_dict, const char * psz_
if( !p_dict->p_entries )
return kVLCDictionaryNotFound;
- int i_pos = DictHash( psz_key, p_dict->i_size );
+ size_t i_pos = DictHash( psz_key, p_dict->i_size );
vlc_dictionary_entry_t * p_entry = p_dict->p_entries[i_pos];
if( !p_entry )
@@ -542,7 +542,7 @@ vlc_dictionary_insert_impl_( vlc_dictionary_t * p_dict, const char * psz_key,
if( !p_dict->p_entries )
vlc_dictionary_init( p_dict, 1 );
- int i_pos = DictHash( psz_key, p_dict->i_size );
+ size_t i_pos = DictHash( psz_key, p_dict->i_size );
vlc_dictionary_entry_t * p_entry;
p_entry = (vlc_dictionary_entry_t *)malloc(sizeof(*p_entry));
@@ -596,7 +596,7 @@ vlc_dictionary_remove_value_for_key( const vlc_dictionary_t * p_dict, const char
if( !p_dict->p_entries )
return;
- int i_pos = DictHash( psz_key, p_dict->i_size );
+ size_t i_pos = DictHash( psz_key, p_dict->i_size );
vlc_dictionary_entry_t * p_entry = p_dict->p_entries[i_pos];
vlc_dictionary_entry_t * p_prev;
--
2.29.2
More information about the vlc-devel
mailing list