From c124d2959e549704048e6b3d2a29379d27439cb4 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 2 Mar 2000 19:49:22 +0000 Subject: [PATCH] 20000302-20:44 GMT+1 Victor Szakats --- harbour/ChangeLog | 24 +++++++++++-- harbour/contrib/rdd_ads/ads1.c | 55 ++++++++++++++---------------- harbour/make_b16.bat | 1 + harbour/make_b32.bat | 1 + harbour/make_b40.bat | 1 + harbour/make_vc.bat | 1 + harbour/makefile.bc | 5 +++ harbour/makefile.vc | 2 +- harbour/source/compiler/cmdcheck.c | 2 ++ harbour/source/compiler/genobj32.c | 15 ++++++++ harbour/source/pp/hbpp.c | 3 ++ harbour/source/rtl/gt/gtcrs.c | 1 - harbour/source/rtl/gt/gtsln.c | 1 - harbour/source/rtl/gt/gtwin.c | 1 - 14 files changed, 76 insertions(+), 37 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index a93c039de0..c5e20b5213 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,12 +1,29 @@ +20000302-20:44 GMT+1 Victor Szakats + * contrib/rdd_ads/ads1.c + ! All direct item accesses changed to Item API calls. + * source/compiler/cmdcheck.c + makefile.bc + makefile.vc + ! Fixed OBJ32 support. + (Note that for some unknown reason the linker GPF on Harbour executables + when the OBJ generation is turned on, and the .OBJ format is also + rejected by the linker. Tested with BCC53 and BCC55) + * source/compiler/genobj32.c + + Stub added for non OBJ32 support mode. + * make*.bat + + They also delete the .LOG file on CLEAN. + * source/gt/* + * Minor formatting. + 20000302-17:45 GMT+1 Victor Szakats * tests/regress/* % Modified to take advantage of the code inclusion feature of the PP. * source/rdd/dbcmd.c ! All direct item accesses changed to Item API calls. ! Fixed direct item string buffer access in DBSETDRIVER() - % Variable scopes and some other minor thing optimized. + % Variable scopes and some other minor things optimized. + Static variables prefixed with "s_" - % LASTREC() is now the same speed as RECCOUNT() (minor enh.) + % LASTREC() is now of the same speed as RECCOUNT() (minor enh.) ! DBSETDRIVER(), RDDSETDEFAULT(), __RDDSETDEFAULT() synchronized. ! DBSETDRIVER(), RDDSETDEFAULT(), __RDDSETDEFAULT(), RDDREGISTER(), DBCREATE() @@ -18,6 +35,7 @@ * source/rtl/arrays.c include/hbapi.h + Added hb_arrayGetDL( PHB_ITEM pArray, ULONG ulIndex ) + Same as above. * source/rtl/arrays.c source/rtl/descend.c source/rtl/empty.c @@ -30,7 +48,7 @@ source/rtl/dates.c ! All direct item accesses changed to Item API calls. * source/rtl/do.c - ! One direct item accesses changed to Item API calls. + ! One direct item access changed to Item API calls. * doc/en/misc.txt ! One copyright fixed. * source/rtl/alert.prg diff --git a/harbour/contrib/rdd_ads/ads1.c b/harbour/contrib/rdd_ads/ads1.c index 52f50f0d50..4791678b14 100644 --- a/harbour/contrib/rdd_ads/ads1.c +++ b/harbour/contrib/rdd_ads/ads1.c @@ -259,7 +259,7 @@ static ERRCODE adsGoToId( ADSAREAP pArea, PHB_ITEM pItem ) HB_TRACE(HB_TR_DEBUG, ("adsGoToId(%p, %p)", pArea, pItem)); - if( pItem->type & IT_NUMERIC ) + if( IS_NUMERIC( pItem ) ) { ulRecNo = hb_itemGetNL( pItem ); if( ulRecNo == 0 ) @@ -289,14 +289,14 @@ static ERRCODE adsSeek( ADSAREAP pArea, BOOL bSoftSeek, PHB_ITEM pKey, BOOL bFin if( bFindLast ) { - AdsSeekLast( pArea->hOrdCurrent, (UNSIGNED8*)pKey->item.asString.value, - (UNSIGNED16) pKey->item.asString.length, ADS_STRINGKEY, + AdsSeekLast( pArea->hOrdCurrent, (UNSIGNED8*) hb_itemGetCPtr( pKey ), + (UNSIGNED16) hb_itemGetCLen( pKey ), ADS_STRINGKEY, (UNSIGNED16*) &(pArea->fFound) ); } else { - AdsSeek( pArea->hOrdCurrent, (UNSIGNED8*)pKey->item.asString.value, - (UNSIGNED16) pKey->item.asString.length, ADS_STRINGKEY, + AdsSeek( pArea->hOrdCurrent, (UNSIGNED8*) hb_itemGetCPtr( pKey ), + (UNSIGNED16) hb_itemGetCLen( pKey ), ADS_STRINGKEY, usSeekType, (UNSIGNED16*) &(pArea->fFound) ); } AdsIsFound( pArea->hTable, (UNSIGNED16 *)&(pArea->fFound) ); @@ -535,20 +535,20 @@ static ERRCODE adsPutValue( ADSAREAP pArea, USHORT uiIndex, PHB_ITEM pItem ) switch( pField->uiType ) { case 'C': - if( pItem->type & IT_STRING ) + if( IS_STRING( pItem ) ) { - uiCount = pItem->item.asString.length; + uiCount = hb_itemGetCLen( pItem ); if( uiCount > pField->uiLen ) uiCount = pField->uiLen; - memcpy( szText, pItem->item.asString.value, uiCount ); + memcpy( szText, hb_itemGetCPtr( pItem ), uiCount ); memset( szText + uiCount, ' ', pField->uiLen - uiCount ); - AdsSetString ( pArea->hTable, szName, pItem->item.asString.value, uiCount ); + AdsSetString( pArea->hTable, szName, hb_itemGetCPtr( pItem ), uiCount ); bError = FALSE; } break; case 'N': - if( pItem->type & IT_NUMERIC ) + if( IS_NUMERIC( pItem ) ) { if( pField->uiDec ) bError = !hb_ndtoa( hb_itemGetND( pItem ), ( char * ) szText, @@ -568,12 +568,12 @@ static ERRCODE adsPutValue( ADSAREAP pArea, USHORT uiIndex, PHB_ITEM pItem ) break; case 'D': - if( pItem->type & IT_DATE ) + if( IS_DATE( pItem ) ) { AdsGetDateFormat ( pucFormat, &pusLen ); AdsSetDateFormat ( "YYYYMMDD" ); szEndChar = * ( szText + pField->uiLen ); - hb_dateDecode( pItem->item.asDate.value, &lDay, &lMonth, &lYear ); + hb_dateDecode( hb_itemGetDL( pItem ), &lDay, &lMonth, &lYear ); hb_dateStrPut( ( char * ) szText, lDay, lMonth, lYear ); * ( szText + pField->uiLen ) = szEndChar; AdsSetDate( pArea->hTable, szName, szText, 8 ); @@ -583,24 +583,20 @@ static ERRCODE adsPutValue( ADSAREAP pArea, USHORT uiIndex, PHB_ITEM pItem ) break; case 'L': - if( pItem->type & IT_LOGICAL ) + if( IS_LOGICAL( pItem ) ) { - if( pItem->item.asLogical.value ) - *szText = 'T'; - else - *szText = 'F'; + *szText = hb_itemGetL( pItem ) ? 'T' : 'F'; bError = FALSE; - AdsSetLogical( pArea->hTable, szName, - pItem->item.asLogical.value ); + AdsSetLogical( pArea->hTable, szName, hb_itemGetL( pItem ) ); } break; case 'M': - if( pItem->type & IT_STRING ) + if( IS_STRING( pItem ) ) { - uiCount = pItem->item.asString.length; - AdsSetString ( pArea->hTable, szName, - pItem->item.asString.value, uiCount ); + uiCount = hb_itemGetCLen( pItem ); + AdsSetString( pArea->hTable, szName, + hb_itemGetCPtr( pItem ), uiCount ); bError = FALSE; } break; @@ -762,11 +758,9 @@ static ERRCODE adsInfo( ADSAREAP pArea, USHORT uiIndex, PHB_ITEM pItem ) break; } case DBI_LASTUPDATE: - hb_itemClear( pItem ); - pItem->type = IT_DATE; - pItem->item.asDate.value = hb_dateEncode( pArea->lpExtendInfo->bDay, - pArea->lpExtendInfo->bMonth, - pArea->lpExtendInfo->bYear ); + hb_itemPutDL( pItem, hb_dateEncode( pArea->lpExtendInfo->bDay, + pArea->lpExtendInfo->bMonth, + pArea->lpExtendInfo->bYear ) ); break; case DBI_GETRECSIZE: @@ -936,8 +930,8 @@ static ERRCODE adsOrderCreate( ADSAREAP pArea, LPDBORDERCREATEINFO pOrderInfo ) HB_TRACE(HB_TR_DEBUG, ("adsOrderCreate(%p, %p)", pArea, pOrderInfo)); if( !pOrderInfo->abBagName || *(pOrderInfo->abBagName) == '\0' ) ulOptions = ADS_COMPOUND; - ulRetVal = AdsCreateIndex ( pArea->hTable, pOrderInfo->abBagName, - pOrderInfo->atomBagName, pItem->item.asString.value, "", "", + ulRetVal = AdsCreateIndex( pArea->hTable, pOrderInfo->abBagName, + pOrderInfo->atomBagName, hb_itemGetCPtr( pItem ), "", "", ulOptions, &phIndex); if ( ulRetVal != AE_SUCCESS ) { @@ -1272,3 +1266,4 @@ HARBOUR HB_ADS_GETFUNCTABLE( void ) else hb_retni( FAILURE ); } + diff --git a/harbour/make_b16.bat b/harbour/make_b16.bat index f305ab46cc..745a44fad6 100644 --- a/harbour/make_b16.bat +++ b/harbour/make_b16.bat @@ -17,6 +17,7 @@ if "%1" == "CLEAN" goto CLEAN echo Y | del bin\*.exe > nul echo Y | del obj\b16\*.* > nul echo Y | del lib\b16\*.* > nul + echo Y | del make_b16.log > nul goto EXIT :EXIT diff --git a/harbour/make_b32.bat b/harbour/make_b32.bat index 02dba59807..c7dbf46b52 100644 --- a/harbour/make_b32.bat +++ b/harbour/make_b32.bat @@ -18,6 +18,7 @@ if "%1" == "CLEAN" goto CLEAN echo Y | del bin\*.tds > nul echo Y | del obj\b32\*.* > nul echo Y | del lib\b32\*.* > nul + echo Y | del make_b32.log > nul goto EXIT :EXIT diff --git a/harbour/make_b40.bat b/harbour/make_b40.bat index 654fb497b4..488a940294 100644 --- a/harbour/make_b40.bat +++ b/harbour/make_b40.bat @@ -18,6 +18,7 @@ if "%1" == "CLEAN" goto CLEAN echo Y | del bin\*.tds > nul echo Y | del obj\b32\*.* > nul echo Y | del lib\b32\*.* > nul + echo Y | del make_b40.log > nul goto EXIT :EXIT diff --git a/harbour/make_vc.bat b/harbour/make_vc.bat index af0706383d..1d5cfe0696 100644 --- a/harbour/make_vc.bat +++ b/harbour/make_vc.bat @@ -17,6 +17,7 @@ if "%1" == "CLEAN" goto CLEAN echo Y | del bin\*.exe > nul echo Y | del obj\vc\*.* > nul echo Y | del lib\vc\*.* > nul + echo Y | del make_vc.log > nul goto EXIT :EXIT diff --git a/harbour/makefile.bc b/harbour/makefile.bc index 2289e7c7e7..0d668d293e 100644 --- a/harbour/makefile.bc +++ b/harbour/makefile.bc @@ -70,6 +70,7 @@ HARBOUR_EXE_OBJS = $(OBJ_DIR)\harbour.obj \ $(OBJ_DIR)\hbgenerr.obj \ $(OBJ_DIR)\hbpcode.obj \ $(OBJ_DIR)\genc.obj \ + $(OBJ_DIR)\genobj32.obj \ $(OBJ_DIR)\genjava.obj \ $(OBJ_DIR)\genpas.obj \ $(OBJ_DIR)\genrc.obj \ @@ -355,6 +356,7 @@ $(HARBOUR_EXE) : $(HARBOUR_EXE_OBJS) echo $(OBJ_DIR)\hbgenerr.obj >> make.tmp echo $(OBJ_DIR)\hbpcode.obj >> make.tmp echo $(OBJ_DIR)\genc.obj >> make.tmp + echo $(OBJ_DIR)\genobj32.obj >> make.tmp echo $(OBJ_DIR)\genjava.obj >> make.tmp echo $(OBJ_DIR)\genpas.obj >> make.tmp echo $(OBJ_DIR)\genrc.obj >> make.tmp @@ -395,6 +397,9 @@ $(OBJ_DIR)\hbpcode.obj : $(COMPILER_DIR)\hbpcode.c $(OBJ_DIR)\genc.obj : $(COMPILER_DIR)\genc.c $(BCC_EXE) $(BCC_OPT) -c -I$(INCLUDE_DIR) -o$@ $** +$(OBJ_DIR)\genobj32.obj : $(COMPILER_DIR)\genobj32.c + $(BCC_EXE) $(BCC_OPT) -c -I$(INCLUDE_DIR) -o$@ $** + $(OBJ_DIR)\genjava.obj : $(COMPILER_DIR)\genjava.c $(BCC_EXE) $(BCC_OPT) -c -I$(INCLUDE_DIR) -o$@ $** diff --git a/harbour/makefile.vc b/harbour/makefile.vc index 278d612003..179ff5c958 100644 --- a/harbour/makefile.vc +++ b/harbour/makefile.vc @@ -416,7 +416,7 @@ $(HARBOUR_EXE) : \ $(PP_DIR)\hbpp.c \ $(PP_DIR)\hbppint.c \ $(PP_DIR)\table.c - $(CC) $(CFLAGS) -w -DHARBOUR_OBJ_GENERATION $** -o $(HARBOUR_EXE) + $(CC) $(CFLAGS) -w $** -o $(HARBOUR_EXE) -del harbour.obj -del harboury.obj -del harbourl.obj diff --git a/harbour/source/compiler/cmdcheck.c b/harbour/source/compiler/cmdcheck.c index 81232afa3e..5a85151fb3 100644 --- a/harbour/source/compiler/cmdcheck.c +++ b/harbour/source/compiler/cmdcheck.c @@ -283,10 +283,12 @@ void hb_compChkEnvironVar( char * szSwitch ) hb_comp_iLanguage = LANG_C; break; +#ifdef HARBOUR_OBJ_GENERATION case 'f': case 'F': hb_comp_iLanguage = LANG_OBJ32; break; +#endif case 'j': case 'J': diff --git a/harbour/source/compiler/genobj32.c b/harbour/source/compiler/genobj32.c index 5ed67f3207..14f06283c9 100644 --- a/harbour/source/compiler/genobj32.c +++ b/harbour/source/compiler/genobj32.c @@ -38,6 +38,18 @@ #include "hbpcode.h" #include "hberrors.h" +#ifndef HARBOUR_OBJ_GENERATION + +void hb_compGenObj32( PHB_FNAME pFileName ) +{ + HB_SYMBOL_UNUSED( pFileName ); + + printf( "\nThis feature is not included in this build." ); + fflush( stdout ); +} + +#else + static ULONG GetSymbolsSize( void ); static PCOMSYMBOL GetFirstSymbol( void ); static char * GetSymbolName( ULONG ulPos ); @@ -730,3 +742,6 @@ static void GroupDef( FILE * hObjFile, BYTE bName, BYTE * aSegs ) putbyte( 256 - bCheckSum, hObjFile ); } + +#endif /* HARBOUR_OBJ_GENERATION */ + diff --git a/harbour/source/pp/hbpp.c b/harbour/source/pp/hbpp.c index 0d4dcf0016..54b0cbab95 100644 --- a/harbour/source/pp/hbpp.c +++ b/harbour/source/pp/hbpp.c @@ -41,6 +41,9 @@ * Support for #pragma directive and related functions * See doc/pragma.txt * + * Copyright 2000 Victor Szakats + * __DATE__, __TIME__ support + * * See doc/license.txt for licensing terms. * */ diff --git a/harbour/source/rtl/gt/gtcrs.c b/harbour/source/rtl/gt/gtcrs.c index 7b1b29ec5d..56b3c69429 100644 --- a/harbour/source/rtl/gt/gtcrs.c +++ b/harbour/source/rtl/gt/gtcrs.c @@ -7,7 +7,6 @@ * Video subsystem based on ncurses. * * Copyright 1999 Gonzalo Diethelm - * * www - http://www.harbour-project.org * * This program is free software; you can redistribute it and/or modify diff --git a/harbour/source/rtl/gt/gtsln.c b/harbour/source/rtl/gt/gtsln.c index fe45763038..d5553d8693 100644 --- a/harbour/source/rtl/gt/gtsln.c +++ b/harbour/source/rtl/gt/gtsln.c @@ -7,7 +7,6 @@ * Video subsystem based on ncurses. * * Copyright 1999 Gonzalo Diethelm - * * www - http://www.harbour-project.org * * This program is free software; you can redistribute it and/or modify diff --git a/harbour/source/rtl/gt/gtwin.c b/harbour/source/rtl/gt/gtwin.c index 987e28c898..f63c8b9794 100644 --- a/harbour/source/rtl/gt/gtwin.c +++ b/harbour/source/rtl/gt/gtwin.c @@ -7,7 +7,6 @@ * Video subsystem for Win32 compilers * * Copyright 1999 Paul Tucker (functions marked ptucker) - * * www - http://www.harbour-project.org * * This program is free software; you can redistribute it and/or modify