Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
LibretroAdmin committed Jan 20, 2025
1 parent 1ecd83b commit b443d99
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 22 deletions.
14 changes: 7 additions & 7 deletions libretro-common/formats/libchdr/libchdr_chd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1568,14 +1568,14 @@ static chd_error hunk_read_into_cache(chd_file *chd, UINT32 hunknum)
hunk
-------------------------------------------------*/

static UINT8* hunk_read_compressed(chd_file *chd, UINT64 offset, size_t size)
static UINT8* hunk_read_compressed(chd_file *chd, UINT64 offset, size_t len)
{
int64_t bytes;
if (chd->file_cache)
return chd->file_cache + offset;
filestream_seek(chd->file, offset, SEEK_SET);
bytes = filestream_read(chd->file, chd->compressed, size);
if (bytes != (int64_t)size)
bytes = filestream_read(chd->file, chd->compressed, len);
if (bytes != (int64_t)len)
return NULL;
return chd->compressed;
}
Expand All @@ -1585,17 +1585,17 @@ static UINT8* hunk_read_compressed(chd_file *chd, UINT64 offset, size_t size)
hunk
-------------------------------------------------*/

static chd_error hunk_read_uncompressed(chd_file *chd, UINT64 offset, size_t size, UINT8 *dest)
static chd_error hunk_read_uncompressed(chd_file *chd, UINT64 offset, size_t len, UINT8 *dest)
{
int64_t bytes;
if (chd->file_cache)
{
memcpy(dest, chd->file_cache + offset, size);
memcpy(dest, chd->file_cache + offset, len);
return CHDERR_NONE;
}
filestream_seek(chd->file, offset, SEEK_SET);
bytes = filestream_read(chd->file, dest, size);
if (bytes != (int64_t)size)
bytes = filestream_read(chd->file, dest, len);
if (bytes != (int64_t)len)
return CHDERR_READ_ERROR;
return CHDERR_NONE;
}
Expand Down
8 changes: 5 additions & 3 deletions libretro-common/include/formats/image.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ bool image_texture_color_convert(unsigned r_shift,
struct texture_image *out_img);

bool image_texture_load_buffer(struct texture_image *img,
enum image_type_enum type, void *buffer, size_t buffer_len);
enum image_type_enum type, void *s, size_t len);

bool image_texture_load(struct texture_image *img, const char *path);
void image_texture_free(struct texture_image *img);
Expand All @@ -90,8 +90,10 @@ void image_transfer_set_buffer_ptr(
int image_transfer_process(
void *data,
enum image_type_enum type,
uint32_t **buf, size_t size,
unsigned *width, unsigned *height);
uint32_t **buf,
size_t len,
unsigned *width,
unsigned *height);

bool image_transfer_iterate(void *data, enum image_type_enum type);

Expand Down
4 changes: 2 additions & 2 deletions libretro-common/include/formats/rwav.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ typedef struct rwav_iterator rwav_iterator_t;
/**
* Initializes the iterator to fill the out structure with data parsed from buf.
*/
void rwav_init(rwav_iterator_t* iter, rwav_t* out, const void* buf, size_t size);
void rwav_init(rwav_iterator_t *iter, rwav_t *out, const void* buf, size_t len);

/**
* Parses a piece of the data. Continue calling as long as it returns RWAV_ITERATE_MORE.
Expand All @@ -75,7 +75,7 @@ enum rwav_state rwav_iterate(rwav_iterator_t *iter);
/**
* Loads the entire data in one go.
*/
enum rwav_state rwav_load(rwav_t* out, const void* buf, size_t size);
enum rwav_state rwav_load(rwav_t *out, const void *buf, size_t len);

/**
* Frees parsed wave data.
Expand Down
20 changes: 10 additions & 10 deletions libretro-common/include/libretro.h
Original file line number Diff line number Diff line change
Expand Up @@ -5365,14 +5365,14 @@ typedef bool (RETRO_CALLCONV *retro_set_initial_image_t)(unsigned index, const c
* on the host's file system.
*
* @param index The index of the disk image to get the path of.
* @param path A buffer to store the path in.
* @param len The size of \c path, in bytes.
* @param s A buffer to store the path in.
* @param len The size of \c s, in bytes.
* @return \c true if the disk image's location was successfully
* queried and copied into \c path,
* queried and copied into \c s,
* \c false if the index is invalid
* or the core couldn't locate the disk image.
*/
typedef bool (RETRO_CALLCONV *retro_get_image_path_t)(unsigned index, char *path, size_t len);
typedef bool (RETRO_CALLCONV *retro_get_image_path_t)(unsigned index, char *s, size_t len);

/**
* Returns a friendly label for the given disk image.
Expand All @@ -5388,12 +5388,12 @@ typedef bool (RETRO_CALLCONV *retro_get_image_path_t)(unsigned index, char *path
* so that the frontend can provide better guidance to the player.
*
* @param index The index of the disk image to return a label for.
* @param label A buffer to store the resulting label in.
* @param len The length of \c label, in bytes.
* @param s A buffer to store the resulting label in.
* @param len The length of \c s, in bytes.
* @return \c true if the disk image at \c index is valid
* and a label was copied into \c label.
* and a label was copied into \c s.
*/
typedef bool (RETRO_CALLCONV *retro_get_image_label_t)(unsigned index, char *label, size_t len);
typedef bool (RETRO_CALLCONV *retro_get_image_label_t)(unsigned index, char *s, size_t len);

/**
* An interface that the frontend can use to exchange disks
Expand Down Expand Up @@ -7705,7 +7705,7 @@ RETRO_API size_t retro_serialize_size(void);
* @see retro_serialize_size()
* @see retro_unserialize()
*/
RETRO_API bool retro_serialize(void *data, size_t size);
RETRO_API bool retro_serialize(void *data, size_t len);

/**
* Unserialize the given state data, and load it into the internal state.
Expand All @@ -7714,7 +7714,7 @@ RETRO_API bool retro_serialize(void *data, size_t size);
*
* @see retro_serialize()
*/
RETRO_API bool retro_unserialize(const void *data, size_t size);
RETRO_API bool retro_unserialize(const void *data, size_t len);

/**
* Reset all the active cheats to their default disabled state.
Expand Down

0 comments on commit b443d99

Please sign in to comment.