X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=include%2Fvlc_arrays.h;h=7ac9290e3183ddf36ce366705a8ca9b7c8f102a0;hb=5dbc70c99be39d53beb4d4548fd5767eddd17cf1;hp=9757ae48c45b0187dfb09ff30e1771937f3ecf2b;hpb=5122c9d9e9f5851a84c2b037cc35dbacd3699aef;p=vlc diff --git a/include/vlc_arrays.h b/include/vlc_arrays.h index 9757ae48c4..7ac9290e31 100644 --- a/include/vlc_arrays.h +++ b/include/vlc_arrays.h @@ -21,15 +21,9 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ -#if !defined( __LIBVLC__ ) - #error You are not libvlc or one of its plugins. You cannot include this file -#endif - #ifndef _VLC_ARRAYS_H_ #define _VLC_ARRAYS_H_ -#include - /** * Simple dynamic array handling. Array is realloced at each insert/removal */ @@ -192,7 +186,6 @@ array.i_alloc = newsize; \ array.p_elems = VLCCVP realloc( array.p_elems, array.i_alloc * \ sizeof(*array.p_elems) ); \ - assert(array.p_elems); \ } #define _ARRAY_GROW1(array) { \ @@ -419,7 +412,6 @@ static inline void vlc_dictionary_init( vlc_dictionary_t * p_dict, int i_size ) if( i_size > 0 ) { p_dict->p_entries = (struct vlc_dictionary_entry_t **)malloc(sizeof(struct vlc_dictionary_entry_t *) * i_size); - assert( p_dict->p_entries ); memset( p_dict->p_entries, 0, sizeof(struct vlc_dictionary_entry_t *) * i_size ); } else @@ -497,16 +489,12 @@ vlc_dictionary_all_keys( const vlc_dictionary_t * p_dict ) int i, count = vlc_dictionary_keys_count( p_dict ); ppsz_ret = (char**)malloc(sizeof(char *) * (count + 1)); - assert( ppsz_ret ); count = 0; for( i = 0; i < p_dict->i_size; i++ ) { for( p_entry = p_dict->p_entries[i]; p_entry; p_entry = p_entry->p_next ) - { ppsz_ret[count++] = strdup( p_entry->psz_key ); - assert( ppsz_ret ); - } } ppsz_ret[count] = NULL; return ppsz_ret; @@ -514,7 +502,7 @@ vlc_dictionary_all_keys( const vlc_dictionary_t * p_dict ) static inline void __vlc_dictionary_insert( vlc_dictionary_t * p_dict, const char * psz_key, - void * p_value, vlc_bool_t rebuild ) + void * p_value, bool rebuild ) { if( !p_dict->p_entries ) vlc_dictionary_init( p_dict, 1 ); @@ -523,7 +511,6 @@ __vlc_dictionary_insert( vlc_dictionary_t * p_dict, const char * psz_key, struct vlc_dictionary_entry_t * p_entry; p_entry = (struct vlc_dictionary_entry_t *)malloc(sizeof(struct vlc_dictionary_entry_t)); - assert( p_entry ); p_entry->psz_key = strdup( psz_key ); p_entry->p_value = p_value; p_entry->p_next = p_dict->p_entries[i_pos];