From 91f4eceed82506ffdcb1632e24f0a9c1670614d7 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 21 Nov 2012 14:06:16 +0000 Subject: [PATCH] 2012-11-21 15:05 UTC+0100 Viktor Szakats (harbour syenar.net) * contrib/hbzebra/code128.c * contrib/hbzebra/pdf417.c * for(); -> for() ; * package/winuni/RELNOTES * FreeImage updated version --- harbour/ChangeLog | 10 +++++++++ harbour/contrib/hbzebra/code128.c | 4 +++- harbour/contrib/hbzebra/pdf417.c | 37 ++++++++++++++++++++++--------- harbour/package/winuni/RELNOTES | 2 +- 4 files changed, 41 insertions(+), 12 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 643fa45983..c0808fd768 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -10,6 +10,16 @@ * Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment */ +2012-11-21 15:05 UTC+0100 Viktor Szakats (harbour syenar.net) + * contrib/hbzebra/code128.c + * contrib/hbzebra/pdf417.c + * for(); -> + for() + ; + + * package/winuni/RELNOTES + * FreeImage updated version + 2012-11-21 13:12 UTC+0100 Viktor Szakats (harbour syenar.net) * src/common/hbver.c * src/compiler/hbpcode.c diff --git a/harbour/contrib/hbzebra/code128.c b/harbour/contrib/hbzebra/code128.c index 212f3736ad..65b84eb25d 100644 --- a/harbour/contrib/hbzebra/code128.c +++ b/harbour/contrib/hbzebra/code128.c @@ -304,7 +304,9 @@ PHB_ZEBRA hb_zebra_create_code128( const char * szCode, HB_SIZE nLen, int iFlags if( 16 <= pCode[ i ] && pCode[ i ] <= 25 ) { - for( j = i + 1; j < iCodeLen && 16 <= pCode[ j ] && pCode[ j ] <= 25; j++ ); + for( j = i + 1; j < iCodeLen && 16 <= pCode[ j ] && pCode[ j ] <= 25; j++ ) + ; + if( j - i == 2 && i == 1 && j == iCodeLen ) { /* [StartB] 1 2 --> [StartC] [12] */ diff --git a/harbour/contrib/hbzebra/pdf417.c b/harbour/contrib/hbzebra/pdf417.c index 74782da811..39891bc741 100644 --- a/harbour/contrib/hbzebra/pdf417.c +++ b/harbour/contrib/hbzebra/pdf417.c @@ -824,9 +824,12 @@ static int _pdf417_encode_text( const char * szCode, int iLen, int * pCW, int iP else /* if( ( no = _pdf417_punctno( szCode[ i ] ) ) != -1 ) */ { no = _pdf417_punctno( szCode[ i ] ); + for( j = i + 1; j < iLen && _pdf417_punctno( szCode[ j ] ) != -1 && - _pdf417_mixedno( szCode[ j ] ) == -1; j++ ); + _pdf417_mixedno( szCode[ j ] ) == -1; j++ ) + ; + if( j - i >= 5 ) { iPos = _pdf417_encode_text_add( pCW, iPos, &i1, &i2, 28 /* UPPER->MIXED */ ); @@ -856,7 +859,9 @@ static int _pdf417_encode_text( const char * szCode, int iLen, int * pCW, int iP { for( j = i + 1; j < iLen && _pdf417_upperno( szCode[ j ] ) != -1 && - szCode[ j ] != ' '; j++ ); + szCode[ j ] != ' '; j++ ) + ; + if( j - i >= 4 ) { iPos = _pdf417_encode_text_add( pCW, iPos, &i1, &i2, 28 /* LOWER->MIXED */ ); @@ -887,9 +892,12 @@ static int _pdf417_encode_text( const char * szCode, int iLen, int * pCW, int iP else /* if( ( no = _pdf417_punctno( szCode[ i ] ) ) != -1 ) */ { no = _pdf417_punctno( szCode[ i ] ); + for( j = i + 1; j < iLen && _pdf417_punctno( szCode[ j ] ) != -1 && - _pdf417_mixedno( szCode[ j ] ) == -1; j++ ); + _pdf417_mixedno( szCode[ j ] ) == -1; j++ ) + ; + if( j - i >= 5 ) { iPos = _pdf417_encode_text_add( pCW, iPos, &i1, &i2, 28 /* LOWER->MIXED */ ); @@ -934,9 +942,12 @@ static int _pdf417_encode_text( const char * szCode, int iLen, int * pCW, int iP else /* if( ( no = _pdf417_punctno( szCode[ i ] ) ) != -1 ) */ { no = _pdf417_punctno( szCode[ i ] ); + for( j = i + 1; j < iLen && _pdf417_punctno( szCode[ j ] ) != -1 && - _pdf417_mixedno( szCode[ j ] ) == -1; j++ ); + _pdf417_mixedno( szCode[ j ] ) == -1; j++ ) + ; + if( j - i >= 4 ) { iPos = _pdf417_encode_text_add( pCW, iPos, &i1, &i2, 25 /* MIXED->PUNCT */ ); @@ -1072,7 +1083,8 @@ static int _pdf417_encode( const char * szCode, int iLen, int * pCW ) To save 2 CW + average remainig space in text mode we must have 2.5 / (0.5-0.3409) = 15.71 digits */ - for( j = i + 1; j < iLen && _pdf417_isdigit( szCode[ j ] ); j++ ); + for( j = i + 1; j < iLen && _pdf417_isdigit( szCode[ j ] ); j++ ) + ; if( j - i >= 16 ) { iPos = _pdf417_encode_text( szCode + iStart, i - iStart, pCW, iPos ); @@ -1090,7 +1102,8 @@ static int _pdf417_encode( const char * szCode, int iLen, int * pCW ) return -1; /* Switch if we have 3 or more non-alphanumeric values */ - for( j = i + 1; j < iLen && ! _pdf417_isalpha( szCode[ j ] ); j++ ); + for( j = i + 1; j < iLen && ! _pdf417_isalpha( szCode[ j ] ); j++ ) + ; if( j - i >= 3 ) { iMode = LATCH_BYTE; @@ -1107,7 +1120,8 @@ static int _pdf417_encode( const char * szCode, int iLen, int * pCW ) { if( _pdf417_isdigit( szCode[ i ] ) ) { - for( j = i + 1; j < iLen && _pdf417_isdigit( szCode[ i ] ); j++ ); + for( j = i + 1; j < iLen && _pdf417_isdigit( szCode[ i ] ); j++ ) + ; if( j - i >= 4 ) { iPos = _pdf417_encode_byte( szCode + iStart, i - iStart, pCW, iPos ); @@ -1119,7 +1133,8 @@ static int _pdf417_encode( const char * szCode, int iLen, int * pCW ) } if( iMode == LATCH_BYTE && _pdf417_isalpha( szCode[ i ] ) ) { - for( j = i + 1; j < iLen && _pdf417_isdigit( szCode[ i ] ); j++ ); + for( j = i + 1; j < iLen && _pdf417_isdigit( szCode[ i ] ); j++ ) + ; if( j - i >= 4 ) { iPos = _pdf417_encode_byte( szCode + iStart, i - iStart, pCW, iPos ); @@ -1141,7 +1156,8 @@ static int _pdf417_encode( const char * szCode, int iLen, int * pCW ) if( iPos == -1 || iPos >= MAX_CODEWORD_COUNT - 2 ) return -1; - for( j = i + 1; j < iLen && ! _pdf417_isalpha( szCode[ j ] ); j++ ); + for( j = i + 1; j < iLen && ! _pdf417_isalpha( szCode[ j ] ); j++ ) + ; if( j - i >= 2 ) { iMode = LATCH_BYTE; @@ -1149,7 +1165,8 @@ static int _pdf417_encode( const char * szCode, int iLen, int * pCW ) } else { - for( j = i + 2; j < iLen && _pdf417_isdigit( szCode[ j ] ); j++ ); + for( j = i + 2; j < iLen && _pdf417_isdigit( szCode[ j ] ); j++ ) + ; if( j - i >= 16 ) { pCW[ iPos++ ] = SHIFT_BYTE; diff --git a/harbour/package/winuni/RELNOTES b/harbour/package/winuni/RELNOTES index 6593a28feb..8b1e27acf4 100644 --- a/harbour/package/winuni/RELNOTES +++ b/harbour/package/winuni/RELNOTES @@ -52,7 +52,7 @@ Tool/lib versions used to create this package: Cairo 1.8.8 libcurl 7.25.0 Firebird 2.5.0 - FreeImage 3.15.0 + FreeImage 3.15.4 GD 2.0.35 MySQL 5.5.13 OCILIB 3.10.0