From 7b83636b6472eb24ca73fd641ca700e82cd2e244 Mon Sep 17 00:00:00 2001 From: libretroadmin Date: Mon, 11 Jul 2022 18:15:08 +0200 Subject: [PATCH] Remove variables that are never used because the return value of the function is already used instead --- libretro-common/net/net_http.c | 7 +++---- libretro-common/string/stdstring.c | 8 ++++---- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/libretro-common/net/net_http.c b/libretro-common/net/net_http.c index bd970024f7..cd305a730e 100644 --- a/libretro-common/net/net_http.c +++ b/libretro-common/net/net_http.c @@ -415,7 +415,6 @@ void net_http_urlencode_full(char *dest, static int net_http_new_socket(struct http_connection_t *conn) { - int ret; struct addrinfo *addr = NULL, *next_addr = NULL; int fd = socket_init( (void**)&addr, conn->port, conn->domain, SOCKET_TYPE_STREAM); @@ -434,8 +433,8 @@ static int net_http_new_socket(struct http_connection_t *conn) #ifdef HAVE_SSL if (conn->sock_state.ssl) { - if ((ret = ssl_socket_connect(conn->sock_state.ssl_ctx, - (void*)next_addr, true, true)) >= 0) + if (ssl_socket_connect(conn->sock_state.ssl_ctx, + (void*)next_addr, true, true) >= 0) break; ssl_socket_close(conn->sock_state.ssl_ctx); @@ -443,7 +442,7 @@ static int net_http_new_socket(struct http_connection_t *conn) else #endif { - if ( (ret = socket_connect(fd, (void*)next_addr, true)) >= 0 + if ( socket_connect(fd, (void*)next_addr, true) >= 0 && socket_nonblock(fd)) break; diff --git a/libretro-common/string/stdstring.c b/libretro-common/string/stdstring.c index be9eff7e66..32b20cc638 100644 --- a/libretro-common/string/stdstring.c +++ b/libretro-common/string/stdstring.c @@ -501,15 +501,15 @@ unsigned string_hex_to_unsigned(const char *str) { const char *hex_str = str; const char *ptr = NULL; - size_t len; if (string_is_empty(str)) return 0; /* Remove leading '0x', if required */ - if ((len = strlen(str)) >= 2) - if ((str[0] == '0') && - ((str[1] == 'x') || (str[1] == 'X'))) + if (strlen(str) >= 2) + if ( (str[0] == '0') && + ((str[1] == 'x') || + (str[1] == 'X'))) hex_str = str + 2; if (string_is_empty(hex_str))