Skip to content

Commit

Permalink
Function argument name standardization
Browse files Browse the repository at this point in the history
  • Loading branch information
LibretroAdmin committed Jan 17, 2025
1 parent ec54cdf commit b211ada
Show file tree
Hide file tree
Showing 47 changed files with 593 additions and 646 deletions.
2 changes: 1 addition & 1 deletion audio/audio_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ typedef struct audio_driver
* Unless said otherwise with set_nonblock_state(), all writes
* are blocking, and it should block till it has written all frames.
*/
ssize_t (*write)(void *data, const void *buf, size_t size);
ssize_t (*write)(void *data, const void *buf, size_t len);

/**
* Temporarily pauses the audio driver.
Expand Down
84 changes: 15 additions & 69 deletions cores/dynamic_dummy.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ void retro_unload_game(void) { libretro_dummy_retro_unload_game(); }
unsigned retro_get_region(void) { return libretro_dummy_retro_get_region(); }
bool retro_load_game_special(unsigned type, const struct retro_game_info *info, size_t num) { return libretro_dummy_retro_load_game_special(type, info, num); }
size_t retro_serialize_size(void) { return libretro_dummy_retro_serialize_size(); }
bool retro_serialize(void *data, size_t size) { return libretro_dummy_retro_serialize(data, size); }
bool retro_unserialize(const void *data, size_t size) { return libretro_dummy_retro_unserialize(data, size); }
bool retro_serialize(void *data, size_t len) { return libretro_dummy_retro_serialize(data, len); }
bool retro_unserialize(const void *data, size_t len) { return libretro_dummy_retro_unserialize(data, len); }
void *retro_get_memory_data(unsigned id) { return libretro_dummy_retro_get_memory_data(id); }
size_t retro_get_memory_size(unsigned id) { return libretro_dummy_retro_get_memory_size(id); }
void retro_cheat_reset(void) { libretro_dummy_retro_cheat_reset(); }
Expand Down Expand Up @@ -119,13 +119,6 @@ unsigned libretro_dummy_retro_api_version(void)
return RETRO_API_VERSION;
}

void libretro_dummy_retro_set_controller_port_device(
unsigned port, unsigned device)
{
(void)port;
(void)device;
}

void libretro_dummy_retro_get_system_info(
struct retro_system_info *info)
{
Expand Down Expand Up @@ -197,9 +190,6 @@ void libretro_dummy_retro_set_video_refresh(retro_video_refresh_t cb)
dummy_video_cb = cb;
}

void libretro_dummy_retro_reset(void)
{}

void libretro_dummy_retro_run(void)
{
dummy_input_poll_cb();
Expand All @@ -209,66 +199,22 @@ void libretro_dummy_retro_run(void)
/* This should never be called, it's only used as a placeholder. */
bool libretro_dummy_retro_load_game(const struct retro_game_info *info)
{
(void)info;
return false;
}

void libretro_dummy_retro_unload_game(void)
{}

unsigned libretro_dummy_retro_get_region(void)
{
return RETRO_REGION_NTSC;
}

void libretro_dummy_retro_set_controller_port_device(
unsigned port, unsigned device) { }
void libretro_dummy_retro_reset(void) { }
unsigned libretro_dummy_retro_get_region(void) { return RETRO_REGION_NTSC; }
void libretro_dummy_retro_unload_game(void) { }
bool libretro_dummy_retro_load_game_special(unsigned type,
const struct retro_game_info *info, size_t num)
{
(void)type;
(void)info;
(void)num;
return false;
}

size_t libretro_dummy_retro_serialize_size(void)
{
return 0;
}

bool libretro_dummy_retro_serialize(void *data, size_t size)
{
(void)data;
(void)size;
return false;
}

const struct retro_game_info *info, size_t num) { return false; }
size_t libretro_dummy_retro_serialize_size(void) { return 0; }
bool libretro_dummy_retro_serialize(void *data, size_t len) { return false; }
bool libretro_dummy_retro_unserialize(const void *data,
size_t size)
{
(void)data;
(void)size;
return false;
}

void *libretro_dummy_retro_get_memory_data(unsigned id)
{
(void)id;
return NULL;
}

size_t libretro_dummy_retro_get_memory_size(unsigned id)
{
(void)id;
return 0;
}

void libretro_dummy_retro_cheat_reset(void)
{}

size_t len) { return false; }
void *libretro_dummy_retro_get_memory_data(unsigned id) { return NULL; }
size_t libretro_dummy_retro_get_memory_size(unsigned id) { return 0; }
void libretro_dummy_retro_cheat_reset(void) { }
void libretro_dummy_retro_cheat_set(unsigned idx,
bool enabled, const char *code)
{
(void)idx;
(void)enabled;
(void)code;
}
bool enabled, const char *code) { }
24 changes: 12 additions & 12 deletions cores/internal_cores.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ void libretro_dummy_retro_run(void);

size_t libretro_dummy_retro_serialize_size(void);

bool libretro_dummy_retro_serialize(void *data, size_t size);
bool libretro_dummy_retro_serialize(void *data, size_t len);

bool libretro_dummy_retro_unserialize(const void *data, size_t size);
bool libretro_dummy_retro_unserialize(const void *data, size_t len);

void libretro_dummy_retro_cheat_reset(void);

Expand Down Expand Up @@ -113,9 +113,9 @@ void libretro_ffmpeg_retro_run(void);

size_t libretro_ffmpeg_retro_serialize_size(void);

bool libretro_ffmpeg_retro_serialize(void *data, size_t size);
bool libretro_ffmpeg_retro_serialize(void *data, size_t len);

bool libretro_ffmpeg_retro_unserialize(const void *data, size_t size);
bool libretro_ffmpeg_retro_unserialize(const void *data, size_t len);

void libretro_ffmpeg_retro_cheat_reset(void);

Expand Down Expand Up @@ -169,9 +169,9 @@ void libretro_mpv_retro_run(void);

size_t libretro_mpv_retro_serialize_size(void);

bool libretro_mpv_retro_serialize(void *data, size_t size);
bool libretro_mpv_retro_serialize(void *data, size_t len);

bool libretro_mpv_retro_unserialize(const void *data, size_t size);
bool libretro_mpv_retro_unserialize(const void *data, size_t len);

void libretro_mpv_retro_cheat_reset(void);

Expand Down Expand Up @@ -225,9 +225,9 @@ void libretro_imageviewer_retro_run(void);

size_t libretro_imageviewer_retro_serialize_size(void);

bool libretro_imageviewer_retro_serialize(void *data, size_t size);
bool libretro_imageviewer_retro_serialize(void *data, size_t len);

bool libretro_imageviewer_retro_unserialize(const void *data, size_t size);
bool libretro_imageviewer_retro_unserialize(const void *data, size_t len);

void libretro_imageviewer_retro_cheat_reset(void);

Expand Down Expand Up @@ -281,9 +281,9 @@ void libretro_netretropad_retro_run(void);

size_t libretro_netretropad_retro_serialize_size(void);

bool libretro_netretropad_retro_serialize(void *data, size_t size);
bool libretro_netretropad_retro_serialize(void *data, size_t len);

bool libretro_netretropad_retro_unserialize(const void *data, size_t size);
bool libretro_netretropad_retro_unserialize(const void *data, size_t len);

void libretro_netretropad_retro_cheat_reset(void);

Expand Down Expand Up @@ -337,9 +337,9 @@ void libretro_videoprocessor_retro_run(void);

size_t libretro_videoprocessor_retro_serialize_size(void);

bool libretro_videoprocessor_retro_serialize(void *data, size_t size);
bool libretro_videoprocessor_retro_serialize(void *data, size_t len);

bool libretro_videoprocessor_retro_unserialize(const void *data, size_t size);
bool libretro_videoprocessor_retro_unserialize(const void *data, size_t len);

void libretro_videoprocessor_retro_cheat_reset(void);

Expand Down
49 changes: 10 additions & 39 deletions cores/libretro-ffmpeg/ffmpeg_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,14 +222,14 @@ static void ass_msg_cb(int level, const char *fmt, va_list args, void *data)
}
#endif

static void append_attachment(const uint8_t *data, size_t size)
static void append_attachment(const uint8_t *data, size_t len)
{
attachments = (struct attachment*)av_realloc(
attachments, (attachments_size + 1) * sizeof(*attachments));

attachments[attachments_size].data = (uint8_t*)av_malloc(size);
attachments[attachments_size].size = size;
memcpy(attachments[attachments_size].data, data, size);
attachments[attachments_size].data = (uint8_t*)av_malloc(len);
attachments[attachments_size].size = len;
memcpy(attachments[attachments_size].data, data, len);

attachments_size++;
}
Expand Down Expand Up @@ -2278,41 +2278,12 @@ size_t CORE_PREFIX(retro_serialize_size)(void)
return 0;
}

bool CORE_PREFIX(retro_serialize)(void *data, size_t size)
{
(void)data;
(void)size;
return false;
}

bool CORE_PREFIX(retro_unserialize)(const void *data, size_t size)
{
(void)data;
(void)size;
return false;
}

void *CORE_PREFIX(retro_get_memory_data)(unsigned id)
{
(void)id;
return NULL;
}

size_t CORE_PREFIX(retro_get_memory_size)(unsigned id)
{
(void)id;
return 0;
}

void CORE_PREFIX(retro_cheat_reset)(void)
{}

void CORE_PREFIX(retro_cheat_set)(unsigned index, bool enabled, const char *code)
{
(void)index;
(void)enabled;
(void)code;
}
bool CORE_PREFIX(retro_serialize)(void *data, size_t len) { return false; }
bool CORE_PREFIX(retro_unserialize)(const void *data, size_t len) { return false; }
void *CORE_PREFIX(retro_get_memory_data)(unsigned id) { return NULL; }
size_t CORE_PREFIX(retro_get_memory_size)(unsigned id) { return 0; }
void CORE_PREFIX(retro_cheat_reset)(void) { }
void CORE_PREFIX(retro_cheat_set)(unsigned a, bool b, const char *c) { }

#if defined(LIBRETRO_SWITCH)

Expand Down
Loading

0 comments on commit b211ada

Please sign in to comment.