2007-07-14 12:31 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)

* harbour/include/hbcompat.ch
    ! changed hb_adler() to hb_adler32()

  * harbour/contrib/libct/dattime2.c
    * changed WEEK() to be exactly CT3 compatible. I do not know why
      but in CT3 WEEK() checks if the first character of date format
      is 'd' or 'D' and in such case uses differ algorithm to calculate
      week number.
This commit is contained in:
Przemyslaw Czerpak
2007-07-14 10:32:09 +00:00
parent 36b4358c32
commit 33dd5132f8
3 changed files with 22 additions and 5 deletions

View File

@@ -8,6 +8,16 @@
2002-12-01 13:30 UTC+0100 Foo Bar <foo.bar@foobar.org>
*/
2007-07-14 12:31 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbcompat.ch
! changed hb_adler() to hb_adler32()
* harbour/contrib/libct/dattime2.c
* changed WEEK() to be exactly CT3 compatible. I do not know why
but in CT3 WEEK() checks if the first character of date format
is 'd' or 'D' and in such case uses differ algorithm to calculate
week number.
2007-07-11 12:04 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
* contrib/mysql/tmysql.prg
! Some fixes for the previous fixes.

View File

@@ -93,7 +93,8 @@ static int ct_daysinmonth( int iMonth, BOOL bLeap )
static int ct_daystomonth( int iMonth, BOOL bLeap )
{
int iMonthes[] = { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 };
static const int iMonthes[] =
{ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 };
return ( ( iMonth < 1 && iMonth > 12 ) ? 0 : iMonthes[iMonth - 1] +
( ( bLeap && iMonth > 2 ) ? 1 : 0 ) );
@@ -909,7 +910,7 @@ HB_FUNC( WEEK )
int iYear, iMonth, iDay, iWeek;
PHB_ITEM pDate = hb_param( 1, HB_IT_DATE );
LONG lDate = 0;
BOOL bSWN = ( ISLOG( 2 ) ? hb_parl( 2 ) : 0 );
BOOL bSWN = ( ISLOG( 2 ) ? hb_parl( 2 ) : FALSE );
if( ISDATE( 1 ) )
{
@@ -942,7 +943,13 @@ HB_FUNC( WEEK )
}
else
{
LONG lDate2 = lDate + 3 - ( ( hb_dateDOW( iYear, iMonth, iDay ) + 5 ) % 7 );
LONG lDate2;
if( hb_set.HB_SET_DATEFORMAT && ( hb_set.HB_SET_DATEFORMAT[0] == 'd' ||
hb_set.HB_SET_DATEFORMAT[0] == 'D' ) )
lDate2 = lDate + 3 - ( hb_dateDOW( iYear, iMonth, iDay ) + 5 ) % 7;
else
lDate2 = lDate + 4 - hb_dateDOW( iYear, iMonth, iDay );
iWeek = ( ct_doy( lDate2 ) - 1 ) / 7 + 1;
}

View File

@@ -74,7 +74,7 @@
#xtranslate hb_libFree([<x,...>]) => libFree(<x>)
#xtranslate hb_CStr([<x,...>]) => CStr(<x>)
#xtranslate hb_checksum([<x,...>]) => hb_adler(<x>)
#xtranslate hb_checksum([<x,...>]) => hb_adler32(<x>)
#else
@@ -97,7 +97,7 @@
#xtranslate libFree([<x,...>]) => hb_libFree(<x>)
#xtranslate CStr([<x,...>]) => hb_CStr(<x>)
#xtranslate hb_adler([<x,...>]) => hb_checksum(<x>)
#xtranslate hb_adler32([<x,...>]) => hb_checksum(<x>)
#xtranslate HASH([<x,...>]) => HB_HASH(<x>)
#xtranslate HHASKEY([<x,...>]) => HB_HHASKEY(<x>)