shithub: jbig2

Download patch

ref: 6ae1795ff130e5942841eb2341b54f72b1e6c7ab
parent: 8a15ebc942e84fb5a35598fc82591e9917c7380b
author: Sebastian Rasmussen <sebras@gmail.com>
date: Wed May 30 10:26:16 EDT 2018

jbig2dec: No need to check for NULL in huff_get_next_word, use macro instead.

--- a/jbig2_huffman.c
+++ b/jbig2_huffman.c
@@ -57,15 +57,8 @@
     Jbig2Ctx *ctx;
 };
 
-static int
-huff_get_next_word(Jbig2HuffmanState *hs, uint32_t offset, uint32_t *word)
-{
-    Jbig2WordStream *ws = hs->ws;
-
-    if (word == NULL)
-        return -1;
-    return ws->get_next_word(ws, offset, word);
-}
+#define huff_get_next_word(hs, offset, word) \
+    (hs)->ws->get_next_word((hs)->ws, (offset), (word))
 
 /** Allocate and initialize a new huffman coding state
  *  the returned pointer can simply be freed; this does