aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2008-02-07 12:14:40 +0000
committerStig Bjørlykke <stig@bjorlykke.org>2008-02-07 12:14:40 +0000
commitc6af1bfdd469de2226235ce79eccd994a4625368 (patch)
tree3e5881e4f97be97d6dd8a866d9297c9dc93091eb /epan
parent542913de9d73b6fd6ac348d66c5ff9e7b6dec419 (diff)
Removed some "statement not reached" warnings.
svn path=/trunk/; revision=24282
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-bacapp.c16
-rw-r--r--epan/dissectors/packet-nbd.c14
-rw-r--r--epan/dissectors/packet-ssl.c43
-rw-r--r--epan/dissectors/packet-tacacs.c7
-rw-r--r--epan/dissectors/packet-tds.c28
-rw-r--r--epan/dissectors/packet-tipc.c9
-rw-r--r--epan/dissectors/packet-uma.c5
-rw-r--r--epan/dissectors/packet-wbxml.c2
-rw-r--r--epan/ftypes/ftype-string.c8
9 files changed, 48 insertions, 84 deletions
diff --git a/epan/dissectors/packet-bacapp.c b/epan/dissectors/packet-bacapp.c
index d44bb5580e..8239000e32 100644
--- a/epan/dissectors/packet-bacapp.c
+++ b/epan/dissectors/packet-bacapp.c
@@ -1924,7 +1924,6 @@ fCalendaryEntry (tvbuff_t *tvb, proto_tree *tree, guint offset)
break;
default:
return offset;
- break;
}
return offset;
@@ -1952,7 +1951,6 @@ static guint fTimeStamp (tvbuff_t *tvb, proto_tree *tree,
break;
default:
return offset;
- break;
}
}
@@ -2717,7 +2715,6 @@ fSubscribeCOVPropertyRequest(tvbuff_t *tvb, proto_tree *tree, guint offset)
break;
default:
return offset;
- break;
}
}
return offset;
@@ -2871,7 +2868,6 @@ fConfirmedTextMessageRequest(tvbuff_t *tvb, proto_tree *tree, guint offset)
break;
default:
return offset;
- break;
}
}
return offset;
@@ -2980,7 +2976,6 @@ fLifeSafetyOperationRequest(tvbuff_t *tvb, proto_tree *tree, guint offset, const
break;
default:
return offset;
- break;
}
}
return offset;
@@ -3621,7 +3616,6 @@ fConfirmedCOVNotificationRequest (tvbuff_t *tvb, proto_tree *tree, guint offset)
break;
default:
return offset;
- break;
}
}
return offset;
@@ -3668,7 +3662,6 @@ fAcknowledgeAlarmRequest (tvbuff_t *tvb, proto_tree *tree, guint offset)
break;
default:
return offset;
- break;
}
}
return offset;
@@ -3728,7 +3721,6 @@ fGetEnrollmentSummaryRequest (tvbuff_t *tvb, proto_tree *tree, guint offset)
break;
default:
return offset;
- break;
}
}
return offset;
@@ -3824,7 +3816,6 @@ flistOfEventSummaries (tvbuff_t *tvb, proto_tree *tree, guint offset)
break;
default:
return offset;
- break;
}
}
return offset;
@@ -3850,7 +3841,6 @@ fGetEventInformationACK (tvbuff_t *tvb, proto_tree *tree, guint offset)
break;
default:
return offset;
- break;
}
}
return offset;
@@ -3891,7 +3881,6 @@ fAddListElementRequest(tvbuff_t *tvb, proto_tree *tree, guint offset)
break;
default:
return offset;
- break;
}
}
return offset;
@@ -3924,7 +3913,6 @@ fDeviceCommunicationControlRequest(tvbuff_t *tvb, proto_tree *tree, guint offset
break;
default:
return offset;
- break;
}
}
return offset;
@@ -3949,7 +3937,6 @@ fReinitializeDeviceRequest(tvbuff_t *tvb, proto_tree *tree, guint offset)
break;
default:
return offset;
- break;
}
}
return offset;
@@ -4946,7 +4933,6 @@ fConfirmedServiceRequest (tvbuff_t *tvb, proto_tree *tree, guint offset, gint se
break;
default:
return offset;
- break;
}
return offset;
}
@@ -5053,7 +5039,6 @@ fWhoIsRequest (tvbuff_t *tvb, proto_tree *tree, guint offset)
break;
default:
return offset;
- break;
}
}
return offset;
@@ -5392,7 +5377,6 @@ fBACnetError (tvbuff_t *tvb, proto_tree *tree, guint offset, guint service)
offset = fVTCloseError (tvb,tree,offset);
default:
return fError (tvb, tree, offset);
- break;
}
return offset;
}
diff --git a/epan/dissectors/packet-nbd.c b/epan/dissectors/packet-nbd.c
index c3d150055d..5a228b49b6 100644
--- a/epan/dissectors/packet-nbd.c
+++ b/epan/dissectors/packet-nbd.c
@@ -106,11 +106,9 @@ get_nbd_tcp_pdu_len(packet_info *pinfo, tvbuff_t *tvb, int offset)
switch(type){
case NBD_CMD_WRITE:
return tvb_get_ntohl(tvb, offset+24)+28;
- break;
default:
return 28;
}
- break;
case NBD_RESPONSE_MAGIC:
/*
* Do we have a conversation for this connection?
@@ -169,11 +167,12 @@ get_nbd_tcp_pdu_len(packet_info *pinfo, tvbuff_t *tvb, int offset)
} else {
return 16;
}
- break;
default:
- /* Did not really look like a NBD packet after all */
- return 0;
+ break;
}
+
+ /* Did not really look like a NBD packet after all */
+ return 0;
}
static void
@@ -433,7 +432,6 @@ dissect_nbd_tcp_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
tcp_dissect_pdus(tvb, pinfo, tree, nbd_desegment, 28, get_nbd_tcp_pdu_len, dissect_nbd_tcp_pdu);
return TRUE;
- break;
case NBD_RESPONSE_MAGIC:
/* responses are 16 bytes or more */
if(tvb_length(tvb)<16){
@@ -442,10 +440,10 @@ dissect_nbd_tcp_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
tcp_dissect_pdus(tvb, pinfo, tree, nbd_desegment, 16, get_nbd_tcp_pdu_len, dissect_nbd_tcp_pdu);
return TRUE;
default:
- return FALSE;
+ break;
}
- return FALSE;
+ return FALSE;
}
void proto_register_nbd(void)
diff --git a/epan/dissectors/packet-ssl.c b/epan/dissectors/packet-ssl.c
index 7467e67e20..2e41f2ac7a 100644
--- a/epan/dissectors/packet-ssl.c
+++ b/epan/dissectors/packet-ssl.c
@@ -3815,6 +3815,7 @@ ssl_looks_like_valid_v2_handshake(tvbuff_t *tvb, guint32 offset,
guint8 msg_type;
guint16 version;
guint32 sum;
+ gint ret = 0;
/* fetch the msg_type */
msg_type = tvb_get_guint8(tvb, offset);
@@ -3823,13 +3824,13 @@ ssl_looks_like_valid_v2_handshake(tvbuff_t *tvb, guint32 offset,
case SSL2_HND_CLIENT_HELLO:
/* version follows msg byte, so verify that this is valid */
version = tvb_get_ntohs(tvb, offset+1);
- return ssl_is_valid_ssl_version(version);
+ ret = ssl_is_valid_ssl_version(version);
break;
case SSL2_HND_SERVER_HELLO:
/* version is three bytes after msg_type */
version = tvb_get_ntohs(tvb, offset+3);
- return ssl_is_valid_ssl_version(version);
+ ret = ssl_is_valid_ssl_version(version);
break;
case SSL2_HND_CLIENT_MASTER_KEY:
@@ -3839,17 +3840,16 @@ ssl_looks_like_valid_v2_handshake(tvbuff_t *tvb, guint32 offset,
sum = tvb_get_ntohs(tvb, offset + 4); /* clear_key_length */
sum += tvb_get_ntohs(tvb, offset + 6); /* encrypted_key_length */
sum += tvb_get_ntohs(tvb, offset + 8); /* key_arg_length */
- if (sum > record_length)
- {
- return 0;
+ if (sum <= record_length) {
+ ret = 1;
}
- return 1;
break;
default:
- return 0;
+ break;
}
- return 0;
+
+ return ret;
}
/* applies a heuristic to determine whether
@@ -3876,6 +3876,7 @@ ssl_looks_like_valid_pct_handshake(tvbuff_t *tvb, guint32 offset,
guint8 msg_type;
guint16 version;
guint32 sum;
+ gint ret = 0;
/* fetch the msg_type */
msg_type = tvb_get_guint8(tvb, offset);
@@ -3884,14 +3885,12 @@ ssl_looks_like_valid_pct_handshake(tvbuff_t *tvb, guint32 offset,
case PCT_MSG_CLIENT_HELLO:
/* version follows msg byte, so verify that this is valid */
version = tvb_get_ntohs(tvb, offset+1);
- return version == PCT_VERSION_1;
- break;
+ ret = (version == PCT_VERSION_1);
case PCT_MSG_SERVER_HELLO:
/* version is one byte after msg_type */
version = tvb_get_ntohs(tvb, offset+2);
- return version == PCT_VERSION_1;
- break;
+ ret = (version == PCT_VERSION_1);
case PCT_MSG_CLIENT_MASTER_KEY:
/* sum of various length fields must be less than record length */
@@ -3901,26 +3900,24 @@ ssl_looks_like_valid_pct_handshake(tvbuff_t *tvb, guint32 offset,
sum += tvb_get_ntohs(tvb, offset + 12); /* verify_prelude_length */
sum += tvb_get_ntohs(tvb, offset + 14); /* client_cert_length */
sum += tvb_get_ntohs(tvb, offset + 16); /* response_length */
- if (sum > record_length)
- {
- return 0;
+ if (sum <= record_length) {
+ ret = 1;
}
- return 1;
break;
case PCT_MSG_SERVER_VERIFY:
/* record is 36 bytes longer than response_length */
sum = tvb_get_ntohs(tvb, offset + 34); /* response_length */
- if ((sum + 36) == record_length)
- return 1;
- else
- return 0;
- break;
+ if ((sum + 36) == record_length) {
+ ret = 1;
+ }
+ break;
default:
- return 0;
+ break;
}
- return 0;
+
+ return ret;
}
diff --git a/epan/dissectors/packet-tacacs.c b/epan/dissectors/packet-tacacs.c
index 2ba94872bf..4ed132c7a2 100644
--- a/epan/dissectors/packet-tacacs.c
+++ b/epan/dissectors/packet-tacacs.c
@@ -771,24 +771,23 @@ dissect_tacplus_body(tvbuff_t * hdr_tvb, tvbuff_t * tvb, proto_tree * tree )
} else {
dissect_tacplus_body_authen_rep( tvb, tree );
}
- return;
break;
case TAC_PLUS_AUTHOR:
if ( seq_no & 0x01)
dissect_tacplus_body_author_req( tvb, tree );
else
dissect_tacplus_body_author_rep( tvb, tree );
- return;
break;
case TAC_PLUS_ACCT:
if ( seq_no & 0x01)
dissect_tacplus_body_acct_req( tvb, tree );
else
dissect_tacplus_body_acct_rep( tvb, tree );
- return;
+ break;
+ default:
+ proto_tree_add_text( tree, tvb, 0, tvb_length( tvb ), "Bogus..");
break;
}
- proto_tree_add_text( tree, tvb, 0, tvb_length( tvb ), "Bogus..");
}
#ifdef DEB_TACPLUS
diff --git a/epan/dissectors/packet-tds.c b/epan/dissectors/packet-tds.c
index 3eaf53ac9b..592da5c7cd 100644
--- a/epan/dissectors/packet-tds.c
+++ b/epan/dissectors/packet-tds.c
@@ -924,20 +924,20 @@ static int get_size_by_coltype(int servertype)
{
switch(servertype)
{
- case SYBINT1: return 1; break;
- case SYBINT2: return 2; break;
- case SYBINT4: return 4; break;
- case SYBINT8: return 8; break;
- case SYBREAL: return 4; break;
- case SYBFLT8: return 8; break;
- case SYBDATETIME: return 8; break;
- case SYBDATETIME4: return 4; break;
- case SYBBIT: return 1; break;
- case SYBBITN: return 1; break;
- case SYBMONEY: return 8; break;
- case SYBMONEY4: return 4; break;
- case SYBUNIQUE: return 16; break;
- default: return -1; break;
+ case SYBINT1: return 1;
+ case SYBINT2: return 2;
+ case SYBINT4: return 4;
+ case SYBINT8: return 8;
+ case SYBREAL: return 4;
+ case SYBFLT8: return 8;
+ case SYBDATETIME: return 8;
+ case SYBDATETIME4: return 4;
+ case SYBBIT: return 1;
+ case SYBBITN: return 1;
+ case SYBMONEY: return 8;
+ case SYBMONEY4: return 4;
+ case SYBUNIQUE: return 16;
+ default: return -1;
}
}
# if 0
diff --git a/epan/dissectors/packet-tipc.c b/epan/dissectors/packet-tipc.c
index 630cd99f92..59d73a005e 100644
--- a/epan/dissectors/packet-tipc.c
+++ b/epan/dissectors/packet-tipc.c
@@ -1604,7 +1604,6 @@ call_tipc_v2_data_subdissectors(tvbuff_t *data_tvb, packet_info *pinfo, guint32
* found */
call_dissector(data_handle, data_tvb, pinfo, top_tree);
- return;
}
@@ -1919,7 +1918,6 @@ dissect_tipc_int_prot_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tipc_tr
ORIGINAL_MSG, where message count is zero, and no packet is wrapped inside.
*/
proto_tree_add_text(tipc_tree, tvb, offset, -1,"TIPC_CHANGEOVER_PROTOCOL Protol/dissection Error");
- return;
break;
}
break;
@@ -1977,7 +1975,6 @@ dissect_tipc_int_prot_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tipc_tr
}
proto_tree_add_text(tipc_tree, next_tvb, 0, -1,"%u bytes Data Fragment",(msg_size - 28));
- return;
break;
case TIPC_MSG_BUNDLER:
proto_tree_add_text(tipc_tree, tvb, offset, -1,"Message Bundle");
@@ -1996,7 +1993,6 @@ dissect_tipc_int_prot_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tipc_tr
proto_tree_add_text(tipc_tree, tvb, offset, -1,"%u bytes Data",(msg_size - 28));
break;
}
- return;
}
@@ -2175,9 +2171,8 @@ dissect_tipc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
case TIPC_MSG_BUNDLER:
dissect_tipc_int_prot_msg(tipc_tvb, pinfo, tipc_tree, offset, user, msg_size);
return;
- break;
default:
- break;
+ break;
}
dword = tvb_get_ntohl(tipc_tvb,offset);
@@ -2274,7 +2269,6 @@ dissect_tipc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_text(tipc_tree, tipc_tvb, offset, 14, "TIPC_NAMED_MSG Hdr");
proto_tree_add_text(tipc_tree, data_tvb,0, -1, "%u bytes Data", (msg_size - hdr_size *4));
return;
- break;
case TIPC_DIRECT_MSG:
previous_offset = offset;
while (tvb_reported_length_remaining(tipc_tvb,offset) > 0){
@@ -2288,7 +2282,6 @@ dissect_tipc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
proto_tree_add_text(tipc_tree, tipc_tvb, previous_offset, -1,"%u bytes Data", (msg_size - hdr_size *4));
return;
- break;
default:
proto_tree_add_text(tipc_tree, tipc_tvb, offset, -1,"%u bytes Data", (msg_size - hdr_size *4));
break;
diff --git a/epan/dissectors/packet-uma.c b/epan/dissectors/packet-uma.c
index cee5403fe7..e090b23079 100644
--- a/epan/dissectors/packet-uma.c
+++ b/epan/dissectors/packet-uma.c
@@ -1494,7 +1494,6 @@ dissect_uma(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset++;
offset = dissect_uma_IE(tvb, pinfo, uma_tree, offset);
}
- return;
break;
case 2: /* URLC */
offset++;
@@ -1511,11 +1510,10 @@ dissect_uma(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset++;
offset = dissect_uma_IE(tvb, pinfo, uma_tree, offset);
}
- return;
break;
default:
proto_tree_add_text(uma_tree, tvb,offset,-1,"Unknown protocol %u",pd);
- return;
+ break;
}
}
@@ -1577,7 +1575,6 @@ dissect_uma_urlc_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset = dissect_uma_IE(tvb, pinfo, uma_tree, offset);
}
return offset;
- break;
default:
proto_tree_add_text(uma_tree, tvb,offset,-1,"Wrong message type %u",octet);
return tvb_length(tvb);
diff --git a/epan/dissectors/packet-wbxml.c b/epan/dissectors/packet-wbxml.c
index beb223ad92..d7505faf1c 100644
--- a/epan/dissectors/packet-wbxml.c
+++ b/epan/dissectors/packet-wbxml.c
@@ -6496,7 +6496,6 @@ parse_wbxml_tag_defined (proto_tree *tree, tvbuff_t *tvb, guint32 offset,
/* Reset code page: not needed as return from recursion */
DebugLog(("STAG: level = %u, Return: len = %u\n", *level, off - offset));
return (off - offset);
- break;
case 0x02: /* ENTITY */
ent = tvb_get_guintvar (tvb, off+1, &len);
proto_tree_add_text (tree, tvb, off, 1+len,
@@ -6909,7 +6908,6 @@ parse_wbxml_tag (proto_tree *tree, tvbuff_t *tvb, guint32 offset,
DebugLog(("STAG: level = %u, Return: len = %u\n",
*level, off - offset));
return (off - offset);
- break;
case 0x02: /* ENTITY */
ent = tvb_get_guintvar (tvb, off+1, &len);
proto_tree_add_text (tree, tvb, off, 1+len,
diff --git a/epan/ftypes/ftype-string.c b/epan/ftypes/ftype-string.c
index e7fd24ad50..c355ce856d 100644
--- a/epan/ftypes/ftype-string.c
+++ b/epan/ftypes/ftype-string.c
@@ -177,11 +177,9 @@ val_from_unparsed(fvalue_t *fv, char *s, gboolean allow_partial_value _U_, LogFu
FVALUE_FREE(fv_bytes);
return TRUE;
}
- else {
- /* Just turn it into a string */
- return val_from_string(fv, s, logfunc);
- }
- g_assert_not_reached();
+
+ /* Just turn it into a string */
+ return val_from_string(fv, s, logfunc);
}
static guint