mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-03 03:20:57 +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:
@@ -434,7 +434,7 @@ int ast_str2tos(const char *value, unsigned int *tos)
|
||||
return 0;
|
||||
}
|
||||
|
||||
for (x = 0; x < sizeof(dscp_pool1) / sizeof(dscp_pool1[0]); x++) {
|
||||
for (x = 0; x < ARRAY_LEN(dscp_pool1); x++) {
|
||||
if (!strcasecmp(value, dscp_pool1[x].name)) {
|
||||
*tos = dscp_pool1[x].space << 2;
|
||||
return 0;
|
||||
@@ -448,7 +448,7 @@ const char *ast_tos2str(unsigned int tos)
|
||||
{
|
||||
unsigned int x;
|
||||
|
||||
for (x = 0; x < sizeof(dscp_pool1) / sizeof(dscp_pool1[0]); x++) {
|
||||
for (x = 0; x < ARRAY_LEN(dscp_pool1); x++) {
|
||||
if (dscp_pool1[x].space == (tos >> 2))
|
||||
return dscp_pool1[x].name;
|
||||
}
|
||||
|
Reference in New Issue
Block a user