]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add functions param details for msvc code analysis.
authorMichael Jerris <mike@jerris.com>
Wed, 19 Dec 2007 15:36:07 +0000 (15:36 +0000)
committerMichael Jerris <mike@jerris.com>
Wed, 19 Dec 2007 15:36:07 +0000 (15:36 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6902 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/include/switch_log.h
src/include/switch_platform.h

index f9addc1d432afb82fc65586ccc07fbf430533f9c..f3b697bd4bc24496dde3dac6948727674ee3e210 100644 (file)
@@ -74,7 +74,7 @@ typedef switch_status_t (*switch_log_function_t) (const switch_log_node_t *node,
   \param pool the memory pool to use
   \note to be called at application startup by the core
 */
-SWITCH_DECLARE(switch_status_t) switch_log_init(switch_memory_pool_t *pool);
+SWITCH_DECLARE(switch_status_t) switch_log_init(_In_ switch_memory_pool_t *pool);
 
 /*! 
   \brief Shut down the logging engine
@@ -94,30 +94,32 @@ SWITCH_DECLARE(switch_status_t) switch_log_shutdown(void);
   \param ... variable args
   \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,
-                                                                          const char *userdata, switch_log_level_t level, const char *fmt, ...) PRINTF_FUNCTION(7, 8);
+SWITCH_DECLARE(void) switch_log_printf(_In_ switch_text_channel_t channel, _In_z_ const char *file,
+                                                                          _In_z_ const char *func, _In_ int line,
+                                                                          _In_opt_z_ const char *userdata, _In_ switch_log_level_t level,
+                                                                          _In_z_ _Printf_format_string_ const char *fmt, ...) PRINTF_FUNCTION(7, 8);
 
 /*! 
   \brief Shut down  the logging engine
   \note to be called at application termination by the core
 */
-SWITCH_DECLARE(switch_status_t) switch_log_bind_logger(switch_log_function_t function, switch_log_level_t level);
+SWITCH_DECLARE(switch_status_t) switch_log_bind_logger(_In_ switch_log_function_t function, _In_ switch_log_level_t level);
 
 /*! 
   \brief Return the name of the specified log level
   \param level the level
   \return the name of the log level
 */
-SWITCH_DECLARE(const char *) switch_log_level2str(switch_log_level_t level);
+_Ret_z_  SWITCH_DECLARE(const char *) switch_log_level2str(_In_ switch_log_level_t level);
 
 /*! 
   \brief Return the level number of the specified log level name
   \param str the name of the level
   \return the log level
 */
-SWITCH_DECLARE(switch_log_level_t) switch_log_str2level(const char *str);
+SWITCH_DECLARE(switch_log_level_t) switch_log_str2level(_In_z_ const char *str);
 
-SWITCH_DECLARE(uint32_t) switch_log_str2mask(const char *str);
+SWITCH_DECLARE(uint32_t) switch_log_str2mask(_In_z_ const char *str);
 #define switch_log_check_mask(_mask, _level) (_mask & (1 << _level))
 
 ///\}
index 5766620f5fa13c304c489cb8606913d24978f1ac..a39c58a9bbf9d0ee92d492ec80a35aef2b8674cc 100644 (file)
@@ -296,6 +296,20 @@ SWITCH_END_EXTERN_C
 #ifndef switch_assert
 #define switch_assert(expr) assert(expr)
 #endif
+
+#ifndef __ATTR_SAL
+ /* used for msvc code analysis */
+ /* http://msdn2.microsoft.com/en-us/library/ms235402.aspx */
+#define _In_
+#define _In_z_
+#define _In_opt_z_
+#define _Printf_format_string_
+#define _Ret_opt_z_
+#define _Ret_z_
+#define _Check_return_
+#endif
+
+
 /* For Emacs:
  * Local Variables:
  * mode:c