Fix types in binary search function

This commit is contained in:
Peter Hill 2024-03-25 10:50:55 +00:00
parent 0b98970677
commit 6f092f01ec
No known key found for this signature in database
GPG Key ID: 0C6B9742E72848EE

View File

@ -1281,17 +1281,17 @@ done:
static NCD4node*
lookupAtomicType(NClist* atomictypes, const char* name)
{
int n = nclistlength(atomictypes);
int L = 0;
int R = (n - 1);
int m, cmp;
size_t n = nclistlength(atomictypes);
if (n == 0) return NULL;
size_t L = 0;
size_t R = n - 1;
NCD4node* p;
for(;;) {
if(L > R) break;
m = (L + R) / 2;
size_t m = (L + R) / 2;
p = (NCD4node*)nclistget(atomictypes,m);
cmp = strcasecmp(p->name,name);
int cmp = strcasecmp(p->name,name);
if(cmp == 0)
return p;
if(cmp < 0)