[asterisk-commits] russell: branch 1.6.1 r170945 - in /branches/1.6.1: ./ include/asterisk/utils.h

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Jan 24 20:52:32 CST 2009


Author: russell
Date: Sat Jan 24 20:52:32 2009
New Revision: 170945

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=170945
Log:
Merged revisions 170943 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
r170943 | russell | 2009-01-24 20:49:30 -0600 (Sat, 24 Jan 2009) | 6 lines

Change ARRAY_LEN() to be more C++ safe.

When the second part of this macro is written as 0[a] instead of a[0], it will
force a failure if the macro is used on a C++ object that overloads the []
operator.

........

Modified:
    branches/1.6.1/   (props changed)
    branches/1.6.1/include/asterisk/utils.h

Propchange: branches/1.6.1/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.1/include/asterisk/utils.h
URL: http://svn.digium.com/svn-view/asterisk/branches/1.6.1/include/asterisk/utils.h?view=diff&rev=170945&r1=170944&r2=170945
==============================================================================
--- branches/1.6.1/include/asterisk/utils.h (original)
+++ branches/1.6.1/include/asterisk/utils.h Sat Jan 24 20:52:32 2009
@@ -657,7 +657,7 @@
  */
 int ast_mkdir(const char *path, int mode);
 
-#define ARRAY_LEN(a) (sizeof(a) / sizeof(a[0]))
+#define ARRAY_LEN(a) (sizeof(a) / sizeof(0[a]))
 
 #ifdef AST_DEVMODE
 #define ast_assert(a) _ast_assert(a, # a, __FILE__, __LINE__, __PRETTY_FUNCTION__)




More information about the asterisk-commits mailing list