I think we need a flag to dissable this optimization, or better
the capability to build harbour.exe with a expecific colattion
and use :
enable optimization if harbour.exe is builded with #ifndef HB_CDP_SUPPORT_OFF
otherwise:
hbdefs.h
#define HB_TOUPPER( c ) ( ( c ) >= 'a' && ( c ) <= 'z' ? ( c ) - ( 'a'
- 'A' ) : ( c ) )
#define HB_TOLOWER( c ) ( ( c ) >= 'A' && ( c ) <= 'Z' ? ( c ) + ( 'a'
- 'A' ) : ( c ) )
strcase.c
/* converts szText to lower case. Does not create a new string! */
char * hb_strLower( char * szText, ULONG ulLen )
{
HB_TRACE(HB_TR_DEBUG, ("hb_strLower(%s, %lu)", szText, ulLen));
{
ULONG i;
#ifndef HB_CDP_SUPPORT_OFF
PHB_CODEPAGE cdp = hb_vmCDP();
if( cdp && cdp->nChars )
for( i = 0; i < ulLen; i++ )
szText[ i ] = ( char ) cdp->s_lower[ ( UCHAR ) szText[ i ] ];
else
#endif
for( i = 0; i < ulLen; i++ )
szText[ i ] = HB_TOLOWER( szText[ i ] );
}
return szText;
}
/* converts szText to upper case. Does not create a new string! */
char * hb_strUpper( char * szText, ULONG ulLen )
{
HB_TRACE(HB_TR_DEBUG, ("hb_strUpper(%s, %lu)", szText, ulLen));
{
ULONG i;
#ifndef HB_CDP_SUPPORT_OFF
PHB_CODEPAGE cdp = hb_vmCDP();
if( cdp && cdp->nChars )
for( i = 0; i < ulLen; i++ )
szText[ i ] = ( char ) cdp->s_upper[ ( UCHAR ) szText[ i ] ];
else
#endif
for( i = 0; i < ulLen; i++ )
szText[ i ] = HB_TOUPPER( szText[ i ] );
}
return szText;
}
Best regards,
Miguel Angel Marchuet
Ron Pinkas escribió:
> 2009-02-25 09:55 UTC-0430 Ron Pinkas <ron/at/xharbour.com>
> * include/hbexprb.c
> ! Fixed compile time optimization of Upper() to process chars as
> unsigned char
>
> /*
> This still leaves the question of CODEPAGE support for compile time
> optimizations
> Wouldn't it be better to DISABLE this optimization?
> */
>
>
>
> ------------------------------------------------------------------------------
> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
> -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
> -Strategies to boost innovation and cut costs with open source participation
> -Receive a $600 discount off the registration fee with the source code: SFAD
> http://p.sf.net/sfu/XcvMzF8H
> _______________________________________________
> xHarbour-developers mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/xharbour-developers
>
> __________ Información de ESET NOD32 Antivirus, versión de la base de firmas
> de virus 3888 (20090225) __________
>
> ESET NOD32 Antivirus ha comprobado este mensaje.
>
> http://www.eset.com
>
>
>
>
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
xHarbour-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xharbour-developers