From 7acede5f22281f291480f8c5f1724eac79e7dcaa Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 9 Dec 2010 14:34:30 +0000 Subject: [PATCH] 2010-12-09 15:34 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * contrib/hblzf/tests/test.prg * contrib/hblzf/hblzf.c * Changed HB_LZF_OPTIMIZED_FOR() to HB_LZF_OPTIMIZED_FOR_SPEED() and to return logical value. --- harbour/ChangeLog | 6 ++++++ harbour/contrib/hblzf/hblzf.c | 16 +++++++--------- harbour/contrib/hblzf/tests/test.prg | 4 ++-- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 03ada2e3f2..a2a66bf035 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,12 @@ The license applies to all entries newer than 2009-04-28. */ +2010-12-09 15:34 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * contrib/hblzf/tests/test.prg + * contrib/hblzf/hblzf.c + * Changed HB_LZF_OPTIMIZED_FOR() to HB_LZF_OPTIMIZED_FOR_SPEED() + and to return logical value. + 2010-12-09 14:42 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * contrib/hblzf/hblzf.c % Deleted unnecessary assignment (fixing potential bcc warning) diff --git a/harbour/contrib/hblzf/hblzf.c b/harbour/contrib/hblzf/hblzf.c index 08edaab3bf..bc991a49d9 100644 --- a/harbour/contrib/hblzf/hblzf.c +++ b/harbour/contrib/hblzf/hblzf.c @@ -61,12 +61,6 @@ #include "lzf.h" #include "lzfP.h" -#if ULTRA_FAST -# define HB_LZF_OPTIMIZED_FOR 1 -#elif VERY_FAST -# define HB_LZF_OPTIMIZED_FOR 0 -#endif - #define HB_LZF_BUFFSIZE 1024 typedef struct @@ -95,12 +89,16 @@ HB_FUNC( HB_LZF_VERSION ) } /** - Return 1 if lzf was optimized for speed, 0 for compression + Return if lzf was optimized for speed (or for compression) */ -HB_FUNC( HB_LZF_OPTIMIZED_FOR ) +HB_FUNC( HB_LZF_OPTIMIZED_FOR_SPEED ) { - hb_retni( HB_LZF_OPTIMIZED_FOR ); +#if ULTRA_FAST + hb_retl( HB_TRUE ); +#else + hb_retl( HB_FALSE ); +#endif } /** diff --git a/harbour/contrib/hblzf/tests/test.prg b/harbour/contrib/hblzf/tests/test.prg index d52411a6a0..60dfcb29b7 100644 --- a/harbour/contrib/hblzf/tests/test.prg +++ b/harbour/contrib/hblzf/tests/test.prg @@ -15,8 +15,8 @@ PROCEDURE Main() LOCAL errno := 0 ? "LZF Api version is", ; - hb_ntos( hb_lzf_version() ) + "(" + hb_numtohex( hb_lzf_version() ) +")" - ? "LibLZF optimized for", iif( hb_lzf_optimized_for() > 0, "speed.", "compression." ) + hb_ntos( hb_lzf_version() ) + "(0x" + hb_numtohex( hb_lzf_version() ) +")" + ? "LibLZF optimized for", iif( hb_lzf_optimized_for_speed(), "speed.", "compression." ) ? "--- test 1 ---" /*