aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2008-11-29 18:37:55 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2008-11-29 18:37:55 +0000
commit62b54302827f550b90a3d68e5f5b75d160efb44d (patch)
tree7ade12cd30f2b6e7392fd122d0b9588c8016e049 /include
parent0a34e6f22dccc7db900606ad35fe041cb9c5112d (diff)
Merged revisions 159818 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ........ r159818 | kpfleming | 2008-11-29 11:57:39 -0600 (Sat, 29 Nov 2008) | 18 lines incorporates r159808 from branches/1.4: ------------------------------------------------------------------------ r159808 | kpfleming | 2008-11-29 10:58:29 -0600 (Sat, 29 Nov 2008) | 7 lines update dev-mode compiler flags to match the ones used by default on Ubuntu Intrepid, so all developers will see the same warnings and errors since this branch already had some printf format attributes, enable checking for them and tag functions that didn't have them format attributes in a consistent way ------------------------------------------------------------------------ in addition: move some format attributes from main/utils.c to the header files they belong in, and fix up references to the relevant functions based on new compiler warnings ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@159855 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include')
-rw-r--r--include/asterisk/astmm.h4
-rw-r--r--include/asterisk/channel.h2
-rw-r--r--include/asterisk/cli.h2
-rw-r--r--include/asterisk/compat.h4
-rw-r--r--include/asterisk/devicestate.h4
-rw-r--r--include/asterisk/dundi.h14
-rw-r--r--include/asterisk/enum.h2
-rw-r--r--include/asterisk/linkedlists.h8
-rw-r--r--include/asterisk/logger.h5
-rw-r--r--include/asterisk/manager.h4
-rw-r--r--include/asterisk/module.h8
-rw-r--r--include/asterisk/res_odbc.h2
-rw-r--r--include/asterisk/stringfields.h4
-rw-r--r--include/asterisk/strings.h12
-rw-r--r--include/asterisk/utils.h4
-rw-r--r--include/jitterbuf.h2
16 files changed, 40 insertions, 41 deletions
diff --git a/include/asterisk/astmm.h b/include/asterisk/astmm.h
index 5d0d47ff5..553587942 100644
--- a/include/asterisk/astmm.h
+++ b/include/asterisk/astmm.h
@@ -51,9 +51,9 @@ void *__ast_realloc(void *ptr, size_t size, const char *file, int lineno, const
char *__ast_strdup(const char *s, const char *file, int lineno, const char *func);
char *__ast_strndup(const char *s, size_t n, const char *file, int lineno, const char *func);
int __ast_asprintf(const char *file, int lineno, const char *func, char **strp, const char *format, ...)
- __attribute__ ((format (printf, 5, 6)));
+ __attribute__((format(printf, 5, 6)));
int __ast_vasprintf(char **strp, const char *format, va_list ap, const char *file, int lineno, const char *func)
- __attribute__ ((format (printf, 2, 0)));
+ __attribute__((format(printf, 2, 0)));
void __ast_mm_init(void);
diff --git a/include/asterisk/channel.h b/include/asterisk/channel.h
index 324fab996..1b67f0a13 100644
--- a/include/asterisk/channel.h
+++ b/include/asterisk/channel.h
@@ -727,7 +727,7 @@ int ast_setstate(struct ast_channel *chan, enum ast_channel_state);
* \note By default, new channels are set to the "s" extension
* and "default" context.
*/
-struct ast_channel *ast_channel_alloc(int needqueue, int state, const char *cid_num, const char *cid_name, const char *acctcode, const char *exten, const char *context, const int amaflag, const char *name_fmt, ...);
+struct ast_channel *ast_channel_alloc(int needqueue, int state, const char *cid_num, const char *cid_name, const char *acctcode, const char *exten, const char *context, const int amaflag, const char *name_fmt, ...) __attribute__((format(printf, 9, 10)));
/*!
* \brief Queue an outgoing frame
diff --git a/include/asterisk/cli.h b/include/asterisk/cli.h
index 854c189ff..7e50e3392 100644
--- a/include/asterisk/cli.h
+++ b/include/asterisk/cli.h
@@ -30,7 +30,7 @@ extern "C" {
#include "asterisk/linkedlists.h"
void ast_cli(int fd, const char *fmt, ...)
- __attribute__ ((format (printf, 2, 3)));
+ __attribute__((format(printf, 2, 3)));
#define RESULT_SUCCESS 0
#define RESULT_SHOWUSAGE 1
diff --git a/include/asterisk/compat.h b/include/asterisk/compat.h
index e481fbec4..41e5a6b8f 100644
--- a/include/asterisk/compat.h
+++ b/include/asterisk/compat.h
@@ -74,7 +74,7 @@
#endif
#if !defined(HAVE_ASPRINTF) && !defined(__AST_DEBUG_MALLOC)
-int __attribute__ ((format (printf, 2, 3))) asprintf(char **str, const char *fmt, ...);
+int __attribute__((format(printf, 2, 3))) asprintf(char **str, const char *fmt, ...);
#endif
#ifndef HAVE_GETLOADAVG
@@ -110,7 +110,7 @@ int unsetenv(const char *name);
#endif
#if !defined(HAVE_VASPRINTF) && !defined(__AST_DEBUG_MALLOC)
-int __attribute__ ((format (printf, 2, 0))) vasprintf(char **strp, const char *fmt, va_list ap);
+int __attribute__((format(printf, 2, 0))) vasprintf(char **strp, const char *fmt, va_list ap);
#endif
#ifndef HAVE_STRLCAT
diff --git a/include/asterisk/devicestate.h b/include/asterisk/devicestate.h
index d52430301..1b7cdd4c8 100644
--- a/include/asterisk/devicestate.h
+++ b/include/asterisk/devicestate.h
@@ -127,7 +127,7 @@ enum ast_device_state ast_device_state(const char *device);
* \retval -1 on failure
*/
int ast_devstate_changed(enum ast_device_state state, const char *fmt, ...)
- __attribute__ ((format (printf, 2, 3)));
+ __attribute__((format(printf, 2, 3)));
/*!
* \brief Tells Asterisk the State for Device is changed
@@ -158,7 +158,7 @@ int ast_devstate_changed_literal(enum ast_device_state state, const char *device
* \note This is deprecated in favor of ast_devstate_changed()
*/
int ast_device_state_changed(const char *fmt, ...)
- __attribute__ ((format (printf, 1, 2)));
+ __attribute__((format(printf, 1, 2)));
/*!
* \brief Tells Asterisk the State for Device is changed
diff --git a/include/asterisk/dundi.h b/include/asterisk/dundi.h
index e588338ae..2e9f822fd 100644
--- a/include/asterisk/dundi.h
+++ b/include/asterisk/dundi.h
@@ -43,13 +43,13 @@ struct dundi_hdr {
unsigned char cmdresp; /*!< Command / Response */
unsigned char cmdflags; /*!< Command / Response specific flags*/
unsigned char ies[0];
-} __attribute__ ((__packed__));
+} __attribute__((__packed__));
struct dundi_ie_hdr {
unsigned char ie;
unsigned char len;
unsigned char iedata[0];
-} __attribute__ ((__packed__));
+} __attribute__((__packed__));
#define DUNDI_FLAG_RETRANS (1 << 16) /*!< Applies to dtrans */
#define DUNDI_FLAG_RESERVED (1 << 16) /*!< Applies to strans */
@@ -78,7 +78,7 @@ struct dundi_ie_hdr {
struct dundi_encblock { /*!< AES-128 encrypted block */
unsigned char iv[16]; /*!< Initialization vector of random data */
unsigned char encdata[0]; /*!< Encrypted / compressed data */
-} __attribute__ ((__packed__));
+} __attribute__((__packed__));
struct dundi_answer {
dundi_eid eid; /*!< Original source of answer */
@@ -86,12 +86,12 @@ struct dundi_answer {
unsigned short flags; /*!< Flags relating to answer */
unsigned short weight; /*!< Weight of answers */
unsigned char data[0]; /*!< Protocol specific URI */
-} __attribute__ ((__packed__));
+} __attribute__((__packed__));
struct dundi_hint {
unsigned short flags; /*!< Flags relating to answer */
unsigned char data[0]; /*!< For data for hint */
-} __attribute__ ((__packed__));
+} __attribute__((__packed__));
#define DUNDI_CAUSE_SUCCESS 0 /*!< Success */
#define DUNDI_CAUSE_GENERAL 1 /*!< General unspecified failure */
@@ -105,14 +105,14 @@ struct dundi_hint {
struct dundi_cause {
unsigned char causecode; /*!< Numerical cause (DUNDI_CAUSE_*) */
char desc[0]; /*!< Textual description */
-} __attribute__ ((__packed__));
+} __attribute__((__packed__));
struct dundi_peer_status {
unsigned int flags;
unsigned short netlag;
unsigned short querylag;
dundi_eid peereid;
-} __attribute__ ((__packed__));
+} __attribute__((__packed__));
#define DUNDI_PEER_PRIMARY (1 << 0)
#define DUNDI_PEER_SECONDARY (1 << 1)
diff --git a/include/asterisk/enum.h b/include/asterisk/enum.h
index d6bbea294..84e8797d5 100644
--- a/include/asterisk/enum.h
+++ b/include/asterisk/enum.h
@@ -28,7 +28,7 @@
struct naptr {
unsigned short order;
unsigned short pref;
-} __attribute__ ((__packed__));
+} __attribute__((__packed__));
struct enum_naptr_rr {
struct naptr naptr; /*!< order and preference of RR */
diff --git a/include/asterisk/linkedlists.h b/include/asterisk/linkedlists.h
index 1f3285dfa..ff23e8f1b 100644
--- a/include/asterisk/linkedlists.h
+++ b/include/asterisk/linkedlists.h
@@ -248,11 +248,11 @@ struct name { \
struct type *last; \
ast_mutex_t lock; \
} name; \
-static void __attribute__ ((constructor)) __init_##name(void) \
+static void __attribute__((constructor)) __init_##name(void) \
{ \
AST_LIST_HEAD_INIT(&name); \
} \
-static void __attribute__ ((destructor)) __fini_##name(void) \
+static void __attribute__((destructor)) __fini_##name(void) \
{ \
AST_LIST_HEAD_DESTROY(&name); \
} \
@@ -290,11 +290,11 @@ struct name { \
struct type *last; \
ast_rwlock_t lock; \
} name; \
-static void __attribute__ ((constructor)) __init_##name(void) \
+static void __attribute__((constructor)) __init_##name(void) \
{ \
AST_RWLIST_HEAD_INIT(&name); \
} \
-static void __attribute__ ((destructor)) __fini_##name(void) \
+static void __attribute__((destructor)) __fini_##name(void) \
{ \
AST_RWLIST_HEAD_DESTROY(&name); \
} \
diff --git a/include/asterisk/logger.h b/include/asterisk/logger.h
index d76aa932f..cab62f4dd 100644
--- a/include/asterisk/logger.h
+++ b/include/asterisk/logger.h
@@ -58,15 +58,14 @@ extern "C" {
*/
void ast_log(int level, const char *file, int line, const char *function, const char *fmt, ...)
- __attribute__ ((format (printf, 5, 6)));
+ __attribute__((format(printf, 5, 6)));
void ast_backtrace(void);
/*! \brief Reload logger without rotating log files */
int logger_reload(void);
-void ast_queue_log(const char *queuename, const char *callid, const char *agent, const char *event, const char *fmt, ...)
- __attribute__ ((format (printf, 5, 6)));
+void __attribute__((format(printf, 5, 6))) ast_queue_log(const char *queuename, const char *callid, const char *agent, const char *event, const char *fmt, ...);
/*! Send a verbose message (based on verbose level)
\brief This works like ast_log, but prints verbose messages to the console depending on verbosity level set.
diff --git a/include/asterisk/manager.h b/include/asterisk/manager.h
index ecc047829..4bd071f4d 100644
--- a/include/asterisk/manager.h
+++ b/include/asterisk/manager.h
@@ -179,7 +179,7 @@ int astman_verify_session_writepermissions(uint32_t ident, int perm);
#define manager_event(category, event, contents , ...) \
__manager_event(category, event, __FILE__, __LINE__, __PRETTY_FUNCTION__, contents , ## __VA_ARGS__)
-int __attribute__ ((format(printf, 6, 7))) __manager_event(int category, const char *event,
+int __attribute__((format(printf, 6, 7))) __manager_event(int category, const char *event,
const char *file, int line, const char *func,
const char *contents, ...);
@@ -201,7 +201,7 @@ void astman_send_ack(struct mansession *s, const struct message *m, char *msg);
/*! \brief Send ack in manager list transaction */
void astman_send_listack(struct mansession *s, const struct message *m, char *msg, char *listflag);
-void __attribute__ ((format (printf, 2, 3))) astman_append(struct mansession *s, const char *fmt, ...);
+void __attribute__((format(printf, 2, 3))) astman_append(struct mansession *s, const char *fmt, ...);
/*! \brief Determinie if a manager session ident is authenticated */
int astman_is_authed(uint32_t ident);
diff --git a/include/asterisk/module.h b/include/asterisk/module.h
index bb58cb268..c30325294 100644
--- a/include/asterisk/module.h
+++ b/include/asterisk/module.h
@@ -250,11 +250,11 @@ void ast_module_unref(struct ast_module *);
flags_to_set, \
AST_BUILDOPT_SUM, \
}; \
- static void __attribute__ ((constructor)) __reg_module(void) \
+ static void __attribute__((constructor)) __reg_module(void) \
{ \
ast_module_register(&__mod_info); \
} \
- static void __attribute__ ((destructor)) __unreg_module(void) \
+ static void __attribute__((destructor)) __unreg_module(void) \
{ \
ast_module_unregister(&__mod_info); \
} \
@@ -344,11 +344,11 @@ static void __restore_globals(void)
.buildopt_sum = AST_BUILDOPT_SUM, \
fields \
}; \
- static void __attribute__ ((constructor)) __reg_module(void) \
+ static void __attribute__((constructor)) __reg_module(void) \
{ \
ast_module_register(&__mod_info); \
} \
- static void __attribute__ ((destructor)) __unreg_module(void) \
+ static void __attribute__((destructor)) __unreg_module(void) \
{ \
ast_module_unregister(&__mod_info); \
} \
diff --git a/include/asterisk/res_odbc.h b/include/asterisk/res_odbc.h
index 1defc816b..6a2bc7000 100644
--- a/include/asterisk/res_odbc.h
+++ b/include/asterisk/res_odbc.h
@@ -64,7 +64,7 @@ struct odbc_obj {
* This function really only ever worked with MySQL, where the statement handle is
* not prepared on the server. If you are not using MySQL, you should avoid it.
*/
-int ast_odbc_smart_execute(struct odbc_obj *obj, SQLHSTMT stmt) __attribute__ ((deprecated));
+int ast_odbc_smart_execute(struct odbc_obj *obj, SQLHSTMT stmt) __attribute__((deprecated));
/*!
* \brief Retrieves a connected ODBC object
diff --git a/include/asterisk/stringfields.h b/include/asterisk/stringfields.h
index b0cda6902..4b1847415 100644
--- a/include/asterisk/stringfields.h
+++ b/include/asterisk/stringfields.h
@@ -183,7 +183,7 @@ ast_string_field __ast_string_field_alloc_space(struct ast_string_field_mgr *mgr
*/
void __ast_string_field_ptr_build(struct ast_string_field_mgr *mgr,
struct ast_string_field_pool **pool_head,
- const ast_string_field *ptr, const char *format, ...);
+ const ast_string_field *ptr, const char *format, ...) __attribute((format(printf, 4, 5)));
/*!
\internal
@@ -198,7 +198,7 @@ void __ast_string_field_ptr_build(struct ast_string_field_mgr *mgr,
*/
void __ast_string_field_ptr_build_va(struct ast_string_field_mgr *mgr,
struct ast_string_field_pool **pool_head,
- const ast_string_field *ptr, const char *format, va_list a1, va_list a2);
+ const ast_string_field *ptr, const char *format, va_list a1, va_list a2) __attribute((format(printf, 4, 0)));
/*!
\brief Declare a string field
diff --git a/include/asterisk/strings.h b/include/asterisk/strings.h
index 4f5e326cf..8de2695ba 100644
--- a/include/asterisk/strings.h
+++ b/include/asterisk/strings.h
@@ -221,7 +221,7 @@ void ast_copy_string(char *dst, const char *src, size_t size),
\retval 0 on success
\retval non-zero on failure.
*/
-int ast_build_string(char **buffer, size_t *space, const char *fmt, ...) __attribute__ ((format (printf, 3, 4)));
+int ast_build_string(char **buffer, size_t *space, const char *fmt, ...) __attribute__((format(printf, 3, 4)));
/*!
\brief Build a string in a buffer, designed to be called repeatedly
@@ -235,7 +235,7 @@ int ast_build_string(char **buffer, size_t *space, const char *fmt, ...) __attri
\param fmt printf-style format string
\param ap varargs list of arguments for format
*/
-int ast_build_string_va(char **buffer, size_t *space, const char *fmt, va_list ap) __attribute__((format (printf, 3, 0)));
+int ast_build_string_va(char **buffer, size_t *space, const char *fmt, va_list ap) __attribute__((format(printf, 3, 0)));
/*!
* \brief Make sure something is true.
@@ -630,8 +630,8 @@ enum {
* through calling one of the other functions or macros defined in this
* file.
*/
-int __ast_str_helper(struct ast_str **buf, size_t max_len,
- int append, const char *fmt, va_list ap);
+int __attribute__((format(printf, 4, 0))) __ast_str_helper(struct ast_str **buf, size_t max_len,
+ int append, const char *fmt, va_list ap);
/*!
* \brief Set a dynamic string using variable arguments
@@ -651,7 +651,7 @@ int __ast_str_helper(struct ast_str **buf, size_t max_len,
* All the rest is the same as ast_str_set_va()
*/
AST_INLINE_API(
-int __attribute__ ((format (printf, 3, 4))) ast_str_set(
+int __attribute__((format(printf, 3, 4))) ast_str_set(
struct ast_str **buf, size_t max_len, const char *fmt, ...),
{
int res;
@@ -672,7 +672,7 @@ int __attribute__ ((format (printf, 3, 4))) ast_str_set(
* ast_str_set(), but the new data is appended to the current value.
*/
AST_INLINE_API(
-int __attribute__ ((format (printf, 3, 4))) ast_str_append(
+int __attribute__((format(printf, 3, 4))) ast_str_append(
struct ast_str **buf, size_t max_len, const char *fmt, ...),
{
int res;
diff --git a/include/asterisk/utils.h b/include/asterisk/utils.h
index b038711f3..d6b00b347 100644
--- a/include/asterisk/utils.h
+++ b/include/asterisk/utils.h
@@ -554,7 +554,7 @@ char * attribute_malloc _ast_strndup(const char *str, size_t len, const char *fi
#define ast_asprintf(ret, fmt, ...) \
_ast_asprintf((ret), __FILE__, __LINE__, __PRETTY_FUNCTION__, fmt, __VA_ARGS__)
-int __attribute__((format (printf, 5, 6)))
+int __attribute__((format(printf, 5, 6)))
_ast_asprintf(char **ret, const char *file, int lineno, const char *func, const char *fmt, ...);
/*!
@@ -569,7 +569,7 @@ int __attribute__((format (printf, 5, 6)))
_ast_vasprintf((ret), __FILE__, __LINE__, __PRETTY_FUNCTION__, (fmt), (ap))
AST_INLINE_API(
-__attribute__((format (printf, 5, 0)))
+__attribute__((format(printf, 5, 0)))
int _ast_vasprintf(char **ret, const char *file, int lineno, const char *func, const char *fmt, va_list ap),
{
int res;
diff --git a/include/jitterbuf.h b/include/jitterbuf.h
index 00f26e21c..6da11a65b 100644
--- a/include/jitterbuf.h
+++ b/include/jitterbuf.h
@@ -163,7 +163,7 @@ enum jb_return_code jb_getinfo(jitterbuf *jb, jb_info *stats);
/*! \brief set jitterbuf conf */
enum jb_return_code jb_setconf(jitterbuf *jb, jb_conf *conf);
-typedef void __attribute__((format (printf, 1, 2))) (*jb_output_function_t)(const char *fmt, ...);
+typedef void __attribute__((format(printf, 1, 2))) (*jb_output_function_t)(const char *fmt, ...);
void jb_setoutput(jb_output_function_t err, jb_output_function_t warn, jb_output_function_t dbg);
#ifdef __cplusplus