mirror of
https://github.com/libretro/RetroArch
synced 2025-04-17 02:43:03 +00:00
Standardize naming of local len variables
This commit is contained in:
parent
1e656261b0
commit
6be18bfee9
@ -231,7 +231,7 @@ static bool caca_frame(void *data, const void *frame,
|
||||
unsigned frame_width, unsigned frame_height, uint64_t frame_count,
|
||||
unsigned pitch, const char *msg, video_frame_info_t *video_info)
|
||||
{
|
||||
size_t len = 0;
|
||||
size_t _len = 0;
|
||||
void *buffer = NULL;
|
||||
const void *frame_to_copy = frame;
|
||||
unsigned width = 0;
|
||||
@ -297,11 +297,11 @@ static bool caca_frame(void *data, const void *frame,
|
||||
height,
|
||||
caca->dither, frame_to_copy);
|
||||
|
||||
buffer = caca_export_canvas_to_memory(caca->cv, "caca", &len);
|
||||
buffer = caca_export_canvas_to_memory(caca->cv, "caca", &_len);
|
||||
|
||||
if (buffer)
|
||||
{
|
||||
if (len)
|
||||
if (_len > 0)
|
||||
caca_refresh_display(caca->display);
|
||||
|
||||
free(buffer);
|
||||
|
@ -617,8 +617,8 @@ bool gfx_thumbnail_update_path(
|
||||
if ( string_is_equal(path_data->system, "history")
|
||||
|| string_is_equal(path_data->system, "favorites"))
|
||||
{
|
||||
if (!gfx_thumbnail_get_content_dir(
|
||||
path_data, content_dir, sizeof(content_dir)))
|
||||
if (gfx_thumbnail_get_content_dir(
|
||||
path_data, content_dir, sizeof(content_dir)) == 0)
|
||||
return false;
|
||||
|
||||
system_name = content_dir;
|
||||
@ -720,26 +720,19 @@ bool gfx_thumbnail_update_path(
|
||||
|
||||
/* Fetches current content directory.
|
||||
* Returns true if content directory is valid. */
|
||||
bool gfx_thumbnail_get_content_dir(
|
||||
gfx_thumbnail_path_data_t *path_data, char *content_dir, size_t len)
|
||||
size_t gfx_thumbnail_get_content_dir(
|
||||
gfx_thumbnail_path_data_t *path_data, char *s, size_t len)
|
||||
{
|
||||
char *last_slash;
|
||||
size_t path_length;
|
||||
size_t _len;
|
||||
char tmp_buf[NAME_MAX_LENGTH];
|
||||
|
||||
if (!path_data || string_is_empty(path_data->content_path))
|
||||
return false;
|
||||
|
||||
return 0;
|
||||
if (!(last_slash = find_last_slash(path_data->content_path)))
|
||||
return false;
|
||||
|
||||
path_length = last_slash + 1 - path_data->content_path;
|
||||
|
||||
if (!((path_length > 1) && (path_length < PATH_MAX_LENGTH)))
|
||||
return false;
|
||||
|
||||
strlcpy(tmp_buf, path_data->content_path, path_length * sizeof(char));
|
||||
strlcpy(content_dir, path_basename_nocompression(tmp_buf), len);
|
||||
|
||||
return !string_is_empty(content_dir);
|
||||
return 0;
|
||||
_len = last_slash + 1 - path_data->content_path;
|
||||
if (!((_len > 1) && (_len < PATH_MAX_LENGTH)))
|
||||
return 0;
|
||||
strlcpy(tmp_buf, path_data->content_path, _len * sizeof(char));
|
||||
return strlcpy(s, path_basename_nocompression(tmp_buf), len);
|
||||
}
|
||||
|
@ -141,7 +141,7 @@ bool gfx_thumbnail_update_path(gfx_thumbnail_path_data_t *path_data, enum gfx_th
|
||||
|
||||
/* Fetches current content directory.
|
||||
* Returns true if content directory is valid. */
|
||||
bool gfx_thumbnail_get_content_dir(gfx_thumbnail_path_data_t *path_data, char *content_dir, size_t len);
|
||||
size_t gfx_thumbnail_get_content_dir(gfx_thumbnail_path_data_t *path_data, char *s, size_t len);
|
||||
|
||||
RETRO_END_DECLS
|
||||
|
||||
|
@ -193,15 +193,15 @@ static enum patch_error bps_apply_patch(
|
||||
|
||||
while (bps.modify_offset < bps.modify_length - 12)
|
||||
{
|
||||
size_t length = bps_decode(&bps);
|
||||
unsigned mode = length & 3;
|
||||
size_t _len = bps_decode(&bps);
|
||||
unsigned mode = _len & 3;
|
||||
|
||||
length = (length >> 2) + 1;
|
||||
_len = (_len >> 2) + 1;
|
||||
|
||||
switch (mode)
|
||||
{
|
||||
case SOURCE_READ:
|
||||
while (length--)
|
||||
while (_len--)
|
||||
{
|
||||
uint8_t data = bps.source_data[bps.output_offset];
|
||||
bps.target_data[bps.output_offset++] = data;
|
||||
@ -210,7 +210,7 @@ static enum patch_error bps_apply_patch(
|
||||
break;
|
||||
|
||||
case TARGET_READ:
|
||||
while (length--)
|
||||
while (_len--)
|
||||
{
|
||||
uint8_t data = bps_read(&bps);
|
||||
bps.target_data[bps.output_offset++] = data;
|
||||
@ -232,7 +232,7 @@ static enum patch_error bps_apply_patch(
|
||||
if (mode == SOURCE_COPY)
|
||||
{
|
||||
bps.source_offset += offset;
|
||||
while (length--)
|
||||
while (_len--)
|
||||
{
|
||||
uint8_t data = bps.source_data[bps.source_offset++];
|
||||
bps.target_data[bps.output_offset++] = data;
|
||||
@ -242,7 +242,7 @@ static enum patch_error bps_apply_patch(
|
||||
else
|
||||
{
|
||||
bps.target_offset += offset;
|
||||
while (length--)
|
||||
while (_len--)
|
||||
{
|
||||
uint8_t data = bps.target_data[bps.target_offset++];
|
||||
bps.target_data[bps.output_offset++] = data;
|
||||
|
@ -218,8 +218,8 @@ static bool task_pl_thumbnail_get_thumbnail_paths(
|
||||
if ( string_is_equal(system, "history")
|
||||
|| string_is_equal(system, "favorites"))
|
||||
{
|
||||
if (!gfx_thumbnail_get_content_dir(
|
||||
pl_thumb->thumbnail_path_data, content_dir, sizeof(content_dir)))
|
||||
if (gfx_thumbnail_get_content_dir(
|
||||
pl_thumb->thumbnail_path_data, content_dir, sizeof(content_dir)) == 0)
|
||||
return false;
|
||||
|
||||
system_name = content_dir;
|
||||
|
Loading…
x
Reference in New Issue
Block a user