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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user