From ccd3a69a61d780ea94fe077f8c5ee0a172367daf Mon Sep 17 00:00:00 2001 From: "David G. Holm" Date: Thu, 6 May 1999 19:15:53 +0000 Subject: [PATCH] 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. --- harbour/source/compiler/harbour.y | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/harbour/source/compiler/harbour.y b/harbour/source/compiler/harbour.y index 7c7d88a440..53d219d4fc 100644 --- a/harbour/source/compiler/harbour.y +++ b/harbour/source/compiler/harbour.y @@ -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