2010-11-10 19:12 UTC+0300 Mindaugas Kavaliauskas (dbtopas/at/dbtopas.lt)

* harbour/contrib/hbzebra/codabar.c
  * harbour/contrib/hbzebra/code11.c
  * harbour/contrib/hbzebra/code128.c
  * harbour/contrib/hbzebra/code39.c
  * harbour/contrib/hbzebra/code93.c
  * harbour/contrib/hbzebra/eanupc.c
  * harbour/contrib/hbzebra/itf.c
  * harbour/contrib/hbzebra/msi.c
    * pacified warning
This commit is contained in:
Mindaugas Kavaliauskas
2010-11-10 17:13:17 +00:00
parent 51ddd618ad
commit 1aa52c0105
9 changed files with 70 additions and 59 deletions

View File

@@ -16,6 +16,17 @@
The license applies to all entries newer than 2009-04-28.
*/
2010-11-10 19:12 UTC+0300 Mindaugas Kavaliauskas (dbtopas/at/dbtopas.lt)
* harbour/contrib/hbzebra/codabar.c
* harbour/contrib/hbzebra/code11.c
* harbour/contrib/hbzebra/code128.c
* harbour/contrib/hbzebra/code39.c
* harbour/contrib/hbzebra/code93.c
* harbour/contrib/hbzebra/eanupc.c
* harbour/contrib/hbzebra/itf.c
* harbour/contrib/hbzebra/msi.c
* pacified warning
2010-11-10 15:40 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
* contrib/hbzebra/d_gen.c
+ Implemented C level callback interface.

View File

@@ -77,7 +77,7 @@ static char s_code[] = {
0x68, /* C */
0x38}; /* D */
static char _codabar_charno( char ch )
static int _codabar_charno( char ch )
{
static char * s_symbols = "-$:/.+ABCD";
@@ -146,7 +146,7 @@ PHB_ZEBRA hb_zebra_create_codabar( const char * szCode, HB_SIZE nLen, int iFlags
}
}
pZebra->szCode = hb_xgrab( iLen + 1 );
pZebra->szCode = ( char * ) hb_xgrab( iLen + 1 );
hb_xmemcpy( pZebra->szCode, szCode, iLen );
pZebra->szCode[ iLen ] = '\0';
szCode = pZebra->szCode;

View File

@@ -130,7 +130,7 @@ PHB_ZEBRA hb_zebra_create_code11( const char * szCode, HB_SIZE nLen, int iFlags
}
}
pZebra->szCode = hb_xgrab( iLen + 1 );
pZebra->szCode = ( char * ) hb_xgrab( iLen + 1 );
hb_xmemcpy( pZebra->szCode, szCode, iLen );
pZebra->szCode[ iLen ] = '\0';
szCode = pZebra->szCode;

View File

@@ -223,7 +223,7 @@ PHB_ZEBRA hb_zebra_create_code128( const char * szCode, HB_SIZE nLen, int iFlags
}
/* make print string */
pZebra->szCode = hb_xgrab( j + 1 );
pZebra->szCode = ( char * ) hb_xgrab( j + 1 );
j = 0;
for( i = 0; i < iLen; i++ )
{

View File

@@ -58,49 +58,49 @@
/* Usually one character bitmap does not fit into 1 byte, but if we use enough
good encoding, we can manage to fit :) [Mindaugas] */
static char s_code[] = {
0x58, /* 0 */
0x09, /* 1 */
0x0C, /* 2 */
0x0D, /* 3 */
0x18, /* 4 */
0x19, /* 5 */
0x1C, /* 6 */
0x48, /* 7 */
0x49, /* 8 */
0x4C, /* 9 */
0x21, /* A */
0x24, /* B */
0x25, /* C */
0x30, /* D */
0x31, /* E */
0x34, /* F */
0x60, /* G */
0x61, /* H */
0x64, /* I */
0x70, /* J */
0x81, /* K */
0x84, /* L */
0x85, /* M */
0x90, /* N */
0x91, /* O */
0x94, /* P */
0xC0, /* Q */
0xC1, /* R */
0xC4, /* S */
0xD0, /* T */
0x03, /* U */
0x06, /* V */
0x07, /* W */
0x12, /* X */
0x13, /* Y */
0x16, /* Z */
0x42, /* - */
0x43, /* . */
0x46, /* */
0x2A, /* $ */
0x8A, /* / */
0xA2, /* + */
0xA8}; /* % */
0x58, /* 0 */
0x09, /* 1 */
0x0C, /* 2 */
0x0D, /* 3 */
0x18, /* 4 */
0x19, /* 5 */
0x1C, /* 6 */
0x48, /* 7 */
0x49, /* 8 */
0x4C, /* 9 */
0x21, /* A */
0x24, /* B */
0x25, /* C */
0x30, /* D */
0x31, /* E */
0x34, /* F */
0x60, /* G */
0x61, /* H */
0x64, /* I */
0x70, /* J */
( char ) 0x81, /* K */
( char ) 0x84, /* L */
( char ) 0x85, /* M */
( char ) 0x90, /* N */
( char ) 0x91, /* O */
( char ) 0x94, /* P */
( char ) 0xC0, /* Q */
( char ) 0xC1, /* R */
( char ) 0xC4, /* S */
( char ) 0xD0, /* T */
0x03, /* U */
0x06, /* V */
0x07, /* W */
0x12, /* X */
0x13, /* Y */
0x16, /* Z */
0x42, /* - */
0x43, /* . */
0x46, /* */
0x2A, /* $ */
( char ) 0x8A, /* / */
( char ) 0xA2, /* + */
( char ) 0xA8}; /* % */
static int _code39_charno( char ch )
{

View File

@@ -147,7 +147,7 @@ PHB_ZEBRA hb_zebra_create_code93( const char * szCode, HB_SIZE nLen, int iFlags
k += _code93_charno( szCode[ i ] ) >= 0 ? 1 : 2;
}
pZebra->szCode = hb_xgrab( j + 1 );
pZebra->szCode = ( char * ) hb_xgrab( j + 1 );
j = 0;
for( i = 0; i < iLen; i++ )
{

View File

@@ -156,7 +156,7 @@ PHB_ZEBRA hb_zebra_create_ean13( const char * szCode, HB_SIZE nLen, int iFlags )
if( iLen == 12 )
{
pZebra->szCode = hb_xgrab( 14 );
pZebra->szCode = ( char * ) hb_xgrab( 14 );
hb_xmemcpy( pZebra->szCode, szCode, 12 );
pZebra->szCode[ 12 ] = _ean13_checksum( szCode );
pZebra->szCode[ 13 ] = '\0';
@@ -168,7 +168,7 @@ PHB_ZEBRA hb_zebra_create_ean13( const char * szCode, HB_SIZE nLen, int iFlags )
pZebra->iError = HB_ZEBRA_ERROR_BADCHECKSUM;
return pZebra;
}
pZebra->szCode = hb_xgrab( 14 );
pZebra->szCode = ( char * ) hb_xgrab( 14 );
hb_xmemcpy( pZebra->szCode, szCode, 13 );
pZebra->szCode[ 13 ] = '\0';
}
@@ -224,7 +224,7 @@ PHB_ZEBRA hb_zebra_create_ean8( const char * szCode, HB_SIZE nLen, int iFlags )
if( iLen == 7 )
{
pZebra->szCode = hb_xgrab( 9 );
pZebra->szCode = ( char * ) hb_xgrab( 9 );
hb_xmemcpy( pZebra->szCode, szCode, 7 );
pZebra->szCode[ 7 ] = _ean8_checksum( szCode );
pZebra->szCode[ 8 ] = '\0';
@@ -236,7 +236,7 @@ PHB_ZEBRA hb_zebra_create_ean8( const char * szCode, HB_SIZE nLen, int iFlags )
pZebra->iError = HB_ZEBRA_ERROR_BADCHECKSUM;
return pZebra;
}
pZebra->szCode = hb_xgrab( 9 );
pZebra->szCode = ( char * ) hb_xgrab( 9 );
hb_xmemcpy( pZebra->szCode, szCode, 8 );
pZebra->szCode[ 8 ] = '\0';
}
@@ -286,7 +286,7 @@ PHB_ZEBRA hb_zebra_create_upca( const char * szCode, HB_SIZE nLen, int iFlags )
if( iLen == 11 )
{
pZebra->szCode = hb_xgrab( 13 );
pZebra->szCode = ( char * ) hb_xgrab( 13 );
hb_xmemcpy( pZebra->szCode, szCode, 11 );
pZebra->szCode[ 11 ] = _upca_checksum( szCode );
pZebra->szCode[ 12 ] = '\0';
@@ -298,7 +298,7 @@ PHB_ZEBRA hb_zebra_create_upca( const char * szCode, HB_SIZE nLen, int iFlags )
pZebra->iError = HB_ZEBRA_ERROR_BADCHECKSUM;
return pZebra;
}
pZebra->szCode = hb_xgrab( 13 );
pZebra->szCode = ( char * ) hb_xgrab( 13 );
hb_xmemcpy( pZebra->szCode, szCode, 12 );
pZebra->szCode[ 12 ] = '\0';
}
@@ -348,7 +348,7 @@ PHB_ZEBRA hb_zebra_create_upce( const char * szCode, HB_SIZE nLen, int iFlags )
if( iLen == 6 )
{
pZebra->szCode = hb_xgrab( 8 );
pZebra->szCode = ( char * ) hb_xgrab( 8 );
hb_xmemcpy( pZebra->szCode, szCode, 6 );
pZebra->szCode[ 6 ] = _upce_checksum( szCode );
pZebra->szCode[ 7 ] = '\0';
@@ -360,7 +360,7 @@ PHB_ZEBRA hb_zebra_create_upce( const char * szCode, HB_SIZE nLen, int iFlags )
pZebra->iError = HB_ZEBRA_ERROR_BADCHECKSUM;
return pZebra;
}
pZebra->szCode = hb_xgrab( 8 );
pZebra->szCode = ( char * ) hb_xgrab( 8 );
hb_xmemcpy( pZebra->szCode, szCode, 7 );
pZebra->szCode[ 7 ] = '\0';
}

View File

@@ -92,7 +92,7 @@ PHB_ZEBRA hb_zebra_create_itf( const char * szCode, HB_SIZE nLen, int iFlags )
}
else
{
pZebra->szCode = hb_xgrab( iLen + 1 );
pZebra->szCode = ( char * ) hb_xgrab( iLen + 1 );
hb_xmemcpy( pZebra->szCode, szCode, iLen );
pZebra->szCode[ iLen ] = '\0';
}

View File

@@ -69,7 +69,7 @@ static char _msi_checksum( const char * szCode )
j = 1 - j;
}
sum %= 10;
return '0' + (sum ? 10 - sum : 0);
return ( char ) ( '0' + ( sum ? 10 - sum : 0 ) );
}
PHB_ZEBRA hb_zebra_create_msi( const char * szCode, HB_SIZE nLen, int iFlags )
@@ -89,7 +89,7 @@ PHB_ZEBRA hb_zebra_create_msi( const char * szCode, HB_SIZE nLen, int iFlags )
}
}
pZebra->szCode = hb_xgrab( iLen + 1 );
pZebra->szCode = ( char * ) hb_xgrab( iLen + 1 );
hb_xmemcpy( pZebra->szCode, szCode, iLen );
pZebra->szCode[ iLen ] = '\0';
szCode = pZebra->szCode;