From 4961857b2ddda5a8353f56c34890c65b8973899d Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Tue, 10 Feb 2009 03:10:57 +0000 Subject: [PATCH] 2009-02-10 04:15 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/source/vm/classes.c * covered some old functions marked as deprecated long time ago by HB_LEGACY_LEVEL2 macro * harbour/source/rtl/hbgtcore.c * harbour/contrib/hbct/ctwin.c * harbour/contrib/hbct/keyset.c * harbour/contrib/hbct/misc3.c * harbour/contrib/hbnf/numlock.c * harbour/contrib/hbnf/shift.c * harbour/contrib/hbnf/alt.c * harbour/contrib/hbnf/ctrl.c * harbour/contrib/hbnf/caplock.c * use memset( >Info, 0, sizeof( gtInfo ) ); to initialize HB_GT_INFO structure - it also fixes possible problems with uninitialized pNewVal2 member in few cases. --- harbour/ChangeLog | 18 ++++++++++++++++++ harbour/contrib/hbct/ctwin.c | 2 +- harbour/contrib/hbct/keyset.c | 2 +- harbour/contrib/hbct/misc3.c | 3 +-- harbour/contrib/hbnf/alt.c | 2 +- harbour/contrib/hbnf/caplock.c | 2 +- harbour/contrib/hbnf/ctrl.c | 2 +- harbour/contrib/hbnf/numlock.c | 2 +- harbour/contrib/hbnf/shift.c | 2 +- harbour/source/rtl/hbgtcore.c | 2 +- harbour/source/vm/classes.c | 3 +-- 11 files changed, 28 insertions(+), 12 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 74122d5c97..3354eb5cba 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,24 @@ 2009-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org) */ +2009-02-10 04:15 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/source/vm/classes.c + * covered some old functions marked as deprecated long time ago + by HB_LEGACY_LEVEL2 macro + + * harbour/source/rtl/hbgtcore.c + * harbour/contrib/hbct/ctwin.c + * harbour/contrib/hbct/keyset.c + * harbour/contrib/hbct/misc3.c + * harbour/contrib/hbnf/numlock.c + * harbour/contrib/hbnf/shift.c + * harbour/contrib/hbnf/alt.c + * harbour/contrib/hbnf/ctrl.c + * harbour/contrib/hbnf/caplock.c + * use memset( >Info, 0, sizeof( gtInfo ) ); to initialize + HB_GT_INFO structure - it also fixes possible problems with + uninitialized pNewVal2 member in few cases. + 2009-02-10 02:53 UTC+0100 Viktor Szakats (harbour.01 syenar hu) * ChangeLog * contrib/rddsql/sddmy/common.mak diff --git a/harbour/contrib/hbct/ctwin.c b/harbour/contrib/hbct/ctwin.c index 9dc484d221..28aa166906 100644 --- a/harbour/contrib/hbct/ctwin.c +++ b/harbour/contrib/hbct/ctwin.c @@ -1815,7 +1815,7 @@ static int hb_ctw_gt_Alert( PHB_GT pGT, PHB_ITEM pMessage, PHB_ITEM pOptions, else { HB_GT_INFO gtInfo; - gtInfo.pNewVal = gtInfo.pResult = NULL; + memset( >Info, 0, sizeof( gtInfo ) ); HB_GTSELF_INFO( pGT, HB_GTI_FULLSCREEN, >Info ); fScreen = gtInfo.pResult && hb_itemGetL( gtInfo.pResult ); HB_GTSELF_INFO( pGT, HB_GTI_KBDSUPPORT, >Info ); diff --git a/harbour/contrib/hbct/keyset.c b/harbour/contrib/hbct/keyset.c index 80727a30f3..ab015d28d1 100644 --- a/harbour/contrib/hbct/keyset.c +++ b/harbour/contrib/hbct/keyset.c @@ -61,7 +61,7 @@ static void SetGet( int iFlag ) int iState = 0, iNewState; HB_GT_INFO gtInfo; - gtInfo.pNewVal = gtInfo.pResult = NULL; + memset( >Info, 0, sizeof( gtInfo ) ); hb_gtInfo( HB_GTI_KBDSHIFTS, >Info ); if( gtInfo.pResult ) diff --git a/harbour/contrib/hbct/misc3.c b/harbour/contrib/hbct/misc3.c index 2d309f4bed..4e6d500b60 100644 --- a/harbour/contrib/hbct/misc3.c +++ b/harbour/contrib/hbct/misc3.c @@ -59,8 +59,7 @@ HB_FUNC( KBDSTAT ) int iRet = 0; HB_GT_INFO gtInfo; - gtInfo.pNewVal = NULL; - gtInfo.pResult = NULL; + memset( >Info, 0, sizeof( gtInfo ) ); hb_gtInfo( HB_GTI_KBDSHIFTS, >Info ); diff --git a/harbour/contrib/hbnf/alt.c b/harbour/contrib/hbnf/alt.c index cefbeb1aa4..1f2c0c34c2 100644 --- a/harbour/contrib/hbnf/alt.c +++ b/harbour/contrib/hbnf/alt.c @@ -69,7 +69,7 @@ HB_FUNC( FT_ALT ) { HB_GT_INFO gtInfo; - gtInfo.pNewVal = gtInfo.pResult = NULL; + memset( >Info, 0, sizeof( gtInfo ) ); hb_gtInfo( HB_GTI_KBDSHIFTS, >Info ); hb_retl( ( hb_itemGetNI( gtInfo.pResult ) & HB_GTI_KBD_ALT ) != 0 ); if( gtInfo.pResult ) diff --git a/harbour/contrib/hbnf/caplock.c b/harbour/contrib/hbnf/caplock.c index 09c62b4ae7..0cd8f5c673 100644 --- a/harbour/contrib/hbnf/caplock.c +++ b/harbour/contrib/hbnf/caplock.c @@ -70,7 +70,7 @@ HB_FUNC( FT_CAPLOCK ) int iState = 0, iNewState; HB_GT_INFO gtInfo; - gtInfo.pNewVal = gtInfo.pResult = NULL; + memset( >Info, 0, sizeof( gtInfo ) ); hb_gtInfo( HB_GTI_KBDSHIFTS, >Info ); if( gtInfo.pResult ) { diff --git a/harbour/contrib/hbnf/ctrl.c b/harbour/contrib/hbnf/ctrl.c index 159d70d884..9e876f4d5a 100644 --- a/harbour/contrib/hbnf/ctrl.c +++ b/harbour/contrib/hbnf/ctrl.c @@ -66,7 +66,7 @@ HB_FUNC( FT_CTRL ) { HB_GT_INFO gtInfo; - gtInfo.pNewVal = gtInfo.pResult = NULL; + memset( >Info, 0, sizeof( gtInfo ) ); hb_gtInfo( HB_GTI_KBDSHIFTS, >Info ); hb_retl( ( hb_itemGetNI( gtInfo.pResult ) & HB_GTI_KBD_CTRL ) != 0 ); if( gtInfo.pResult ) diff --git a/harbour/contrib/hbnf/numlock.c b/harbour/contrib/hbnf/numlock.c index 108fb313ff..122b0446ce 100644 --- a/harbour/contrib/hbnf/numlock.c +++ b/harbour/contrib/hbnf/numlock.c @@ -81,7 +81,7 @@ HB_FUNC( FT_NUMLOCK ) int iState = 0, iNewState; HB_GT_INFO gtInfo; - gtInfo.pNewVal = gtInfo.pResult = NULL; + memset( >Info, 0, sizeof( gtInfo ) ); hb_gtInfo( HB_GTI_KBDSHIFTS, >Info ); if( gtInfo.pResult ) { diff --git a/harbour/contrib/hbnf/shift.c b/harbour/contrib/hbnf/shift.c index cb51efec52..67eb6f675c 100644 --- a/harbour/contrib/hbnf/shift.c +++ b/harbour/contrib/hbnf/shift.c @@ -66,7 +66,7 @@ HB_FUNC( FT_SHIFT ) { HB_GT_INFO gtInfo; - gtInfo.pNewVal = gtInfo.pResult = NULL; + memset( >Info, 0, sizeof( gtInfo ) ); hb_gtInfo( HB_GTI_KBDSHIFTS, >Info ); hb_retl( ( hb_itemGetNI( gtInfo.pResult ) & HB_GTI_KBD_SHIFT ) != 0 ); if( gtInfo.pResult ) diff --git a/harbour/source/rtl/hbgtcore.c b/harbour/source/rtl/hbgtcore.c index 88a5f17324..9a156e17a7 100644 --- a/harbour/source/rtl/hbgtcore.c +++ b/harbour/source/rtl/hbgtcore.c @@ -1632,7 +1632,7 @@ static int hb_gt_def_Alert( PHB_GT pGT, PHB_ITEM pMessage, PHB_ITEM pOptions, BYTE * pBuffer = NULL; HB_GT_INFO gtInfo; - gtInfo.pNewVal = gtInfo.pNewVal2 = gtInfo.pResult = NULL; + memset( >Info, 0, sizeof( gtInfo ) ); HB_GTSELF_INFO( pGT, HB_GTI_FULLSCREEN, >Info ); if( gtInfo.pResult ) diff --git a/harbour/source/vm/classes.c b/harbour/source/vm/classes.c index 78bb4a8287..25bb3f330f 100644 --- a/harbour/source/vm/classes.c +++ b/harbour/source/vm/classes.c @@ -4832,7 +4832,7 @@ void hb_clsAssociate( USHORT usClassH ) hb_itemReturnRelease( pSelf ); } -#if 1 +#ifdef HB_LEGACY_LEVEL2 /* * __CLS_PARAM() and __CLS_PAR00() functions are only for backward binary * compatibility. They will be removed in the future so please do not use @@ -4884,7 +4884,6 @@ BOOL hb_objGetpMethod( PHB_ITEM pObject, PHB_SYMB pMessage ) { return hb_objHasMessage( pObject, pMessage->pDynSym ); } - #endif #if 0