diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 61db4d6b86..bf23b56cd9 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,31 @@ The license applies to all entries newer than 2009-04-28. */ +2010-11-09 15:13 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + * contrib/hbplist + + Enabled hbzebra. + + * contrib/hbzebra/hbzebra.hbp + + Added optional cairo dependency. + + Enabled cairo dependent components if cairo is detected. + - Deleted hard-coded reference to cairo lib. + + Adjusted reference to hbcairo.hbc. + + * contrib/hbzebra/itf.c + * contrib/hbzebra/codabar.c + * Silenced three warnings. + ; TOFIX: Remains one: + ../../../../../contrib/hbzebra/code128.c: In function 'hb_zebra_create_code128': + ../../../../../contrib/hbzebra/code128.c:316:19: warning: suggest parentheses around '&&' within '||' + + * contrib/hbzebra/core.c + ! Replaced hbcairo.h header reference with hbstack.h + + * contrib/hbzebra/cairo.c + * contrib/hbzebra/hbzebra.hbc + ! Added EOL at EOF. + * Indenting. + 2010-11-09 14:56 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * src/common/hbver.c + Added support for hb_iswin*() and HB_OSISWIN*() functions diff --git a/harbour/contrib/hbplist b/harbour/contrib/hbplist index ba4ac44452..474db1de4c 100644 --- a/harbour/contrib/hbplist +++ b/harbour/contrib/hbplist @@ -41,6 +41,7 @@ hbtpathy/hbtpathy.hbp hbwin/hbwin.hbp hbxbp/hbxbp.hbp hbxpp/hbxpp.hbp +hbzebra/hbzebra.hbp hbziparc/hbziparc.hbp rddads/rddads.hbp rddbmcdx/rddbmcdx.hbp diff --git a/harbour/contrib/hbzebra/cairo.c b/harbour/contrib/hbzebra/cairo.c index 7c7bfa6127..8ed569c597 100644 --- a/harbour/contrib/hbzebra/cairo.c +++ b/harbour/contrib/hbzebra/cairo.c @@ -98,13 +98,13 @@ int hb_zebra_draw_cairo( PHB_ZEBRA pZebra, cairo_t * pCairo, double dX, double d HB_FUNC( HB_ZEBRA_DRAW_CAIRO ) { - PHB_ZEBRA pZebra = hb_zebra_param( 1 ); - if( pZebra ) - { - cairo_t * pCairo = hb_cairo_param( 2 ); - if( pCairo ) - { - hb_retni( hb_zebra_draw_cairo( pZebra, pCairo, hb_parnd( 3 ), hb_parnd( 4 ), hb_parnd( 5 ), hb_parnd( 6 ), hb_parni( 7 ) ) ); - } - } -} \ No newline at end of file + PHB_ZEBRA pZebra = hb_zebra_param( 1 ); + if( pZebra ) + { + cairo_t * pCairo = hb_cairo_param( 2 ); + if( pCairo ) + { + hb_retni( hb_zebra_draw_cairo( pZebra, pCairo, hb_parnd( 3 ), hb_parnd( 4 ), hb_parnd( 5 ), hb_parnd( 6 ), hb_parni( 7 ) ) ); + } + } +} diff --git a/harbour/contrib/hbzebra/codabar.c b/harbour/contrib/hbzebra/codabar.c index b9dbbba91b..080ae748c7 100644 --- a/harbour/contrib/hbzebra/codabar.c +++ b/harbour/contrib/hbzebra/codabar.c @@ -88,7 +88,7 @@ static char _codabar_charno( char ch ) char * ptr = strchr( s_symbols, ch ); if( ptr && *ptr ) return ptr - s_symbols + 10; - } + } return -1; } @@ -153,8 +153,8 @@ PHB_ZEBRA hb_zebra_create_codabar( const char * szCode, HB_SIZE nLen, int iFlags pZebra->pBits = hb_bitbuffer_create(); - if( iLen == 0 || _codabar_charno( szCode[ 0 ] ) < 16 ) - _codabar_add( pZebra->pBits, s_code[ _codabar_charno( 'A' ) ], iFlags, HB_FALSE ); /* Default start A */ + if( iLen == 0 || _codabar_charno( ( int ) szCode[ 0 ] ) < 16 ) + _codabar_add( pZebra->pBits, s_code[ ( int ) _codabar_charno( 'A' ) ], iFlags, HB_FALSE ); /* Default start A */ for( i = 0; i < iLen; i++ ) { @@ -163,7 +163,7 @@ PHB_ZEBRA hb_zebra_create_codabar( const char * szCode, HB_SIZE nLen, int iFlags } if( iLen == 0 || _codabar_charno( szCode[ i - 1 ] ) < 16 ) - _codabar_add( pZebra->pBits, s_code[ _codabar_charno( 'B' ) ], iFlags, HB_TRUE ); /* Default stop B */ + _codabar_add( pZebra->pBits, s_code[ ( int ) _codabar_charno( 'B' ) ], iFlags, HB_TRUE ); /* Default stop B */ return pZebra; } diff --git a/harbour/contrib/hbzebra/core.c b/harbour/contrib/hbzebra/core.c index d51eb1a03a..8726208d6c 100644 --- a/harbour/contrib/hbzebra/core.c +++ b/harbour/contrib/hbzebra/core.c @@ -53,7 +53,7 @@ #include "hbzebra.h" #include "hbapiitm.h" #include "hbapierr.h" -#include "hbcairo.h" +#include "hbstack.h" /* ================ Bit buffer ================ */ @@ -118,7 +118,7 @@ HB_SIZE hb_bitbuffer_len( PHB_BITBUFFER pBitBuffer ) HB_BOOL hb_bitbuffer_get( PHB_BITBUFFER pBitBuffer, HB_SIZE nPos ) { - return nPos > pBitBuffer->nLen ? HB_FALSE : + return nPos > pBitBuffer->nLen ? HB_FALSE : ( ( pBitBuffer->pBuffer[ nPos >> 3 ] >> ( nPos & 7 ) ) & 1 ); } diff --git a/harbour/contrib/hbzebra/hbzebra.hbc b/harbour/contrib/hbzebra/hbzebra.hbc index 19e8c7a0a1..5202341a80 100644 --- a/harbour/contrib/hbzebra/hbzebra.hbc +++ b/harbour/contrib/hbzebra/hbzebra.hbc @@ -6,4 +6,4 @@ incpaths=. libs=${hb_name} -..\hbcairo\hbcairo.hbc \ No newline at end of file +..\hbcairo\hbcairo.hbc diff --git a/harbour/contrib/hbzebra/hbzebra.hbp b/harbour/contrib/hbzebra/hbzebra.hbp index 8891e020ea..f6fd9ca1ca 100644 --- a/harbour/contrib/hbzebra/hbzebra.hbp +++ b/harbour/contrib/hbzebra/hbzebra.hbp @@ -25,6 +25,16 @@ itf.c msi.c # Drawing backends --Ic:\devel\cairo-1.8.10\include\cairo -cairo.c -hbcairo.hbc \ No newline at end of file + +-depoptional=cairo:yes +-depkeyhead=cairo:cairo.h +-depcontrol=cairo:no{HB_BUILD_3RDEXT='no'} +-depcontrol=cairo:${HB_WITH_CAIRO} +-depincpath=cairo:/usr/include/cairo +-depincpath=cairo:/opt/local/include/cairo +-depimplibs=cairo:../../bin/libcairo-2.dll +-depimplibd=cairo:cairo +-depfinish=cairo + +cairo.c{HBMK_HAS_CAIRO} +../hbcairo/hbcairo.hbc{HBMK_HAS_CAIRO} diff --git a/harbour/contrib/hbzebra/itf.c b/harbour/contrib/hbzebra/itf.c index d029f5fb5b..24a4fded0c 100644 --- a/harbour/contrib/hbzebra/itf.c +++ b/harbour/contrib/hbzebra/itf.c @@ -60,8 +60,8 @@ static char s_code[] = { 0x0C, 0x11, 0x12, 0x03, 0x14, 0x05, 0x06, 0x18, 0x09, 0 static char _itf_checksum( const char * szCode ) { int i, sum = 0; - - for ( i = 0; szCode[ i ]; i++ ) + + for ( i = 0; szCode[ i ]; i++ ) sum += ( szCode[ i ] - '0' ) * ( i & 1 ? 1 : 3 ); return '0' + ( 100000 - sum ) % 10; } @@ -100,6 +100,8 @@ PHB_ZEBRA hb_zebra_create_itf( const char * szCode, HB_SIZE nLen, int iFlags ) szCode = pZebra->szCode; if( iFlags & HB_ZEBRA_FLAG_CHECKSUM ) csum = _itf_checksum( pZebra->szCode ); + else + csum = 0; if( iFlags & HB_ZEBRA_FLAG_WIDE2_5 ) { @@ -125,7 +127,7 @@ PHB_ZEBRA hb_zebra_create_itf( const char * szCode, HB_SIZE nLen, int iFlags ) hb_bitbuffer_cat_int( pZebra->pBits, 3, iN ); hb_bitbuffer_cat_int( pZebra->pBits, 0, iN ); - for( i = 0; szCode[ i ]; i += 2 ) + for( i = 0; szCode[ i ]; i += 2 ) { char c1 = s_code[ szCode[ i ] - '0' ], c2 = szCode[ i + 1 ] ? s_code[ szCode[ i + 1 ] - '0' ] : csum; hb_bitbuffer_cat_int( pZebra->pBits, 31, c1 & 1 ? iW : iN ); hb_bitbuffer_cat_int( pZebra->pBits, 0, c2 & 1 ? iW : iN ); c1 >>= 1; c2 >>= 1;