mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-03 11:25:35 +00:00
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:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user