MCPcopy Create free account
hub / github.com/NetHack/NetHack / get_code

Function get_code

win/share/giftiles.c:401–418  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

399}
400
401static int
402get_code(struct Bitstream *gif, struct DataBlock *block)
403{
404 int code;
405
406 while (gif->num_bits < gif->bit_width) {
407 unsigned char b;
408 if (block->index >= block->size) return EOF;
409 b = block->data[block->index++];
410 gif->bits |= (unsigned long)b << gif->num_bits;
411 gif->num_bits += 8;
412 }
413
414 code = (int) (gif->bits & ((1UL << gif->bit_width) - 1));
415 gif->bits >>= gif->bit_width;
416 gif->num_bits -= gif->bit_width;
417 return code;
418}
419
420static unsigned
421interlace_incr(unsigned y, unsigned height)

Callers 1

decodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected