[asterisk-bugs] [Asterisk 0013054]: [patch] janitor project to use ARRAY_LEN instead of in-line sizeof() and division.

noreply at bugs.digium.com noreply at bugs.digium.com
Thu Oct 30 10:55:58 CDT 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=13054 
====================================================================== 
Reported By:                pabelanger
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   13054
Category:                   General
Reproducibility:            N/A
Severity:                   feature
Priority:                   normal
Status:                     new
Asterisk Version:           SVN 
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!): 129568 
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             07-10-2008 11:51 CDT
Last Modified:              07-10-2008 12:23 CDT
====================================================================== 
Summary:                    [patch] janitor project to use ARRAY_LEN instead of
in-line sizeof() and division.
Description: 
replaced:

 sizeof(array)/sizeof(array[0])

with:

 ARRAY_LEN(array)
====================================================================== 

---------------------------------------------------------------------- 
 seanbright - 07-10-08 12:23  
---------------------------------------------------------------------- 
My only comment is that there are some unnecessary parenthesis around some
of the replacements, for example:

  if (++receivedRingT == (ARRAY_LEN(curRingData)))

Could be:

  if (++receivedRingT == ARRAY_LEN(curRingData))

I noticed this in the chan_dahdi.c, chan_sip.c and chan_skinny.c changes,
but there may be more.  Otherwise I think it looks good. 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
07-10-08 12:23  seanbright     Note Added: 0090029                          
======================================================================




More information about the asterisk-bugs mailing list