From 898769a86f1881871bc778135395fd6f4a6129a1 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Sun, 18 Oct 2009 15:09:39 +0200 Subject: [PATCH] make init_vlc() return void. --- bitstream.c | 11 +++-------- bitstream.h | 5 +++-- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/bitstream.c b/bitstream.c index 11429489..e9f7126e 100644 --- a/bitstream.c +++ b/bitstream.c @@ -155,22 +155,17 @@ static int build_table(struct vlc *vlc, int table_nb_bits, int nb_codes, * The wrap and size parameters allow to use any memory configuration and * types (byte/word/long) to store the bits and codes tables. */ -int init_vlc(struct vlc *vlc, int nb_bits, int nb_codes, +void init_vlc(struct vlc *vlc, int nb_bits, int nb_codes, const void *bits, const void *codes, int codes_wrap, int codes_size) { - int ret; - - PARA_INFO_LOG("nb_codes=%d\n", nb_codes); + PARA_INFO_LOG("nb_codes: %d\n", nb_codes); vlc->bits = nb_bits; vlc->table = NULL; vlc->table_allocated = 0; vlc->table_size = 0; - ret = build_table(vlc, nb_bits, nb_codes, bits, + build_table(vlc, nb_bits, nb_codes, bits, codes, codes_wrap, codes_size, 0, 0); - if (ret < 0) - freep(&vlc->table); - return ret; } void free_vlc(struct vlc *vlc) diff --git a/bitstream.h b/bitstream.h index 7e518c5f..a82dcd72 100644 --- a/bitstream.h +++ b/bitstream.h @@ -161,8 +161,9 @@ static inline void init_get_bits(struct getbit_context *s, s->index = 0; } -int init_vlc(struct vlc *vlc, int nb_bits, int nb_codes, - const void *bits, const void *codes, int codes_wrap, int codes_size); +void init_vlc(struct vlc *vlc, int nb_bits, int nb_codes, + const void *bits, const void *codes, int codes_wrap, + int codes_size); void free_vlc(struct vlc *vlc); -- 2.30.2