(General) Cleanups pt. 2

This commit is contained in:
twinaphex 2015-06-12 17:04:25 +02:00
parent c36e21ed13
commit 29c82f9360
3 changed files with 22 additions and 22 deletions

View File

@ -56,9 +56,10 @@ struct rarch_cmd
#if defined(HAVE_NETWORK_CMD) && defined(HAVE_NETPLAY)
static bool cmd_init_network(rarch_cmd_t *handle, uint16_t port)
{
char port_buf[16];
struct addrinfo hints, *res = NULL;
int yes = 1;
struct addrinfo hints = {0};
char port_buf[16] = {0};
struct addrinfo *res = NULL;
int yes = 1;
if (!network_init())
return false;
@ -66,7 +67,6 @@ static bool cmd_init_network(rarch_cmd_t *handle, uint16_t port)
RARCH_LOG("Bringing up command interface on port %hu.\n",
(unsigned short)port);
memset(&hints, 0, sizeof(hints));
#if defined(_WIN32) || defined(HAVE_SOCKET_LEGACY)
hints.ai_family = AF_INET;
#else
@ -217,9 +217,9 @@ static const struct cmd_map map[] = {
static bool cmd_set_shader(const char *arg)
{
char msg[PATH_MAX_LENGTH];
char msg[PATH_MAX_LENGTH] = {0};
enum rarch_shader_type type = RARCH_SHADER_NONE;
const char *ext = path_get_extension(arg);
const char *ext = path_get_extension(arg);
if (strcmp(ext, "glsl") == 0 || strcmp(ext, "glslp") == 0)
type = RARCH_SHADER_GLSL;
@ -522,13 +522,13 @@ void rarch_cmd_poll(rarch_cmd_t *handle)
static bool send_udp_packet(const char *host,
uint16_t port, const char *msg)
{
char port_buf[16];
struct addrinfo hints, *res = NULL;
char port_buf[16] = {0};
struct addrinfo hints = {0};
struct addrinfo *res = NULL;
const struct addrinfo *tmp = NULL;
int fd = -1;
bool ret = true;
int fd = -1;
bool ret = true;
memset(&hints, 0, sizeof(hints));
#if defined(_WIN32) || defined(HAVE_SOCKET_LEGACY)
hints.ai_family = AF_INET;
#else
@ -603,7 +603,7 @@ bool network_cmd_send(const char *cmd_)
const char *port_ = NULL;
global_t *global = global_get_ptr();
bool old_verbose = global->verbosity;
uint16_t port = DEFAULT_NETWORK_CMD_PORT;
uint16_t port = DEFAULT_NETWORK_CMD_PORT;
if (!network_init())
return false;

View File

@ -182,7 +182,7 @@ static int database_cursor_iterate(libretrodb_cursor_t *cur,
{
unsigned i;
struct rmsgpack_dom_value item;
const char* str;
const char* str = NULL;
if (libretrodb_cursor_read_item(cur, &item) != 0)
return -1;

View File

@ -887,10 +887,10 @@ static bool get_nickname(netplay_t *netplay, int fd)
static bool send_info(netplay_t *netplay)
{
unsigned sram_size;
char msg[512];
void *sram = NULL;
uint32_t header[3];
global_t *global = global_get_ptr();
char msg[512] = {0};
void *sram = NULL;
uint32_t header[3] = {0};
global_t *global = global_get_ptr();
header[0] = htonl(global->content_crc);
header[1] = htonl(implementation_magic_value());
@ -1057,11 +1057,11 @@ static bool bsv_parse_header(const uint32_t *header, uint32_t magic)
static bool get_info_spectate(netplay_t *netplay)
{
void *buf;
size_t save_state_size, size;
uint32_t header[4];
char msg[512];
bool ret = true;
void *buf = NULL;
uint32_t header[4] = {0};
char msg[512] = {0};
bool ret = true;
if (!send_nickname(netplay, netplay->fd))
{
@ -1587,7 +1587,7 @@ static void netplay_post_frame_spectate(netplay_t *netplay)
for (i = 0; i < MAX_SPECTATORS; i++)
{
char msg[PATH_MAX_LENGTH];
char msg[PATH_MAX_LENGTH] = {0};
if (netplay->spectate_fds[i] == -1)
continue;