From 78fcd3ab59ebf7cc80c5800547bebac9196f3fd2 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 21 Dec 2009 00:07:24 +0000 Subject: [PATCH] 2009-12-21 00:59 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * include/hbextern.ch + Added new trace functions. ; TODO: Use these new functions in HBQT, HBXBP. * contrib/hbwin/win_dll.c ! Fix for OpenWatcom. Seems to require LPVOID in asm code. * contrib/hbqt/hbqt_destruct.cpp * Minor formatting. ('return( x )' -> 'return x', return is not a function) + Added 'TODO:' to todo text. + Added TOFIX to hb_parptr() usage. Without reference counting this is still dangerous. Probably some mechanisms would be needed to count references when attaching one GC collected pointer to another object, and decrement references when disconnecting or deleting holder object. Without this, there will always be a possibility that some objects refer to deleted objects. Unless I'm missing some logic which already that. Probably "delayed release" is the mechanism which is trying to solve that problem at the moment. * contrib/hbwin/wapi_winbase_mutex.c * Minor formatting (superfluous brackets) --- harbour/ChangeLog | 32 +++++++++++++++++++--- harbour/contrib/hbqt/hbqt_destruct.cpp | 4 +-- harbour/contrib/hbwin/wapi_winbase_mutex.c | 2 +- harbour/contrib/hbwin/win_dll.c | 5 +++- harbour/include/hbextern.ch | 3 ++ 5 files changed, 38 insertions(+), 8 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 46fdcadcb4..32c3c6d771 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,30 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-12-21 00:59 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * include/hbextern.ch + + Added new trace functions. + ; TODO: Use these new functions in HBQT, HBXBP. + + * contrib/hbwin/win_dll.c + ! Fix for OpenWatcom. Seems to require LPVOID in asm code. + + * contrib/hbqt/hbqt_destruct.cpp + * Minor formatting. ('return( x )' -> 'return x', return is not a function) + + Added 'TODO:' to todo text. + + Added TOFIX to hb_parptr() usage. Without reference counting this is + still dangerous. + Probably some mechanisms would be needed to count references when + attaching one GC collected pointer to another object, and decrement + references when disconnecting or deleting holder object. Without + this, there will always be a possibility that some objects refer + to deleted objects. Unless I'm missing some logic which already that. + Probably "delayed release" is the mechanism which is trying to + solve that problem at the moment. + + * contrib/hbwin/wapi_winbase_mutex.c + * Minor formatting (superfluous brackets) + 2009-12-20 22:12 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/include/Makefile + harbour/include/hbtrace.ch @@ -65,11 +89,11 @@ * contrib/hbide/hbide.ch * contrib/hbide/hbide.prg - ! Improved Find/Replace functionality. Now it is usable feature + ! Improved Find/Replace functionality. Now it is usable feature though I have to tweak it a little more. The current functionality is as: CTRL+F or "Find" icon => Opens dialog. - CTRL+N finds next occurance of current "Find" string - always + CTRL+N finds next occurance of current "Find" string - always shown in one of the panels of status-bar. This invocation is equivalent to if you click pushbutton of the dialog. @@ -79,8 +103,8 @@ of the dialog. History of / strings is maintained and is populated - in drop-down list of respective combo-boxes. - + in drop-down list of respective combo-boxes. + TODO: and features. 2009-12-20 16:15 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) diff --git a/harbour/contrib/hbqt/hbqt_destruct.cpp b/harbour/contrib/hbqt/hbqt_destruct.cpp index 1618cdd630..c7ff60212d 100644 --- a/harbour/contrib/hbqt/hbqt_destruct.cpp +++ b/harbour/contrib/hbqt/hbqt_destruct.cpp @@ -89,9 +89,9 @@ void * hbqt_gcpointer( int iParam ) if( p && p->ph ) return p->ph; else if( HB_ISPOINTER( iParam ) ) - return hb_parptr( iParam ); + return hb_parptr( iParam ); /* TOFIX: In what cases is this needed? Reference counting to avoid referring to freed pointers? */ else - return( NULL ); /* Still better if RTE */ + return NULL; /* TODO: Still better if RTE. */ } void * hbqt_pPtrFromObj( int iParam ) diff --git a/harbour/contrib/hbwin/wapi_winbase_mutex.c b/harbour/contrib/hbwin/wapi_winbase_mutex.c index 01a9139045..71320ae15c 100644 --- a/harbour/contrib/hbwin/wapi_winbase_mutex.c +++ b/harbour/contrib/hbwin/wapi_winbase_mutex.c @@ -89,7 +89,7 @@ static HANDLE wapi_mutex_par( int iParam ) { void ** ph = ( void ** ) hb_parptrGC( &s_gc_wapi_mutex_funcs, iParam ); - return ( ph ? ( HANDLE ) *ph : NULL ); + return ph ? ( HANDLE ) *ph : NULL; } /* HANDLE WINAPI CreateMutex( LPSECURITY_ATTRIBUTES lpMutexAttributes, BOOL bInitialOwner, LPCTSTR lpName ) */ diff --git a/harbour/contrib/hbwin/win_dll.c b/harbour/contrib/hbwin/win_dll.c index ece60ac994..eb1608c714 100644 --- a/harbour/contrib/hbwin/win_dll.c +++ b/harbour/contrib/hbwin/win_dll.c @@ -177,6 +177,9 @@ static HB_DYNRETVAL hb_DynaCall( int iFlags, FARPROC lpFunction, int nArgs, HB_D int i, nInd, nSize, nLoops; DWORD dwEAX, dwEDX, dwVal, * pStack, dwStSize = 0; BYTE * pArg; +#if ! defined( __MINGW32__ ) && ! defined( __BORLANDC__ ) && ! defined( __DMC__ ) + LPVOID lpFunctionVoid = ( LPVOID ) lpFunction; +#endif #if defined( __MINGW32__ ) #elif defined( __BORLANDC__ ) || defined( __DMC__ ) @@ -325,7 +328,7 @@ static HB_DYNRETVAL hb_DynaCall( int iFlags, FARPROC lpFunction, int nArgs, HB_D _asm sub esp, dwStSize /* Adjust for our new parameters */ /* Stack is now properly built, we can call the function */ - _asm call [lpFunction] + _asm call [lpFunctionVoid] _asm mov dwEAX, eax /* Save eax/edx registers */ _asm mov dwEDX, edx /* */ diff --git a/harbour/include/hbextern.ch b/harbour/include/hbextern.ch index ba8f3b6d4a..56019d5906 100644 --- a/harbour/include/hbextern.ch +++ b/harbour/include/hbextern.ch @@ -1132,6 +1132,9 @@ EXTERNAL HB_SHADOW EXTERNAL HB_TRACELEVEL EXTERNAL HB_TRACESTATE EXTERNAL HB_TRACESTRING +EXTERNAL HB_TRACELOGLEVEL +EXTERNAL HB_TRACELOG +EXTERNAL HB_TRACELOGAT EXTERNAL HB_CSTR EXTERNAL HB_VALTOEXP EXTERNAL HB_VALTOSTR