X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=deps%2Flibchdr%2Fbitstream.c;h=3f61c938c347c81d68bd3d6c058e773666cd3e1e;hb=e3e1b865f7c06f57918b97f7293b5b2959fb7b7d;hp=735b97f4b1ae0e700870c03a3fa97bcce541bac9;hpb=80209d1715398a16b6ace1c2e4cd0aab5c00248d;p=pcsx_rearmed.git diff --git a/deps/libchdr/bitstream.c b/deps/libchdr/bitstream.c index 735b97f4..3f61c938 100644 --- a/deps/libchdr/bitstream.c +++ b/deps/libchdr/bitstream.c @@ -1,6 +1,6 @@ -// license:BSD-3-Clause -// copyright-holders:Aaron Giles -/*************************************************************************** +/* license:BSD-3-Clause + * copyright-holders:Aaron Giles +*************************************************************************** bitstream.c @@ -11,15 +11,17 @@ #include "bitstream.h" #include -//************************************************************************** -// INLINE FUNCTIONS -//************************************************************************** +/*************************************************************************** + * INLINE FUNCTIONS + *************************************************************************** + */ int bitstream_overflow(struct bitstream* bitstream) { return ((bitstream->doffset - bitstream->bits / 8) > bitstream->dlength); } -//------------------------------------------------- -// create_bitstream - constructor -//------------------------------------------------- +/*------------------------------------------------- + * create_bitstream - constructor + *------------------------------------------------- + */ struct bitstream* create_bitstream(const void *src, uint32_t srclength) { @@ -33,17 +35,18 @@ struct bitstream* create_bitstream(const void *src, uint32_t srclength) } -//----------------------------------------------------- -// bitstream_peek - fetch the requested number of bits -// but don't advance the input pointer -//----------------------------------------------------- +/*----------------------------------------------------- + * bitstream_peek - fetch the requested number of bits + * but don't advance the input pointer + *----------------------------------------------------- + */ uint32_t bitstream_peek(struct bitstream* bitstream, int numbits) { if (numbits == 0) return 0; - // fetch data if we need more + /* fetch data if we need more */ if (numbits > bitstream->bits) { while (bitstream->bits <= 24) @@ -55,15 +58,16 @@ uint32_t bitstream_peek(struct bitstream* bitstream, int numbits) } } - // return the data + /* return the data */ return bitstream->buffer >> (32 - numbits); } -//----------------------------------------------------- -// bitstream_remove - advance the input pointer by the -// specified number of bits -//----------------------------------------------------- +/*----------------------------------------------------- + * bitstream_remove - advance the input pointer by the + * specified number of bits + *----------------------------------------------------- + */ void bitstream_remove(struct bitstream* bitstream, int numbits) { @@ -72,9 +76,10 @@ void bitstream_remove(struct bitstream* bitstream, int numbits) } -//----------------------------------------------------- -// bitstream_read - fetch the requested number of bits -//----------------------------------------------------- +/*----------------------------------------------------- + * bitstream_read - fetch the requested number of bits + *----------------------------------------------------- + */ uint32_t bitstream_read(struct bitstream* bitstream, int numbits) { @@ -84,9 +89,10 @@ uint32_t bitstream_read(struct bitstream* bitstream, int numbits) } -//------------------------------------------------- -// read_offset - return the current read offset -//------------------------------------------------- +/*------------------------------------------------- + * read_offset - return the current read offset + *------------------------------------------------- + */ uint32_t bitstream_read_offset(struct bitstream* bitstream) { @@ -101,9 +107,10 @@ uint32_t bitstream_read_offset(struct bitstream* bitstream) } -//------------------------------------------------- -// flush - flush to the nearest byte -//------------------------------------------------- +/*------------------------------------------------- + * flush - flush to the nearest byte + *------------------------------------------------- + */ uint32_t bitstream_flush(struct bitstream* bitstream) {