mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-31 12:19:49 +00:00
inetmib1: Avoid idempotent operation in findSupportedQuery function (Clang).
This commit is contained in:
parent
29b52fa575
commit
699fb02d10
1 changed files with 8 additions and 11 deletions
|
@ -1342,29 +1342,26 @@ static void cleanup(void)
|
||||||
static struct mibImplementation *findSupportedQuery(UINT *ids, UINT idLength,
|
static struct mibImplementation *findSupportedQuery(UINT *ids, UINT idLength,
|
||||||
UINT *matchingIndex)
|
UINT *matchingIndex)
|
||||||
{
|
{
|
||||||
int indexHigh = DEFINE_SIZEOF(supportedIDs) - 1, indexLow = 0, i;
|
int indexHigh = DEFINE_SIZEOF(supportedIDs) - 1, indexLow = 0;
|
||||||
struct mibImplementation *impl = NULL;
|
|
||||||
AsnObjectIdentifier oid1 = { idLength, ids};
|
AsnObjectIdentifier oid1 = { idLength, ids};
|
||||||
|
|
||||||
if (!idLength)
|
if (!idLength)
|
||||||
return NULL;
|
return NULL;
|
||||||
for (i = (indexLow + indexHigh) / 2; !impl && indexLow <= indexHigh;
|
|
||||||
i = (indexLow + indexHigh) / 2)
|
|
||||||
{
|
|
||||||
INT cmp;
|
|
||||||
|
|
||||||
cmp = SnmpUtilOidNCmp(&oid1, &supportedIDs[i].name, idLength);
|
while (indexLow <= indexHigh)
|
||||||
if (!cmp)
|
{
|
||||||
|
INT cmp, i = (indexLow + indexHigh) / 2;
|
||||||
|
if (!(cmp = SnmpUtilOidNCmp(&oid1, &supportedIDs[i].name, idLength)))
|
||||||
{
|
{
|
||||||
impl = &supportedIDs[i];
|
|
||||||
*matchingIndex = i;
|
*matchingIndex = i;
|
||||||
|
return &supportedIDs[i];
|
||||||
}
|
}
|
||||||
else if (cmp > 0)
|
if (cmp > 0)
|
||||||
indexLow = i + 1;
|
indexLow = i + 1;
|
||||||
else
|
else
|
||||||
indexHigh = i - 1;
|
indexHigh = i - 1;
|
||||||
}
|
}
|
||||||
return impl;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
|
|
Loading…
Reference in a new issue