2008-04-22 20:41 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbclass.ch
* harbour/include/hbcomp.h
* harbour/source/compiler/hbmain.c
* harbour/source/compiler/harbour.yyc
* harbour/source/compiler/harbour.y
! fixed -w3 warnings when class name is different then function name
* allow to overwrite predefined classes definitions
it's a dirty hack but current implementation of predefined
function and class declarations has to be rewritten from scratch
in the future so I make it intentionally - at least it resolves
some memory leaks like: harbour -n -w3 tbcolumn.prg
* harbour/config/rules.cf
* harbour/make_b32.mak
* harbour/make_gcc.mak
* harbour/make_vc.mak
* harbour/make_vcce.mak
* harbour/contrib/mtpl_b32.mak
* harbour/contrib/mtpl_gcc.mak
* harbour/contrib/mtpl_vc.mak
* changed default Harbour compiler switch -w2 to -w3
* harbour/contrib/xhb/xhbcomp.prg
* replaced repeated declarations by small hack
* harbour/utils/hbmake/tmake.prg
! fixed reported by -w3 repeated aDir declaration
* harbour/source/rtl/tbrowse.prg
* calculate frozen area size for 5-th element of array returned
by xbase++ compatible method :viewArea(). Viktor please check me.
If you can also describe what exactly TOFIX in :firstScrCol()
and :viewArea() means then maybe I can help - I do not have
xbase++ so I do not know what should be fixed.
This commit is contained in:
@@ -8,6 +8,42 @@
|
||||
2008-12-31 13:59 UTC+0100 Foo Bar <foo.bar@foobar.org>
|
||||
*/
|
||||
|
||||
2008-04-22 20:41 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
|
||||
* harbour/include/hbclass.ch
|
||||
* harbour/include/hbcomp.h
|
||||
* harbour/source/compiler/hbmain.c
|
||||
* harbour/source/compiler/harbour.yyc
|
||||
* harbour/source/compiler/harbour.y
|
||||
! fixed -w3 warnings when class name is different then function name
|
||||
* allow to overwrite predefined classes definitions
|
||||
it's a dirty hack but current implementation of predefined
|
||||
function and class declarations has to be rewritten from scratch
|
||||
in the future so I make it intentionally - at least it resolves
|
||||
some memory leaks like: harbour -n -w3 tbcolumn.prg
|
||||
|
||||
* harbour/config/rules.cf
|
||||
* harbour/make_b32.mak
|
||||
* harbour/make_gcc.mak
|
||||
* harbour/make_vc.mak
|
||||
* harbour/make_vcce.mak
|
||||
* harbour/contrib/mtpl_b32.mak
|
||||
* harbour/contrib/mtpl_gcc.mak
|
||||
* harbour/contrib/mtpl_vc.mak
|
||||
* changed default Harbour compiler switch -w2 to -w3
|
||||
|
||||
* harbour/contrib/xhb/xhbcomp.prg
|
||||
* replaced repeated declarations by small hack
|
||||
|
||||
* harbour/utils/hbmake/tmake.prg
|
||||
! fixed reported by -w3 repeated aDir declaration
|
||||
|
||||
* harbour/source/rtl/tbrowse.prg
|
||||
* calculate frozen area size for 5-th element of array returned
|
||||
by xbase++ compatible method :viewArea(). Viktor please check me.
|
||||
If you can also describe what exactly TOFIX in :firstScrCol()
|
||||
and :viewArea() means then maybe I can help - I do not have
|
||||
xbase++ so I do not know what should be fixed.
|
||||
|
||||
2008-04-22 15:24 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
|
||||
* harbour/bin/bld_os2.cmd
|
||||
* changed eol-style from native to CRLF
|
||||
|
||||
@@ -20,7 +20,7 @@ HB := $(HB_BIN_COMPILE)/
|
||||
endif
|
||||
HB := $(HB)harbour$(EXE_EXT)
|
||||
|
||||
HB_FLAGS = -n -q0 -w2 -es2 -gc0 -kM -I$(TOP) -I$(HB_INC_COMPILE)
|
||||
HB_FLAGS = -n -q0 -w3 -es2 -gc0 -kM -I$(TOP) -I$(HB_INC_COMPILE)
|
||||
|
||||
# The rule to link an executable.
|
||||
ifeq ($(LD_RULE),)
|
||||
|
||||
@@ -138,7 +138,7 @@ CFLAGS = -I$(INCLUDE_DIR) -d $(C_USR) $(CFLAGS) $(HB_BUILD_MODE)
|
||||
#**********************************************************
|
||||
|
||||
CLIBFLAGS = -c -q $(CFLAGS) $(CLIBFLAGS)
|
||||
HARBOURFLAGS = -i$(INCLUDE_DIR) -n -q0 -w2 -es2 -gc0 $(PRG_USR) $(HARBOURFLAGS)
|
||||
HARBOURFLAGS = -i$(INCLUDE_DIR) -n -q0 -w3 -es2 -gc0 $(PRG_USR) $(HARBOURFLAGS)
|
||||
LDFLAGS = $(LDFLAGS)
|
||||
|
||||
#**********************************************************
|
||||
|
||||
@@ -126,7 +126,7 @@ endif
|
||||
|
||||
CFLAGS := -W -Wall -I$(INCLUDE_DIR) $(C_USR) $(CFLAGS) -I$(OBJ_DIR)
|
||||
CLIBFLAGS := -c $(CFLAGS) $(CLIBFLAGS)
|
||||
HARBOURFLAGS := -i$(INCLUDE_DIR) -n -q0 -w2 -es2 -gc0 $(PRG_USR) $(HARBOURFLAGS)
|
||||
HARBOURFLAGS := -i$(INCLUDE_DIR) -n -q0 -w3 -es2 -gc0 $(PRG_USR) $(HARBOURFLAGS)
|
||||
LDFLAGS := $(LDFLAGS)
|
||||
|
||||
#**********************************************************
|
||||
|
||||
@@ -134,7 +134,7 @@ CFLAGS = -MT$(DBGMARKER) $(CFLAGS)
|
||||
#**********************************************************
|
||||
|
||||
CLIBFLAGS = -c $(CFLAGS) $(CLIBFLAGS)
|
||||
HARBOURFLAGS = -i$(INCLUDE_DIR) -n -q0 -w2 -es2 -gc0 $(PRG_USR) $(HARBOURFLAGS)
|
||||
HARBOURFLAGS = -i$(INCLUDE_DIR) -n -q0 -w3 -es2 -gc0 $(PRG_USR) $(HARBOURFLAGS)
|
||||
LDFLAGS = $(LDFLAGS)
|
||||
|
||||
#**********************************************************
|
||||
|
||||
@@ -55,36 +55,28 @@
|
||||
|
||||
ANNOUNCE XHB_LIB
|
||||
|
||||
|
||||
/* It's a hack which directly manipulates class definition.
|
||||
* It should not be used in user code. [druzus]
|
||||
*/
|
||||
#xcommand OPTIONAL INHERIT <!className!> => ;
|
||||
if type( <"className">+"()" ) == "UI" ;;
|
||||
aadd( s_oClass:asSuper, @__<className>() ) ;;
|
||||
end
|
||||
|
||||
|
||||
INIT PROCEDURE xhb_Init()
|
||||
/* Add calls to do initial settings to Harbour to be more compatible with xhb. */
|
||||
|
||||
if type("HBCHARACTER()")=="UI"
|
||||
ASSOCIATE CLASS _Character WITH TYPE Character
|
||||
else
|
||||
ASSOCIATE CLASS xhb_Character WITH TYPE Character
|
||||
endif
|
||||
|
||||
if type("HBNUMERIC()")=="UI"
|
||||
ASSOCIATE CLASS _Numeric WITH TYPE Numeric
|
||||
else
|
||||
ASSOCIATE CLASS xhb_Numeric WITH TYPE Numeric
|
||||
endif
|
||||
|
||||
if type("HBARRAY()")=="UI"
|
||||
ASSOCIATE CLASS _Array WITH TYPE Array
|
||||
else
|
||||
ASSOCIATE CLASS xhb_Array WITH TYPE Array
|
||||
endif
|
||||
|
||||
if type("HBHASH()")=="UI"
|
||||
ASSOCIATE CLASS _Hash WITH TYPE Hash
|
||||
else
|
||||
ASSOCIATE CLASS xhb_Hash WITH TYPE Hash
|
||||
endif
|
||||
ASSOCIATE CLASS _Character WITH TYPE Character
|
||||
ASSOCIATE CLASS _Numeric WITH TYPE Numeric
|
||||
ASSOCIATE CLASS _Array WITH TYPE Array
|
||||
ASSOCIATE CLASS _Hash WITH TYPE Hash
|
||||
|
||||
RETURN
|
||||
|
||||
CREATE CLASS Character FUNCTION xhb_Character
|
||||
CREATE CLASS Character FUNCTION _Character
|
||||
OPTIONAL INHERIT HBCharacter
|
||||
OPERATOR "[]" FUNCTION XHB_INDEX()
|
||||
OPERATOR "+" FUNCTION XHB_PLUS()
|
||||
OPERATOR "-" FUNCTION XHB_MINUS()
|
||||
@@ -96,8 +88,8 @@ CREATE CLASS Character FUNCTION xhb_Character
|
||||
OPERATOR "--" FUNCTION XHB_DEC()
|
||||
ENDCLASS
|
||||
|
||||
CREATE CLASS Character INHERIT __HBCharacter FUNCTION _Character
|
||||
OPERATOR "[]" FUNCTION XHB_INDEX()
|
||||
CREATE CLASS Numeric FUNCTION _Numeric
|
||||
OPTIONAL INHERIT HBNumeric
|
||||
OPERATOR "+" FUNCTION XHB_PLUS()
|
||||
OPERATOR "-" FUNCTION XHB_MINUS()
|
||||
OPERATOR "*" FUNCTION XHB_MULT()
|
||||
@@ -108,46 +100,14 @@ CREATE CLASS Character INHERIT __HBCharacter FUNCTION _Character
|
||||
OPERATOR "--" FUNCTION XHB_DEC()
|
||||
ENDCLASS
|
||||
|
||||
CREATE CLASS Numeric FUNCTION xhb_Numeric
|
||||
OPERATOR "+" FUNCTION XHB_PLUS()
|
||||
OPERATOR "-" FUNCTION XHB_MINUS()
|
||||
OPERATOR "*" FUNCTION XHB_MULT()
|
||||
OPERATOR "/" FUNCTION XHB_DIV()
|
||||
OPERATOR "%" FUNCTION XHB_MOD()
|
||||
OPERATOR "^" FUNCTION XHB_POW()
|
||||
OPERATOR "++" FUNCTION XHB_INC()
|
||||
OPERATOR "--" FUNCTION XHB_DEC()
|
||||
ENDCLASS
|
||||
|
||||
CREATE CLASS Numeric INHERIT __HBNumeric FUNCTION _Numeric
|
||||
OPERATOR "+" FUNCTION XHB_PLUS()
|
||||
OPERATOR "-" FUNCTION XHB_MINUS()
|
||||
OPERATOR "*" FUNCTION XHB_MULT()
|
||||
OPERATOR "/" FUNCTION XHB_DIV()
|
||||
OPERATOR "%" FUNCTION XHB_MOD()
|
||||
OPERATOR "^" FUNCTION XHB_POW()
|
||||
OPERATOR "++" FUNCTION XHB_INC()
|
||||
OPERATOR "--" FUNCTION XHB_DEC()
|
||||
ENDCLASS
|
||||
|
||||
CREATE CLASS Array FUNCTION xhb_Array
|
||||
CREATE CLASS Array FUNCTION _Array
|
||||
OPTIONAL INHERIT HBArray
|
||||
OPERATOR "[]" FUNCTION XHB_INDEX()
|
||||
OPERATOR "$$" FUNCTION XHB_INCLUDE()
|
||||
ENDCLASS
|
||||
|
||||
CREATE CLASS Array INHERIT __HBArray FUNCTION _Array
|
||||
OPERATOR "[]" FUNCTION XHB_INDEX()
|
||||
OPERATOR "$$" FUNCTION XHB_INCLUDE()
|
||||
ENDCLASS
|
||||
|
||||
CREATE CLASS Hash FUNCTION xhb_Hash
|
||||
ON ERROR FUNCTION XHB_HASHERROR()
|
||||
OPERATOR "+" FUNCTION XHB_PLUS()
|
||||
OPERATOR "-" FUNCTION XHB_MINUS()
|
||||
OPERATOR "$$" FUNCTION XHB_INCLUDE()
|
||||
ENDCLASS
|
||||
|
||||
CREATE CLASS Hash INHERIT __HBHash FUNCTION _Hash
|
||||
OPTIONAL INHERIT HBHash
|
||||
ON ERROR FUNCTION XHB_HASHERROR()
|
||||
OPERATOR "+" FUNCTION XHB_PLUS()
|
||||
OPERATOR "-" FUNCTION XHB_MINUS()
|
||||
|
||||
@@ -170,11 +170,12 @@
|
||||
|
||||
/* should we use _HB_CLASS/_HB_MEMBER declarations? */
|
||||
#ifdef HB_CLS_NO_DECLARATIONS
|
||||
#xcommand _HB_CLASS <name> =>
|
||||
#xcommand _HB_MEMBER <name> =>
|
||||
#xcommand DECLARE <*decl*> =>
|
||||
#xtranslate AS <type> =>
|
||||
#xtranslate AS CLASS <name> =>
|
||||
#xcommand _HB_CLASS <name> =>
|
||||
#xcommand _HB_CLASS <name> <name> =>
|
||||
#xcommand _HB_MEMBER <name> =>
|
||||
#xcommand DECLARE <*decl*> =>
|
||||
#xtranslate AS <type> =>
|
||||
#xtranslate AS CLASS <name> =>
|
||||
#endif
|
||||
|
||||
/* should we inherit from HBObject class by default ? */
|
||||
@@ -264,7 +265,7 @@ DECLARE HBClass ;
|
||||
[ <frm: FROM, INHERIT> <SuperClass1> [,<SuperClassN>] ] ;
|
||||
[ <modulfriend: MODULE FRIENDLY> ] ;
|
||||
[ <static: STATIC> ] [ FUNCTION <FuncName> ] => ;
|
||||
_HB_CLASS <ClassName> ;;
|
||||
_HB_CLASS <ClassName> <FuncName> ;;
|
||||
<static> function __HB_CLS_OPT([<FuncName>,] <ClassName>) ( HB_CLS_PARAM_LIST ) ;;
|
||||
static s_oClass ;;
|
||||
local nScope, oInstance ;;
|
||||
|
||||
@@ -158,7 +158,7 @@ extern char * hb_compSymbolName( HB_COMP_DECL, USHORT ); /* returns a symbol n
|
||||
|
||||
extern PCOMDECLARED hb_compDeclaredAdd( HB_COMP_DECL, char * );
|
||||
|
||||
extern PCOMCLASS hb_compClassAdd( HB_COMP_DECL, char * );
|
||||
extern PCOMCLASS hb_compClassAdd( HB_COMP_DECL, char *, char * );
|
||||
extern PCOMCLASS hb_compClassFind( HB_COMP_DECL, char * );
|
||||
extern PCOMDECLARED hb_compMethodAdd( HB_COMP_DECL, PCOMCLASS pClass, char * );
|
||||
extern PCOMDECLARED hb_compMethodFind( PCOMCLASS pClass, char * );
|
||||
|
||||
@@ -148,7 +148,7 @@ CEXEFLAGSDLL = -tWM $(CLIBFLAGSxxx) $(CEXEFLAGSDLL)
|
||||
#**********************************************************
|
||||
|
||||
# Harbour Compiler Flags
|
||||
HBFLAGSCMN = -i$(INCLUDE_DIR) -q0 -w2 -es2 -gc0 -kM $(PRG_USR)
|
||||
HBFLAGSCMN = -i$(INCLUDE_DIR) -q0 -w3 -es2 -gc0 -kM $(PRG_USR)
|
||||
!ifdef HB_DOC_PDF
|
||||
HBFLAGSCMN = $(HBFLAGSCMN) -dPDF
|
||||
!endif
|
||||
|
||||
@@ -207,7 +207,7 @@ endif
|
||||
# Harbour Compiler Flags
|
||||
#**********************************************************
|
||||
|
||||
HBFLAGSCMN := -i$(INCLUDE_DIR) -q0 -w2 -es2 -gc0 -kM $(PRG_USR)
|
||||
HBFLAGSCMN := -i$(INCLUDE_DIR) -q0 -w3 -es2 -gc0 -kM $(PRG_USR)
|
||||
ifdef HB_DOC_PDF
|
||||
HBFLAGSCMN := $(HBFLAGSCMN) -dPDF
|
||||
endif
|
||||
|
||||
@@ -159,7 +159,7 @@ CEXEFLAGSDLL = -MT$(DBGMARKER) $(CLIBFLAGS) $(CEXEFLAGSDLL)
|
||||
#**********************************************************
|
||||
|
||||
# Harbour Compiler Flags
|
||||
HBFLAGSCMN = -i$(INCLUDE_DIR) -q0 -w2 -es2 -gc0 -kM $(PRG_USR)
|
||||
HBFLAGSCMN = -i$(INCLUDE_DIR) -q0 -w3 -es2 -gc0 -kM $(PRG_USR)
|
||||
!ifdef HB_DOC_PDF
|
||||
HBFLAGSCMN = $(HBFLAGSCMN) -dPDF
|
||||
!endif
|
||||
|
||||
@@ -160,7 +160,7 @@ CLIBFLAGSDLL = -D__EXPORT__ $(CLIBFLAGS) $(CLIBFLAGSDLL)
|
||||
CEXEFLAGSDLL = $(CLIBFLAGS) $(CEXEFLAGSDLL)
|
||||
|
||||
# Harbour Compiler Flags
|
||||
HBFLAGSCMN = -DHB_WINCE -D__PLATFORM__WINCE -i$(INCLUDE_DIR) -q0 -w2 -es2 -gc1 $(PRG_USR)
|
||||
HBFLAGSCMN = -DHB_WINCE -D__PLATFORM__WINCE -i$(INCLUDE_DIR) -q0 -w3 -es2 -gc1 $(PRG_USR)
|
||||
!ifdef HB_DOC_PDF
|
||||
HBFLAGSCMN = $(HBFLAGSCMN) -dPDF
|
||||
!endif
|
||||
|
||||
@@ -1248,8 +1248,9 @@ Declaration: DECLARE IdentName '(' { hb_compDeclaredAdd( HB_COMP_PARAM, $2 ); HB
|
||||
HB_COMP_PARAM->cVarType = ' ';
|
||||
HB_COMP_PARAM->iVarScope = VS_NONE;
|
||||
}
|
||||
| DECLARE IdentName { HB_COMP_PARAM->pLastClass = hb_compClassAdd( HB_COMP_PARAM, $2 ); } ClassInfo Crlf { HB_COMP_PARAM->iVarScope = VS_NONE; }
|
||||
| DECLARE_CLASS IdentName Crlf { HB_COMP_PARAM->pLastClass = hb_compClassAdd( HB_COMP_PARAM, $2 ); HB_COMP_PARAM->iVarScope = VS_NONE; }
|
||||
| DECLARE IdentName { HB_COMP_PARAM->pLastClass = hb_compClassAdd( HB_COMP_PARAM, $2, NULL ); } ClassInfo Crlf { HB_COMP_PARAM->iVarScope = VS_NONE; }
|
||||
| DECLARE_CLASS IdentName Crlf { HB_COMP_PARAM->pLastClass = hb_compClassAdd( HB_COMP_PARAM, $2, NULL ); HB_COMP_PARAM->iVarScope = VS_NONE; }
|
||||
| DECLARE_CLASS IdentName IdentName Crlf { HB_COMP_PARAM->pLastClass = hb_compClassAdd( HB_COMP_PARAM, $2, $3 ); HB_COMP_PARAM->iVarScope = VS_NONE; }
|
||||
| DECLARE_MEMBER DecMethod Crlf { HB_COMP_PARAM->iVarScope = VS_NONE; }
|
||||
| DECLARE_MEMBER '{' AsType { HB_COMP_PARAM->cDataListType = HB_COMP_PARAM->cVarType; } DecDataList '}' Crlf { HB_COMP_PARAM->cDataListType = 0; HB_COMP_PARAM->iVarScope = VS_NONE; }
|
||||
;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -981,7 +981,23 @@ BOOL hb_compIsValidMacroText( HB_COMP_DECL, char * szText, ULONG ulLen )
|
||||
* DECLARATIONS
|
||||
*/
|
||||
|
||||
PCOMCLASS hb_compClassAdd( HB_COMP_DECL, char * szClassName )
|
||||
PCOMCLASS hb_compClassFind( HB_COMP_DECL, char * szClassName )
|
||||
{
|
||||
PCOMCLASS pClass = HB_COMP_PARAM->pFirstClass;
|
||||
|
||||
if( HB_COMP_PARAM->iWarnings < 3 )
|
||||
return NULL;
|
||||
|
||||
while( pClass )
|
||||
{
|
||||
if( ! strcmp( pClass->szName, szClassName ) )
|
||||
return pClass;
|
||||
pClass = pClass->pNext;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PCOMCLASS hb_compClassAdd( HB_COMP_DECL, char * szClassName, char * szClassFunc )
|
||||
{
|
||||
PCOMCLASS pClass;
|
||||
PCOMDECLARED pDeclared;
|
||||
@@ -991,10 +1007,27 @@ PCOMCLASS hb_compClassAdd( HB_COMP_DECL, char * szClassName )
|
||||
if( HB_COMP_PARAM->iWarnings < 3 )
|
||||
return NULL;
|
||||
|
||||
if ( ( pClass = hb_compClassFind( HB_COMP_PARAM, szClassName ) ) != NULL )
|
||||
if( ( pClass = hb_compClassFind( HB_COMP_PARAM, szClassName ) ) != NULL )
|
||||
{
|
||||
hb_compGenWarning( HB_COMP_PARAM, hb_comp_szWarnings, 'W', HB_COMP_WARN_DUP_DECLARATION, "Class", szClassName );
|
||||
return pClass;
|
||||
PCOMCLASS * pClassPtr = &HB_COMP_PARAM->pFirstClass;
|
||||
|
||||
while( *pClassPtr && *pClassPtr != HB_COMP_PARAM->pReleaseClass )
|
||||
{
|
||||
/* It's predefined class, allow to redefine them */
|
||||
if( *pClassPtr == pClass )
|
||||
{
|
||||
*pClassPtr = pClass->pNext;
|
||||
pClass = NULL;
|
||||
break;
|
||||
}
|
||||
pClassPtr = &( *pClassPtr )->pNext;
|
||||
}
|
||||
|
||||
if( pClass )
|
||||
{
|
||||
hb_compGenWarning( HB_COMP_PARAM, hb_comp_szWarnings, 'W', HB_COMP_WARN_DUP_DECLARATION, "Class", szClassName );
|
||||
return pClass;
|
||||
}
|
||||
}
|
||||
|
||||
pClass = ( PCOMCLASS ) hb_xgrab( sizeof( COMCLASS ) );
|
||||
@@ -1003,7 +1036,7 @@ PCOMCLASS hb_compClassAdd( HB_COMP_DECL, char * szClassName )
|
||||
pClass->pMethod = NULL;
|
||||
pClass->pNext = NULL;
|
||||
|
||||
if ( HB_COMP_PARAM->pFirstClass == NULL )
|
||||
if( HB_COMP_PARAM->pFirstClass == NULL )
|
||||
HB_COMP_PARAM->pFirstClass = pClass;
|
||||
else
|
||||
HB_COMP_PARAM->pLastClass->pNext = pClass;
|
||||
@@ -1011,7 +1044,7 @@ PCOMCLASS hb_compClassAdd( HB_COMP_DECL, char * szClassName )
|
||||
HB_COMP_PARAM->pLastClass = pClass;
|
||||
|
||||
/* Auto declaration for the Class Function. */
|
||||
pDeclared = hb_compDeclaredAdd( HB_COMP_PARAM, szClassName );
|
||||
pDeclared = hb_compDeclaredAdd( HB_COMP_PARAM, szClassFunc ? szClassFunc : szClassName );
|
||||
pDeclared->cType = 'S';
|
||||
pDeclared->pClass = pClass;
|
||||
|
||||
@@ -1023,25 +1056,20 @@ PCOMCLASS hb_compClassAdd( HB_COMP_DECL, char * szClassName )
|
||||
return pClass;
|
||||
}
|
||||
|
||||
PCOMCLASS hb_compClassFind( HB_COMP_DECL, char * szClassName )
|
||||
PCOMDECLARED hb_compMethodFind( PCOMCLASS pClass, char * szMethodName )
|
||||
{
|
||||
PCOMCLASS pClass = HB_COMP_PARAM->pFirstClass;
|
||||
|
||||
if ( HB_COMP_PARAM->iWarnings < 3 )
|
||||
return NULL;
|
||||
|
||||
while( pClass )
|
||||
if( pClass )
|
||||
{
|
||||
if( ! strcmp( pClass->szName, szClassName ) )
|
||||
return pClass;
|
||||
else
|
||||
PCOMDECLARED pMethod = pClass->pMethod;
|
||||
|
||||
while( pMethod )
|
||||
{
|
||||
if( pClass->pNext )
|
||||
pClass = pClass->pNext;
|
||||
else
|
||||
return NULL;
|
||||
if( ! strcmp( pMethod->szName, szMethodName ) )
|
||||
return pMethod;
|
||||
pMethod = pMethod->pNext;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -1051,10 +1079,10 @@ PCOMDECLARED hb_compMethodAdd( HB_COMP_DECL, PCOMCLASS pClass, char * szMethodNa
|
||||
|
||||
/*printf( "\nDeclaring Method: %s of Class: %s Pointer: %li\n", szMethodName, pClass->szName, pClass );*/
|
||||
|
||||
if ( HB_COMP_PARAM->iWarnings < 3 )
|
||||
if( HB_COMP_PARAM->iWarnings < 3 )
|
||||
return NULL;
|
||||
|
||||
if ( ( pMethod = hb_compMethodFind( pClass, szMethodName ) ) != NULL )
|
||||
if( ( pMethod = hb_compMethodFind( pClass, szMethodName ) ) != NULL )
|
||||
{
|
||||
hb_compGenWarning( HB_COMP_PARAM, hb_comp_szWarnings, 'W', HB_COMP_WARN_DUP_DECLARATION, "Method", szMethodName );
|
||||
|
||||
@@ -1075,7 +1103,7 @@ PCOMDECLARED hb_compMethodAdd( HB_COMP_DECL, PCOMCLASS pClass, char * szMethodNa
|
||||
pMethod->pParamClasses = NULL;
|
||||
pMethod->pNext = NULL;
|
||||
|
||||
if ( pClass->pMethod == NULL )
|
||||
if( pClass->pMethod == NULL )
|
||||
pClass->pMethod = pMethod;
|
||||
else
|
||||
pClass->pLastMethod->pNext = pMethod;
|
||||
@@ -1087,28 +1115,6 @@ PCOMDECLARED hb_compMethodAdd( HB_COMP_DECL, PCOMCLASS pClass, char * szMethodNa
|
||||
return pMethod;
|
||||
}
|
||||
|
||||
PCOMDECLARED hb_compMethodFind( PCOMCLASS pClass, char * szMethodName )
|
||||
{
|
||||
PCOMDECLARED pMethod = NULL;
|
||||
|
||||
if ( pClass )
|
||||
pMethod = pClass->pMethod;
|
||||
|
||||
while( pMethod )
|
||||
{
|
||||
if( ! strcmp( pMethod->szName, szMethodName ) )
|
||||
return pMethod;
|
||||
else
|
||||
{
|
||||
if( pMethod->pNext )
|
||||
pMethod = pMethod->pNext;
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void hb_compDeclaredInit( HB_COMP_DECL )
|
||||
{
|
||||
#define _DECL static COMDECLARED
|
||||
@@ -1418,9 +1424,9 @@ static void hb_compDeclaredInit( HB_COMP_DECL )
|
||||
/* -------------------------------------------------- Standard Classes --------------------------------------------------- */
|
||||
|
||||
static COMCLASS s_ERROR = { "ERROR" , NULL, NULL, NULL };
|
||||
static COMCLASS s_GET = { "GET" , NULL, NULL, &s_ERROR };
|
||||
static COMCLASS s_TBCOLUMN = { "TBCOLUMN", NULL, NULL, &s_GET };
|
||||
static COMCLASS s_TBROWSE = { "TBROWSE" , NULL, NULL, &s_TBCOLUMN };
|
||||
static COMCLASS s_GET = { "GET" , NULL, NULL, NULL };
|
||||
static COMCLASS s_TBCOLUMN = { "TBCOLUMN", NULL, NULL, NULL };
|
||||
static COMCLASS s_TBROWSE = { "TBROWSE" , NULL, NULL, NULL };
|
||||
|
||||
/* Name Ret # of Prams Param Types Ret Class Param Classes Next
|
||||
--------------- --- ---------- -------------------- --------- ------------- --------------- */
|
||||
@@ -1504,6 +1510,8 @@ static void hb_compDeclaredInit( HB_COMP_DECL )
|
||||
s_ERROR.pMethod = &s_ERROR_14;
|
||||
/* Last (top) Method. */
|
||||
s_ERROR.pLastMethod = &s_ERROR_01;
|
||||
/* Next class definition pointer */
|
||||
s_ERROR.pNext = NULL;
|
||||
|
||||
/* ------- */
|
||||
|
||||
@@ -1511,6 +1519,8 @@ static void hb_compDeclaredInit( HB_COMP_DECL )
|
||||
s_GET.pMethod = &s_GET_33; /* Change to BOTTOM Method. */
|
||||
/* Last (top) Method. */
|
||||
s_GET.pLastMethod = &s_GET_01;
|
||||
/* Next class definition pointer */
|
||||
s_GET.pNext = &s_ERROR;
|
||||
|
||||
/* ------- */
|
||||
|
||||
@@ -1518,6 +1528,17 @@ static void hb_compDeclaredInit( HB_COMP_DECL )
|
||||
s_TBCOLUMN.pMethod = &s_TBCOLUMN_12; /* Change to BOTTOM Method. */
|
||||
/* Last (top) Method. */
|
||||
s_TBCOLUMN.pLastMethod = &s_TBCOLUMN_01;
|
||||
/* Next class definition pointer */
|
||||
s_TBCOLUMN.pNext = &s_GET;
|
||||
|
||||
/* ------- */
|
||||
|
||||
/* First (bottom) Method */
|
||||
s_TBROWSE.pMethod = NULL; /* Change to BOTTOM Method. */
|
||||
/* Last (top) Method. */
|
||||
s_TBROWSE.pLastMethod = NULL;
|
||||
/* Next class definition pointer */
|
||||
s_TBROWSE.pNext = &s_TBCOLUMN;
|
||||
|
||||
/* ------- */
|
||||
|
||||
@@ -1551,12 +1572,12 @@ PCOMDECLARED hb_compDeclaredAdd( HB_COMP_DECL, char * szDeclaredName )
|
||||
{
|
||||
PCOMDECLARED pDeclared;
|
||||
|
||||
if ( HB_COMP_PARAM->iWarnings < 3 )
|
||||
if( HB_COMP_PARAM->iWarnings < 3 )
|
||||
return NULL;
|
||||
|
||||
/*printf( "\nDeclaring Function: %s\n", szDeclaredName, NULL );*/
|
||||
|
||||
if ( ( pDeclared = hb_compDeclaredFind( HB_COMP_PARAM, szDeclaredName ) ) != NULL )
|
||||
if( ( pDeclared = hb_compDeclaredFind( HB_COMP_PARAM, szDeclaredName ) ) != NULL )
|
||||
{
|
||||
hb_compGenWarning( HB_COMP_PARAM, hb_comp_szWarnings, 'W', HB_COMP_WARN_DUP_DECLARATION, "Function", szDeclaredName );
|
||||
|
||||
@@ -1591,7 +1612,7 @@ PCOMDECLARED hb_compDeclaredAdd( HB_COMP_DECL, char * szDeclaredName )
|
||||
void hb_compDeclaredParameterAdd( HB_COMP_DECL, char * szVarName, BYTE cValueType )
|
||||
{
|
||||
/* Nothing to do since no warnings requested.*/
|
||||
if ( HB_COMP_PARAM->iWarnings < 3 )
|
||||
if( HB_COMP_PARAM->iWarnings < 3 )
|
||||
{
|
||||
HB_SYMBOL_UNUSED( szVarName );
|
||||
return;
|
||||
@@ -1603,13 +1624,13 @@ void hb_compDeclaredParameterAdd( HB_COMP_DECL, char * szVarName, BYTE cValueTyp
|
||||
/* Find the Declared Function owner of this parameter. */
|
||||
PCOMDECLARED pDeclared = hb_compDeclaredFind( HB_COMP_PARAM, HB_COMP_PARAM->szDeclaredFun );
|
||||
|
||||
if ( pDeclared )
|
||||
if( pDeclared )
|
||||
{
|
||||
pDeclared->iParamCount++;
|
||||
|
||||
|
||||
/* TOFIX: these allocations causes memory leaks */
|
||||
if ( pDeclared->cParamTypes )
|
||||
if( pDeclared->cParamTypes )
|
||||
{
|
||||
pDeclared->cParamTypes = ( BYTE * ) hb_xrealloc( pDeclared->cParamTypes, pDeclared->iParamCount );
|
||||
pDeclared->pParamClasses = ( PCOMCLASS * ) hb_xrealloc( pDeclared->pParamClasses, pDeclared->iParamCount * sizeof( PCOMCLASS ) );
|
||||
@@ -1622,7 +1643,7 @@ void hb_compDeclaredParameterAdd( HB_COMP_DECL, char * szVarName, BYTE cValueTyp
|
||||
|
||||
pDeclared->cParamTypes[ pDeclared->iParamCount - 1 ] = cValueType;
|
||||
|
||||
if ( toupper( cValueType ) == 'S' )
|
||||
if( toupper( cValueType ) == 'S' )
|
||||
{
|
||||
pDeclared->pParamClasses[ pDeclared->iParamCount - 1 ] = hb_compClassFind( HB_COMP_PARAM, HB_COMP_PARAM->szFromClass );
|
||||
|
||||
@@ -1638,7 +1659,7 @@ void hb_compDeclaredParameterAdd( HB_COMP_DECL, char * szVarName, BYTE cValueTyp
|
||||
HB_COMP_PARAM->pLastMethod->iParamCount++;
|
||||
|
||||
/* TOFIX: these allocations causes memory leaks */
|
||||
if ( HB_COMP_PARAM->pLastMethod->cParamTypes )
|
||||
if( HB_COMP_PARAM->pLastMethod->cParamTypes )
|
||||
{
|
||||
HB_COMP_PARAM->pLastMethod->cParamTypes = ( BYTE * ) hb_xrealloc( HB_COMP_PARAM->pLastMethod->cParamTypes, HB_COMP_PARAM->pLastMethod->iParamCount );
|
||||
HB_COMP_PARAM->pLastMethod->pParamClasses = ( PCOMCLASS * ) hb_xrealloc( HB_COMP_PARAM->pLastMethod->pParamClasses, HB_COMP_PARAM->pLastMethod->iParamCount * sizeof( COMCLASS ) );
|
||||
@@ -1651,7 +1672,7 @@ void hb_compDeclaredParameterAdd( HB_COMP_DECL, char * szVarName, BYTE cValueTyp
|
||||
|
||||
HB_COMP_PARAM->pLastMethod->cParamTypes[ HB_COMP_PARAM->pLastMethod->iParamCount - 1 ] = cValueType;
|
||||
|
||||
if ( toupper( cValueType ) == 'S' )
|
||||
if( toupper( cValueType ) == 'S' )
|
||||
{
|
||||
HB_COMP_PARAM->pLastMethod->pParamClasses[ HB_COMP_PARAM->pLastMethod->iParamCount - 1 ] = hb_compClassFind( HB_COMP_PARAM, HB_COMP_PARAM->szFromClass );
|
||||
|
||||
@@ -2045,11 +2066,11 @@ static void hb_compOptimizeFrames( HB_COMP_DECL, PFUNCTION pFunc )
|
||||
{
|
||||
/*printf( "\nChecking: %s Used: %i\n", pVar->szName, pVar->iUsed );*/
|
||||
|
||||
if ( ! ( pVar->iUsed & VU_USED ) && (pVar->iUsed & VU_INITIALIZED) )
|
||||
if( ! ( pVar->iUsed & VU_USED ) && (pVar->iUsed & VU_INITIALIZED) )
|
||||
hb_compGenWarning( HB_COMP_PARAM, hb_comp_szWarnings, 'W', HB_COMP_WARN_VAL_NOT_USED, pVar->szName, NULL );
|
||||
|
||||
/* May have been initialized in previous execution of the function.
|
||||
else if ( ( pVar->iUsed & VU_USED ) && ! ( pVar->iUsed & VU_INITIALIZED ) )
|
||||
else if( ( pVar->iUsed & VU_USED ) && ! ( pVar->iUsed & VU_INITIALIZED ) )
|
||||
hb_compGenWarning( HB_COMP_PARAM, hb_comp_szWarnings, 'W', HB_COMP_WARN_NOT_INITIALIZED, pVar->szName, NULL );
|
||||
*/
|
||||
pVar = pVar->pNext;
|
||||
|
||||
@@ -2380,17 +2380,23 @@ METHOD nRight( nRight ) CLASS TBROWSE
|
||||
|
||||
METHOD viewArea() CLASS TBROWSE
|
||||
|
||||
LOCAL nWidth, nFrozenWidth
|
||||
|
||||
IF ::nConfigure != 0
|
||||
::doConfigure()
|
||||
ENDIF
|
||||
|
||||
// TOFIX
|
||||
|
||||
nWidth := nFrozenWidth := _TBR_COORD( ::n_Right ) - _TBR_COORD( ::n_Left ) + 1
|
||||
_MAXFREEZE( ::nFrozen, ::aColData, @nWidth )
|
||||
nFrozenWidth -= nWidth
|
||||
|
||||
RETURN { ::n_Top + ::nHeadHeight + iif( ::lHeadSep, 1, 0 ),;
|
||||
::n_Left,;
|
||||
::n_Bottom - ::nFootHeight - iif( ::lFootSep, 1, 0 ),;
|
||||
::n_Right,;
|
||||
0 /* nFrozenWidth */ }
|
||||
nFrozenWidth }
|
||||
|
||||
|
||||
/* NOTE: Returns the left margin relative column position of the first
|
||||
@@ -2403,7 +2409,7 @@ METHOD firstScrCol() CLASS TBROWSE
|
||||
|
||||
// TOFIX
|
||||
|
||||
RETURN iif( ::leftVisible == 0, 0, ::aColData[ ::leftVisible ][ _TBCI_COLPOS ] )
|
||||
RETURN IIF( ::leftVisible == 0, 0, ::aColData[ ::leftVisible ][ _TBCI_COLPOS ] )
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -83,7 +83,6 @@ DATA lIgnoreErrors Init .F.
|
||||
DATA lExtended Init .T.
|
||||
DATA lOs2 Init .F.
|
||||
DATA lRecurse Init .F.
|
||||
DATA aDir
|
||||
DATA lEditMode Init .F.
|
||||
DATA aDir
|
||||
DATA aLangMessages init {}
|
||||
|
||||
Reference in New Issue
Block a user