Variable naming cleanups
This commit is contained in:
parent
807866d799
commit
efc1f7f8e1
|
@ -59,8 +59,7 @@ bool slang_texture_semantic_is_array(enum slang_texture_semantic sem)
|
|||
}
|
||||
|
||||
enum slang_texture_semantic slang_name_to_texture_semantic_array(
|
||||
const char *name, const char **names,
|
||||
unsigned *index)
|
||||
const char *name, const char **names, unsigned *index)
|
||||
{
|
||||
unsigned i = 0;
|
||||
while (*names)
|
||||
|
@ -70,12 +69,12 @@ enum slang_texture_semantic slang_name_to_texture_semantic_array(
|
|||
|
||||
if (slang_texture_semantic_is_array(semantic))
|
||||
{
|
||||
size_t baselen = strlen(n);
|
||||
int cmp = strncmp(n, name, baselen);
|
||||
size_t _len = strlen(n);
|
||||
int cmp = strncmp(n, name, _len);
|
||||
|
||||
if (cmp == 0)
|
||||
{
|
||||
*index = (unsigned)strtoul(name + baselen, NULL, 0);
|
||||
*index = (unsigned)strtoul(name + _len, NULL, 0);
|
||||
return semantic;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -402,25 +402,21 @@ bool rpng_save_image_bgr24(const char *path, const uint8_t *data,
|
|||
uint8_t* rpng_save_image_bgr24_string(const uint8_t *data,
|
||||
unsigned width, unsigned height, signed pitch, uint64_t* bytes)
|
||||
{
|
||||
bool ret = false;
|
||||
uint8_t* buf = NULL;
|
||||
uint8_t* output = NULL;
|
||||
int buf_length = 0;
|
||||
intfstream_t* intf_s = NULL;
|
||||
|
||||
buf_length = (int)(width*height*3*DEFLATE_PADDING)+PNG_ROUGH_HEADER;
|
||||
buf = (uint8_t*)malloc(buf_length*sizeof(uint8_t));
|
||||
bool ret = false;
|
||||
uint8_t *output = NULL;
|
||||
intfstream_t *intf_s = NULL;
|
||||
size_t _len = (width * height * 3 * DEFLATE_PADDING) + PNG_ROUGH_HEADER;
|
||||
uint8_t *buf = (uint8_t*)malloc(_len * sizeof(uint8_t));
|
||||
if (!buf)
|
||||
GOTO_END_ERROR();
|
||||
|
||||
intf_s = intfstream_open_writable_memory(buf,
|
||||
RETRO_VFS_FILE_ACCESS_WRITE,
|
||||
RETRO_VFS_FILE_ACCESS_HINT_NONE,
|
||||
buf_length);
|
||||
_len);
|
||||
|
||||
ret = rpng_save_image_stream((const uint8_t*)data,
|
||||
ret = rpng_save_image_stream((const uint8_t*)data,
|
||||
intf_s, width, height, pitch, 3);
|
||||
|
||||
*bytes = intfstream_get_ptr(intf_s);
|
||||
intfstream_rewind(intf_s);
|
||||
output = (uint8_t*)malloc((size_t)((*bytes)*sizeof(uint8_t)));
|
||||
|
|
|
@ -544,7 +544,7 @@ void net_http_connection_set_content(
|
|||
if (conn->postdata)
|
||||
free(conn->postdata);
|
||||
|
||||
conn->contenttype = content_type ? strdup(content_type) : NULL;
|
||||
conn->contenttype = content_type ? strdup(content_type) : NULL;
|
||||
conn->contentlength = content_length;
|
||||
if (content_length)
|
||||
{
|
||||
|
@ -1078,8 +1078,8 @@ static bool net_http_send_request(struct http_t *state)
|
|||
|
||||
if (request->method && (string_is_equal(request->method, "POST") || string_is_equal(request->method, "PUT")))
|
||||
{
|
||||
size_t post_len, len;
|
||||
char *len_str = NULL;
|
||||
size_t _len, len;
|
||||
char *len_str = NULL;
|
||||
|
||||
if (!request->postdata && !string_is_equal(request->method, "PUT"))
|
||||
{
|
||||
|
@ -1094,15 +1094,15 @@ static bool net_http_send_request(struct http_t *state)
|
|||
|
||||
net_http_send_str(state, "Content-Length: ", STRLEN_CONST("Content-Length: "));
|
||||
|
||||
post_len = request->contentlength;
|
||||
_len = request->contentlength;
|
||||
#ifdef _WIN32
|
||||
len = snprintf(NULL, 0, "%" PRIuPTR, post_len);
|
||||
len = snprintf(NULL, 0, "%" PRIuPTR, _len);
|
||||
len_str = (char*)malloc(len + 1);
|
||||
snprintf(len_str, len + 1, "%" PRIuPTR, post_len);
|
||||
snprintf(len_str, len + 1, "%" PRIuPTR, _len);
|
||||
#else
|
||||
len = snprintf(NULL, 0, "%llu", (long long unsigned)post_len);
|
||||
len = snprintf(NULL, 0, "%llu", (long long unsigned)_len);
|
||||
len_str = (char*)malloc(len + 1);
|
||||
snprintf(len_str, len + 1, "%llu", (long long unsigned)post_len);
|
||||
snprintf(len_str, len + 1, "%llu", (long long unsigned)_len);
|
||||
#endif
|
||||
|
||||
len_str[len] = '\0';
|
||||
|
|
|
@ -281,13 +281,9 @@ generic_queue_iterator_t *generic_queue_iterator_remove(generic_queue_iterator_t
|
|||
iterator->item = iterator->forward ? item->next : item->previous;
|
||||
free(item);
|
||||
if (iterator->item)
|
||||
{
|
||||
return iterator;
|
||||
} else
|
||||
{
|
||||
free(iterator);
|
||||
return NULL;
|
||||
}
|
||||
free(iterator);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item = iterator->forward ? item->next : item->previous;
|
||||
|
|
|
@ -327,12 +327,12 @@ runtime_log_t *runtime_log_init(
|
|||
char *last_slash = find_last_slash(content_path);
|
||||
if (last_slash)
|
||||
{
|
||||
size_t path_length = last_slash + 1 - content_path;
|
||||
if (path_length < PATH_MAX_LENGTH)
|
||||
size_t _len = last_slash + 1 - content_path;
|
||||
if (_len < PATH_MAX_LENGTH)
|
||||
{
|
||||
memset(tmp_buf, 0, sizeof(tmp_buf));
|
||||
strlcpy(tmp_buf,
|
||||
content_path, path_length * sizeof(char));
|
||||
content_path, _len * sizeof(char));
|
||||
fill_pathname(content_name,
|
||||
path_basename(tmp_buf), ".lrtl", sizeof(content_name));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue