2000-06-17 19:37 UTC+0100 Victor Szakats <info@szelvesz.hu>
This commit is contained in:
@@ -1,3 +1,15 @@
|
||||
2000-06-17 19:37 UTC+0100 Victor Szakats <info@szelvesz.hu>
|
||||
|
||||
* source/common/hbstr.c
|
||||
* source/rtl/strings.c
|
||||
* source/rtl/dir.c
|
||||
* source/rtl/transfrm.c
|
||||
! Fixed unary increment/decrement operator usage in toupper()/tolower()
|
||||
functions, since these may be macros on some systems.
|
||||
|
||||
* source/rtl/right.c
|
||||
% Some optimization.
|
||||
|
||||
2000-06-17 18:58 UTC+0100 Victor Szakats <info@szelvesz.hu>
|
||||
|
||||
* source/compiler/harbour.y
|
||||
|
||||
@@ -117,8 +117,11 @@ int hb_stricmp( const char * s1, const char * s2 )
|
||||
|
||||
while( rc == 0 && count > 0 )
|
||||
{
|
||||
char c1 = toupper( *s1++ );
|
||||
char c2 = toupper( *s2++ );
|
||||
char c1 = toupper( *s1 );
|
||||
char c2 = toupper( *s2 );
|
||||
|
||||
s1++;
|
||||
s2++;
|
||||
|
||||
if( c1 != c2 )
|
||||
rc = ( c1 < c2 ? -1 : 1 );
|
||||
|
||||
@@ -256,7 +256,7 @@ static USHORT HarbourAttributesToMask( BYTE * byAttrib )
|
||||
|
||||
HB_TRACE(HB_TR_DEBUG, ("HarbourAttributesToMask(%p)", byAttrib));
|
||||
|
||||
while( ( c = toupper( *pos++ ) ) != '\0' )
|
||||
while( ( c = toupper( *pos ) ) != '\0' )
|
||||
{
|
||||
switch( c )
|
||||
{
|
||||
@@ -278,6 +278,8 @@ static USHORT HarbourAttributesToMask( BYTE * byAttrib )
|
||||
case 'L': usMask |= FA_REPARSE; break;
|
||||
case 'P': usMask |= FA_SPARSE; break;
|
||||
}
|
||||
|
||||
pos++;
|
||||
}
|
||||
|
||||
return usMask;
|
||||
|
||||
@@ -49,7 +49,6 @@ HB_FUNC( LEFT )
|
||||
|
||||
if( lLen > ( long ) hb_itemGetCLen( pText ) )
|
||||
lLen = ( long ) hb_itemGetCLen( pText );
|
||||
|
||||
else if( lLen < 0 )
|
||||
lLen = 0;
|
||||
|
||||
|
||||
@@ -46,19 +46,16 @@ HB_FUNC( RIGHT )
|
||||
if( pText && ISNUM( 2 ) )
|
||||
{
|
||||
long lLen = hb_parnl( 2 );
|
||||
long lTextLen = ( long ) hb_itemGetCLen( pText );
|
||||
|
||||
if( lLen > ( long ) hb_itemGetCLen( pText ) )
|
||||
lLen = ( long ) hb_itemGetCLen( pText );
|
||||
|
||||
if( lLen > lTextLen )
|
||||
lLen = lTextLen;
|
||||
else if( lLen < 0 )
|
||||
lLen = 0;
|
||||
|
||||
hb_retclen( hb_itemGetCPtr( pText ) + hb_itemGetCLen( pText ) - lLen, lLen );
|
||||
hb_retclen( hb_itemGetCPtr( pText ) + lTextLen - lLen, lLen );
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Clipper doesn't error */
|
||||
hb_retc( "" );
|
||||
}
|
||||
hb_retc( "" ); /* Clipper doesn't error */
|
||||
}
|
||||
|
||||
|
||||
@@ -80,8 +80,11 @@ int hb_strnicmp( const char * s1, const char * s2, ULONG count )
|
||||
|
||||
while( rc == 0 && count > 0 )
|
||||
{
|
||||
char c1 = toupper( *s1++ );
|
||||
char c2 = toupper( *s2++ );
|
||||
char c1 = toupper( *s1 );
|
||||
char c2 = toupper( *s2 );
|
||||
|
||||
s1++;
|
||||
s2++;
|
||||
|
||||
if( c1 != c2 )
|
||||
rc = ( c1 < c2 ? -1 : 1 );
|
||||
|
||||
@@ -204,7 +204,8 @@ HB_FUNC( TRANSFORM )
|
||||
/* Upper */
|
||||
case '!':
|
||||
{
|
||||
szResult[ ulResultPos++ ] = toupper( szExp[ ulExpPos++ ] );
|
||||
szResult[ ulResultPos++ ] = toupper( szExp[ ulExpPos ] );
|
||||
ulExpPos++;
|
||||
bAnyPic = TRUE;
|
||||
break;
|
||||
}
|
||||
@@ -221,7 +222,8 @@ HB_FUNC( TRANSFORM )
|
||||
case 'x':
|
||||
case 'X':
|
||||
{
|
||||
szResult[ ulResultPos++ ] = ( uiPicFlags & PF_UPPER ) ? toupper( szExp[ ulExpPos++ ] ) : szExp[ ulExpPos++ ];
|
||||
szResult[ ulResultPos++ ] = ( uiPicFlags & PF_UPPER ) ? toupper( szExp[ ulExpPos ] ) : szExp[ ulExpPos ];
|
||||
ulExpPos++;
|
||||
bAnyPic = TRUE;
|
||||
break;
|
||||
}
|
||||
@@ -256,13 +258,19 @@ HB_FUNC( TRANSFORM )
|
||||
else
|
||||
{
|
||||
while( ulExpPos++ < ulExpLen )
|
||||
szResult[ ulResultPos++ ] = ( uiPicFlags & PF_UPPER ) ? toupper( *szExp++ ) : *szExp++;
|
||||
{
|
||||
szResult[ ulResultPos++ ] = ( uiPicFlags & PF_UPPER ) ? toupper( *szExp ) : *szExp;
|
||||
szExp++;
|
||||
}
|
||||
}
|
||||
|
||||
if( ( uiPicFlags & PF_REMAIN ) && ! bAnyPic )
|
||||
{
|
||||
while( ulExpPos++ < ulExpLen )
|
||||
szResult[ ulResultPos++ ] = ( uiPicFlags & PF_UPPER ) ? toupper( *szExp++ ) : *szExp++;
|
||||
{
|
||||
szResult[ ulResultPos++ ] = ( uiPicFlags & PF_UPPER ) ? toupper( *szExp ) : *szExp;
|
||||
szExp++;
|
||||
}
|
||||
}
|
||||
|
||||
/* Any chars left ? */
|
||||
|
||||
Reference in New Issue
Block a user