diff --git a/ChangeLog.txt b/ChangeLog.txt index 6d7fff6a7e..27ee3dcdf4 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -10,6 +10,19 @@ * Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment */ +2014-10-08 11:06 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) + * contrib/hbamf/amfdec.c + ! simplified and fixed datetime decoding. + Please verify what is the correct time base value. + Used by current and commented previous wrong code: + 1970-01-01 00:00:00 => 210866803200000 + or: + 1969/12/31 12:00:00 => 210866760000000 + Testing please remember about UTC offset. + + * contrib/hbbz2/core.c + ! fixed declaration for bz_internal_error() + 2014-10-08 02:46 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) * include/hbdefs.h * minor fix in recently added casting diff --git a/contrib/hbamf/amfdec.c b/contrib/hbamf/amfdec.c index d8289fdbc9..233e70b3a1 100644 --- a/contrib/hbamf/amfdec.c +++ b/contrib/hbamf/amfdec.c @@ -477,22 +477,12 @@ static HB_BOOL amf3_deserialize_array( amfContext * context, PHB_ITEM pItem, HB_ /* Decode a date. */ static HB_BOOL amf3_decode_epoch( amfContext * context, PHB_ITEM pItem ) { - double dJulian, dTime; double epoch_millisecs; - double * epoch_p = &epoch_millisecs; - if( ! amfX_decode_double( context, epoch_p ) ) + if( ! amfX_decode_double( context, &epoch_millisecs ) ) return HB_FALSE; - /* 210866760000000 unix_epoch milliseconds base in JD */ - dTime = modf( ( 210866760000000 + epoch_millisecs + 0.5 ) / HB_MILLISECS_PER_DAY, &dJulian ); - - hb_itemPutTDT( pItem, ( long ) dJulian, ( long ) ( dTime * HB_MILLISECS_PER_DAY ) ); - - /* TOFIX: why following Harbour function doesn't work out of the box? - C compiler was MSVC 7.1 (Visual Studio 2003) - hb_itemPutTD( pItem, epoch_millisecs + 210866803200000 ); - */ + hb_itemPutTD( pItem, ( epoch_millisecs + 210866803200000.4 ) / HB_MILLISECS_PER_DAY ); return HB_TRUE; } diff --git a/contrib/hbbz2/core.c b/contrib/hbbz2/core.c index 8b5d209a9f..7e09391e96 100644 --- a/contrib/hbbz2/core.c +++ b/contrib/hbbz2/core.c @@ -56,6 +56,13 @@ #include "hbbz2.ch" /* Required if bz2 lib was built with BZ_NO_STDIO [vszakats] */ +#ifdef __cplusplus +extern "C" { +#endif +extern void bz_internal_error ( int errcode ); +#ifdef __cplusplus +} +#endif void bz_internal_error( int errcode ) { hb_errInternal( ( HB_ERRCODE ) errcode, "libbzip2", NULL, NULL );