Revision
16592
Author
mrene
Date
2010-02-09 12:09:55 -0600 (Tue, 09 Feb 2010)

Log Message

fix some code analysis tags

Modified Paths

Diff

Modified: freeswitch/trunk/src/include/switch_core.h (16591 => 16592)


--- freeswitch/trunk/src/include/switch_core.h	2010-02-09 15:58:36 UTC (rev 16591)
+++ freeswitch/trunk/src/include/switch_core.h	2010-02-09 18:09:55 UTC (rev 16592)
@@ -857,7 +857,7 @@
   \return the application's return value
 */
 SWITCH_DECLARE(switch_status_t) switch_core_session_execute_application_get_flags(_In_ switch_core_session_t *session,
-																				  _In_ const char *app, _In_opt_z_ const char *arg, _Out_ int32_t *flags);
+																				  _In_ const char *app, _In_opt_z_ const char *arg, _Out_opt_ int32_t *flags);
 
 SWITCH_DECLARE(switch_status_t) switch_core_session_get_app_flags(const char *app, int32_t *flags);
 

Modified: freeswitch/trunk/src/include/switch_platform.h (16591 => 16592)


--- freeswitch/trunk/src/include/switch_platform.h	2010-02-09 15:58:36 UTC (rev 16591)
+++ freeswitch/trunk/src/include/switch_platform.h	2010-02-09 18:09:55 UTC (rev 16592)
@@ -338,6 +338,7 @@
 #define _Out_z_cap_(x)
 #define _Out_ptrdiff_cap_(x)
 #define _Out_opt_ptrdiff_cap_(x)
+#define _Post_count_(x)
 #endif
 /* For Emacs:
  * Local Variables:

Modified: freeswitch/trunk/src/include/switch_utils.h (16591 => 16592)


--- freeswitch/trunk/src/include/switch_utils.h	2010-02-09 15:58:36 UTC (rev 16591)
+++ freeswitch/trunk/src/include/switch_utils.h	2010-02-09 18:09:55 UTC (rev 16592)
@@ -72,11 +72,15 @@
   \param s the string to test
   \return true value if the string is NULL or zero length
 */
-	 static inline int zstr(const char *s)
+_Check_return_ static inline switch_bool_t _zstr(_In_opt_z_ const char *s)
 {
 	return !s || *s == '\0';
 }
-
+#ifdef _PREFAST_
+#define zstr(x) (_zstr(x) ? 1 : __analysis_assume(x),0)
+#else
+#define zstr(x) _zstr(x)
+#endif
 #define switch_strlen_zero(x) zstr(x)
 #define switch_strlen_zero_buf(x) zstr_buf(x)
 #define zstr_buf(s) (*(s) == '\0')
@@ -113,7 +117,7 @@
 SWITCH_DECLARE(switch_size_t) switch_b64_decode(char *in, char *out, switch_size_t olen);
 SWITCH_DECLARE(char *) switch_amp_encode(char *s, char *buf, switch_size_t len);
 
-	 static inline switch_bool_t switch_is_digit_string(const char *s)
+static inline switch_bool_t switch_is_digit_string(const char *s)
 {
 
 	while (s && *s) {
@@ -536,8 +540,8 @@
   \param arraylen the max number of elements in the array
   \return the number of elements added to the array
 */
-SWITCH_DECLARE(unsigned int) switch_separate_string(char *buf, char delim, char **array, unsigned int arraylen);
-SWITCH_DECLARE(unsigned int) switch_separate_string_string(char *buf, char *delim, char **array, unsigned int arraylen);
+SWITCH_DECLARE(unsigned int) switch_separate_string(_In_ char *buf, char delim, _Post_count_(return) char **array, unsigned int arraylen);
+SWITCH_DECLARE(unsigned int) switch_separate_string_string(char *buf, char *delim, _Post_count_(return) char **array, unsigned int arraylen);
 
 SWITCH_DECLARE(switch_bool_t) switch_is_number(const char *str);
 SWITCH_DECLARE(char *) switch_strip_spaces(const char *str);