diff --git a/harbour/ChangeLog b/harbour/ChangeLog index adf22fed5e..fcad4254ff 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,16 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-02-07 13:58 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + * contrib/hbct/ctchksum.c + ! Fixed to not strip const from type. + * ULONG -> HB_SIZE, HB_U32 + * UCHAR -> HB_UCHAR + + * contrib/hbct/asciisum.c + * size_t -> HB_SIZE + * Formatting. + 2010-02-07 13:16 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * src/vm/fm.c * src/vm/extrap.c diff --git a/harbour/contrib/hbct/asciisum.c b/harbour/contrib/hbct/asciisum.c index 802c5f6870..7ce0129889 100644 --- a/harbour/contrib/hbct/asciisum.c +++ b/harbour/contrib/hbct/asciisum.c @@ -96,16 +96,15 @@ HB_FUNC( ASCIISUM ) { - if( HB_ISCHAR( 1 ) ) { - size_t sStrSize = hb_parclen( 1 ); - const char *pcString = hb_parc( 1 ); - size_t sPos; + const char * pcString = hb_parc( 1 ); + HB_SIZE sStrSize = hb_parclen( 1 ); + HB_SIZE sPos; ULONG ulResult = 0; for( sPos = 0; sPos < sStrSize; sPos++ ) - ulResult += ( ULONG ) pcString[sPos]; + ulResult += ( ULONG ) pcString[ sPos ]; hb_retnl( ulResult ); } @@ -122,12 +121,8 @@ HB_FUNC( ASCIISUM ) } if( pSubst != NULL ) - { hb_itemReturnRelease( pSubst ); - } else - { hb_retni( 0 ); - } } } diff --git a/harbour/contrib/hbct/ctchksum.c b/harbour/contrib/hbct/ctchksum.c index 9bda761925..c109527587 100644 --- a/harbour/contrib/hbct/ctchksum.c +++ b/harbour/contrib/hbct/ctchksum.c @@ -54,13 +54,13 @@ HB_FUNC( CHECKSUM ) { - UCHAR *pbyString = ( UCHAR * ) hb_parc( 1 ); - ULONG ulLen = hb_parclen( 1 ); - ULONG ulPos; - ULONG ulResult = 0; + const HB_UCHAR * pbyString = ( const HB_UCHAR * ) hb_parc( 1 ); + HB_SIZE ulLen = hb_parclen( 1 ); + HB_SIZE ulPos; + HB_U32 ulResult = 0; for( ulPos = 0; ulPos < ulLen; ulPos++ ) - ulResult += pbyString[ulPos] | ( pbyString[ulPos + 1] << 8 ); + ulResult += pbyString[ ulPos ] | ( pbyString[ ulPos + 1 ] << 8 ); - hb_retnint( ( ULONG ) ( ( ulResult & 0x00FFFFFF ) | ( ( ulLen & 0xFF ) << 24 ) ) ); + hb_retnint( ( HB_U32 ) ( ( ulResult & 0x00FFFFFF ) | ( ( ulLen & 0xFF ) << 24 ) ) ); }