From 6277cb38ff85ddc0612683c15f477594abb71852 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20Czerpak?= Date: Wed, 2 Apr 2014 12:46:22 +0200 Subject: [PATCH] 2014-04-02 12:46 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) * src/rtl/filebufd.c * src/rtl/iousr.c * slightly modified code to pacify warnings in some older GCC versions * contrib/gtwvg/gtwvg.hbx * regenerated with new function --- ChangeLog.txt | 8 ++++++++ contrib/gtwvg/gtwvg.hbx | 1 + src/rtl/filebufd.c | 6 +++--- src/rtl/iousr.c | 11 ++++++----- 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index b84929d850..818d5d2138 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -10,6 +10,14 @@ * Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment */ +2014-04-02 12:46 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) + * src/rtl/filebufd.c + * src/rtl/iousr.c + * slightly modified code to pacify warnings in some older GCC versions + + * contrib/gtwvg/gtwvg.hbx + * regenerated with new function + 2014-04-02 08:31 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) * src/vm/hashes.c ! added missing HB_STACK_TLS_PRELOAD diff --git a/contrib/gtwvg/gtwvg.hbx b/contrib/gtwvg/gtwvg.hbx index cfc489f57f..0ebc529fa0 100644 --- a/contrib/gtwvg/gtwvg.hbx +++ b/contrib/gtwvg/gtwvg.hbx @@ -131,6 +131,7 @@ DYNAMIC Wvg_IsWindow DYNAMIC Wvg_IsZoomed DYNAMIC Wvg_Label DYNAMIC Wvg_LabelEx +DYNAMIC Wvg_LabelEx2 DYNAMIC Wvg_LBGetCurSel DYNAMIC Wvg_LBGetText DYNAMIC Wvg_LBSetCurSel diff --git a/src/rtl/filebufd.c b/src/rtl/filebufd.c index 056c8fc599..ee3c7f1023 100644 --- a/src/rtl/filebufd.c +++ b/src/rtl/filebufd.c @@ -450,7 +450,7 @@ static const HB_FILE_FUNCS s_fileFuncs = s_fileHandle }; -typedef void * ( * HB_FILE_FUNC )( PHB_FILE ); +typedef HB_BOOL ( * HB_FILE_FUNC )( PHB_FILE_FUNCS pFuncs, const char * ); #define HB_FILE_FUNC_COUNT ( sizeof( HB_FILE_FUNCS ) / sizeof( HB_FILE_FUNC ) ) HB_BOOL hb_fileRegisterPart( HB_FILE_FUNCS * pFuncs ) @@ -459,8 +459,8 @@ HB_BOOL hb_fileRegisterPart( HB_FILE_FUNCS * pFuncs ) HB_FILE_FUNC * pFunction; int iCount; - pDummyFunc = ( const HB_FILE_FUNC * ) &s_fileFuncs.Accept; - pFunction = ( HB_FILE_FUNC * ) pFuncs; + pDummyFunc = &s_fileFuncs.Accept; + pFunction = &pFuncs->Accept; for( iCount = 0; iCount < ( int ) HB_FILE_FUNC_COUNT; iCount++, pDummyFunc++, pFunction++ ) diff --git a/src/rtl/iousr.c b/src/rtl/iousr.c index b562e87ff6..7d1ec318ea 100644 --- a/src/rtl/iousr.c +++ b/src/rtl/iousr.c @@ -697,7 +697,8 @@ static const HB_FILE_FUNCS s_fileFuncs = s_fileHandle }; -typedef void * ( * HB_FILE_FUNC )( PHB_FILE ); +typedef HB_BOOL ( * HB_FILE_FUNC )( PHB_FILE_FUNCS pFuncs, const char * ); +#define HB_FILE_FUNC_COUNT ( sizeof( HB_FILE_FUNCS ) / sizeof( HB_FILE_FUNC ) ) /* IOUSR_Register( , ) */ HB_FUNC( IOUSR_REGISTER ) @@ -709,8 +710,8 @@ HB_FUNC( IOUSR_REGISTER ) { HB_SIZE nMethods = hb_arrayLen( pMthItm ), nAt; - if( nMethods > IOUSR_METHODCOUNT ) - nMethods = IOUSR_METHODCOUNT; + if( nMethods > HB_MIN( IOUSR_METHODCOUNT, HB_FILE_FUNC_COUNT ) ) + nMethods = HB_MIN( IOUSR_METHODCOUNT, HB_FILE_FUNC_COUNT ); for( nAt = 1; nAt <= nMethods; ++nAt ) { @@ -729,8 +730,8 @@ HB_FUNC( IOUSR_REGISTER ) const HB_FILE_FUNC * pDummyFunc; HB_FILE_FUNC * pFunction; - pDummyFunc = ( const HB_FILE_FUNC * ) &s_fileFuncs.Accept; - pFunction = ( HB_FILE_FUNC * ) &pIO->funcs.Accept; + pDummyFunc = &s_fileFuncs.Accept; + pFunction = &pIO->funcs.Accept; for( nAt = 1; nAt <= nMethods; ++nAt, pDummyFunc++, pFunction++ ) { pIO->prg_funcs[ nAt - 1 ] = hb_arrayGetSymbol( pMthItm, nAt );