I replaced the forward declaration of sz_compare4 with the actual

function, because Borland C++ 3.1 complained about a type mismatch
when it encountered the actual function.
This commit is contained in:
David G. Holm
1999-05-06 19:15:53 +00:00
parent 47e49c3240
commit ccd3a69a61

View File

@@ -335,7 +335,21 @@ static const char * _szReservedFun[] = {
};
#define RESERVED_FUNCTIONS sizeof(_szReservedFun) / sizeof(char *)
/* function compares strings upto maximum 4 characters (used in bsearch) */
int sz_compare4( const void *, const void * );
/* Compare first 4 characters
* If they are the same then compare the whole name
*/
int sz_compare4( const void *pLookup, const void *pReserved )
{
int iCmp;
iCmp = strncmp( (const char *)pLookup, *((const char * *)pReserved), 4 );
if( iCmp == 0 )
iCmp = strncmp( (const char *)pLookup, *((const char * *)pReserved),
strlen((const char *)pLookup) );
return iCmp;
}
#define RESERVED_FUNC(szName) \
bsearch( (szName), _szReservedFun, RESERVED_FUNCTIONS, sizeof(char*), sz_compare4 )
@@ -3058,20 +3072,6 @@ int FieldsCount()
return iFields;
}
/* Compare first 4 characters
* If they are the same then compare the whole name
*/
int sz_compare4( const void *pLookup, const void *pReserved )
{
int iCmp;
iCmp = strncmp( (const char *)pLookup, *((const char * *)pReserved), 4 );
if( iCmp == 0 )
iCmp = strncmp( (const char *)pLookup, *((const char * *)pReserved),
strlen((const char *)pLookup) );
return iCmp;
}
/*
* Start of definition of static variable
* We are using here the special function _pInitFunc which will store