diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 2dcc189100..72293dd0fb 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,22 @@ The license applies to all entries newer than 2009-04-28. */ +2010-06-25 00:33 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * include/hbdefs.h + + Added two new abstract types: HB_AREANO, HB_FIELDNO + + * src/rdd/wacore.c + * src/rdd/dbcmd.c + * src/rdd/dbcmd53.c + * src/rdd/wafunc.c + + Using above abstract types as casts to pacify long time + msvc warnings. + + Using HB_USHORT cast to pacify msvc warnings in hb_rddList() + and hb_rddRegister() (shouldn't these have 'int' parameters?) + + * contrib/xhb/xhb.hbp + * Synced with actual file list. + 2010-06-24 23:20 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/include/hbgtinfo.ch * harbour/include/hbgtcore.h diff --git a/harbour/contrib/xhb/xhb.hbp b/harbour/contrib/xhb/xhb.hbp index 2b50f80f1c..d225ff73eb 100644 --- a/harbour/contrib/xhb/xhb.hbp +++ b/harbour/contrib/xhb/xhb.hbp @@ -23,6 +23,7 @@ hboutdbg.c hbserv.c hbsyslog.c hbxml.c +hbxml1.c txtline.c xhbarr.c xhbat.c @@ -35,14 +36,15 @@ xhbfunc.c xhbgt.c xhbhash.c xhbhasha.c +xhbhashp.c xhbi18n.c xhbinet.c xhbini.c xhbis.c xhbmsgs.c xhbmtc.c -xhbqself.c xhbproc.c +xhbqself.c xhbregx.c xhbsave.c xhbscr.c @@ -63,9 +65,18 @@ hbcomprs.prg hblog.prg hblognet.prg hbstruct.prg +hjwindow.prg +hterrsys.prg +htjlist.prg +htmutil.prg regexrpl.prg sprintf.prg stream.prg +tcgi.prg +tedit.prg +tfile.prg +tframe.prg +thtm.prg traceprg.prg trpc.prg trpccli.prg @@ -76,17 +87,8 @@ xdbmodst.prg xhbcomp.prg xhberr.prg xhbfunp.prg +xhbinkey.prg xhbmt.prg xhbver.prg -xthrow.prg xhw32prn.prg - -hjwindow.prg -hterrsys.prg -htjlist.prg -htmutil.prg -tcgi.prg -tedit.prg -tfile.prg -tframe.prg -thtm.prg +xthrow.prg diff --git a/harbour/include/hbdefs.h b/harbour/include/hbdefs.h index c3ac748c33..15069f2619 100644 --- a/harbour/include/hbdefs.h +++ b/harbour/include/hbdefs.h @@ -259,6 +259,8 @@ typedef unsigned int HB_UINT; /* Harbour abstract types */ /* ...add them here... */ +#define HB_AREANO HB_USHORT +#define HB_FIELDNO HB_USHORT /* Convenience */ typedef HB_UCHAR HB_BYTE; diff --git a/harbour/src/rdd/dbcmd.c b/harbour/src/rdd/dbcmd.c index 859c04387e..9480a27b57 100644 --- a/harbour/src/rdd/dbcmd.c +++ b/harbour/src/rdd/dbcmd.c @@ -392,7 +392,7 @@ HB_FUNC( DBCREATE ) } hb_retl( hb_rddCreateTable( szFileName, szDriver, - fCurrArea ? hb_rddGetCurrentWorkAreaNumber() : 0, + fCurrArea ? ( HB_AREANO ) hb_rddGetCurrentWorkAreaNumber() : 0, szAlias, fKeepOpen, szCpId, ulConnection, pStruct, pDelim ) == HB_SUCCESS ); @@ -510,7 +510,7 @@ HB_FUNC( __DBOPENSDF ) } errCode = hb_rddOpenTable( szFileName, szDriver, - fCurrArea ? hb_rddGetCurrentWorkAreaNumber() : 0, + fCurrArea ? ( HB_AREANO ) hb_rddGetCurrentWorkAreaNumber() : 0, szAlias, HB_TRUE, HB_TRUE, szCpId, ulConnection, pStruct, pDelim ); @@ -894,7 +894,7 @@ HB_FUNC( DBUNLOCKALL ) HB_FUNC( DBUSEAREA ) { hb_retl( hb_rddOpenTable( hb_parc( 3 ), hb_parc( 2 ), - hb_parl( 1 ) ? 0 : hb_rddGetCurrentWorkAreaNumber(), + hb_parl( 1 ) ? 0 : ( HB_AREANO ) hb_rddGetCurrentWorkAreaNumber(), hb_parc( 4 ), HB_ISLOG( 5 ) ? hb_parl( 5 ) : !hb_setGetExclusive(), hb_parl( 6 ), hb_parc( 7 ), hb_parnl( 8 ), NULL, NULL ) == HB_SUCCESS ); } @@ -943,7 +943,7 @@ HB_FUNC( FIELDGET ) { PHB_ITEM pItem = hb_itemNew( NULL ); AREAP pArea = ( AREAP ) hb_rddGetCurrentWorkAreaPointer(); - HB_USHORT uiField = hb_parni( 1 ); + HB_USHORT uiField = ( HB_FIELDNO ) hb_parni( 1 ); if( pArea && uiField ) { @@ -957,7 +957,7 @@ HB_FUNC( FIELDNAME ) { char * szName; AREAP pArea = ( AREAP ) hb_rddGetCurrentWorkAreaPointer(); - HB_USHORT uiFields, uiIndex = hb_parni( 1 ); + HB_USHORT uiFields, uiIndex = ( HB_FIELDNO ) hb_parni( 1 ); if( pArea && uiIndex ) { @@ -994,7 +994,7 @@ HB_FUNC( FIELDPUT ) if( pArea ) { - HB_USHORT uiIndex = hb_parni( 1 ); + HB_USHORT uiIndex = ( HB_FIELDNO ) hb_parni( 1 ); if( uiIndex > 0 ) { PHB_ITEM pItem = hb_param( 2, HB_IT_ANY ); @@ -1540,7 +1540,7 @@ HB_FUNC( ORDSETFOCUS ) HB_FUNC( RDDLIST ) { - hb_itemReturnRelease( hb_rddList( hb_parni( 1 ) ) ); + hb_itemReturnRelease( hb_rddList( ( HB_USHORT ) hb_parni( 1 ) ) ); } HB_FUNC( RDDNAME ) @@ -1577,7 +1577,7 @@ HB_FUNC( RDDREGISTER ) * 1: RDD already registerd * > 1: error */ - if( hb_rddRegister( szDriver, hb_parni( 2 ) ) > 1 ) + if( hb_rddRegister( szDriver, ( HB_USHORT ) hb_parni( 2 ) ) > 1 ) { hb_errInternal( HB_EI_RDDINVALID, NULL, NULL, NULL ); } @@ -1747,7 +1747,7 @@ HB_FUNC( DBRSELECT ) /* () --> nWorkArea */ AREAP pArea = ( AREAP ) hb_rddGetCurrentWorkAreaPointer(); if( pArea ) - SELF_RELAREA( pArea, hb_parni(1), &uiWorkArea ); + SELF_RELAREA( pArea, hb_parni( 1 ), &uiWorkArea ); hb_retni( uiWorkArea ); } @@ -1779,7 +1779,7 @@ HB_FUNC( DBSETRELATION ) if( hb_parinfo( 1 ) & HB_IT_NUMERIC ) { - uiChildArea = hb_parni( 1 ); + uiChildArea = ( HB_AREANO ) hb_parni( 1 ); } else { @@ -1788,7 +1788,7 @@ HB_FUNC( DBSETRELATION ) hb_rddSelectWorkAreaAlias( hb_parcx( 1 ) ); if( hb_vmRequestQuery() ) return; - uiChildArea = hb_rddGetCurrentWorkAreaNumber(); + uiChildArea = ( HB_AREANO ) hb_rddGetCurrentWorkAreaNumber(); hb_rddSelectWorkAreaNumber( iArea ); } @@ -1828,7 +1828,7 @@ HB_FUNC( __DBARRANGE ) memset( &dbSortInfo, 0, sizeof( dbSortInfo ) ); dbSortInfo.dbtri.uiFlags = DBTF_PUTREC; - uiNewArea = hb_parni( 1 ); + uiNewArea = ( HB_AREANO ) hb_parni( 1 ); /* Fields structure of source WorkArea */ pStruct = hb_param( 2 , HB_IT_ARRAY ); @@ -1951,9 +1951,9 @@ HB_FUNC( __DBTRANS ) HB_USHORT uiSrcArea, uiDstArea; AREAP pSrcArea, pDstArea; - uiSrcArea = hb_rddGetCurrentWorkAreaNumber(); + uiSrcArea = ( HB_AREANO ) hb_rddGetCurrentWorkAreaNumber(); pSrcArea = ( AREAP ) hb_rddGetCurrentWorkAreaPointer(); - uiDstArea = hb_parni( 1 ); + uiDstArea = ( HB_AREANO ) hb_parni( 1 ); hb_rddSelectWorkAreaNumber( uiDstArea ); pDstArea = ( AREAP ) hb_rddGetCurrentWorkAreaPointer(); @@ -2171,7 +2171,7 @@ HB_FUNC( HB_FIELDLEN ) { HB_USHORT uiIndex; - if( ( uiIndex = hb_parni( 1 ) ) > 0 ) + if( ( uiIndex = ( HB_FIELDNO ) hb_parni( 1 ) ) > 0 ) { PHB_ITEM pItem = hb_itemNew( NULL ); @@ -2195,7 +2195,7 @@ HB_FUNC( HB_FIELDDEC ) { HB_USHORT uiIndex; - if( ( uiIndex = hb_parni( 1 ) ) > 0 ) + if( ( uiIndex = ( HB_FIELDNO ) hb_parni( 1 ) ) > 0 ) { PHB_ITEM pItem = hb_itemNew( NULL ); @@ -2219,7 +2219,7 @@ HB_FUNC( HB_FIELDTYPE ) { HB_USHORT uiIndex; - if( ( uiIndex = hb_parni( 1 ) ) > 0 ) + if( ( uiIndex = ( HB_FIELDNO ) hb_parni( 1 ) ) > 0 ) { PHB_ITEM pItem = hb_itemNew( NULL ); diff --git a/harbour/src/rdd/dbcmd53.c b/harbour/src/rdd/dbcmd53.c index 782b064a49..5638ecc98c 100644 --- a/harbour/src/rdd/dbcmd53.c +++ b/harbour/src/rdd/dbcmd53.c @@ -387,7 +387,7 @@ HB_FUNC( DBFIELDINFO ) PHB_ITEM pType; pType = hb_param( 1 , HB_IT_NUMERIC ); - uiIndex = hb_parni( 2 ); + uiIndex = ( HB_FIELDNO ) hb_parni( 2 ); if( pType && SELF_FIELDCOUNT( pArea, &uiFields ) == HB_SUCCESS && uiIndex > 0 && uiIndex <= uiFields ) { @@ -443,7 +443,7 @@ HB_FUNC( DBFILEGET ) if( szField ) uiIndex = hb_rddFieldIndex( pArea, szField ); else - uiIndex = hb_parni( 1 ); + uiIndex = ( HB_FIELDNO ) hb_parni( 1 ); pMode = hb_param( 3, HB_IT_NUMERIC ); if( uiIndex > 0 && pMode && hb_parclen( 2 ) > 0 && @@ -475,7 +475,7 @@ HB_FUNC( DBFILEPUT ) if( szField ) uiIndex = hb_rddFieldIndex( pArea, szField ); else - uiIndex = hb_parni( 1 ); + uiIndex = ( HB_FIELDNO ) hb_parni( 1 ); if( uiIndex > 0 && hb_parclen( 2 ) > 0 && SELF_FIELDCOUNT( pArea, &uiFields ) == HB_SUCCESS && uiIndex <= uiFields ) diff --git a/harbour/src/rdd/wacore.c b/harbour/src/rdd/wacore.c index 77677671c5..0b0691e800 100644 --- a/harbour/src/rdd/wacore.c +++ b/harbour/src/rdd/wacore.c @@ -304,7 +304,7 @@ void hb_rddCloseAll( void ) void hb_rddFlushAll( void ) { PHB_STACKRDD pRddInfo = hb_stackRDD(); - HB_USHORT uiArea = hb_rddGetCurrentWorkAreaNumber(), uiIndex; + HB_USHORT uiArea = ( HB_AREANO ) hb_rddGetCurrentWorkAreaNumber(), uiIndex; for( uiIndex = 1; uiIndex < pRddInfo->uiWaMax; ++uiIndex ) { @@ -317,7 +317,7 @@ void hb_rddFlushAll( void ) void hb_rddUnLockAll( void ) { PHB_STACKRDD pRddInfo = hb_stackRDD(); - HB_USHORT uiArea = hb_rddGetCurrentWorkAreaNumber(), uiIndex; + HB_USHORT uiArea = ( HB_AREANO ) hb_rddGetCurrentWorkAreaNumber(), uiIndex; for( uiIndex = 1; uiIndex < pRddInfo->uiWaMax; ++uiIndex ) { @@ -451,7 +451,7 @@ HB_ERRCODE hb_rddSelectWorkAreaNumber( int iArea ) if( iArea < 1 || iArea > HB_RDD_MAX_AREA_NUM ) HB_SET_WA( 0 ); else - HB_SET_WA( iArea ); + HB_SET_WA( ( HB_AREANO ) iArea ); return ( pRddInfo->pCurrArea == NULL ) ? HB_FAILURE : HB_SUCCESS; } diff --git a/harbour/src/rdd/wafunc.c b/harbour/src/rdd/wafunc.c index 2a1f3ce1db..7061a657df 100644 --- a/harbour/src/rdd/wafunc.c +++ b/harbour/src/rdd/wafunc.c @@ -690,7 +690,7 @@ HB_ERRCODE hb_rddCreateTable( const char * szFileName, const char * szDriver, else szDriver = hb_rddDefaultDrv( NULL ); - uiPrevArea = hb_rddGetCurrentWorkAreaNumber(); + uiPrevArea = ( HB_AREANO ) hb_rddGetCurrentWorkAreaNumber(); /* 0 means chose first available in hb_rddInsertAreaNode() */ hb_rddSelectWorkAreaNumber( uiArea ); @@ -757,7 +757,7 @@ HB_ERRCODE hb_rddCreateTableTemp( const char * szDriver, else szDriver = hb_rddDefaultDrv( NULL ); - uiPrevArea = hb_rddGetCurrentWorkAreaNumber(); + uiPrevArea = ( HB_AREANO ) hb_rddGetCurrentWorkAreaNumber(); /* 0 means chose first available in hb_rddInsertAreaNode() */ hb_rddSelectWorkAreaNumber( 0 ); @@ -820,7 +820,7 @@ static void hb_fldStructure( AREAP pArea, HB_USHORT uiField, HB_USHORT uiSize, hb_arrayNew( pField, uiSize ); for( uiCount = 0; uiCount < uiSize; ++uiCount ) { - SELF_FIELDINFO( pArea, uiField, s_uiActions[uiCount], + SELF_FIELDINFO( pArea, uiField, s_uiActions[ uiCount ], hb_arrayGetItemPtr( pField, uiCount + 1 ) ); } } @@ -1078,7 +1078,7 @@ HB_ERRCODE hb_rddTransRecords( AREAP pArea, HB_ERRCODE errCode; memset( &dbTransInfo, 0, sizeof( dbTransInfo ) ); - uiPrevArea = hb_rddGetCurrentWorkAreaNumber(); + uiPrevArea = ( HB_AREANO ) hb_rddGetCurrentWorkAreaNumber(); if( szDriver == NULL ) /* szDriver = SELF_RDDNODE( pArea )->szName; */ @@ -1119,10 +1119,10 @@ HB_ERRCODE hb_rddTransRecords( AREAP pArea, dbTransInfo.lpaDest = dbTransInfo.lpaSource; for( uiCount = 0; uiCount < dbTransInfo.uiItemCount; ++uiCount ) { - uiSwap = dbTransInfo.lpTransItems[uiCount].uiSource; - dbTransInfo.lpTransItems[uiCount].uiSource = - dbTransInfo.lpTransItems[uiCount].uiDest; - dbTransInfo.lpTransItems[uiCount].uiDest = uiSwap; + uiSwap = dbTransInfo.lpTransItems[ uiCount ].uiSource; + dbTransInfo.lpTransItems[ uiCount ].uiSource = + dbTransInfo.lpTransItems[ uiCount ].uiDest; + dbTransInfo.lpTransItems[ uiCount ].uiDest = uiSwap; } if( errCode == HB_SUCCESS ) @@ -1226,7 +1226,7 @@ HB_ERRCODE hb_rddCloseAllParentRelations( AREAP pArea ) if( pArea->uiParents > 0 ) { - HB_USHORT uiArea = hb_rddGetCurrentWorkAreaNumber(); + HB_USHORT uiArea = ( HB_AREANO ) hb_rddGetCurrentWorkAreaNumber(); errCode = hb_rddIterateWorkAreas( hb_rddCloseParentRel, pArea ); hb_rddSelectWorkAreaNumber( uiArea ); } @@ -1255,7 +1255,7 @@ HB_ERRCODE hb_rddEvalWA( PHB_ITEM pBlock ) HB_TRACE(HB_TR_DEBUG, ("hb_rddEvalWA(%p)", pBlock)); - uiArea = hb_rddGetCurrentWorkAreaNumber(); + uiArea = ( HB_AREANO ) hb_rddGetCurrentWorkAreaNumber(); errCode = hb_rddIterateWorkAreas( hb_rddEvalWABlock, pBlock ); hb_rddSelectWorkAreaNumber( uiArea );