Fix warnings/errors of type -Wused-but-marked-unused

Change-Id: I34c2d9953272822da0745d1b24c64d8466e43b37
Reviewed-on: https://code.wireshark.org/review/14668
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
This commit is contained in:
Joerg Mayer 2016-03-28 15:25:12 +02:00 committed by Jörg Mayer
parent 8f3ad91905
commit 7e5dae90d6
15 changed files with 34 additions and 24 deletions

View File

@ -926,7 +926,12 @@ get_editcap_compiled_info(GString *str)
}
static void
get_editcap_runtime_info(GString *str _U_)
get_editcap_runtime_info(
#if defined(HAVE_LIBZ) && !defined(_WIN32)
GString *str)
#else
GString *str _U_)
#endif
{
/* zlib */
#if defined(HAVE_LIBZ) && !defined(_WIN32)

View File

@ -1204,7 +1204,7 @@ dissect_ndr_uint16s(tvbuff_t *tvb, gint offset, packet_info *pinfo,
* Helper routines for dissecting NDR strings
*/
void cb_wstr_postprocess(packet_info *pinfo, proto_tree *tree _U_,
proto_item *item, dcerpc_info *di _U_, tvbuff_t *tvb,
proto_item *item, dcerpc_info *di, tvbuff_t *tvb,
int start_offset, int end_offset,
void *callback_args)
{
@ -1265,7 +1265,7 @@ void cb_wstr_postprocess(packet_info *pinfo, proto_tree *tree _U_,
}
void cb_str_postprocess(packet_info *pinfo, proto_tree *tree _U_,
proto_item *item, dcerpc_info *di _U_, tvbuff_t *tvb,
proto_item *item, dcerpc_info *di, tvbuff_t *tvb,
int start_offset, int end_offset,
void *callback_args)
{

View File

@ -89,7 +89,7 @@ bytes_repr_len(fvalue_t *fv, ftrepr_t rtype, int field_display _U_)
#define OID_REPR_LEN(fv) (1 + REL_OID_REPR_LEN(fv))
static int
oid_repr_len(fvalue_t *fv _U_, ftrepr_t rtype _U_, int field_display _U_)
oid_repr_len(fvalue_t *fv, ftrepr_t rtype _U_, int field_display _U_)
{
return OID_REPR_LEN(fv);
}
@ -110,7 +110,7 @@ oid_to_repr(fvalue_t *fv, ftrepr_t rtype _U_, int field_display _U_, char *buf)
}
static int
rel_oid_repr_len(fvalue_t *fv _U_, ftrepr_t rtype _U_, int field_display _U_)
rel_oid_repr_len(fvalue_t *fv, ftrepr_t rtype _U_, int field_display _U_)
{
return REL_OID_REPR_LEN(fv);
}

View File

@ -300,7 +300,7 @@ ipxnet_repr_len(fvalue_t *fv _U_, ftrepr_t rtype _U_, int field_display _U_)
}
static void
ipxnet_to_repr(fvalue_t *fv, ftrepr_t rtype _U_, int field_display _U_, char *buf)
ipxnet_to_repr(fvalue_t *fv, ftrepr_t rtype, int field_display _U_, char *buf)
{
uinteger_to_repr(fv, rtype, BASE_HEX, buf);
}
@ -587,7 +587,7 @@ uinteger64_repr_len(fvalue_t *fv _U_, ftrepr_t rtype _U_, int field_display _U_)
}
static void
uinteger64_to_repr(fvalue_t *fv, ftrepr_t rtype _U_, int field_display _U_, char *buf)
uinteger64_to_repr(fvalue_t *fv, ftrepr_t rtype _U_, int field_display, char *buf)
{
if ((field_display == BASE_HEX) || (field_display == BASE_HEX_DEC))
{

View File

@ -110,7 +110,7 @@ val_from_string(fvalue_t *fv, const char *pattern, gchar **err_msg)
* On failure, if err_msg is non-null, set *err_msg to point to a
* g_malloc()ed error message. */
static gboolean
val_from_unparsed(fvalue_t *fv, const char *pattern, gboolean allow_partial_value _U_, gchar **err_msg)
val_from_unparsed(fvalue_t *fv, const char *pattern, gboolean allow_partial_value, gchar **err_msg)
{
g_assert(! allow_partial_value);

View File

@ -122,7 +122,7 @@ sub dotap {
$elems{$k} = $v;
}
my $code = "static void wslua_${tname}_to_table(lua_State* L, const void* p) { const $sname* v _U_; v = (const $sname*)p; lua_newtable(L);\n";
my $code = "static void wslua_${tname}_to_table(lua_State* L, const void* p) { const $sname* v; v = (const $sname*)p; lua_newtable(L);\n";
my $doc = "Tap: $tname\n";
for my $n (sort keys %elems) {
@ -187,7 +187,7 @@ print CFILE <<"TBLFTR";
{NULL,NULL}
};
int wslua_set_tap_enums(lua_State* L _U_) {
int wslua_set_tap_enums(lua_State* L) {
TBLFTR

View File

@ -81,7 +81,7 @@ WSLUA_METAMETHOD CaptureInfo__tostring(lua_State* L) {
}
static int CaptureInfo__gc(lua_State* L _U_) {
static int CaptureInfo__gc(lua_State* L) {
CaptureInfo fc = toCaptureInfo(L,1);
if (fc)
g_free(fc);
@ -468,7 +468,7 @@ static int CaptureInfoConst_set_private_table(lua_State* L) {
return set_wdh_priv_table_ref(L, fi->wdh);
}
static int CaptureInfoConst__gc(lua_State* L _U_) {
static int CaptureInfoConst__gc(lua_State* L) {
CaptureInfoConst fi = toCaptureInfoConst(L,1);
if (fi)
g_free(fi);

View File

@ -662,7 +662,7 @@ WSLUA_METAMETHOD DissectorTable__tostring(lua_State* L) {
}
/* Gets registered as metamethod automatically by WSLUA_REGISTER_CLASS/META */
static int DissectorTable__gc(lua_State* L _U_) {
static int DissectorTable__gc(lua_State* L) {
DissectorTable dt = toDissectorTable(L,1);
if (dt->created && !dt->expired) {

View File

@ -432,7 +432,7 @@ WSLUA_METAMETHOD FieldInfo__lt(lua_State* L) {
}
/* Gets registered as metamethod automatically by WSLUA_REGISTER_META */
static int FieldInfo__gc(lua_State* L _U_) {
static int FieldInfo__gc(lua_State* L) {
FieldInfo fi = toFieldInfo(L,1);
if (!fi) return 0;

View File

@ -461,7 +461,7 @@ WSLUA_METAMETHOD File__tostring(lua_State* L) {
}
/* We free the struct we malloc'ed, but not the FILE_T/dumper in it of course */
static int File__gc(lua_State* L _U_) {
static int File__gc(lua_State* L) {
File f = toFile(L,1);
if (f)
g_free(f);

View File

@ -109,7 +109,7 @@ WSLUA_METHOD FrameInfo_read_data(lua_State* L) {
}
/* free the struct we created, but not the phdr/buf it points to */
static int FrameInfo__gc(lua_State* L _U_) {
static int FrameInfo__gc(lua_State* L) {
FrameInfo fi = toFrameInfo(L,1);
if (fi)
g_free(fi);
@ -319,7 +319,7 @@ WSLUA_METHOD FrameInfoConst_write_data(lua_State* L) {
}
/* free the struct we created, but not the wtap_pkthdr it points to */
static int FrameInfoConst__gc(lua_State* L _U_) {
static int FrameInfoConst__gc(lua_State* L) {
FrameInfoConst fi = toFrameInfoConst(L,1);
if (fi)
g_free(fi);

View File

@ -497,7 +497,7 @@ static int Proto_set_experts(lua_State* L) {
}
/* Gets registered as metamethod automatically by WSLUA_REGISTER_CLASS/META */
static int Proto__gc(lua_State* L _U_) {
static int Proto__gc(lua_State* L) {
/* Proto is registered twice, once in protocols_table_ref and once returned from Proto_new.
* It will not be freed unless deregistered.
*/
@ -758,7 +758,7 @@ int Proto_commit(lua_State* L) {
static guint
wslua_dissect_tcp_get_pdu_len(packet_info *pinfo, tvbuff_t *tvb,
int offset, void *data _U_)
int offset, void *data)
{
func_saver_t* fs = (func_saver_t*)data;
lua_State* L = fs->state;

View File

@ -195,7 +195,12 @@ get_mergecap_compiled_info(GString *str)
}
static void
get_mergecap_runtime_info(GString *str _U_)
get_mergecap_runtime_info(
#if defined(HAVE_LIBZ) && !defined(_WIN32)
GString *str)
#else
GString *str _U_)
#endif
{
/* zlib */
#if defined(HAVE_LIBZ) && !defined(_WIN32)

View File

@ -184,7 +184,7 @@ seq_analysis_frame_packet( void *ptr, packet_info *pinfo, epan_dissect_t *edt _U
/* whenever a TCP packet is seen by the tap listener */
/* Add a new tcp frame into the graph */
static gboolean
seq_analysis_tcp_packet( void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const void *tcp_info)
seq_analysis_tcp_packet( void *ptr, packet_info *pinfo, epan_dissect_t *edt _U_, const void *tcp_info)
{
seq_analysis_info_t *sainfo = (seq_analysis_info_t *) ptr;
const struct tcpheader *tcph = (const struct tcpheader *)tcp_info;

View File

@ -362,7 +362,7 @@ add_to_graph(voip_calls_tapinfo_t *tapinfo, packet_info *pinfo, epan_dissect_t *
/****************************************************************************/
/* Append str to frame_label and comment in a graph item */
/* return 0 if the frame_num is not in the graph list */
static int append_to_frame_graph(voip_calls_tapinfo_t *tapinfo _U_, guint32 frame_num, const gchar *new_frame_label, const gchar *new_comment)
static int append_to_frame_graph(voip_calls_tapinfo_t *tapinfo, guint32 frame_num, const gchar *new_frame_label, const gchar *new_comment)
{
seq_analysis_item_t *gai=NULL;
gchar *frame_label = NULL;
@ -391,7 +391,7 @@ static int append_to_frame_graph(voip_calls_tapinfo_t *tapinfo _U_, guint32 fram
/****************************************************************************/
/* Change the frame_label and comment in a graph item if not NULL*/
/* return 0 if the frame_num is not in the graph list */
static int change_frame_graph(voip_calls_tapinfo_t *tapinfo _U_, guint32 frame_num, const gchar *new_frame_label, const gchar *new_comment)
static int change_frame_graph(voip_calls_tapinfo_t *tapinfo, guint32 frame_num, const gchar *new_frame_label, const gchar *new_comment)
{
seq_analysis_item_t *gai=NULL;
gchar *frame_label = NULL;
@ -419,7 +419,7 @@ static int change_frame_graph(voip_calls_tapinfo_t *tapinfo _U_, guint32 frame_n
/****************************************************************************/
/* Change all the graph items with call_num to new_call_num */
static guint change_call_num_graph(voip_calls_tapinfo_t *tapinfo _U_, guint16 call_num, guint16 new_call_num)
static guint change_call_num_graph(voip_calls_tapinfo_t *tapinfo, guint16 call_num, guint16 new_call_num)
{
seq_analysis_item_t *gai;
GList *list;