[asterisk-commits] russell: branch 1.6.0 r170944 - in /branches/1.6.0: ./ include/asterisk/utils.h

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


Author: russell
Date: Sat Jan 24 20:50:24 2009
New Revision: 170944

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=170944
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.0/   (props changed)
    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/utils.h
URL: http://svn.digium.com/svn-view/asterisk/branches/1.6.0/include/asterisk/utils.h?view=diff&rev=170944&r1=170943&r2=170944
==============================================================================
--- branches/1.6.0/include/asterisk/utils.h (original)
+++ branches/1.6.0/include/asterisk/utils.h Sat Jan 24 20:50:24 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