2008-01-26 07:53 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)

* source/pp/pplib.c
   * source/rtl/run.c
   * source/rtl/hbgtcore.c
   * source/rtl/philesx.c
   * source/rtl/strzero.c
   * source/vm/runner.c
   * source/vm/debug.c
   * source/vm/itemapi.c
   * source/vm/arrayshb.c
   * source/vm/classes.c
   * source/rdd/dbfntx/dbfntx1.c
   * source/rdd/dbfcdx/dbfcdx1.c
     ! Replaced 9999 internal and RT error codes with 
       unique ones, in new Harbour ranges:
       RT/PP: 1001-1999
       RT/BASE: 6001-6999
          runner: 6101-6199
       Internal/misc: 6001-6999
       Internal/RDD: 7001-7999
          CDX: 7001-7099
          NTX: 7101-7199
       NOTE: If you find some more 9999s in the core code, 
             pls tell.
This commit is contained in:
Viktor Szakats
2008-01-26 06:54:55 +00:00
parent 5212854942
commit 80e4b3ae70
13 changed files with 59 additions and 38 deletions

View File

@@ -8,6 +8,31 @@
2002-12-01 13:30 UTC+0100 Foo Bar <foo.bar@foobar.org>
*/
2008-01-26 07:53 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
* source/pp/pplib.c
* source/rtl/run.c
* source/rtl/hbgtcore.c
* source/rtl/philesx.c
* source/rtl/strzero.c
* source/vm/runner.c
* source/vm/debug.c
* source/vm/itemapi.c
* source/vm/arrayshb.c
* source/vm/classes.c
* source/rdd/dbfntx/dbfntx1.c
* source/rdd/dbfcdx/dbfcdx1.c
! Replaced 9999 internal and RT error codes with
unique ones, in new Harbour ranges:
RT/PP: 1001-1999
RT/BASE: 6001-6999
runner: 6101-6199
Internal/misc: 6001-6999
Internal/RDD: 7001-7999
CDX: 7001-7099
NTX: 7101-7199
NOTE: If you find some more 9999s in the core code,
pls tell.
2008-01-26 06:27 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
* tests/gfx.prg
* tests/wcecon.prg

View File

@@ -73,7 +73,7 @@ static void hb_pp_ErrorMessage( void * cargo, const char * szMsgTable[],
PHB_ITEM pError;
snprintf( szMsgBuf, sizeof( szMsgBuf ), szMsgTable[ iCode - 1 ],
szParam1, szParam2 );
pError = hb_errRT_New( ES_ERROR, "PP", 9999, ( ULONG ) iCode, szMsgBuf,
pError = hb_errRT_New( ES_ERROR, "PP", 1001, ( ULONG ) iCode, szMsgBuf,
NULL, 0, EF_NONE | EF_CANDEFAULT );
hb_errLaunch( pError );
hb_errRelease( pError );

View File

@@ -8784,7 +8784,7 @@ static void hb_cdxSortWritePage( LPCDXSORTINFO pSort )
pSort->hTempFile = hb_fsCreateTemp( NULL, NULL, FC_NORMAL, szName );
if ( pSort->hTempFile == FS_ERROR )
{
hb_errInternal( 9999, "hb_cdxSortWritePage: Can't create temporary file.", "", "" );
hb_errInternal( 7001, "hb_cdxSortWritePage: Can't create temporary file.", "", "" );
}
pSort->szTempFileName = hb_strdup( ( char * ) szName );
}
@@ -8792,7 +8792,7 @@ static void hb_cdxSortWritePage( LPCDXSORTINFO pSort )
pSort->pSwapPage[ pSort->ulCurPage ].nOffset = hb_fsSeekLarge( pSort->hTempFile, 0, FS_END );
if ( hb_fsWriteLarge( pSort->hTempFile, pSort->pKeyPool, ulSize ) != ulSize )
{
hb_errInternal( 9999, "hb_cdxSortWritePage: Write error in temporary file.", "", "" );
hb_errInternal( 7002, "hb_cdxSortWritePage: Write error in temporary file.", "", "" );
}
pSort->ulKeys = 0;
pSort->ulCurPage++;
@@ -8811,7 +8811,7 @@ static void hb_cdxSortGetPageKey( LPCDXSORTINFO pSort, ULONG ulPage,
if ( hb_fsSeekLarge( pSort->hTempFile, pSort->pSwapPage[ ulPage ].nOffset, SEEK_SET ) != pSort->pSwapPage[ ulPage ].nOffset ||
hb_fsReadLarge( pSort->hTempFile, pSort->pSwapPage[ ulPage ].pKeyPool, ulSize ) != ulSize )
{
hb_errInternal( 9999, "hb_cdxSortGetPageKey: Read error from temporary file.", "", "" );
hb_errInternal( 7003, "hb_cdxSortGetPageKey: Read error from temporary file.", "", "" );
}
pSort->pSwapPage[ ulPage ].nOffset += ulSize;
pSort->pSwapPage[ ulPage ].ulKeyBuf = ulKeys;
@@ -9144,7 +9144,7 @@ static void hb_cdxSortOut( LPCDXSORTINFO pSort )
{
if ( ! hb_cdxSortKeyGet( pSort, &pKeyVal, &ulRec ) )
{
hb_errInternal( 9999, "hb_cdxSortOut: memory structure corrupted.", "", "" );
hb_errInternal( 7004, "hb_cdxSortOut: memory structure corrupted.", "", "" );
}
if ( fUnique )
{
@@ -9165,7 +9165,7 @@ static void hb_cdxSortOut( LPCDXSORTINFO pSort )
{
printf("\r\nulKey=%ld, pKeyVal=[%s][%ld], pKeyLast=[%s][%ld]\r\n",
ulKey, pKeyVal, ulRec, pSort->pLastKey, pSort->ulLastRec); fflush(stdout);
hb_errInternal( 9999, "hb_cdxSortOut: sorting fails.", "", "" );
hb_errInternal( 7005, "hb_cdxSortOut: sorting fails.", "", "" );
}
}
#endif
@@ -9177,7 +9177,7 @@ static void hb_cdxSortOut( LPCDXSORTINFO pSort )
#ifdef HB_CDX_DBGCODE
if ( hb_cdxSortKeyGet( pSort, &pKeyVal, &ulRec ) )
{
hb_errInternal( 9999, "hb_cdxSortOut: memory structure corrupted(2).", "", "" );
hb_errInternal( 7006, "hb_cdxSortOut: memory structure corrupted(2).", "", "" );
}
#endif

View File

@@ -856,15 +856,15 @@ static void hb_ntxTagCheckBuffers( LPTAGINFO pTag )
ULONG i;
if( ( pTag->HdrChanged || pTag->Owner->Changed ) && !pTag->Owner->lockWrite )
hb_errInternal( 9999, "hb_ntxTagCheckBuffers: tag modified in unlocked index", "", "" );
hb_errInternal( 7101, "hb_ntxTagCheckBuffers: tag modified in unlocked index", "", "" );
for( i = 0; i < pTag->Owner->ulPages; i++ )
{
pPage = pTag->Owner->pages[ i ];
if( pPage->Changed && !pTag->Owner->lockWrite )
hb_errInternal( 9999, "hb_ntxTagCheckBuffers: page modified in unlocked index", "", "" );
hb_errInternal( 7102, "hb_ntxTagCheckBuffers: page modified in unlocked index", "", "" );
if( pPage->iUsed )
hb_errInternal( 9999, "hb_ntxTagCheckBuffers: page still allocated", "", "" );
hb_errInternal( 7103, "hb_ntxTagCheckBuffers: page still allocated", "", "" );
}
}
@@ -886,7 +886,7 @@ static void hb_ntxPageCheckKeys( LPPAGEINFO pPage, LPTAGINFO pTag, int iPos, int
u - 1, pTag->KeyLength, hb_ntxGetKeyVal( pPage, u - 1 ),
u, pTag->KeyLength, hb_ntxGetKeyVal( pPage, u ) );
fflush(stdout);
hb_errInternal( 9999, "hb_ntxPageCheckKeys: keys sorted wrong.", "", "" );
hb_errInternal( 7104, "hb_ntxPageCheckKeys: keys sorted wrong.", "", "" );
}
}
}
@@ -1093,9 +1093,9 @@ static LPPAGEINFO hb_ntxPageGetBuffer( LPTAGINFO pTag, ULONG ulPage )
LPPAGEINFO pPage = pIndex->pFirst;
if( pPage->iUsed )
hb_errInternal( 9999, "hb_ntxPageGetBuffer: page used.", "", "" );
hb_errInternal( 7105, "hb_ntxPageGetBuffer: page used.", "", "" );
if( pPage->Changed )
hb_errInternal( 9999, "hb_ntxPageGetBuffer: page changed.", "", "" );
hb_errInternal( 7106, "hb_ntxPageGetBuffer: page changed.", "", "" );
pIndex->pFirst = pPage->pNext;
if( pIndex->pFirst )
@@ -1207,7 +1207,7 @@ static void hb_ntxPageRelease( LPTAGINFO pTag, LPPAGEINFO pPage )
}
}
else if( pPage->iUsed < 0 )
hb_errInternal( 9999, "hb_ntxPageRelease: unused page freed.", "", "" );
hb_errInternal( 7107, "hb_ntxPageRelease: unused page freed.", "", "" );
}
/*
@@ -1950,7 +1950,7 @@ static void hb_ntxIndexFlush( LPNTXINDEX pIndex )
hb_ntxPageRelease( pIndex->lpTags[0], pPage );
}
else
hb_errInternal( 9999, "hb_ntxIndexFlush: unchaged page in the list.", "", "" );
hb_errInternal( 7108, "hb_ntxIndexFlush: unchaged page in the list.", "", "" );
}
if( pIndex->Compound )
@@ -5082,7 +5082,7 @@ static void hb_ntxSortOut( LPNTXSORTINFO pSort )
{
if( hb_vmRequestQuery() != 0 )
return;
hb_errInternal( 9999, "hb_ntxSortOut: memory structure corrupted.", "", "" );
hb_errInternal( 7109, "hb_ntxSortOut: memory structure corrupted.", "", "" );
}
if( fUnique )
{
@@ -5111,7 +5111,7 @@ static void hb_ntxSortOut( LPNTXSORTINFO pSort )
ulKey, pKeyVal, ulRec, pSort->pLastKey, pSort->ulLastRec); fflush(stdout);
if( hb_vmRequestQuery() != 0 )
return;
hb_errInternal( 9999, "hb_ntxSortOut: sorting fails.", "", "" );
hb_errInternal( 7110, "hb_ntxSortOut: sorting fails.", "", "" );
}
}
memcpy( pSort->pLastKey, pKeyVal, iLen );
@@ -5125,7 +5125,7 @@ static void hb_ntxSortOut( LPNTXSORTINFO pSort )
{
if( hb_vmRequestQuery() != 0 )
return;
hb_errInternal( 9999, "hb_ntxSortOut: memory structure corrupted(2).", "", "" );
hb_errInternal( 7111, "hb_ntxSortOut: memory structure corrupted(2).", "", "" );
}
#endif
@@ -5780,7 +5780,7 @@ static ERRCODE ntxGoCold( NTXAREAP pArea )
if( fAppend && pArea->fShared )
{
if( pArea->fNtxAppend )
hb_errInternal( 9999, "ntxGoCold: multiple appending without GOCOLD.", "", "" );
hb_errInternal( 7112, "ntxGoCold: multiple appending without GOCOLD.", "", "" );
pArea->fNtxAppend = TRUE;
}
else

View File

@@ -3073,7 +3073,7 @@ HB_EXPORT BOOL hb_gtLoad( const char * szGtName, PHB_GT_FUNCS pFuncTable )
memcpy( s_gtInit[ iPos ]->pSuperTable, pFuncTable, sizeof( HB_GT_FUNCS ) );
if( !s_gtInit[ iPos ]->init( pFuncTable ) )
{
hb_errInternal( 9999, "Internal error: screen driver initialization failure", NULL, NULL );
hb_errInternal( 6001, "Internal error: screen driver initialization failure", NULL, NULL );
}
if( s_gtInit[ iPos ]->pGtId )
*s_gtInit[ iPos ]->pGtId = s_iGtLinkCount;

View File

@@ -71,7 +71,7 @@ HB_FUNC( CURDRIVE )
{
while( hb_fsChDrv( ( BYTE )( toupper( *hb_parc( 1 ) ) - 'A' ) ) != 0 )
{
USHORT uiAction = hb_errRT_BASE_Ext1( EG_OPEN, 9999, "Operating system error", "CURDRIVE", 0, EF_CANDEFAULT | EF_CANRETRY, HB_ERR_ARGS_BASEPARAMS );
USHORT uiAction = hb_errRT_BASE_Ext1( EG_OPEN, 6001, "Operating system error", "CURDRIVE", 0, EF_CANDEFAULT | EF_CANRETRY, HB_ERR_ARGS_BASEPARAMS );
if( uiAction != E_RETRY )
break;
@@ -80,5 +80,3 @@ HB_FUNC( CURDRIVE )
}
#endif

View File

@@ -66,7 +66,7 @@ HB_FUNC( __RUN )
if( hb_gtResume() != 0 )
{
/* an error should be generated here !! Something like */
/* hb_errRT_BASE_Ext1( EG_GTRESUME, 9999, NULL, "__RUN", 0, EF_CANDEFAULT ); */
/* hb_errRT_BASE_Ext1( EG_GTRESUME, 6002, NULL, "__RUN", 0, EF_CANDEFAULT ); */
}
}
}

View File

@@ -121,7 +121,7 @@ HB_FUNC( STRZERO )
by STR(). [vszakats] */
hb_errRT_BASE_SubstR( EG_ARG, 1099, NULL, "STR", HB_ERR_ARGS_BASEPARAMS );
#else
hb_errRT_BASE_SubstR( EG_ARG, 9999, NULL, "STRZERO", HB_ERR_ARGS_BASEPARAMS );
hb_errRT_BASE_SubstR( EG_ARG, 6003, NULL, "STRZERO", HB_ERR_ARGS_BASEPARAMS );
#endif
}
}

View File

@@ -248,7 +248,7 @@ HB_FUNC( AFILL )
thrown by AEVAL(). [vszakats] */
hb_errRT_BASE( EG_ARG, 2017, NULL, "AEVAL", HB_ERR_ARGS_BASEPARAMS );
#else
hb_errRT_BASE( EG_ARG, 9999, NULL, "AFILL", HB_ERR_ARGS_BASEPARAMS );
hb_errRT_BASE( EG_ARG, 6004, NULL, "AFILL", HB_ERR_ARGS_BASEPARAMS );
#endif
}

View File

@@ -410,7 +410,7 @@ static BOOL hb_clsDictRealloc( PCLASS pClass )
ulNewHashKey <<= 1;
if( ulNewHashKey > HASH_KEYMAX )
{
hb_errInternal( 9999, "Not able to realloc classmessage! __clsDictRealloc", NULL, NULL );
hb_errInternal( 6002, "Unable to realloc class message in __clsDictRealloc", NULL, NULL );
return FALSE;
}

View File

@@ -230,7 +230,7 @@ HB_FUNC( HB_DBG_VMVARLGET )
if( pLocal )
hb_itemReturn( pLocal );
else
hb_errRT_BASE( EG_ARG, 9999, NULL, &hb_errFuncName, HB_ERR_ARGS_BASEPARAMS );
hb_errRT_BASE( EG_ARG, 6005, NULL, &hb_errFuncName, HB_ERR_ARGS_BASEPARAMS );
}
HB_FUNC( HB_DBG_VMVARLSET )

View File

@@ -347,7 +347,7 @@ HB_EXPORT PHB_ITEM hb_itemPutCLConst( PHB_ITEM pItem, const char * szText, ULONG
else
{
if( szText[ ulLen ] != '\0' )
hb_errInternal( 9999, "Internal error: hb_itemPutCLConst() missing termination character", NULL, NULL );
hb_errInternal( 6003, "Internal error: hb_itemPutCLConst() missing termination character", NULL, NULL );
pItem->item.asString.value = ( char * ) szText;
pItem->item.asString.length = ulLen;

View File

@@ -71,8 +71,6 @@
#include "hbset.h"
#include "hb_io.h"
/* TODO: Fill the error codes with valid ones (instead of 9999) */
typedef struct
{
char * szName; /* Name of the function */
@@ -451,7 +449,7 @@ static PHRB_BODY hb_hrbLoad( char* szHrbBody, ULONG ulBodySize )
hb_strncpy( szName, pSymRead[ ul ].szName, HB_SYMBOL_NAME_LEN );
hb_hrbFreeSymbols( pSymRead, pHrbBody->ulSymbols );
hb_hrbUnLoad( pHrbBody );
hb_errRT_BASE( EG_ARG, 9999, "Unknown or unregistered symbol", szName, 0 );
hb_errRT_BASE( EG_ARG, 6101, "Unknown or unregistered symbol", szName, 0 );
return NULL;
}
}
@@ -508,7 +506,7 @@ static PHRB_BODY hb_hrbLoadFromFile( char* szHrb )
hFile = hb_fsOpen( ( BYTE * ) szFileName, FO_READ );
}
while( hFile == FS_ERROR &&
hb_errRT_BASE_Ext1( EG_OPEN, 9999, NULL, szFileName, hb_fsError(),
hb_errRT_BASE_Ext1( EG_OPEN, 6102, NULL, szFileName, hb_fsError(),
EF_CANDEFAULT | EF_CANRETRY,
HB_ERR_ARGS_BASEPARAMS ) == E_RETRY );
@@ -614,7 +612,7 @@ HB_FUNC( __HRBRUN )
hb_retl( FALSE );
}
else
hb_errRT_BASE( EG_ARG, 9999, NULL, "__HRBRUN", HB_ERR_ARGS_BASEPARAMS );
hb_errRT_BASE( EG_ARG, 6103, NULL, "__HRBRUN", HB_ERR_ARGS_BASEPARAMS );
}
HB_FUNC( __HRBLOAD )
@@ -680,7 +678,7 @@ HB_FUNC( __HRBDO )
hb_xfree( argv );
}
else
hb_errRT_BASE( EG_ARG, 9999, NULL, "__HRBDO", HB_ERR_ARGS_BASEPARAMS );
hb_errRT_BASE( EG_ARG, 6104, NULL, "__HRBDO", HB_ERR_ARGS_BASEPARAMS );
}
HB_FUNC( __HRBUNLOAD )
@@ -690,7 +688,7 @@ HB_FUNC( __HRBUNLOAD )
if( pHrbBody )
hb_hrbUnLoad( pHrbBody );
else
hb_errRT_BASE( EG_ARG, 9999, NULL, "__HRBUNLOAD", HB_ERR_ARGS_BASEPARAMS );
hb_errRT_BASE( EG_ARG, 6105, NULL, "__HRBUNLOAD", HB_ERR_ARGS_BASEPARAMS );
}
HB_FUNC( __HRBGETFU )
@@ -714,7 +712,7 @@ HB_FUNC( __HRBGETFU )
hb_itemPutSymbol( hb_stackReturnItem(), pHrbBody->pSymRead + ulPos );
}
else
hb_errRT_BASE( EG_ARG, 9999, NULL, "__HRBGETFU", HB_ERR_ARGS_BASEPARAMS );
hb_errRT_BASE( EG_ARG, 6106, NULL, "__HRBGETFU", HB_ERR_ARGS_BASEPARAMS );
}
HB_FUNC( __HRBDOFU )
@@ -735,5 +733,5 @@ HB_FUNC( __HRBDOFU )
hb_vmDo( argc - 1 ); /* Run function */
}
else
hb_errRT_BASE( EG_ARG, 9999, NULL, "__HRBDOFU", HB_ERR_ARGS_BASEPARAMS );
hb_errRT_BASE( EG_ARG, 6107, NULL, "__HRBDOFU", HB_ERR_ARGS_BASEPARAMS );
}