From b4e9d2621f15a7017dd353bac66222e1ecaf11c9 Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Mon, 7 Mar 2011 21:44:02 +0000 Subject: [PATCH] 2011-03-07 22:43 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/src/rtl/minmax.c ! fixed MAX() for mixed date and timestamp values * harbour/src/rtl/strtran.c % minor modification * harbour/src/rtl/cdpapihb.c * updated for signed HB_SIZE type --- harbour/ChangeLog | 10 ++++++++++ harbour/src/rtl/cdpapihb.c | 4 ++-- harbour/src/rtl/minmax.c | 4 ++-- harbour/src/rtl/strtran.c | 4 ++-- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index cf2512f8d7..961556aec5 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,16 @@ The license applies to all entries newer than 2009-04-28. */ +2011-03-07 22:43 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/src/rtl/minmax.c + ! fixed MAX() for mixed date and timestamp values + + * harbour/src/rtl/strtran.c + % minor modification + + * harbour/src/rtl/cdpapihb.c + * updated for signed HB_SIZE type + 2011-03-07 15:06 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbgs/tests/testgs.prg * contrib/hbgs/hbgs.hbx diff --git a/harbour/src/rtl/cdpapihb.c b/harbour/src/rtl/cdpapihb.c index 4ee4fbf715..940d883b37 100644 --- a/harbour/src/rtl/cdpapihb.c +++ b/harbour/src/rtl/cdpapihb.c @@ -66,9 +66,9 @@ #define HB_MAX_UTF8 3 -static HB_SIZE utf8pos( const char * szUTF8, HB_SIZE nLen, HB_SIZE nUTF8Pos ) +static HB_SIZE utf8pos( const char * szUTF8, HB_SIZE nLen, HB_SIZE ) { - if( nUTF8Pos ) + if( nUTF8Pos > 0 && nUTF8Pos <= nLen ) { HB_SIZE n1, n2; HB_WCHAR uc; diff --git a/harbour/src/rtl/minmax.c b/harbour/src/rtl/minmax.c index 222c0aa956..f7b5ed45df 100644 --- a/harbour/src/rtl/minmax.c +++ b/harbour/src/rtl/minmax.c @@ -103,9 +103,9 @@ HB_FUNC( MAX ) } else if( HB_IS_DATETIME( p1 ) && HB_IS_DATETIME( p2 ) ) { - if( HB_IS_DATE( p1 ) ) + if( HB_IS_DATE( p1 ) && hb_itemGetDL( p1 ) == hb_itemGetDL( p2 ) ) hb_itemReturn( p1 ); - else if( HB_IS_DATE( p2 ) ) + else if( HB_IS_DATE( p2 ) && hb_itemGetDL( p1 ) == hb_itemGetDL( p2 ) ) hb_itemReturn( p2 ); else hb_itemReturn( hb_itemGetTD( p1 ) >= hb_itemGetTD( p2 ) ? p1 : p2 ); diff --git a/harbour/src/rtl/strtran.c b/harbour/src/rtl/strtran.c index 05e1624b86..d2402af2d2 100644 --- a/harbour/src/rtl/strtran.c +++ b/harbour/src/rtl/strtran.c @@ -73,8 +73,6 @@ HB_FUNC( STRTRAN ) if( nSeek && nSeek <= nText ) { - const char * szSeek = hb_itemGetCPtr( pSeek ); - const char * szReplace; HB_SIZE nStart; nStart = hb_parnldef( 4, 1 ); @@ -87,6 +85,8 @@ HB_FUNC( STRTRAN ) else if( nStart > 0 ) { PHB_ITEM pReplace = hb_param( 3, HB_IT_STRING ); + const char * szSeek = hb_itemGetCPtr( pSeek ); + const char * szReplace; HB_SIZE nReplace; HB_SIZE nCount; HB_BOOL bAll;