From 9c659ffe685d5615b15c31cd86814e597cff7488 Mon Sep 17 00:00:00 2001 From: negativeExponent Date: Fri, 5 Jun 2020 19:56:44 +0800 Subject: libchdr: Update to latest upstream Update libchdr based from latest upstream sources. Fixes some issues as noted. - Latest upstream commit: https://github.com/rtissera/libchdr/tree/6117d59d00ef8620de4cff4d6ecae46368cae881 - Fix https://github.com/libretro/pcsx_rearmed/issues/301 - Specific commit that fixes above problem: https://github.com/rtissera/libchdr/commit/e1acac6d83b36531e543e39a9e1a363e681083e6 --- deps/libchdr/bitstream.h | 85 ++++++++++++++++++++++++------------------------ 1 file changed, 43 insertions(+), 42 deletions(-) (limited to 'deps/libchdr/bitstream.h') diff --git a/deps/libchdr/bitstream.h b/deps/libchdr/bitstream.h index 9250d33..d376373 100644 --- a/deps/libchdr/bitstream.h +++ b/deps/libchdr/bitstream.h @@ -1,42 +1,43 @@ -// license:BSD-3-Clause -// copyright-holders:Aaron Giles -/*************************************************************************** - - bitstream.h - - Helper classes for reading/writing at the bit level. - -***************************************************************************/ - -#pragma once - -#ifndef __BITSTREAM_H__ -#define __BITSTREAM_H__ - -#include - -//************************************************************************** -// TYPE DEFINITIONS -//************************************************************************** - -// helper class for reading from a bit buffer -struct bitstream -{ - uint32_t buffer; // current bit accumulator - int bits; // number of bits in the accumulator - const uint8_t * read; // read pointer - uint32_t doffset; // byte offset within the data - uint32_t dlength; // length of the data -}; - -struct bitstream* create_bitstream(const void *src, uint32_t srclength); -int bitstream_overflow(struct bitstream* bitstream); -uint32_t bitstream_read_offset(struct bitstream* bitstream); - -uint32_t bitstream_read(struct bitstream* bitstream, int numbits); -uint32_t bitstream_peek(struct bitstream* bitstream, int numbits); -void bitstream_remove(struct bitstream* bitstream, int numbits); -uint32_t bitstream_flush(struct bitstream* bitstream); - - -#endif +/* license:BSD-3-Clause + * copyright-holders:Aaron Giles +*************************************************************************** + + bitstream.h + + Helper classes for reading/writing at the bit level. + +***************************************************************************/ + +#pragma once + +#ifndef __BITSTREAM_H__ +#define __BITSTREAM_H__ + +#include + +/*************************************************************************** + * TYPE DEFINITIONS + *************************************************************************** + */ + +/* helper class for reading from a bit buffer */ +struct bitstream +{ + uint32_t buffer; /* current bit accumulator */ + int bits; /* number of bits in the accumulator */ + const uint8_t * read; /* read pointer */ + uint32_t doffset; /* byte offset within the data */ + uint32_t dlength; /* length of the data */ +}; + +struct bitstream* create_bitstream(const void *src, uint32_t srclength); +int bitstream_overflow(struct bitstream* bitstream); +uint32_t bitstream_read_offset(struct bitstream* bitstream); + +uint32_t bitstream_read(struct bitstream* bitstream, int numbits); +uint32_t bitstream_peek(struct bitstream* bitstream, int numbits); +void bitstream_remove(struct bitstream* bitstream, int numbits); +uint32_t bitstream_flush(struct bitstream* bitstream); + + +#endif -- cgit v1.2.3