aboutsummaryrefslogtreecommitdiffstats
path: root/utils
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 /utils
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 'utils')
-rw-r--r--utils/astman.c4
-rw-r--r--utils/check_expr.c4
-rw-r--r--utils/conf2ael.c2
-rw-r--r--utils/extconf.c26
-rw-r--r--utils/frame.c10
5 files changed, 23 insertions, 23 deletions
diff --git a/utils/astman.c b/utils/astman.c
index 9c659cd86..71956410b 100644
--- a/utils/astman.c
+++ b/utils/astman.c
@@ -147,7 +147,7 @@ static void del_chan(char *name)
}
-static void __attribute__((format (printf, 2, 3))) fdprintf(int fd, char *fmt, ...)
+static void __attribute__((format(printf, 2, 3))) fdprintf(int fd, char *fmt, ...)
{
char stuff[4096];
va_list ap;
@@ -417,7 +417,7 @@ static struct message *wait_for_response(int timeout)
}
-static int __attribute__((format (printf, 2, 3))) manager_action(char *action, char *fmt, ...)
+static int __attribute__((format(printf, 2, 3))) manager_action(char *action, char *fmt, ...)
{
struct ast_mansession *s;
char tmp[4096];
diff --git a/utils/check_expr.c b/utils/check_expr.c
index 7b013f163..7dab4f23a 100644
--- a/utils/check_expr.c
+++ b/utils/check_expr.c
@@ -40,7 +40,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
* ast_str_set_va(...)
* ast_str_append_va(...)
*/
-int __attribute__((format (printf, 4, 0))) __ast_str_helper(struct ast_str **buf, size_t max_len,
+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)
{
int res, need;
@@ -125,7 +125,7 @@ struct varz *global_varlist;
/* Our own version of ast_log, since the expr parser uses it. */
-void ast_log(int level, const char *file, int line, const char *function, const char *fmt, ...) __attribute__ ((format (printf,5,6)));
+void ast_log(int level, const char *file, int line, const char *function, const char *fmt, ...) __attribute__((format(printf,5,6)));
void ast_log(int level, const char *file, int line, const char *function, const char *fmt, ...)
{
diff --git a/utils/conf2ael.c b/utils/conf2ael.c
index 03d7105d6..9957078d0 100644
--- a/utils/conf2ael.c
+++ b/utils/conf2ael.c
@@ -92,7 +92,7 @@ void ast_unregister_file_version(const char *file)
int ast_add_profile(const char *x, uint64_t scale) { return 0;}
#endif
/* Our own version of ast_log, since the expr parser uses it. -- stolen from utils/check_expr.c */
-void ast_log(int level, const char *file, int line, const char *function, const char *fmt, ...) __attribute__ ((format (printf,5,6)));
+void ast_log(int level, const char *file, int line, const char *function, const char *fmt, ...) __attribute__((format(printf,5,6)));
void ast_log(int level, const char *file, int line, const char *function, const char *fmt, ...)
{
diff --git a/utils/extconf.c b/utils/extconf.c
index 5003a5c6a..d595c2c7b 100644
--- a/utils/extconf.c
+++ b/utils/extconf.c
@@ -89,10 +89,10 @@ struct ast_channel
void ast_backtrace(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)));
+ __attribute__((format(printf, 5, 6)));
/* IN CONFLICT: void ast_verbose(const char *fmt, ...)
- __attribute__ ((format (printf, 1, 2))); */
+ __attribute__((format(printf, 1, 2))); */
int ast_register_verbose(void (*verboser)(const char *string));
int ast_unregister_verbose(void (*verboser)(const char *string));
@@ -666,11 +666,11 @@ static inline int ast_cond_timedwait(ast_cond_t *cond, ast_mutex_t *t, const str
constructors/destructors to create/destroy mutexes. */
#define __AST_MUTEX_DEFINE(scope, mutex) \
scope ast_mutex_t mutex = AST_MUTEX_INIT_VALUE; \
-static void __attribute__ ((constructor)) init_##mutex(void) \
+static void __attribute__((constructor)) init_##mutex(void) \
{ \
ast_mutex_init(&mutex); \
} \
-static void __attribute__ ((destructor)) fini_##mutex(void) \
+static void __attribute__((destructor)) fini_##mutex(void) \
{ \
ast_mutex_destroy(&mutex); \
}
@@ -754,11 +754,11 @@ static inline int ast_rwlock_trywrlock(ast_rwlock_t *prwlock)
#ifndef HAVE_PTHREAD_RWLOCK_INITIALIZER
#define __AST_RWLOCK_DEFINE(scope, rwlock) \
scope ast_rwlock_t rwlock; \
-static void __attribute__ ((constructor)) init_##rwlock(void) \
+static void __attribute__((constructor)) init_##rwlock(void) \
{ \
ast_rwlock_init(&rwlock); \
} \
-static void __attribute__ ((destructor)) fini_##rwlock(void) \
+static void __attribute__((destructor)) fini_##rwlock(void) \
{ \
ast_rwlock_destroy(&rwlock); \
}
@@ -1074,7 +1074,7 @@ char * attribute_malloc _ast_strndup(const char *str, size_t len, const char *fi
_ast_asprintf((ret), __FILE__, __LINE__, __PRETTY_FUNCTION__, fmt, __VA_ARGS__)
AST_INLINE_API(
-__attribute__((format (printf, 5, 6)))
+__attribute__((format(printf, 5, 6)))
int _ast_asprintf(char **ret, const char *file, int lineno, const char *func, const char *fmt, ...),
{
int res;
@@ -1101,7 +1101,7 @@ int _ast_asprintf(char **ret, const char *file, int lineno, const char *func, co
_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;
@@ -2014,11 +2014,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); \
} \
@@ -2056,11 +2056,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); \
} \
@@ -2671,7 +2671,7 @@ static void ast_log(int level, const char *file, int line, const char *function,
va_end(vars);
}
-void __attribute__((format (printf, 1, 2))) ast_verbose(const char *fmt, ...)
+void __attribute__((format(printf, 1, 2))) ast_verbose(const char *fmt, ...)
{
va_list vars;
va_start(vars,fmt);
diff --git a/utils/frame.c b/utils/frame.c
index c598f57cb..67fa8483e 100644
--- a/utils/frame.c
+++ b/utils/frame.c
@@ -968,7 +968,7 @@ int workloop( FILE *theinfile, FILE *theoutfile,
return TRUE; /* Input file done with, no errors. */
}
-int __attribute__((format (printf,1,2))) chat( const char *format, ...)
+int __attribute__((format(printf,1,2))) chat( const char *format, ...)
{
va_list ap;
int result = 0;
@@ -982,7 +982,7 @@ int __attribute__((format (printf,1,2))) chat( const char *format, ...)
return result;
}
-int __attribute__((format (printf,1,2))) inform( const char *format, ...)
+int __attribute__((format(printf,1,2))) inform( const char *format, ...)
{
va_list ap;
int result = 0;
@@ -996,7 +996,7 @@ int __attribute__((format (printf,1,2))) inform( const char *format, ...)
return result;
}
-int __attribute__((format (printf,1,2))) error( const char *format, ...)
+int __attribute__((format(printf,1,2))) error( const char *format, ...)
{
va_list ap;
int result;
@@ -1007,7 +1007,7 @@ int __attribute__((format (printf,1,2))) error( const char *format, ...)
return result;
}
-void __attribute__((format (printf,1,2))) fatalerror( const char *format, ...)
+void __attribute__((format(printf,1,2))) fatalerror( const char *format, ...)
{
va_list ap;
@@ -1023,7 +1023,7 @@ void fatalperror( const char *string)
myexit( 1);
}
-int __attribute__((format (printf,1,2))) say( const char *format, ...)
+int __attribute__((format(printf,1,2))) say( const char *format, ...)
{
va_list ap;
int result;