[svn-commits] tilghman: branch 1.6.0 r116695 - in /branches/1.6.0: ./ include/asterisk/
SVN commits to the Digium repositories
svn-commits at lists.digium.com
Thu May 15 17:07:30 CDT 2008
Author: tilghman
Date: Thu May 15 17:07:30 2008
New Revision: 116695
URL: http://svn.digium.com/view/asterisk?view=rev&rev=116695
Log:
Merged revisions 116694 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
........
r116694 | tilghman | 2008-05-15 17:05:47 -0500 (Thu, 15 May 2008) | 4 lines
Add an extra check in ast_strlen_zero, and make ast_assert() not print the
file, line, and function name twice.
(Closes issue #12650)
........
Modified:
branches/1.6.0/ (props changed)
branches/1.6.0/include/asterisk/strings.h
branches/1.6.0/include/asterisk/utils.h
Propchange: branches/1.6.0/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.
Modified: branches/1.6.0/include/asterisk/strings.h
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/include/asterisk/strings.h?view=diff&rev=116695&r1=116694&r2=116695
==============================================================================
--- branches/1.6.0/include/asterisk/strings.h (original)
+++ branches/1.6.0/include/asterisk/strings.h Thu May 15 17:07:30 2008
@@ -29,10 +29,25 @@
/* You may see casts in this header that may seem useless but they ensure this file is C++ clean */
+#ifdef AST_DEVMODE
+#define ast_strlen_zero(foo) _ast_strlen_zero(foo, __FILE__, __PRETTY_FUNCTION__, __LINE__)
+static force_inline int _ast_strlen_zero(const char *s, const char *file, const char *function, int line)
+{
+ if (!s || (*s == '\0')) {
+ return 1;
+ }
+ if (!strcmp(s, "(null)")) {
+ ast_log(__LOG_WARNING, file, line, function, "Possible programming error: \"(null)\" is not NULL!\n");
+ }
+ return 0;
+}
+
+#else
static force_inline int ast_strlen_zero(const char *s)
{
return (!s || (*s == '\0'));
}
+#endif
/*! \brief returns the equivalent of logic or for strings:
* first one if not empty, otherwise second one.
Modified: branches/1.6.0/include/asterisk/utils.h
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/include/asterisk/utils.h?view=diff&rev=116695&r1=116694&r2=116695
==============================================================================
--- branches/1.6.0/include/asterisk/utils.h (original)
+++ branches/1.6.0/include/asterisk/utils.h Thu May 15 17:07:30 2008
@@ -662,8 +662,8 @@
if (__builtin_expect(!condition, 1)) {
/* Attempt to put it into the logger, but hope that at least someone saw the
* message on stderr ... */
- ast_log(LOG_ERROR, "FRACK!, Failed assertion %s (%d) at line %d in %s of %s\n",
- condition_str, condition, line, function, file);
+ ast_log(__LOG_ERROR, file, line, function, "FRACK!, Failed assertion %s (%d)\n",
+ condition_str, condition);
fprintf(stderr, "FRACK!, Failed assertion %s (%d) at line %d in %s of %s\n",
condition_str, condition, line, function, file);
/* Give the logger a chance to get the message out, just in case we abort(), or
More information about the svn-commits
mailing list