Janitor project to convert sizeof to ARRAY_LEN macro.

(closes issue #13002)
Reported by: caio1982
Patches:
      janitor_arraylen5.diff uploaded by caio1982 (license 22)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@129045 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Brett Bryant
2008-07-08 16:40:28 +00:00
parent 2ed6cea551
commit d185405755
19 changed files with 77 additions and 70 deletions

View File

@@ -1099,7 +1099,7 @@ int ast_parse_caller_presentation(const char *data)
{
int i;
for (i = 0; i < ((sizeof(pres_types) / sizeof(pres_types[0]))); i++) {
for (i = 0; i < ARRAY_LEN(pres_types); i++) {
if (!strcasecmp(pres_types[i].name, data))
return pres_types[i].val;
}
@@ -1115,7 +1115,7 @@ const char *ast_describe_caller_presentation(int data)
{
int i;
for (i = 0; i < ((sizeof(pres_types) / sizeof(pres_types[0]))); i++) {
for (i = 0; i < ARRAY_LEN(pres_types); i++) {
if (pres_types[i].val == data)
return pres_types[i].description;
}
@@ -1131,7 +1131,7 @@ const char *ast_named_caller_presentation(int data)
{
int i;
for (i = 0; i < ((sizeof(pres_types) / sizeof(pres_types[0]))); i++) {
for (i = 0; i < ARRAY_LEN(pres_types); i++) {
if (pres_types[i].val == data)
return pres_types[i].name;
}