From: Andre Noll Date: Sat, 28 Dec 2013 17:16:18 +0000 (+0000) Subject: bitstream: Replace check for impossible condition by assertion. X-Git-Tag: v0.5.3~17^2~2 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=c31a963befeea8d9441efc19dd31273260152012;ds=sidebyside bitstream: Replace check for impossible condition by assertion. No big deal because behaviour is unchanged (abort). Calling assert() is a bit shorter and will print a better error message. --- diff --git a/bitstream.c b/bitstream.c index 8f13a9b5..492b407d 100644 --- a/bitstream.c +++ b/bitstream.c @@ -88,10 +88,7 @@ static int build_table(struct vlc *vlc, int table_nb_bits, int nb_codes, j = (code << (table_nb_bits - n)) & (table_size - 1); nb = 1 << (table_nb_bits - n); for (k = 0; k < nb; k++) { - if (table[j][1] /* bits */ != 0) { - PARA_EMERG_LOG("incorrect code\n"); - exit(EXIT_FAILURE); - } + assert(table[j][1] == 0); /* incorrect code */ table[j][1] = n; /* bits */ table[j][0] = i; j++;