提交 95374eda authored 作者: Michael Jerris's avatar Michael Jerris

constify the fmt string on all printf like functions

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4249 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 c3bcb585
...@@ -67,7 +67,7 @@ SWITCH_DECLARE(void) switch_console_printf(switch_text_channel_t channel, const ...@@ -67,7 +67,7 @@ SWITCH_DECLARE(void) switch_console_printf(switch_text_channel_t channel, const
/*! /*!
\brief A method akin to printf for dealing with api streams \brief A method akin to printf for dealing with api streams
*/ */
SWITCH_DECLARE(switch_status_t) switch_console_stream_write(switch_stream_handle_t *handle, char *fmt, ...) PRINTF_FUNCTION(2,3); SWITCH_DECLARE(switch_status_t) switch_console_stream_write(switch_stream_handle_t *handle, const char *fmt, ...) PRINTF_FUNCTION(2,3);
SWITCH_END_EXTERN_C SWITCH_END_EXTERN_C
#endif #endif
......
...@@ -172,7 +172,7 @@ SWITCH_DECLARE(char *) switch_event_get_body(switch_event_t *event); ...@@ -172,7 +172,7 @@ SWITCH_DECLARE(char *) switch_event_get_body(switch_event_t *event);
\param fmt the value of the header (varargs see standard sprintf family) \param fmt the value of the header (varargs see standard sprintf family)
\return SWITCH_STATUS_SUCCESS if the header was added \return SWITCH_STATUS_SUCCESS if the header was added
*/ */
SWITCH_DECLARE(switch_status_t) switch_event_add_header(switch_event_t *event, switch_stack_t stack, char *header_name, char *fmt, ...) PRINTF_FUNCTION(4,5); SWITCH_DECLARE(switch_status_t) switch_event_add_header(switch_event_t *event, switch_stack_t stack, const char *header_name, const char *fmt, ...) PRINTF_FUNCTION(4,5);
/*! /*!
\brief Destroy an event \brief Destroy an event
...@@ -251,7 +251,7 @@ SWITCH_DECLARE(switch_status_t) switch_event_serialize(switch_event_t *event, ch ...@@ -251,7 +251,7 @@ SWITCH_DECLARE(switch_status_t) switch_event_serialize(switch_event_t *event, ch
\return the xml object if the operation was successful \return the xml object if the operation was successful
\note the body supplied by this function will supersede an existing body the event may have \note the body supplied by this function will supersede an existing body the event may have
*/ */
SWITCH_DECLARE(switch_xml_t) switch_event_xmlize(switch_event_t *event, char *fmt, ...) PRINTF_FUNCTION(2,3); SWITCH_DECLARE(switch_xml_t) switch_event_xmlize(switch_event_t *event, const char *fmt, ...) PRINTF_FUNCTION(2,3);
/*! /*!
\brief Determine if the event system has been initilized \brief Determine if the event system has been initilized
...@@ -266,7 +266,7 @@ SWITCH_DECLARE(switch_status_t) switch_event_running(void); ...@@ -266,7 +266,7 @@ SWITCH_DECLARE(switch_status_t) switch_event_running(void);
\return SWITCH_STATUS_SUCCESS if the body was added to the event \return SWITCH_STATUS_SUCCESS if the body was added to the event
\note the body parameter can be shadowed by the switch_event_reserve_subclass_detailed function \note the body parameter can be shadowed by the switch_event_reserve_subclass_detailed function
*/ */
SWITCH_DECLARE(switch_status_t) switch_event_add_body(switch_event_t *event, char *fmt, ...) PRINTF_FUNCTION(2,3); SWITCH_DECLARE(switch_status_t) switch_event_add_body(switch_event_t *event, const char *fmt, ...) PRINTF_FUNCTION(2,3);
/*! /*!
......
...@@ -94,7 +94,7 @@ SWITCH_DECLARE(switch_status_t) switch_log_shutdown(void); ...@@ -94,7 +94,7 @@ SWITCH_DECLARE(switch_status_t) switch_log_shutdown(void);
\param ... variable args \param ... variable args
\note there are channel macros to supply the first 4 parameters \note there are channel macros to supply the first 4 parameters
*/ */
SWITCH_DECLARE(void) switch_log_printf(switch_text_channel_t channel, const char *file, const char *func, int line, switch_log_level_t level, char *fmt, ...) PRINTF_FUNCTION(6,7); SWITCH_DECLARE(void) switch_log_printf(switch_text_channel_t channel, const char *file, const char *func, int line, switch_log_level_t level, const char *fmt, ...) PRINTF_FUNCTION(6,7);
/*! /*!
\brief Shut down the logging engine \brief Shut down the logging engine
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
#define CMD_BUFLEN 1024; #define CMD_BUFLEN 1024;
SWITCH_DECLARE(switch_status_t) switch_console_stream_write(switch_stream_handle_t *handle, char *fmt, ...) SWITCH_DECLARE(switch_status_t) switch_console_stream_write(switch_stream_handle_t *handle, const char *fmt, ...)
{ {
va_list ap; va_list ap;
char *buf = handle->data; char *buf = handle->data;
......
...@@ -474,8 +474,8 @@ SWITCH_DECLARE(char *) switch_event_get_body(switch_event_t *event) ...@@ -474,8 +474,8 @@ SWITCH_DECLARE(char *) switch_event_get_body(switch_event_t *event)
return NULL; return NULL;
} }
SWITCH_DECLARE(switch_status_t) switch_event_add_header(switch_event_t *event, switch_stack_t stack, char *header_name, SWITCH_DECLARE(switch_status_t) switch_event_add_header(switch_event_t *event, switch_stack_t stack, const char *header_name,
char *fmt, ...) const char *fmt, ...)
{ {
int ret = 0; int ret = 0;
char data[2048]; char data[2048];
...@@ -516,7 +516,7 @@ SWITCH_DECLARE(switch_status_t) switch_event_add_header(switch_event_t *event, s ...@@ -516,7 +516,7 @@ SWITCH_DECLARE(switch_status_t) switch_event_add_header(switch_event_t *event, s
} }
SWITCH_DECLARE(switch_status_t) switch_event_add_body(switch_event_t *event, char *fmt, ...) SWITCH_DECLARE(switch_status_t) switch_event_add_body(switch_event_t *event, const char *fmt, ...)
{ {
int ret = 0; int ret = 0;
char *data; char *data;
...@@ -729,7 +729,7 @@ static switch_xml_t add_xml_header(switch_xml_t xml, char *name, char *value, in ...@@ -729,7 +729,7 @@ static switch_xml_t add_xml_header(switch_xml_t xml, char *name, char *value, in
return header; return header;
} }
SWITCH_DECLARE(switch_xml_t) switch_event_xmlize(switch_event_t *event, char *fmt, ...) SWITCH_DECLARE(switch_xml_t) switch_event_xmlize(switch_event_t *event, const char *fmt, ...)
{ {
switch_event_header_t *hp; switch_event_header_t *hp;
char *data = NULL, *body = NULL; char *data = NULL, *body = NULL;
......
...@@ -162,7 +162,7 @@ static void *SWITCH_THREAD_FUNC log_thread(switch_thread_t *thread, void *obj) ...@@ -162,7 +162,7 @@ static void *SWITCH_THREAD_FUNC log_thread(switch_thread_t *thread, void *obj)
return NULL; return NULL;
} }
SWITCH_DECLARE(void) switch_log_printf(switch_text_channel_t channel, const char *file, const char *func, int line, switch_log_level_t level, char *fmt, ...) SWITCH_DECLARE(void) switch_log_printf(switch_text_channel_t channel, const char *file, const char *func, int line, switch_log_level_t level, const char *fmt, ...)
{ {
char *data = NULL; char *data = NULL;
char *new_fmt = NULL; char *new_fmt = NULL;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论