From 7b24fd360168a9440327b3b682c3f077daa33188 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 2 Jun 2000 17:53:00 +0000 Subject: [PATCH] 2000-06-02 19:56 UTC+0100 Victor Szakats --- harbour/ChangeLog | 15 +++++++++ harbour/source/rtl/minmax.c | 8 ++--- harbour/source/rtl/mlpos.c | 3 +- harbour/source/rtl/mod.c | 6 ++-- harbour/source/rtl/mouseapi.c | 10 +++--- harbour/source/rtl/strmatch.c | 52 +++++++++++++++---------------- harbour/source/rtl/strtran.c | 4 +-- harbour/utils/hbtest/hbtest.prg | 2 ++ harbour/utils/hbtest/make_xpp.bat | 2 +- harbour/utils/hbtest/make_xpp.cmd | 2 +- 10 files changed, 59 insertions(+), 45 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index cda21ec5cf..086089aa7b 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,18 @@ +2000-06-02 19:56 UTC+0100 Victor Szakats + + * utils/hbtest/hbtest.prg + * utils/hbtest/make_xpp.bat + * utils/hbtest/make_xpp.cmd + ! HBTEST was broken for Xbase++. Fixed. + + * source/rtl/minmax.c + * source/rtl/mlpos.c + * source/rtl/mod.c + * source/rtl/mouseapi.c + * source/rtl/strmatch.c + * source/rtl/strtran.c + * Minor typos, formattings, optimizations. + 2000-06-02 15:39 UTC+0100 Victor Szakats * doc/whatsnew.txt diff --git a/harbour/source/rtl/minmax.c b/harbour/source/rtl/minmax.c index 2bafc9c558..96c3f05f61 100644 --- a/harbour/source/rtl/minmax.c +++ b/harbour/source/rtl/minmax.c @@ -45,8 +45,8 @@ HB_FUNC( MAX ) if( HB_IS_NUMERIC( p1 ) && HB_IS_NUMERIC( p2 ) ) { - /* NOTE: The order of these if() branches is significant, */ - /* please, don't change it. [vszakats] */ + /* NOTE: The order of these if() branches is significant, + please, don't change it. [vszakats] */ if( HB_IS_DOUBLE( p1 ) || HB_IS_DOUBLE( p2 ) ) { @@ -105,8 +105,8 @@ HB_FUNC( MIN ) if( HB_IS_NUMERIC( p1 ) && HB_IS_NUMERIC( p2 ) ) { - /* NOTE: The order of these if() branches is significant, */ - /* please, don't change it. [vszakats] */ + /* NOTE: The order of these if() branches is significant, + please, don't change it. [vszakats] */ if( HB_IS_DOUBLE( p1 ) || HB_IS_DOUBLE( p2 ) ) { diff --git a/harbour/source/rtl/mlpos.c b/harbour/source/rtl/mlpos.c index 58d33c1013..111c233bba 100644 --- a/harbour/source/rtl/mlpos.c +++ b/harbour/source/rtl/mlpos.c @@ -106,4 +106,5 @@ HB_FUNC( MLPOS ) hb_retnl( ulPos - ulCurLength + 1); else hb_retnl( ulLen ); -} \ No newline at end of file +} + diff --git a/harbour/source/rtl/mod.c b/harbour/source/rtl/mod.c index 689cbc340f..9d8f60e2aa 100644 --- a/harbour/source/rtl/mod.c +++ b/harbour/source/rtl/mod.c @@ -37,11 +37,11 @@ #include "hbapiitm.h" #include "hbapierr.h" -/* NOTE: In Clipper this is written in Clipper, see the source below, +/* NOTE: In CA-Cl*pper this is written in Clipper, see the source below, and the error handling is NOT made here, but in the % operator. [vszakats] */ -/* NOTE: CA-Clipper is buggy since it relies on the fact that the errorhandler +/* NOTE: CA-Cl*pper is buggy since it relies on the fact that the errorhandler will silently handle zero division errors. [vszakats] */ /* NOTE: This C version fully emulates the behaviour of the original @@ -97,5 +97,5 @@ HB_FUNC( MOD ) FUNCTION MOD( cl_num, cl_base ) LOCAL cl_result := cl_num % cl_base - RETURN IF( cl_base = 0, cl_num, iif( cl_result * cl_base < 0, cl_result + cl_base, cl_result ) ) + RETURN iif( cl_base = 0, cl_num, iif( cl_result * cl_base < 0, cl_result + cl_base, cl_result ) ) */ diff --git a/harbour/source/rtl/mouseapi.c b/harbour/source/rtl/mouseapi.c index b6c06d414f..d1e6e75c85 100644 --- a/harbour/source/rtl/mouseapi.c +++ b/harbour/source/rtl/mouseapi.c @@ -303,12 +303,10 @@ HB_FUNC( MRESTSTATE ) HB_FUNC( MSETBOUNDS ) { - int iTop = ISNUM( 1 ) ? hb_parni( 1 ) : 0; - int iLeft = ISNUM( 2 ) ? hb_parni( 2 ) : 0; - int iBottom = ISNUM( 3 ) ? hb_parni( 3 ) : hb_gtMaxRow(); - int iRight = ISNUM( 4 ) ? hb_parni( 4 ) : hb_gtMaxCol(); - - hb_mouseSetBounds( iTop, iLeft, iBottom, iRight ); + hb_mouseSetBounds( ISNUM( 1 ) ? hb_parni( 1 ) : 0, + ISNUM( 2 ) ? hb_parni( 2 ) : 0, + ISNUM( 3 ) ? hb_parni( 3 ) : hb_gtMaxRow(), + ISNUM( 4 ) ? hb_parni( 4 ) : hb_gtMaxCol() ); } #endif diff --git a/harbour/source/rtl/strmatch.c b/harbour/source/rtl/strmatch.c index d2544ec156..caf46ab4bd 100644 --- a/harbour/source/rtl/strmatch.c +++ b/harbour/source/rtl/strmatch.c @@ -41,45 +41,43 @@ static BOOL hb_strMatchDOS( const char * pszString, const char * pszMask ) { HB_TRACE(HB_TR_DEBUG, ("hb_strMatchDOS(%s, %s)", pszString, pszMask)); - while( *pszMask && *pszString ) + while( *pszMask != '\0' && *pszString != '\0' ) { if( *pszMask == '*' ) { while( *pszMask == '*' ) - pszMask++; + pszMask++; - if( ! ( *pszMask ) ) + if( *pszMask == '\0' ) return TRUE; - else - if( *pszMask == '?' ) - pszString++; - else - { - while( toupper( *pszString ) != toupper( *pszMask ) ) - { - if( ! ( *( ++pszString ) ) ) - return FALSE; - } - while( toupper( *pszString ) == toupper( *pszMask ) ) - { - if( ! ( *( ++pszString ) ) ) - break; - } - pszMask++; - } - } - else - if( toupper( *pszMask ) != toupper( *pszString ) && *pszMask != '?' ) - return FALSE; + else if( *pszMask == '?' ) + pszString++; else { + while( toupper( *pszString ) != toupper( *pszMask ) ) + { + if( *( ++pszString ) == '\0' ) + return FALSE; + } + while( toupper( *pszString ) == toupper( *pszMask ) ) + { + if( *( ++pszString ) == '\0' ) + break; + } pszMask++; - pszString++; } + } + else if( toupper( *pszMask ) != toupper( *pszString ) && *pszMask != '?' ) + return FALSE; + else + { + pszMask++; + pszString++; + } } - return ! ( ( ! ( *pszString ) && *pszMask && *pszMask != '*') || - ( ! ( *pszMask ) && *pszString ) ); + return ! ( ( *pszMask != '\0' && *pszString == '\0' && *pszMask != '*') || + ( *pszMask == '\0' && *pszString != '\0' ) ); } /* TODO: Replace it with a code that supports real regular expressions diff --git a/harbour/source/rtl/strtran.c b/harbour/source/rtl/strtran.c index 0f4761bb16..205ab53665 100644 --- a/harbour/source/rtl/strtran.c +++ b/harbour/source/rtl/strtran.c @@ -162,8 +162,8 @@ HB_FUNC( STRTRAN ) } else hb_retclen( szText, ulText ); - } - else + } + else hb_retclen( szText, ulText ); } else diff --git a/harbour/utils/hbtest/hbtest.prg b/harbour/utils/hbtest/hbtest.prg index 476f344e5e..97e9dd483a 100644 --- a/harbour/utils/hbtest/hbtest.prg +++ b/harbour/utils/hbtest/hbtest.prg @@ -525,6 +525,7 @@ FUNCTION HB_SToD( cDate ) #ifndef HAVE_HBCLIP #ifndef __HARBOUR__ +#ifndef __XPP__ FUNCTION HB_SToD( cDate ) LOCAL cOldDateFormat @@ -546,6 +547,7 @@ FUNCTION HB_SToD( cDate ) #endif #endif +#endif /* Don't change the position of this #include. */ #include "rt_init.ch" diff --git a/harbour/utils/hbtest/make_xpp.bat b/harbour/utils/hbtest/make_xpp.bat index 459fb9aa2a..c8335ef17c 100644 --- a/harbour/utils/hbtest/make_xpp.bat +++ b/harbour/utils/hbtest/make_xpp.bat @@ -15,6 +15,6 @@ xpp rt_str.prg /w /n xpp rt_stra.prg /w /n xpp rt_trans.prg /w /n -alink hbtest rt_array rt_date rt_file rt_hvm rt_math rt_misc rt_str rt_stra rt_trans +alink hbtest rt_array rt_date rt_file rt_hvm rt_hvma rt_math rt_misc rt_str rt_stra rt_trans del *.obj diff --git a/harbour/utils/hbtest/make_xpp.cmd b/harbour/utils/hbtest/make_xpp.cmd index 459fb9aa2a..c8335ef17c 100644 --- a/harbour/utils/hbtest/make_xpp.cmd +++ b/harbour/utils/hbtest/make_xpp.cmd @@ -15,6 +15,6 @@ xpp rt_str.prg /w /n xpp rt_stra.prg /w /n xpp rt_trans.prg /w /n -alink hbtest rt_array rt_date rt_file rt_hvm rt_math rt_misc rt_str rt_stra rt_trans +alink hbtest rt_array rt_date rt_file rt_hvm rt_hvma rt_math rt_misc rt_str rt_stra rt_trans del *.obj