mirror of
https://github.com/libretro/RetroArch
synced 2025-04-09 21:45:45 +00:00
Move retro_le to archive_file_zlib.c
This commit is contained in:
parent
ba71dda1b2
commit
50b07ad8c4
@ -21,11 +21,12 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#include <file/archive_file.h>
|
#include <file/archive_file.h>
|
||||||
#include <streams/file_stream.h>
|
#include <streams/file_stream.h>
|
||||||
#include <streams/trans_stream.h>
|
#include <streams/trans_stream.h>
|
||||||
#include <string.h>
|
#include <retro_inline.h>
|
||||||
#include <retro_miscellaneous.h>
|
#include <retro_miscellaneous.h>
|
||||||
#include <encodings/crc32.h>
|
#include <encodings/crc32.h>
|
||||||
|
|
||||||
@ -40,6 +41,18 @@
|
|||||||
#define END_OF_CENTRAL_DIR_SIGNATURE 0x06054b50
|
#define END_OF_CENTRAL_DIR_SIGNATURE 0x06054b50
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static INLINE uint32_t read_le(const uint8_t *data, unsigned size)
|
||||||
|
{
|
||||||
|
unsigned i;
|
||||||
|
uint32_t val = 0;
|
||||||
|
|
||||||
|
size *= 8;
|
||||||
|
for (i = 0; i < size; i += 8)
|
||||||
|
val |= (uint32_t)*data++ << i;
|
||||||
|
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
|
||||||
static void *zlib_stream_new(void)
|
static void *zlib_stream_new(void)
|
||||||
{
|
{
|
||||||
return zlib_inflate_backend.stream_new();
|
return zlib_inflate_backend.stream_new();
|
||||||
|
@ -169,18 +169,6 @@ static INLINE uint32_t prev_pow2(uint32_t v)
|
|||||||
return v - (v >> 1);
|
return v - (v >> 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static INLINE uint32_t read_le(const uint8_t *data, unsigned size)
|
|
||||||
{
|
|
||||||
unsigned i;
|
|
||||||
uint32_t val = 0;
|
|
||||||
|
|
||||||
size *= 8;
|
|
||||||
for (i = 0; i < size; i += 8)
|
|
||||||
val |= (uint32_t)*data++ << i;
|
|
||||||
|
|
||||||
return val;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Helper macros and struct to keep track of many booleans.
|
/* Helper macros and struct to keep track of many booleans.
|
||||||
* To check for multiple bits, use &&, not &.
|
* To check for multiple bits, use &&, not &.
|
||||||
* For OR, | can be used. */
|
* For OR, | can be used. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user