Minor code cleanups based on static code analysis

This commit is contained in:
twinaphex 2015-09-28 22:07:40 +02:00
parent 94c3546e71
commit 790bb0d0d6
3 changed files with 8 additions and 6 deletions

View File

@ -67,8 +67,7 @@ int32_t pad_connection_pad_init(joypad_connection_t *joyconn,
if (pad != -1) if (pad != -1)
{ {
unsigned i; joypad_connection_t *s = (joypad_connection_t*)&joyconn[pad];
joypad_connection_t* s = (joypad_connection_t*)&joyconn[pad];
static const struct static const struct
{ {
@ -89,6 +88,8 @@ int32_t pad_connection_pad_init(joypad_connection_t *joyconn,
if (s) if (s)
{ {
unsigned i;
for (i = 0; name && pad_map[i].name; i++) for (i = 0; name && pad_map[i].name; i++)
{ {
const char *name_match = strstr(name, pad_map[i].name); const char *name_match = strstr(name, pad_map[i].name);

View File

@ -9,7 +9,7 @@
int main(void) int main(void)
{ {
char *data; char *data;
http_t *http1, *http2, *http3; http_t *http1, *http3;
size_t len, pos = 0, tot = 0; size_t len, pos = 0, tot = 0;
if (!network_init()) if (!network_init())

View File

@ -66,9 +66,6 @@ static void parse_map( pr_state_t* parser, int skip, int isrom )
{ {
pr_node_t dummy; pr_node_t dummy;
pr_node_t* node; pr_node_t* node;
unsigned hash;
const char* key;
unsigned keylen;
if ( skip ) if ( skip )
{ {
@ -82,6 +79,10 @@ static void parse_map( pr_state_t* parser, int skip, int isrom )
while ( parser->lexer.token != LX_RPAREN ) while ( parser->lexer.token != LX_RPAREN )
{ {
unsigned hash;
const char* key;
unsigned keylen;
if ( parser->lexer.token != LX_TAG ) if ( parser->lexer.token != LX_TAG )
longjmp( parser->env, PR_UNEXPECTED_TOKEN ); longjmp( parser->env, PR_UNEXPECTED_TOKEN );