From 76a5fd9b3b88acbcee5c355bc14433ec0bfc1eba Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Thu, 16 Jul 2009 13:20:19 +0000 Subject: [PATCH] 2009-07-16 15:20 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/source/pp/ppcore.c * harbour/source/compiler/complex.c * harbour/source/hbzlib/ChangeLog * harbour/source/hbzlib/trees.c * cleaned casting --- harbour/ChangeLog | 7 +++++++ harbour/source/compiler/complex.c | 6 +++--- harbour/source/hbzlib/ChangeLog | 4 ++++ harbour/source/hbzlib/trees.c | 10 +++++----- harbour/source/pp/ppcore.c | 10 +++++----- 5 files changed, 24 insertions(+), 13 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 971857f6bb..82a9896e8f 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,13 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-07-16 15:20 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/source/pp/ppcore.c + * harbour/source/compiler/complex.c + * harbour/source/hbzlib/ChangeLog + * harbour/source/hbzlib/trees.c + * cleaned casting + 2009-07-16 14:57 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * config/global.cf ! Switched to use HB_FLAGSEXTRA for __PLATFORM__ macros instead diff --git a/harbour/source/compiler/complex.c b/harbour/source/compiler/complex.c index 1cc3561a3f..60f62e8887 100644 --- a/harbour/source/compiler/complex.c +++ b/harbour/source/compiler/complex.c @@ -104,7 +104,7 @@ typedef struct int maxlen; /* maximal length */ int type; /* terminal symbol code */ } -HB_LEX_KEY, * PHB_LEX_KEY; +HB_LEX_KEY; static const HB_LEX_KEY s_keytable[] = { @@ -220,7 +220,7 @@ static int hb_comp_asType( PHB_PP_TOKEN pToken, BOOL fArray ) { if( pToken && HB_PP_TOKEN_TYPE( pToken->type ) == HB_PP_TOKEN_KEYWORD ) { - PHB_LEX_KEY pKey = ( PHB_LEX_KEY ) s_typetable; + const HB_LEX_KEY * pKey = s_typetable; int i = sizeof( s_typetable ) / sizeof( HB_LEX_KEY ); hb_pp_tokenUpper( pToken ); @@ -238,7 +238,7 @@ static int hb_comp_asType( PHB_PP_TOKEN pToken, BOOL fArray ) static int hb_comp_keywordType( PHB_PP_TOKEN pToken ) { - PHB_LEX_KEY pKey = ( PHB_LEX_KEY ) s_keytable; + const HB_LEX_KEY * pKey = s_keytable; int i = sizeof( s_keytable ) / sizeof( HB_LEX_KEY ); do diff --git a/harbour/source/hbzlib/ChangeLog b/harbour/source/hbzlib/ChangeLog index 039a5da3ea..70f04fd91c 100644 --- a/harbour/source/hbzlib/ChangeLog +++ b/harbour/source/hbzlib/ChangeLog @@ -18,6 +18,10 @@ * */ +2009-07-16 15:20 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/source/hbzlib/trees.c + * cleaned casting + 2008-08-05 21:39 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * harbour/source/hbzlib/zconf.h + Setting ZLIB_DLL if HB_DYNLIB is defined. diff --git a/harbour/source/hbzlib/trees.c b/harbour/source/hbzlib/trees.c index b0d37b666f..f543d5e6d9 100644 --- a/harbour/source/hbzlib/trees.c +++ b/harbour/source/hbzlib/trees.c @@ -150,8 +150,8 @@ local void send_tree OF((deflate_state *s, ct_data *tree, int max_code)); local int build_bl_tree OF((deflate_state *s)); local void send_all_trees OF((deflate_state *s, int lcodes, int dcodes, int blcodes)); -local void compress_block OF((deflate_state *s, ct_data *ltree, - ct_data *dtree)); +local void compress_block OF((deflate_state *s, const ct_data *ltree, + const ct_data *dtree)); local void set_data_type OF((deflate_state *s)); local unsigned bi_reverse OF((unsigned value, int length)); local void bi_windup OF((deflate_state *s)); @@ -986,7 +986,7 @@ void _tr_flush_block( } else if (s->strategy == Z_FIXED || static_lenb == opt_lenb) { #endif send_bits(s, (STATIC_TREES<<1)+eof, 3); - compress_block(s, (ct_data *)static_ltree, (ct_data *)static_dtree); + compress_block(s, &static_ltree[0], &static_dtree[0]); #ifdef DEBUG s->compressed_len += 3 + s->static_len; #endif @@ -1071,8 +1071,8 @@ int _tr_tally ( */ local void compress_block( deflate_state *s, - ct_data *ltree, /* literal tree */ - ct_data *dtree) /* distance tree */ + const ct_data *ltree, /* literal tree */ + const ct_data *dtree) /* distance tree */ { unsigned dist; /* distance of matched string */ int lc; /* match length or unmatched char (if dist == 0) */ diff --git a/harbour/source/pp/ppcore.c b/harbour/source/pp/ppcore.c index e9bb95fa11..422dab3f4b 100644 --- a/harbour/source/pp/ppcore.c +++ b/harbour/source/pp/ppcore.c @@ -263,10 +263,10 @@ static void hb_pp_operatorsFree( PHB_PP_OPERATOR pOperators, int iOperators ) hb_xfree( pOperators ); } -static PHB_PP_OPERATOR hb_pp_operatorFind( PHB_PP_STATE pState, - char * buffer, ULONG ulLen ) +static const HB_PP_OPERATOR * hb_pp_operatorFind( PHB_PP_STATE pState, + char * buffer, ULONG ulLen ) { - PHB_PP_OPERATOR pOperator = pState->pOperators; + const HB_PP_OPERATOR * pOperator = pState->pOperators; int i = pState->iOperators; while( --i >= 0 ) @@ -278,7 +278,7 @@ static PHB_PP_OPERATOR hb_pp_operatorFind( PHB_PP_STATE pState, ++pOperator; } - pOperator = ( PHB_PP_OPERATOR ) s_operators; + pOperator = s_operators; i = sizeof( s_operators ) / sizeof( HB_PP_OPERATOR ); do @@ -1428,7 +1428,7 @@ static void hb_pp_getLine( PHB_PP_STATE pState ) } else { - PHB_PP_OPERATOR pOperator = hb_pp_operatorFind( pState, pBuffer, ulLen ); + const HB_PP_OPERATOR * pOperator = hb_pp_operatorFind( pState, pBuffer, ulLen ); if( pOperator ) {