Fix gcc 4.6 "set but not used [-Wunused-but-set-variable]" warnings;

Also: whitespace cleanup.

svn path=/trunk/; revision=37718
This commit is contained in:
Bill Meier 2011-06-19 19:13:26 +00:00
parent 0adcab9f13
commit 26c721b7c9
4 changed files with 31 additions and 41 deletions

View File

@ -302,7 +302,7 @@ static gint hf_ipmi_se_XX_b4_0 = -1;
static gint hf_ipmi_se_28_sensor = -1;
static gint hf_ipmi_se_28_fl_evm = -1;
static gint hf_ipmi_se_28_fl_scan = -1;
static gint hf_ipmi_se_28_fl_scan = -1;
static gint hf_ipmi_se_28_fl_action = -1;
static gint hf_ipmi_se_29_sensor = -1;
@ -2219,9 +2219,7 @@ rs10(tvbuff_t *tvb, proto_tree *tree)
static const int *byte2[] = { &hf_ipmi_se_10_action_oem_filter, &hf_ipmi_se_10_action_diag_intr,
&hf_ipmi_se_10_action_oem_action, &hf_ipmi_se_10_action_pwr_cycle, &hf_ipmi_se_10_action_reset,
&hf_ipmi_se_10_action_pwr_down, &hf_ipmi_se_10_action_alert, NULL };
guint8 v;
v = tvb_get_guint8(tvb, 0);
proto_tree_add_item(tree, hf_ipmi_se_10_pef_version, tvb, 0, 1, TRUE);
proto_tree_add_bitmask_text(tree, tvb, 1, 1, "Action support: ", "None", ett_ipmi_se_10_action,
byte2, TRUE, 0);
@ -2260,7 +2258,7 @@ rq12(tvbuff_t *tvb, proto_tree *tree)
tvbuff_t *sub;
guint8 pno;
const char *desc;
pno = tvb_get_guint8(tvb, 0) & 0x7f;
if (pno < array_length(conf_params)) {
desc = conf_params[pno].name;
@ -2312,7 +2310,7 @@ rq13(tvbuff_t *tvb, proto_tree *tree)
}
pno &= 0x7f;
if (pno < array_length(conf_params)) {
desc = conf_params[pno].name;
} else if (pno >= 96 && pno <= 127) {
@ -2463,7 +2461,7 @@ static void
rs16(tvbuff_t *tvb, proto_tree *tree)
{
guint32 val;
if (ipmi_getsaveddata(0, &val) && val == 0x01) {
/* Operation == Get Alert Immediate Status */
proto_tree_add_item(tree, hf_ipmi_se_16_status, tvb, 0, 1, TRUE);
@ -3497,7 +3495,7 @@ ipmi_register_se(gint proto_ipmi)
{ &hf_ipmi_se_28_fl_evm,
{ "Event Messages",
"ipmi.se28.fl_evm", FT_BOOLEAN, 8, TFS(&tfs_28_enable), 0x80, NULL, HFILL }},
{ &hf_ipmi_se_28_fl_scan,
{ &hf_ipmi_se_28_fl_scan,
{ "Scanning",
"ipmi.se28.fl_scan", FT_BOOLEAN, 8, TFS(&tfs_28_enable), 0x40, NULL, HFILL }},
{ &hf_ipmi_se_28_fl_action,

View File

@ -52,7 +52,7 @@
* close-delimiter := delimiter "--"
* body-part := MIME-part-headers [ line-end *OCTET ]
* transport-padding := *LWSP-char
*
*
* Note that line-end is often a LF instead of a CRLF.
*/
@ -193,7 +193,7 @@ base64_decode(packet_info *pinfo, tvbuff_t *b64_tvb, char *name)
* o Remove LWS before and after a separator
* o Remove trailing LWS
* o Replace other LWS with a single space
* Set value to the start of the value
* Set value to the start of the value
* Return the cleaned-up RFC2822 header (buffer must be freed).
*/
static char *
@ -331,7 +331,7 @@ static char *find_parameter(char *parameters, const char *key, int *retlen)
while ((*p) && isspace((guchar)*p))
p++; /* Skip white space */
if (g_ascii_strncasecmp(p, key, keylen) == 0)
break;
/* Skip to next parameter */
@ -385,7 +385,7 @@ static char *find_parameter(char *parameters, const char *key, int *retlen)
/* Retrieve the media information from pinfo->private_data,
* and compute the boundary string and its length.
* Return a pointer to a filled-in multipart_info_t, or NULL on failure.
*
*
* Boundary delimiters must not appear within the encapsulated material,
* and must be no longer than 70 characters, not counting the two
* leading hyphens. (quote from rfc2046)
@ -417,7 +417,7 @@ get_multipart_info(packet_info *pinfo)
g_free(parameters);
return NULL;
}
/*
* There is a value for the boundary string
*/
@ -614,7 +614,7 @@ process_body_part(proto_tree *tree, tvbuff_t *tvb, const guint8 *boundary,
char *hdr_str;
char *header_str;
/* Look for the end of the header (denoted by cr)
/* Look for the end of the header (denoted by cr)
* 3:d argument to imf_find_field_end() maxlen; must be last offset in the tvb.
*/
next_offset = imf_find_field_end(tvb, offset, tvb_length_remaining(tvb, offset)+offset, &last_field);
@ -675,7 +675,7 @@ process_body_part(proto_tree *tree, tvbuff_t *tvb, const guint8 *boundary,
/* Show content-type in root 'part' label */
proto_item_append_text(ti, " (%s)", content_type_str);
/* find the "name" parameter in case we don't find a content disposition "filename" */
if((typename = find_parameter(parameters, "name=", &len)) != NULL) {
typename = g_strndup(typename, len);
@ -734,9 +734,9 @@ process_body_part(proto_tree *tree, tvbuff_t *tvb, const guint8 *boundary,
void *save_private_data = pinfo->private_data;
gboolean dissected;
/*
/*
* Try and remove any content transfer encoding so that each sub-dissector
* doesn't have to do it itself
* doesn't have to do it itself
*
*/
@ -812,7 +812,6 @@ static void dissect_multipart(tvbuff_t *tvb, packet_info *pinfo,
gint header_start = 0;
guint8 *boundary;
gint boundary_len;
gint offset = 0;
gboolean last_boundary = FALSE;
if (m_info == NULL) {
@ -852,8 +851,6 @@ static void dissect_multipart(tvbuff_t *tvb, packet_info *pinfo,
if (check_col(pinfo->cinfo, COL_INFO))
col_set_fence(pinfo->cinfo, COL_INFO);
offset = 0;
/*
* Process the multipart preamble
*/

View File

@ -84,24 +84,23 @@ static void dissect_user(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree) {
user_encap_t* encap = NULL;
tvbuff_t* payload_tvb;
proto_item* item;
int offset = 0;
int len;
guint i;
for (i = 0; i < num_encaps; i++) {
if (encaps[i].encap == pinfo->match_uint) {
encap = &(encaps[i]);
break;
}
}
item = proto_tree_add_item(tree,proto_user_encap,tvb,0,-1,FALSE);
if (!encap) {
char* msg = ep_strdup_printf("User encapsulation not handled: DLT=%d, check your Preferences->Protocols->DLT_USER",
pinfo->match_uint + 147 - WTAP_ENCAP_USER0);
proto_item_set_text(item,"%s",msg);
expert_add_info_format(pinfo, item, PI_UNDECODED, PI_WARN, "%s", msg);
call_dissector(data_handle, tvb, pinfo, tree);
return;
}
@ -111,7 +110,7 @@ static void dissect_user(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree) {
pinfo->match_uint + 147 - WTAP_ENCAP_USER0);
proto_item_set_text(item,"%s",msg);
expert_add_info_format(pinfo, item, PI_UNDECODED, PI_WARN, "%s", msg);
call_dissector(data_handle, tvb, pinfo, tree);
return;
}
@ -119,11 +118,10 @@ static void dissect_user(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree) {
proto_item_set_text(item,"DLT: %d",pinfo->match_uint + 147 - WTAP_ENCAP_USER0);
len = tvb_reported_length(tvb) - (encap->header_size + encap->trailer_size);
if (encap->header_size) {
tvbuff_t* hdr_tvb = tvb_new_subset(tvb, 0, encap->header_size, encap->header_size);
call_dissector(encap->header_proto, hdr_tvb, pinfo, tree);
offset = encap->header_size;
if (encap->header_proto_name) {
const char *proto_name = dissector_handle_get_long_name(find_dissector(encap->header_proto_name));
if (proto_name) {
@ -131,7 +129,7 @@ static void dissect_user(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree) {
}
}
}
payload_tvb = tvb_new_subset(tvb, encap->header_size, len, len);
call_dissector(encap->payload_proto, payload_tvb, pinfo, tree);
if (encap->payload_proto_name) {
@ -144,7 +142,6 @@ static void dissect_user(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree) {
if (encap->trailer_size) {
tvbuff_t* trailer_tvb = tvb_new_subset(tvb, encap->header_size + len, encap->trailer_size, encap->trailer_size);
call_dissector(encap->trailer_proto, trailer_tvb, pinfo, tree);
offset = encap->trailer_size;
if (encap->trailer_proto_name) {
const char *proto_name = dissector_handle_get_long_name(find_dissector(encap->trailer_proto_name));
if (proto_name) {
@ -154,7 +151,7 @@ static void dissect_user(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree) {
}
}
static void* user_copy_cb(void* dest, const void* orig, size_t len _U_)
static void* user_copy_cb(void* dest, const void* orig, size_t len _U_)
{
const user_encap_t *o = orig;
user_encap_t *d = dest;
@ -186,10 +183,10 @@ void proto_reg_handoff_user_encap(void)
{
dissector_handle_t user_encap_handle;
guint i;
user_encap_handle = find_dissector("user_dlt");
data_handle = find_dissector("data");
for (i = WTAP_ENCAP_USER0 ; i <= WTAP_ENCAP_USER15; i++)
dissector_add_uint("wtap_encap", i, user_encap_handle);
@ -209,12 +206,12 @@ void proto_register_user_encap(void)
UAT_FLD_PROTO(user_encap,trailer_proto,"Trailer protocol","Protocol to be used for the trailer (empty = data)"),
UAT_END_FIELDS
};
proto_user_encap = proto_register_protocol("DLT User","DLT_USER","user_dlt");
module = prefs_register_protocol(proto_user_encap, NULL);
encaps_uat = uat_new("User DLTs Table",
sizeof(user_encap_t),
"user_dlts",
@ -228,14 +225,14 @@ void proto_register_user_encap(void)
user_free_cb,
NULL,
user_flds );
prefs_register_uat_preference(module,
"encaps_table",
"Encapsulations Table",
"A table that enumerates the various protocols to be used against a certain user DLT",
encaps_uat);
register_dissector("user_dlt",dissect_user,proto_user_encap);
/*

View File

@ -42,7 +42,7 @@
#include <epan/reassemble.h>
#define WAI_SUB_PRE_AUTHENTICATION 0x01 /* pre-authentication start */
#define WAI_SUB_STAKEY_REQ 0x02 /* STAKey request */
#define WAI_SUB_STAKEY_REQ 0x02 /* STAKey request */
#define WAI_SUB_AUTH_ACTIVATION 0x03 /* authentication activation */
#define WAI_SUB_ACCESS_AUTH_REQ 0x04 /* access authentication request */
#define WAI_SUB_ACCESS_AUTH_RESP 0x05 /* access authentication response */
@ -826,7 +826,6 @@ Figure 18 from [ref:1]
#define WAI_MESSAGE_LENGTH 12 /*Length of all fields without 'Data' field*/
#define WAI_DATA_OFFSET WAI_MESSAGE_LENGTH
guint16 version;
guint8 type;
guint8 subtype;
guint16 length;
guint16 packet_num;
@ -856,7 +855,6 @@ Figure 18 from [ref:1]
col_append_fstr(pinfo->cinfo, COL_INFO, "%s", subtype_name);
/* Field lengths and offsets in WAI protocol described above */
type = tvb_get_guint8(tvb, 2);
packet_num = tvb_get_ntohs(tvb, 8);
fragment_num = tvb_get_guint8(tvb, 10);
flags = tvb_get_guint8(tvb, 11);