Skip to content

Commit

Permalink
Changed from using own defined GNUC_FORMAT_CHECK to G_GNUC_PRINTF
Browse files Browse the repository at this point in the history
defined in GLib.  Removed epan/gnuc_format_check.h.

svn path=/trunk/; revision=31657
  • Loading branch information
stigbjorlykke committed Jan 25, 2010
1 parent 2b5f360 commit 9092486
Show file tree
Hide file tree
Showing 10 changed files with 62 additions and 110 deletions.
6 changes: 2 additions & 4 deletions cmdarg_err.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,17 @@
extern "C" {
#endif /* __cplusplus */

#include <epan/gnuc_format_check.h>

/*
* Report an error in command-line arguments.
*/
extern void cmdarg_err(const char *fmt, ...)
GNUC_FORMAT_CHECK(printf, 1, 2);
G_GNUC_PRINTF(1, 2);

/*
* Report additional information for an error in command-line arguments.
*/
extern void cmdarg_err_cont(const char *fmt, ...)
GNUC_FORMAT_CHECK(printf, 1, 2);
G_GNUC_PRINTF(1, 2);

#ifdef __cplusplus
}
Expand Down
4 changes: 2 additions & 2 deletions doxygen_global.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -850,14 +850,14 @@ INCLUDE_FILE_PATTERNS =
# or name=definition (no spaces). If the definition and the = are
# omitted =1 is assumed.

PREDEFINED = GNUC_FORMAT_CHECK(a,b,c) HAVE_LIBPCAP _U_=
PREDEFINED = G_GNUC_MALLOC G_GNUC_PRINTF(a,b) HAVE_LIBPCAP _U_=

# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
# this tag can be used to specify a list of macro names that should be expanded.
# The macro definition that is found in the sources will be used.
# Use the PREDEFINED tag if you want to use a different macro definition.

EXPAND_AS_DEFINED = GNUC_FORMAT_CHECK
EXPAND_AS_DEFINED = G_GNUC_MALLOC G_GNUC_PRINTF

# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
# doxygen's preprocessor will remove all function-like macros that are alone
Expand Down
11 changes: 5 additions & 6 deletions epan/column-utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@

#include <glib.h>

#include "gnuc_format_check.h"
#include "column_info.h"
#include "packet_info.h"
#include <epan/epan.h>
Expand Down Expand Up @@ -147,7 +146,7 @@ extern void col_add_str(column_info *cinfo, gint col, const gchar *str);
* @param ... the variable number of parameters
*/
extern void col_add_fstr(column_info *cinfo, gint col, const gchar *format, ...)
GNUC_FORMAT_CHECK(printf, 3, 4);
G_GNUC_PRINTF(3, 4);

/* For internal Wireshark use only. Not to be called from dissectors. */
void col_custom_set_edt(epan_dissect_t *edt, column_info *cinfo);
Expand Down Expand Up @@ -178,7 +177,7 @@ extern void col_append_str(column_info *cinfo, gint col, const gchar *str);
* @param ... the variable number of parameters
*/
extern void col_append_fstr(column_info *cinfo, gint col, const gchar *format, ...)
GNUC_FORMAT_CHECK(printf, 3, 4);
G_GNUC_PRINTF(3, 4);

/** Prepend the given text to a column element, the text will be formatted and copied.
*
Expand All @@ -188,7 +187,7 @@ extern void col_append_fstr(column_info *cinfo, gint col, const gchar *format, .
* @param ... the variable number of parameters
*/
extern void col_prepend_fstr(column_info *cinfo, gint col, const gchar *format, ...)
GNUC_FORMAT_CHECK(printf, 3, 4);
G_GNUC_PRINTF(3, 4);

/**Prepend the given text to a column element, the text will be formatted and copied.
* This function is similar to col_prepend_fstr() but this function will
Expand All @@ -199,7 +198,7 @@ extern void col_prepend_fstr(column_info *cinfo, gint col, const gchar *format,
* it does not yet exist.
*/
extern void col_prepend_fence_fstr(column_info *cinfo, gint col, const gchar *format, ...)
GNUC_FORMAT_CHECK(printf, 3, 4);
G_GNUC_PRINTF(3, 4);

/** Append the given text (prepended by a separator) to a column element.
*
Expand All @@ -225,7 +224,7 @@ extern void col_append_sep_str(column_info *cinfo, gint col, const gchar *sep,
*/
extern void col_append_sep_fstr(column_info *cinfo, gint col, const gchar *sep,
const gchar *format, ...)
GNUC_FORMAT_CHECK(printf, 4, 5);
G_GNUC_PRINTF(4, 5);

/** Set the given (relative) time to a column element.
*
Expand Down
5 changes: 2 additions & 3 deletions epan/dissectors/packet-ssl-utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#include <glib.h>
#include <epan/packet.h>
#include <epan/emem.h>
#include <epan/gnuc_format_check.h>
#include <epan/value_string.h>

#ifdef HAVE_LIBGNUTLS
Expand Down Expand Up @@ -486,7 +485,7 @@ ssl_is_valid_content_type(guint8 type);

#ifdef SSL_DECRYPT_DEBUG
extern void
ssl_debug_printf(const gchar* fmt,...) GNUC_FORMAT_CHECK(printf,1,2);
ssl_debug_printf(const gchar* fmt,...) G_GNUC_PRINTF(1,2);
extern void
ssl_print_data(const gchar* name, const guchar* data, size_t len);
extern void
Expand All @@ -500,7 +499,7 @@ ssl_debug_flush(void);
#else

/* No debug: nullify debug operation*/
static inline void GNUC_FORMAT_CHECK(printf,1,2)
static inline void G_GNUC_PRINTF(1,2)
ssl_debug_printf(const gchar* fmt _U_,...)
{
}
Expand Down
2 changes: 1 addition & 1 deletion epan/dissectors/packet-zbee-zdp.h
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ extern const gchar *zdp_status_name (guint8 status);
extern void zdp_dump_excess (tvbuff_t *tvb, guint offset, packet_info *pinfo, proto_tree *tree);
extern guint zbee_parse_uint (proto_tree *tree, int hfindex, tvbuff_t *tvb, guint *offset, guint length, proto_item **ti);
extern guint64 zbee_parse_eui64 (proto_tree *tree, int hfindex, tvbuff_t *tvb, guint *offset, guint length, proto_item **ti);
extern void zbee_append_info (proto_item *item, packet_info *pinfo, const gchar *format, ...) GNUC_FORMAT_CHECK(printf, 3, 4);
extern void zbee_append_info (proto_item *item, packet_info *pinfo, const gchar *format, ...) G_GNUC_PRINTF(3, 4);

extern void zdp_parse_node_desc (proto_tree *tree, gint ettindex, tvbuff_t *tvb, guint *offset, packet_info *pinfo);
extern void zdp_parse_power_desc (proto_tree *tree, gint ettindex, tvbuff_t *tvb, guint *offset);
Expand Down
11 changes: 5 additions & 6 deletions epan/emem.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#define __EMEM_H__

#include "g_gnuc_malloc.h"
#include "gnuc_format_check.h"

/* Initialize all the memory allocation pools described below.
* This function must be called once when *shark initialize to set up the
Expand Down Expand Up @@ -67,7 +66,7 @@ void* ep_memdup(const void* src, size_t len) G_GNUC_MALLOC;
/* Create a formatted string with a packet lifetime scope */
gchar* ep_strdup_vprintf(const gchar* fmt, va_list ap) G_GNUC_MALLOC;
gchar* ep_strdup_printf(const gchar* fmt, ...)
G_GNUC_MALLOC GNUC_FORMAT_CHECK(printf, 1, 2);
G_GNUC_MALLOC G_GNUC_PRINTF(1, 2);

/* allocates with a packet lifetime scope an array of type made of num elements */
#define ep_alloc_array(type,num) (type*)ep_alloc(sizeof(type)*(num))
Expand Down Expand Up @@ -150,7 +149,7 @@ void* se_memdup(const void* src, size_t len) G_GNUC_MALLOC;
/* Create a formatted string with a capture lifetime scope */
gchar* se_strdup_vprintf(const gchar* fmt, va_list ap) G_GNUC_MALLOC;
gchar* se_strdup_printf(const gchar* fmt, ...)
G_GNUC_MALLOC GNUC_FORMAT_CHECK(printf, 1, 2);
G_GNUC_MALLOC G_GNUC_PRINTF(1, 2);

/* allocates with a capture lifetime scope an array of type made of num elements */
#define se_alloc_array(type,num) (type*)se_alloc(sizeof(type)*(num))
Expand Down Expand Up @@ -423,7 +422,7 @@ void ep_strbuf_append_vprintf(emem_strbuf_t *strbuf, const gchar *format, va_lis
* @param format A printf-style string format.
*/
void ep_strbuf_printf(emem_strbuf_t *strbuf, const gchar *format, ...)
GNUC_FORMAT_CHECK(printf, 2, 3);
G_GNUC_PRINTF(2, 3);

/**
* Append printf-style formatted text to a string buffer.
Expand All @@ -432,7 +431,7 @@ void ep_strbuf_printf(emem_strbuf_t *strbuf, const gchar *format, ...)
* @param format A printf-style string format.
*/
void ep_strbuf_append_printf(emem_strbuf_t *strbuf, const gchar *format, ...)
GNUC_FORMAT_CHECK(printf, 2, 3);
G_GNUC_PRINTF(2, 3);

/**
* Append a string to a string buffer.
Expand Down Expand Up @@ -478,7 +477,7 @@ void emem_print_tree(emem_tree_t* emem_tree);

#ifdef DEBUG_INTENSE_CANARY_CHECKS
void ep_check_canary_integrity(const char* fmt, ...)
GNUC_FORMAT_CHECK(printf, 1, 2);
G_GNUC_PRINTF(1, 2);
#define EP_CHECK_CANARY(args) ep_check_canary_integrity args
#else
#define EP_CHECK_CANARY(args)
Expand Down
3 changes: 1 addition & 2 deletions epan/expert.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#ifndef __EXPERT_H__
#define __EXPERT_H__

#include "gnuc_format_check.h"
#include <epan/proto.h>
#include "value_string.h"

Expand Down Expand Up @@ -65,6 +64,6 @@ expert_get_highest_severity(void);
extern void
expert_add_info_format(packet_info *pinfo, proto_item *pi, int group,
int severity, const char *format, ...)
GNUC_FORMAT_CHECK(printf, 5, 6);
G_GNUC_PRINTF(5, 6);

#endif /* __EXPERT_H__ */
39 changes: 0 additions & 39 deletions epan/gnuc_format_check.h

This file was deleted.

Loading

0 comments on commit 9092486

Please sign in to comment.