Removed even more "statement not reached" warnings.

svn path=/trunk/; revision=24286
This commit is contained in:
Stig Bjørlykke 2008-02-07 15:44:45 +00:00
parent 36431783b7
commit 28ae535b00
38 changed files with 31 additions and 117 deletions

View File

@ -27,8 +27,8 @@
* Ref ITU-T Rec. Q.1990 (07/2001)
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <glib.h>

View File

@ -213,7 +213,7 @@ static int
dissect_beep_more(tvbuff_t *tvb, int offset,
proto_tree *tree)
{
int ret = 0;
switch (beep_get_more(tvb_get_guint8(tvb, offset))) {
@ -224,7 +224,7 @@ dissect_beep_more(tvbuff_t *tvb, int offset,
proto_tree_add_text(tree, tvb, offset, 1, "More: Complete");
}
return 0;
ret = 0;
break;
@ -235,7 +235,7 @@ dissect_beep_more(tvbuff_t *tvb, int offset,
proto_tree_add_text(tree, tvb, offset, 1, "More: Intermediate");
}
return 1;
ret = 1;
break;
@ -246,11 +246,12 @@ dissect_beep_more(tvbuff_t *tvb, int offset,
proto_tree_add_text(tree, tvb, offset, 1, "PROTOCOL VIOLATION: Expected More Flag (* or .)");
}
return -1;
ret = -1;
break;
}
return ret;
}
#if 0

View File

@ -2712,7 +2712,6 @@ printf("CHOICE dissect_ber_choice(%s) trying again\n",name);
}
}
return end_offset;
break;
}
ch++;
}
@ -2943,7 +2942,6 @@ printf("CHOICE dissect_ber_old_choice(%s) trying again\n",name);
}
}
return end_offset;
break;
}
ch++;
}

View File

@ -287,7 +287,7 @@ static void dissect_bfd_authentication(tvbuff_t *tvb, packet_info *pinfo, proto_
proto_item *ti;
proto_item *auth_item;
proto_tree *auth_tree;
char *password;
guint8 *password;
auth_type = tvb_get_guint8(tvb, offset);
auth_len = tvb_get_guint8(tvb, offset + 1);

View File

@ -677,7 +677,6 @@ bootp_option(tvbuff_t *tvb, proto_tree *bp_tree, int voff, int eoff,
}
consumed = i;
return consumed;
break;
case 255: /* End Option */
if (!first_pass) {

View File

@ -1735,8 +1735,6 @@ static void dissect_bssap_plus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
return;
proto_tree_add_text(tree, tvb, offset, -1, "Extraneous data");
break;
break;
case BSSAP_LOCATION_UPDATE_REQUEST: /* 17.1.11 BSSAP+-LOCATION-UPDATE-REQUEST */
/* IMSI IMSI 18.4.10 M TLV 6-10 */
if ( check_ie(tvb, tree, &offset, BSSAP_IMSI))
@ -1987,7 +1985,6 @@ static void dissect_bssap_plus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
/* VLR number VLR number 18.4.26 C TLV 5-11 */
if ( check_optional_ie(tvb, offset, BSSAP_VLR_NUMBER)){
offset = dissect_bssap_vlr_number(tvb, bssap_tree, offset);
return;
if (tvb_length_remaining(tvb,offset) == 0)
return;
proto_tree_add_text(tree, tvb, offset, -1, "Extraneous data");
@ -2007,7 +2004,6 @@ static void dissect_bssap_plus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
/* VLR number VLR number 18.4.26 C TLV 5-11 */
if ( check_optional_ie(tvb, offset, BSSAP_VLR_NUMBER)){
offset = dissect_bssap_vlr_number(tvb, bssap_tree, offset);
return;
if (tvb_length_remaining(tvb,offset) == 0)
return;
proto_tree_add_text(tree, tvb, offset, -1, "Extraneous data");

View File

@ -48,7 +48,7 @@
* configured locally to a different value without it being considered
* a violation of this protocol.
*/
static int additional_bvlc_udp_port = 0;
static guint additional_bvlc_udp_port = 0;
static int proto_bvlc = -1;
static int hf_bvlc_type = -1;
@ -428,7 +428,7 @@ proto_reg_handoff_bvlc(void)
{
static int bvlc_initialized = FALSE;
static dissector_handle_t bvlc_handle;
static int bvlc_udp_port;
static guint bvlc_udp_port;
if (!bvlc_initialized)
{

View File

@ -845,8 +845,6 @@ static int ositp_decode_DR(tvbuff_t *tvb, int offset, guint8 li, guint8 tpdu,
case (2): str = "Session entity not attached to TSAP"; break;
case (3): str = "Address unknown"; break;
default: return -1;
/*NOTREACHED*/
break;
}
if (check_col(pinfo->cinfo, COL_INFO))
@ -961,8 +959,6 @@ static int ositp_decode_DT(tvbuff_t *tvb, int offset, guint8 li, guint8 tpdu,
default : /* bad TPDU */
return -1;
/*NOTREACHED*/
break;
}
pinfo->clnp_dstref = dst_ref;
@ -1155,8 +1151,6 @@ static int ositp_decode_ED(tvbuff_t *tvb, int offset, guint8 li, guint8 tpdu,
default : /* bad TPDU */
return -1;
/*NOTREACHED*/
break;
} /* li */
dst_ref = tvb_get_ntohs(tvb, offset + P_DST_REF);
@ -1234,8 +1228,6 @@ static int ositp_decode_RJ(tvbuff_t *tvb, int offset, guint8 li, guint8 tpdu,
break;
default :
return -1;
/*NOTREACHED*/
break;
}
dst_ref = tvb_get_ntohs(tvb, offset + P_DST_REF);
@ -1571,8 +1563,6 @@ static int ositp_decode_EA(tvbuff_t *tvb, int offset, guint8 li, guint8 tpdu,
default : /* bad TPDU */
return -1;
/*NOTREACHED*/
break;
} /* li */
dst_ref = tvb_get_ntohs(tvb, offset + P_DST_REF);
@ -1650,8 +1640,6 @@ static int ositp_decode_ER(tvbuff_t *tvb, int offset, guint8 li, guint8 tpdu,
break;
default:
return -1;
/*NOTREACHED*/
break;
}
dst_ref = tvb_get_ntohs(tvb, offset + P_DST_REF);

View File

@ -439,19 +439,13 @@ static const char *
version2str(guint16 version) {
switch(version) {
case 1: return "4.1";
break;
case 6: return "NG Feature Pack 2";
break;
case 530: return "NG Feature Pack 3";
break;
case 540: return "NG with Application Intelligence (Early Availability)";
break;
case 541: return "NG with Application Intelligence";
break;
default: return "Unknown Version";
break;
default: break;
}
return NULL;
return "Unknown Version";
}
static const char *
opcode2str_short(guint16 opcode) {

View File

@ -914,7 +914,6 @@ static void dissect_dcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if(tree)
proto_tree_add_text(dcp_tree, tvb, offset, -1, "Reserved packet type: unable to dissect further");
return;
break;
}

View File

@ -1198,7 +1198,6 @@ dissect_dns_answer(tvbuff_t *tvb, int offset, int dns_data_offset,
proto_tree_add_text(rr_tree, tvb, cur_offset, pname_len, "Domain name: %s",
name_out);
}
break;
}
break;
@ -1311,7 +1310,6 @@ dissect_dns_answer(tvbuff_t *tvb, int offset, int dns_data_offset,
proto_tree_add_text(rr_tree, tvb, os_offset, 1 + os_len, "OS: %.*s",
os_len, os);
}
break;
}
break;

View File

@ -189,7 +189,6 @@ dissect_error_cause(tvbuff_t *cause_tvb, proto_tree *parameter_tree)
message_tvb = tvb_new_subset(cause_tvb, CAUSE_INFO_OFFSET, -1, -1);
dissect_enrp(message_tvb, NULL, cause_tree);
break;
break;
case INVALID_VALUES:
parameter_tvb = tvb_new_subset(cause_tvb, CAUSE_INFO_OFFSET, -1, -1);
dissect_parameter(parameter_tvb, cause_tree);

View File

@ -254,7 +254,6 @@ fddifc_to_str(int fc)
g_snprintf(strbuf, sizeof(strbuf), "Implementor sync frame, control %x",
fc & FDDI_FC_ZZZZ);
return strbuf;
break;
default:
return "Unknown frame type";

View File

@ -1753,48 +1753,37 @@ val_to_str_err_code(guint8 class, guint8 code)
switch(class) {
case 1:
return(val_to_str(code, names_err_code_vfd_state, "Unknown"));
break;
case 2:
return(val_to_str(code, names_err_code_appl_ref, "Unknown"));
break;
case 3:
return(val_to_str(code, names_err_code_def, "Unknown"));
break;
case 4:
return(val_to_str(code, names_err_code_res, "Unknown"));
break;
case 5:
return(val_to_str(code, names_err_code_srv, "Unknown"));
break;
case 6:
return(val_to_str(code, names_err_code_access, "Unknown"));
break;
case 7:
return(val_to_str(code, names_err_code_od, "Unknown"));
break;
case 8:
return(val_to_str(code, names_err_code_other, "Unknown"));
break;
case 9:
return(val_to_str(code, names_err_code_reject, "Unknown"));
break;
case 10:
return(val_to_str(code,
names_err_code_h1_sm_reason_code, "Unknown"));
break;
case 11:
return(val_to_str(code, names_err_code_fms_init, "Unknown"));
break;
default:
return("Unknown");

View File

@ -705,8 +705,6 @@ dissect_fmp_status(tvbuff_t *tvb, int offset, proto_tree *tree, int *rval)
case FMP_WRITER_ZEROED_BLK:
*rval = 0;
break;
*rval = 1;
break;
case FMP_WRONG_HANDLE:
*rval = 0;
break;

View File

@ -266,7 +266,7 @@ parse_extended_pasv_response(const guchar *line, int linelen, guint16 *ftp_port)
delimiter = c;
}
if (c != delimiter) {
break;;
break;
}
p++;
}

View File

@ -6152,7 +6152,6 @@ de_bearer_cap(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar
str = "Reserved";
break;
}
break;
}
else
{
@ -6165,7 +6164,6 @@ de_bearer_cap(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar
str = "Reserved";
break;
}
break;
}
break;
@ -18470,8 +18468,7 @@ dissect_ccch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
default:
/* XXX - hf_idx is still -1! this is a bug in the implementation, and I don't know how to fix it so simple return here */
return;
break;
return;
}
/*
@ -18746,8 +18743,7 @@ dissect_dtap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
default:
/* XXX - hf_idx is still -1! this is a bug in the implementation, and I don't know how to fix it so simple return here */
return;
break;
return;
}
sccp_msg = pinfo->sccp_info;

View File

@ -1533,17 +1533,17 @@ char_def_alphabet_ext_decode(unsigned char value)
{
switch (value)
{
case 0x0a: return 0x0c; break; /* form feed */
case 0x14: return '^'; break;
case 0x28: return '{'; break;
case 0x29: return '}'; break;
case 0x2f: return '\\'; break;
case 0x3c: return '['; break;
case 0x3d: return '~'; break;
case 0x3e: return ']'; break;
case 0x40: return '|'; break;
case 0x65: return 0x20ac; break; /* euro */
default: return '?'; break; /* invalid character */
case 0x0a: return 0x0c; /* form feed */
case 0x14: return '^';
case 0x28: return '{';
case 0x29: return '}';
case 0x2f: return '\\';
case 0x3c: return '[';
case 0x3d: return '~';
case 0x3e: return ']';
case 0x40: return '|';
case 0x65: return 0x20ac; /* euro */
default: return '?'; /* invalid character */
}
}

View File

@ -238,7 +238,6 @@ static gboolean dissect_h1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* This is not a valid telegram. So cancel dissection
and try the next dissector */
return FALSE;
break;
}
if (tvb_get_guint8(tvb,offset + position + 1) < 1)
THROW(ReportedBoundsError);

View File

@ -183,7 +183,7 @@ static gint circuit_chain_equal(gconstpointer v, gconstpointer w)
gint result;
result = ( v1->call == v2->call &&
v1->vc == v2 -> vc );
return result;;
return result;
}
static guint circuit_chain_hash (gconstpointer v)
@ -1142,7 +1142,6 @@ static gboolean h223_mux_check_hdlc(int h223_level, guint32 nbytes, guint32 tail
/* level 0 isn't byte-aligned, so is a complete pain to implement */
DISSECTOR_ASSERT_NOT_REACHED();
return FALSE;
break;
case 1:
masked = tail_buf & 0xffff;

View File

@ -411,7 +411,6 @@ dissect_h264_exp_golomb_code(proto_tree *tree, int hf_index, tvbuff_t *tvb, gint
}
}
return codenum;
break;
default:
break;
}
@ -1346,7 +1345,6 @@ dissect_h264_pic_parameter_set_rbsp(proto_tree *tree, tvbuff_t *tvb, packet_info
/* else*/
/* scaling_list( ScalingList8x8[ i - 6 ], 64, UseDefaultScalingMatrix8x8Flag[ i - 6 ] )*/
/* }*/
proto_tree_add_text(tree, tvb, bit_offset>>3, -1, "[Not decoded yet]");
}
/* second_chroma_qp_index_offset 1 se(v)*/

View File

@ -205,7 +205,6 @@ dissect_icap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
*/
is_icap = TRUE;
goto is_icap_header;
break;
}
}

View File

@ -619,7 +619,6 @@ again:
ip6_to_str(&opt_nr->fmip6_opt_prefix));
break;
}
break;
case FMIP6_OPT_LINK_LAYER_ADDRESS:
{
int len, p;

View File

@ -437,7 +437,6 @@ int imf_find_field_end(tvbuff_t *tvb, int offset, gint max_length, gboolean *las
if(last_field)
*last_field = TRUE;
return offset;
break;
case ' ':
case '\t':
/* continuation line */
@ -445,7 +444,6 @@ int imf_find_field_end(tvbuff_t *tvb, int offset, gint max_length, gboolean *las
default:
/* this is a new field */
return offset;
break;
}
}
}else {

View File

@ -523,7 +523,6 @@ dissect_ipopt_cipso(const ip_tcp_opt *optp, tvbuff_t *tvb, int offset,
/* padding - skip this tag */
offset += 1;
continue;
break;
case 1:
/* restrictive bitmap, see CIPSO draft section 3.4.2 for tag format */
if ((taglen < 4) || (taglen > CIPSO_TAG_LEN_MAX) ||

View File

@ -666,7 +666,6 @@ handleHeaderDigest(iscsi_session_t *iscsi_session, proto_item *ti, tvbuff_t *tvb
}
}
return offset + headerLen + 4;
break;
}
return offset + headerLen;
}

View File

@ -2296,7 +2296,6 @@ dissect_ansi_isup_cause_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree
length, "Diagnostic: %s",
tvb_bytes_to_str(parameter_tvb, offset, length));
return;
break;
case 2:
/*ANSI*/
proto_tree_add_item(parameter_tree, hf_isup_cause_location, parameter_tvb, offset, 1, FALSE);
@ -2318,7 +2317,6 @@ dissect_ansi_isup_cause_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree
length, "Diagnostic: %s",
tvb_bytes_to_str(parameter_tvb, offset, length));
return;
break;
default:
proto_tree_add_item(parameter_tree, hf_ansi_isup_coding_standard, parameter_tvb, offset, 1, FALSE);
proto_tree_add_item(parameter_tree, hf_isup_extension_ind, parameter_tvb, offset, 1, FALSE);

View File

@ -1267,11 +1267,9 @@ ppp_heuristic_guess(guint16 proto) {
case PPP_IPV6 :
case PPP_IPV6CP :
return TRUE;
break;
default:
return FALSE; /* did not find a ppp header */
break;
}
}
@ -1295,7 +1293,6 @@ ip_heuristic_guess(guint8 ip_header_byte) {
case 0x4e:
case 0x4f:
return PROTO_IP;
break;
case 0x60:
case 0x61:
case 0x62:
@ -1313,7 +1310,6 @@ ip_heuristic_guess(guint8 ip_header_byte) {
case 0x6e:
case 0x6f:
return PROTO_IP6;
break;
default:
return PROTO_UNKNOWN; /* did not find a ip header */
}

View File

@ -535,7 +535,6 @@ dissect_megaco_text(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
dissect_megaco_errordescriptor(tvb, megaco_tree, tvb_len-1, tvb_command_start_offset);
}
return;
break;
/* transactionResponseAck
* transactionResponseAck = ResponseAckToken LBRKT transactionAck
* *(COMMA transactionAck) RBRKT
@ -574,7 +573,6 @@ dissect_megaco_text(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
tvb_previous_offset = tvb_LBRKT +1;
return;
break;
/* Pe and PN is transactionPending, P+"any char" is transactionReply */
case PENDINGTOKEN:
trx_type = GCP_TRX_PENDING;
@ -604,7 +602,6 @@ dissect_megaco_text(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
tvb_offset, len,
tvb_format_text(tvb,tvb_offset,len));
return;
break;
/* transactionReply */
case REPLYTOKEN:
@ -678,7 +675,6 @@ dissect_megaco_text(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
"Sorry, can't understand errorDescriptor / transactionList = %s, can't parse it pos %u",
tvb_format_text(tvb,tvb_previous_offset,2),tvb_previous_offset);
return;
break;
} /* end switch */
/* Only these remains now
* transactionReply = ReplyToken EQUAL TransactionID LBRKT
@ -1086,8 +1082,6 @@ nextcontext:
tvb_previous_offset, tokenlen,
"No Command detectable !");
return;
break;
}
}
else{

View File

@ -1259,7 +1259,6 @@ get_encrypted_state(packet_info *pinfo, int cryptpeer)
}
}
}
return NULL;
}
/*

View File

@ -357,14 +357,12 @@ capture_ppi(const guchar *pd, int len, packet_counts *ld)
case 1: /* DLT_EN10MB */
capture_eth(pd, ppi_len, len, ld);
return;
break;
case 105: /* DLT_DLT_IEEE802_11 */
if (is_htc)
capture_ieee80211_ht(pd, ppi_len, len, ld);
else
capture_ieee80211(pd, ppi_len, len, ld);
return;
break;
default:
break;
}

View File

@ -1457,7 +1457,6 @@ static inline int rsvp_class_to_filter_num(int classnum)
case RSVP_CLASS_MESSAGE_ID_ACK :
case RSVP_CLASS_MESSAGE_ID_LIST :
return classnum + RSVPF_OBJECT;
break;
case RSVP_CLASS_RECOVERY_LABEL :
case RSVP_CLASS_UPSTREAM_LABEL :

View File

@ -1616,7 +1616,6 @@ static void dissect_sdp_media_attribute(tvbuff_t *tvb, packet_info *pinfo, proto
else
g_hash_table_insert(transport_info->media[ transport_info->media_count-1 ].rtp_dyn_payload,
key, g_strdup(transport_info->encoding_name));
return;
break;
case SDP_FMTP:
if(sdp_media_attribute_tree){
@ -1667,7 +1666,6 @@ static void dissect_sdp_media_attribute(tvbuff_t *tvb, packet_info *pinfo, proto
offset = next_offset + 1;
}
}
return;
break;
case SDP_PATH:
/* msrp attributes that contain address needed for conversation */

View File

@ -531,7 +531,6 @@ dissect_sflow_extended_router(tvbuff_t *tvb, proto_tree *tree, gint offset)
"Unknown address type (%d)", address_type);
len += 4; /* not perfect, but what else to do? */
return len; /* again, this is wrong. but... ? */
break;
};
proto_tree_add_item(tree, hf_sflow_nexthop_src_mask, tvb, offset + len,
@ -863,9 +862,8 @@ dissect_sflow(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset += 16;
break;
default:
return 0;
/* unknown address. this will cause a malformed packet. */
break;
return 0;
};
if (version == 5) {

View File

@ -259,10 +259,8 @@ static gboolean check_slsk_format(tvbuff_t *tvb, int offset, const char format[]
break;
case '*':
return TRUE;
break;
default:
return FALSE;
break;
}
if (format[1] == '\0' ) {

View File

@ -3696,7 +3696,6 @@ dissect_pipe_smb(tvbuff_t *sp_tvb, tvbuff_t *s_tvb, tvbuff_t *pd_tvb,
case PIPE_LANMAN:
return dissect_pipe_lanman(pd_tvb, p_tvb, d_tvb, pinfo,
tree);
break;
case PIPE_DCERPC:
/*
@ -3721,7 +3720,6 @@ dissect_pipe_smb(tvbuff_t *sp_tvb, tvbuff_t *s_tvb, tvbuff_t *pd_tvb,
case PIPE_LANMAN:
return dissect_pipe_lanman(pd_tvb, p_tvb, d_tvb, pinfo,
tree);
break;
}
break;

View File

@ -16042,22 +16042,18 @@ static const char *decode_smb_error(guint8 errcls, guint16 errcode)
case SMB_SUCCESS:
return("No Error"); /* No error ??? */
break;
case SMB_ERRDOS:
return(val_to_str(errcode, DOS_errors, "Unknown DOS error (%x)"));
break;
case SMB_ERRSRV:
return(val_to_str(errcode, SRV_errors, "Unknown SRV error (%x)"));
break;
case SMB_ERRHRD:
return(val_to_str(errcode, HRD_errors, "Unknown HRD error (%x)"));
break;
default:

View File

@ -120,11 +120,9 @@ val_from_unparsed(fvalue_t *fv, char *s, gboolean allow_partial_value _U_, LogFu
fv->value.tvb = new_tvb;
return TRUE;
}
else {
/* Treat it as a string. */
return val_from_string(fv, s, logfunc);
}
g_assert_not_reached();
/* Treat it as a string. */
return val_from_string(fv, s, logfunc);
}
static int