From 3c2646a728356ac8a9235c6407b6c868e8d08287 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 7 Feb 2010 00:02:17 +0000 Subject: [PATCH] 2010-02-07 01:00 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * src/vm/runner.c ! Fixed error reported by Petr. I'm not really sure about the problem, and current code is not 100% future proof as a HB_SIZE is passed by reference where ULONG ptr is expected. * include/hbsetup.h + Added HB_DEPRECATED. Can be used as function or variable attribute. --- harbour/ChangeLog | 14 ++++++++++++-- harbour/include/hbsetup.h | 3 +++ harbour/src/vm/runner.c | 6 +----- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 5688eca574..c897f3ddbf 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,16 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-02-07 01:00 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + * src/vm/runner.c + ! Fixed error reported by Petr. + I'm not really sure about the problem, and current code + is not 100% future proof as a HB_SIZE is passed by reference + where ULONG ptr is expected. + + * include/hbsetup.h + + Added HB_DEPRECATED. Can be used as function or variable attribute. + 2010-02-06 15:21 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) * contrib/hbide/resources/findinfiles.ui * contrib/hbide/resources/findinfiles.uic @@ -29,7 +39,7 @@ ! Fixed for RegEx to be compiled with case sensivity. BTW, hb_regEx( compiledRegExp, cString, lCaseSensitive, ... ) - does not honor attribute. Only + does not honor attribute. Only hb_compRegEx() honors. + Implemented to remember last find folder and search expression. @@ -51,7 +61,7 @@ + Added more info in "Results". ! Core normalization. - + Implemented RegEx search. + + Implemented RegEx search. I am not good at this engine, please test. % Changed TODO => DONE in one entry in ChangeLog. diff --git a/harbour/include/hbsetup.h b/harbour/include/hbsetup.h index ad2774fe15..92f1eabfd6 100644 --- a/harbour/include/hbsetup.h +++ b/harbour/include/hbsetup.h @@ -488,6 +488,8 @@ #if defined( __GNUC__ ) && ( __GNUC__ - 0 >= 3 ) + #define HB_DEPRECATED __attribute__ (( __deprecated__ )) + #define HB_PRINTF_FORMAT( _nStr, _nParam ) \ __attribute__ (( format (printf, _nStr, _nParam))) #define HB_MALLOC_ATTR \ @@ -524,6 +526,7 @@ #define HB_RESTRICT __restrict #else + #define HB_DEPRECATED #define HB_PRINTF_FORMAT( _nStr, _nParam ) #define HB_MALLOC_ATTR #define HB_NORETURN_ATTR diff --git a/harbour/src/vm/runner.c b/harbour/src/vm/runner.c index b2d0f49b06..4f15dc4774 100644 --- a/harbour/src/vm/runner.c +++ b/harbour/src/vm/runner.c @@ -404,20 +404,16 @@ static PHRB_BODY hb_hrbLoad( const char * szHrbBody, HB_SIZE ulBodySize, USHORT for( ul = 0; ul < pHrbBody->ulFuncs; ul++ ) { - ULONG ulSizeTmp; - /* Read name of function */ pDynFunc[ ul ].szName = hb_hrbReadId( szHrbBody, ulBodySize, &ulBodyOffset ); if( pDynFunc[ ul ].szName == NULL ) break; /* Read size of function */ - if( ! hb_hrbReadValue( szHrbBody, ulBodySize, &ulBodyOffset, &ulSizeTmp ) || + if( ! hb_hrbReadValue( szHrbBody, ulBodySize, &ulBodyOffset, &ulSize ) || ulBodyOffset + ulSize > ulBodySize ) break; - ulSize = ( HB_SIZE ) ulSizeTmp; - /* Copy function body */ pDynFunc[ ul ].pCode = ( BYTE * ) hb_xgrab( ulSize ); memcpy( ( char * ) pDynFunc[ ul ].pCode, szHrbBody + ulBodyOffset, ulSize );