From fa7dcb44ea32b25e83d82989298777ebbe20cd4b Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 2 Jun 2008 19:19:50 +0000 Subject: [PATCH] 2008-06-02 21:16 UTC+0100 Viktor Szakats (harbour.01 syenar hu) * source/vm/hvm.c % Minor opt to __SETPROFILE(), __TRACEPRGCALLS() ! __SETPROFILE() to only set the value if a parameter was passed. This way it's possible to read the value without destroying it. --- harbour/ChangeLog | 6 ++++++ harbour/source/vm/hvm.c | 19 ++++++++----------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 1fe993848d..81cb29382f 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,12 @@ 2008-12-31 13:59 UTC+0100 Foo Bar */ +2008-06-02 21:16 UTC+0100 Viktor Szakats (harbour.01 syenar hu) + * source/vm/hvm.c + % Minor opt to __SETPROFILE(), __TRACEPRGCALLS() + ! __SETPROFILE() to only set the value if a parameter was passed. + This way it's possible to read the value without destroying it. + 2008-06-02 20:16 UTC+0100 Viktor Szakats (harbour.01 syenar hu) * source/common/hbstr.c ! HB_EXPORT added to hb_strRemEscSeq(). Thanks Javier. diff --git a/harbour/source/vm/hvm.c b/harbour/source/vm/hvm.c index a231fdcad5..ff4451d18e 100644 --- a/harbour/source/vm/hvm.c +++ b/harbour/source/vm/hvm.c @@ -9668,14 +9668,12 @@ void hb_vmIsStaticRef( void ) * $End$ */ HB_FUNC( __SETPROFILER ) { -#ifndef HB_NO_PROFILER - BOOL bOldValue = hb_bProfiler; - - hb_bProfiler = hb_parl( 1 ); - - hb_retl( bOldValue ); -#else +#ifdef HB_NO_PROFILER hb_retl( FALSE ); +#else + hb_retl( hb_bProfiler ); + if( ISLOG( 1 ) ) + hb_bProfiler = hb_parl( 1 ); #endif } @@ -9688,10 +9686,9 @@ HB_FUNC( __TRACEPRGCALLS ) #ifdef HB_NO_TRACE hb_retl( FALSE ); #else - BOOL bOldValue = hb_bTracePrgCalls; + hb_retl( hb_bTracePrgCalls ); if( ISLOG( 1 ) ) hb_bTracePrgCalls = hb_parl( 1 ); - hb_retl( bOldValue ); #endif } @@ -9718,8 +9715,8 @@ HB_FUNC( __OPGETPRF ) /* profiler: It returns an array with an opcode called and hb_reta( 2 ); #endif { - hb_stornl( 0, -1, 1 ); - hb_stornl( 0, -1, 2 ); + hb_stornl( 0, -1, 1 ); + hb_stornl( 0, -1, 2 ); } }