Remove unreachable code to make -Wunreachable-code on clang useful.

This commit is contained in:
Alex Young
2014-02-24 11:23:09 +00:00
parent 50ec8fb7cc
commit 374b4c616e
5 changed files with 13 additions and 12 deletions

View File

@@ -126,7 +126,9 @@ void write_not_zeroes(struct client* client, uint64_t from, uint64_t len)
debug("(run adjusted to %d)", run);
}
if (0) /* useful but expensive */
/*
// Useful but expensive
if (0)
{
uint64_t i;
fprintf(stderr, "full map resolution=%d: ", map->resolution);
@@ -139,6 +141,7 @@ void write_not_zeroes(struct client* client, uint64_t from, uint64_t len)
}
fprintf(stderr, "\n");
}
*/
#define DO_READ(dst, len) ERROR_IF_NEGATIVE( \
readloop( \

View File

@@ -220,7 +220,6 @@ void read_serve_param( int c, char **ip_addr, char **ip_port, char **file, char
case 'h':
fprintf(stdout, "%s\n", serve_help_text );
exit( 0 );
break;
case 'l':
*ip_addr = optarg;
break;
@@ -263,7 +262,6 @@ void read_listen_param( int c,
case 'h':
fprintf(stdout, "%s\n", listen_help_text );
exit(0);
break;
case 'l':
*ip_addr = optarg;
break;
@@ -297,7 +295,6 @@ void read_readwrite_param( int c, char **ip_addr, char **ip_port, char **bind_ad
case 'h':
fprintf(stdout, "%s\n", err_text );
exit( 0 );
break;
case 'l':
*ip_addr = optarg;
break;
@@ -331,7 +328,6 @@ void read_sock_param( int c, char **sock, char *help_text )
case 'h':
fprintf( stdout, "%s\n", help_text );
exit( 0 );
break;
case 's':
*sock = optarg;
break;
@@ -362,7 +358,6 @@ void read_mirror_speed_param(
case 'h':
fprintf( stdout, "%s\n", mirror_speed_help_text );
exit( 0 );
break;
case 's':
*sock = optarg;
break;
@@ -394,7 +389,6 @@ void read_mirror_param(
case 'h':
fprintf( stdout, "%s\n", mirror_help_text );
exit( 0 );
break;
case 's':
*sock = optarg;
break;
@@ -428,7 +422,6 @@ void read_break_param( int c, char **sock )
case 'h':
fprintf( stdout, "%s\n", break_help_text );
exit( 0 );
break;
case 's':
*sock = optarg;
break;

View File

@@ -63,7 +63,5 @@ void do_remote_command(char* command, char* socket_name, int argc, char** argv)
print_response( response );
exit(atoi(response));
close(remote);
}

View File

@@ -42,7 +42,6 @@ void read_proxy_param(
case 'h' :
fprintf( stdout, "%s\n", proxy_help_text );
exit( 0 );
break;
case 'l':
*downstream_addr = optarg;
break;