2010-12-09 14:42 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)

* contrib/hblzf/hblzf.c
    % Deleted unnecessary assignment (fixing potential bcc warning)
    ! Fixed missing casts in allocations, breaking C++ mode (f.e. msvc)
This commit is contained in:
Viktor Szakats
2010-12-09 13:44:43 +00:00
parent 0ab0d778c8
commit 0ef35d5a72
2 changed files with 11 additions and 6 deletions

View File

@@ -16,6 +16,11 @@
The license applies to all entries newer than 2009-04-28.
*/
2010-12-09 14:42 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* contrib/hblzf/hblzf.c
% Deleted unnecessary assignment (fixing potential bcc warning)
! Fixed missing casts in allocations, breaking C++ mode (f.e. msvc)
2010-12-09 14:38 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* contrib/hblzf/hblzf.c
! Fixed for MT mode by moving static vars to TSD.

View File

@@ -135,11 +135,11 @@ HB_FUNC( LZF_COMPRESS )
{
PHB_ITEM pArg = hb_param( 1, HB_IT_STRING );
if( pArg != NULL )
if( pArg )
{
PHB_LZF_VAR pLZF_VAR = ( PHB_LZF_VAR ) hb_stackGetTSD( &s_lzf_var );
const char * in_data = NULL;
const char * in_data;
char * out_data;
HB_SIZE in_len, out_len;
unsigned int uiResult;
@@ -171,11 +171,11 @@ HB_FUNC( LZF_DECOMPRESS )
{
PHB_ITEM pArg = hb_param( 1, HB_IT_STRING );
if( pArg != NULL )
if( pArg )
{
PHB_LZF_VAR pLZF_VAR = ( PHB_LZF_VAR ) hb_stackGetTSD( &s_lzf_var );
const char * in_data = NULL;
const char * in_data;
char * buffer;
HB_SIZE in_len, buffer_size, i = 1;
unsigned int uiResult;
@@ -184,12 +184,12 @@ HB_FUNC( LZF_DECOMPRESS )
in_len = hb_itemGetCLen( pArg );
buffer_size = pLZF_VAR->buffer_size;
buffer = hb_xgrab( buffer_size + 1 );
buffer = ( char * ) hb_xgrab( buffer_size + 1 );
do
{
buffer_size *= i++;
buffer = hb_xrealloc( buffer, buffer_size );
buffer = ( char * ) hb_xrealloc( buffer, buffer_size );
uiResult = lzf_decompress( in_data, in_len, buffer, buffer_size );
} while( uiResult == 0 && errno == E2BIG );