diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 857a26aba3..f47dfd77dd 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,17 @@ +20000415-05:12 GMT+1 Victor Szakats + + * include/error.ch + * source/rdd/dbcmd.c + * source/rtl/errorapi.c + * source/vm/classes.c + * source/vm/fm.c + * source/vm/hvm.c + * source/vm/itemapi.c + * source/vm/memvars.c + * source/lang/*.c + + All internal error texts converted to support multi-language. + Also the internal error code are now correctly set. + 20000415-03:32 GMT+1 Victor Szakats * include/error.ch diff --git a/harbour/include/error.ch b/harbour/include/error.ch index f9c9b6c032..d5707ca1e0 100644 --- a/harbour/include/error.ch +++ b/harbour/include/error.ch @@ -91,28 +91,28 @@ #define EG_CONDITION 50 /* Harbour special */ /* Internal errors */ -#define IE_ERRUNRECOV 9000 -#define IE_ERRRECFAILURE 9001 -#define IE_ERRNOBLOCK 9002 -#define IE_ERRTOOMANY 9003 -#define IE_RDDINVALID 9004 -#define IE_CLSINVMETHOD 9005 -#define IE_XGRABALLOC 9006 -#define IE_XREALLOCNULL 9007 -#define IE_XREALLOCINV 9008 -#define IE_XREALLOC 9009 -#define IE_XFREEINV 9010 -#define IE_XFREENULL 9011 -#define IE_VMBADSTARTUP 9012 -#define IE_VMNOSTARTUP 9013 -#define IE_VMBADOPCODE 9014 -#define IE_VMNOTSYMBOL 9015 -#define IE_VMINVSYMBOL 9016 -#define IE_VMNOTCBLOCK 9017 -#define IE_VMNOTNUMBER 9018 -#define IE_VMNOTDOUBLE 9019 -#define IE_STACKUFLOW 9020 -#define IE_ITEMBADCOPY 9021 -#define IE_MVBADSYMBOL 9022 +#define IE_ERRUNRECOV 9000 // "Unrecoverable error %lu: " +#define IE_ERRRECFAILURE 9001 // "Error recovery failure" +#define IE_ERRNOBLOCK 9002 // "No ERRORBLOCK() for error" +#define IE_ERRTOOMANY 9003 // "Too many recursive error handler calls" +#define IE_RDDINVALID 9004 // "RDD invalid or failed to load" +#define IE_CLSINVMETHOD 9005 // "Invalid method type from %s" +#define IE_XGRABALLOC 9006 // "hb_xgrab can't allocate memory" +#define IE_XREALLOCNULL 9007 // "hb_xrealloc called with a NULL pointer" +#define IE_XREALLOCINV 9008 // "hb_xrealloc called with an invalid pointer" +#define IE_XREALLOC 9009 // "hb_xrealloc can't reallocate memory" +#define IE_XFREEINV 9010 // "hb_xfree called with an invalid pointer" +#define IE_XFREENULL 9011 // "hb_xfree called with a NULL pointer" +#define IE_VMBADSTARTUP 9012 // "Can\'t locate the starting procedure: \'%s\'" +#define IE_VMNOSTARTUP 9013 // "No starting procedure" +#define IE_VMBADOPCODE 9014 // "Unsupported VM opcode" +#define IE_VMNOTSYMBOL 9015 // "Symbol item expected from %s" +#define IE_VMINVSYMBOL 9016 // "Invalid symbol type for self from %s" +#define IE_VMNOTCBLOCK 9017 // "Codeblock expected from %s" +#define IE_VMPOPINVITEM 9018 // "Incorrect item type on the stack trying to pop from %s" +#define IE_STACKUFLOW 9019 // "Stack underflow" +#define IE_ITEMBADCOPY 9020 // "An item was going to be copied to itself from %s" +#define IE_MVBADSYMBOL 9021 // "Invalid symbol item passed as memvar %s" #endif /* _ERROR_CH */ + diff --git a/harbour/include/hbapilng.h b/harbour/include/hbapilng.h index eb87d16dc5..ec91d6e3c0 100644 --- a/harbour/include/hbapilng.h +++ b/harbour/include/hbapilng.h @@ -54,8 +54,8 @@ extern "C" { #define HB_LANG_ITEM_BASE_NATMSG 25 #define HB_LANG_ITEM_BASE_ERRDESC 38 #define HB_LANG_ITEM_BASE_ERRINTR 89 -#define HB_LANG_ITEM_BASE_TEXT 112 -#define HB_LANG_ITEM_MAX_ 115 +#define HB_LANG_ITEM_BASE_TEXT 111 +#define HB_LANG_ITEM_MAX_ 114 typedef struct _HB_LANG { diff --git a/harbour/source/lang/msg_tpl.c b/harbour/source/lang/msg_tpl.c index 620e2970e8..ac7f690d94 100644 --- a/harbour/source/lang/msg_tpl.c +++ b/harbour/source/lang/msg_tpl.c @@ -164,12 +164,11 @@ static HB_LANG s_lang = "No starting procedure", "Unsupported VM opcode", "Symbol item expected from %s", - "Invalid symbol type for self from hb_vmDo()", - "Codeblock expected from hb_vmDoBlock()", - "Incorrect item type on the stack trying to pop a number", - "Incorrect item type on the stack trying to pop a double", + "Invalid symbol type for self from %s", + "Codeblock expected from %s", + "Incorrect item type on the stack trying to pop from %s", "Stack underflow", - "An item was going to be copied to itself from hb_itemCopy()", + "An item was going to be copied to itself from %s", "Invalid symbol item passed as memvar %s", /* Texts */ diff --git a/harbour/source/lang/msgen.c b/harbour/source/lang/msgen.c index 0cf5ee5d08..2821abc8cf 100644 --- a/harbour/source/lang/msgen.c +++ b/harbour/source/lang/msgen.c @@ -164,12 +164,11 @@ static HB_LANG s_lang = "No starting procedure", "Unsupported VM opcode", "Symbol item expected from %s", - "Invalid symbol type for self from hb_vmDo()", - "Codeblock expected from hb_vmDoBlock()", - "Incorrect item type on the stack trying to pop a number", - "Incorrect item type on the stack trying to pop a double", + "Invalid symbol type for self from %s", + "Codeblock expected from %s", + "Incorrect item type on the stack trying to pop from %s", "Stack underflow", - "An item was going to be copied to itself from hb_itemCopy()", + "An item was going to be copied to itself from %s", "Invalid symbol item passed as memvar %s", /* Texts */ diff --git a/harbour/source/lang/msghu852.c b/harbour/source/lang/msghu852.c index adcf93f934..b98363b059 100644 --- a/harbour/source/lang/msghu852.c +++ b/harbour/source/lang/msghu852.c @@ -164,12 +164,11 @@ static HB_LANG s_lang = "No starting procedure", "Unsupported VM opcode", "Symbol item expected from %s", - "Invalid symbol type for self from hb_vmDo()", - "Codeblock expected from hb_vmDoBlock()", - "Incorrect item type on the stack trying to pop a number", - "Incorrect item type on the stack trying to pop a double", + "Invalid symbol type for self from %s", + "Codeblock expected from %s", + "Incorrect item type on the stack trying to pop from %s", "Stack underflow", - "An item was going to be copied to itself from hb_itemCopy()", + "An item was going to be copied to itself from %s", "Invalid symbol item passed as memvar %s", /* Texts */ diff --git a/harbour/source/lang/msghucwi.c b/harbour/source/lang/msghucwi.c index 99314504b7..1528ead1ec 100644 --- a/harbour/source/lang/msghucwi.c +++ b/harbour/source/lang/msghucwi.c @@ -152,8 +152,8 @@ static HB_LANG s_lang = "Error recovery failure", "No ERRORBLOCK() for error", "Too many recursive error handler calls", - "RDD invalid of failed to load", - "Invalid method type from __clsAddMsg", + "RDD invalid or failed to load", + "Invalid method type from %s", "hb_xgrab can't allocate memory", "hb_xrealloc called with a NULL pointer", "hb_xrealloc called with an invalid pointer", @@ -164,12 +164,11 @@ static HB_LANG s_lang = "No starting procedure", "Unsupported VM opcode", "Symbol item expected from %s", - "Invalid symbol type for self from hb_vmDo()", - "Codeblock expected from hb_vmDoBlock()", - "Incorrect item type on the stack trying to pop a number", - "Incorrect item type on the stack trying to pop a double", + "Invalid symbol type for self from %s", + "Codeblock expected from %s", + "Incorrect item type on the stack trying to pop from %s", "Stack underflow", - "An item was going to be copied to itself from hb_itemCopy()", + "An item was going to be copied to itself from %s", "Invalid symbol item passed as memvar %s", /* Texts */ diff --git a/harbour/source/lang/msghuwin.c b/harbour/source/lang/msghuwin.c index cee635ed2d..7b8b24605a 100644 --- a/harbour/source/lang/msghuwin.c +++ b/harbour/source/lang/msghuwin.c @@ -152,8 +152,8 @@ static HB_LANG s_lang = "Error recovery failure", "No ERRORBLOCK() for error", "Too many recursive error handler calls", - "RDD invalid of failed to load", - "Invalid method type from __clsAddMsg", + "RDD invalid or failed to load", + "Invalid method type from %s", "hb_xgrab can't allocate memory", "hb_xrealloc called with a NULL pointer", "hb_xrealloc called with an invalid pointer", @@ -164,12 +164,11 @@ static HB_LANG s_lang = "No starting procedure", "Unsupported VM opcode", "Symbol item expected from %s", - "Invalid symbol type for self from hb_vmDo()", - "Codeblock expected from hb_vmDoBlock()", - "Incorrect item type on the stack trying to pop a number", - "Incorrect item type on the stack trying to pop a double", + "Invalid symbol type for self from %s", + "Codeblock expected from %s", + "Incorrect item type on the stack trying to pop from %s", "Stack underflow", - "An item was going to be copied to itself from hb_itemCopy()", + "An item was going to be copied to itself from %s", "Invalid symbol item passed as memvar %s", /* Texts */ diff --git a/harbour/source/lang/msgpt.c b/harbour/source/lang/msgpt.c index 39c837f9f6..6ffffdd03f 100644 --- a/harbour/source/lang/msgpt.c +++ b/harbour/source/lang/msgpt.c @@ -164,12 +164,11 @@ static HB_LANG s_lang = "No starting procedure", "Unsupported VM opcode", "Symbol item expected from %s", - "Invalid symbol type for self from hb_vmDo()", - "Codeblock expected from hb_vmDoBlock()", - "Incorrect item type on the stack trying to pop a number", - "Incorrect item type on the stack trying to pop a double", - "Stack underflow", - "An item was going to be copied to itself from hb_itemCopy()", + "Invalid symbol type for self from %s", + "Codeblock expected from %s", + "Incorrect item type on the stack trying to pop from %s", + "Stack underflow", + "An item was going to be copied to itself from %s", "Invalid symbol item passed as memvar %s", /* Texts */ diff --git a/harbour/source/rdd/dbcmd.c b/harbour/source/rdd/dbcmd.c index 2c7466e602..e4e1aa848f 100644 --- a/harbour/source/rdd/dbcmd.c +++ b/harbour/source/rdd/dbcmd.c @@ -3293,7 +3293,7 @@ HB_FUNC( RDDREGISTER ) * > 1: error */ if( hb_rddRegister( szDriver, hb_parni( 2 ) ) > 1 ) - hb_errInternal( 9999, "RDD invalid of failed to load", NULL, NULL ); + hb_errInternal( IE_RDDINVALID, NULL, NULL, NULL ); } } diff --git a/harbour/source/rtl/errorapi.c b/harbour/source/rtl/errorapi.c index 5501c16f55..e3ad1a894f 100644 --- a/harbour/source/rtl/errorapi.c +++ b/harbour/source/rtl/errorapi.c @@ -90,7 +90,7 @@ void hb_errForceLink() HB_FUNC( __ERRINHANDLER ) { - hb_errInternal( 9999, "Error recovery failure", NULL, NULL ); + hb_errInternal( IE_ERRRECFAILURE, NULL, NULL, NULL ); } HB_FUNC( ERRORBLOCK ) @@ -177,12 +177,12 @@ USHORT hb_errLaunch( PHB_ITEM pError ) /* Check if we have a valid error handler */ if( hb_itemType( &s_errorBlock ) != HB_IT_BLOCK ) - hb_errInternal( 9999, "No ERRORBLOCK() for error", NULL, NULL ); + hb_errInternal( IE_ERRNOBLOCK, NULL, NULL, NULL ); /* Check if the error launcher was called too many times recursively */ if( s_iLaunchCount == HB_ERROR_LAUNCH_MAX ) - hb_errInternal( 9999, "Too many recursive error handler calls", NULL, NULL ); + hb_errInternal( IE_ERRTOOMANY, NULL, NULL, NULL ); /* Launch the error handler: "lResult := EVAL( ErrorBlock(), oError )" */ @@ -241,7 +241,7 @@ USHORT hb_errLaunch( PHB_ITEM pError ) hb_itemRelease( pResult ); if( bFailure ) - hb_errInternal( 9999, "Error recovery failure", NULL, NULL ); + hb_errInternal( IE_ERRRECFAILURE, NULL, NULL, NULL ); /* Add one try to the counter. */ @@ -249,7 +249,7 @@ USHORT hb_errLaunch( PHB_ITEM pError ) hb_errPutTries( pError, hb_errGetTries( pError ) + 1 ); } else - hb_errInternal( 9999, "Error recovery failure", NULL, NULL ); + hb_errInternal( IE_ERRRECFAILURE, NULL, NULL, NULL ); } else uiAction = E_RETRY; /* Clipper does this, undocumented */ @@ -280,12 +280,12 @@ PHB_ITEM hb_errLaunchSubst( PHB_ITEM pError ) /* Check if we have a valid error handler */ if( hb_itemType( &s_errorBlock ) != HB_IT_BLOCK ) - hb_errInternal( 9999, "No ERRORBLOCK() for error", NULL, NULL ); + hb_errInternal( IE_ERRNOBLOCK, NULL, NULL, NULL ); /* Check if the error launcher was called too many times recursively */ if( s_iLaunchCount == HB_ERROR_LAUNCH_MAX ) - hb_errInternal( 9999, "Too many recursive ERRORBLOCK() calls", NULL, NULL ); + hb_errInternal( IE_ERRTOOMANY, NULL, NULL, NULL ); /* Launch the error handler: "xResult := EVAL( ErrorBlock(), oError )" */ @@ -328,7 +328,7 @@ PHB_ITEM hb_errLaunchSubst( PHB_ITEM pError ) consider it as a failure. */ if( ! ( hb_errGetFlags( pError ) & EF_CANSUBSTITUTE ) ) - hb_errInternal( 9999, "Error recovery failure", NULL, NULL ); + hb_errInternal( IE_ERRRECFAILURE, NULL, NULL, NULL ); } } else @@ -793,7 +793,7 @@ void hb_errInternal( ULONG ulIntCode, char * szText, char * szPar1, char * szPar HB_TRACE(HB_TR_DEBUG, ("hb_errInternal(%lu, %s, %s, %s)", ulIntCode, szText, szPar1, szPar2)); hb_conOutErr( hb_conNewLine(), 0 ); - sprintf( buffer, "Unrecoverable error %lu: ", ulIntCode ); + sprintf( buffer, ( char * ) hb_langDGetItem( HB_LANG_ITEM_BASE_ERRINTR ), ulIntCode ); hb_conOutErr( buffer, 0 ); sprintf( buffer, szText != NULL ? szText : ( char * ) hb_langDGetItem( HB_LANG_ITEM_BASE_ERRINTR + ulIntCode - 9000 ), szPar1, szPar2 ); hb_conOutErr( buffer, 0 ); diff --git a/harbour/source/vm/classes.c b/harbour/source/vm/classes.c index a39306597e..432730d823 100644 --- a/harbour/source/vm/classes.c +++ b/harbour/source/vm/classes.c @@ -503,7 +503,7 @@ HB_FUNC( __CLSADDMSG ) break; default: - hb_errInternal( 9999, "Invalid method type from __clsAddMsg", NULL, NULL ); + hb_errInternal( IE_CLSINVMETHOD, NULL, "__clsAddMsg", NULL ); break; } } diff --git a/harbour/source/vm/fm.c b/harbour/source/vm/fm.c index a9484d453e..b43e018b75 100644 --- a/harbour/source/vm/fm.c +++ b/harbour/source/vm/fm.c @@ -176,7 +176,7 @@ void * hb_xgrab( ULONG ulSize ) /* allocates fixed memory, exits on fail pMem = malloc( ulSize + sizeof( HB_MEMINFO ) ); if( ! pMem ) - hb_errInternal( 9999, "hb_xgrab can't allocate memory", NULL, NULL ); + hb_errInternal( IE_XGRABALLOC, NULL, NULL, NULL ); if( ! s_pFirstBlock ) { @@ -233,7 +233,7 @@ void * hb_xgrab( ULONG ulSize ) /* allocates fixed memory, exits on fail pMem = malloc( ulSize ); if( ! pMem ) - hb_errInternal( 9999, "hb_xgrab can't allocate memory", NULL, NULL ); + hb_errInternal( IE_XGRABALLOC, NULL, NULL, NULL ); return pMem; @@ -250,12 +250,12 @@ void * hb_xrealloc( void * pMem, ULONG ulSize ) /* reallocates memory */ HB_TRACE_STEALTH(HB_TR_DEBUG, ("hb_xrealloc(%p, %lu)", pMem, ulSize)); if( ! pMem ) - hb_errInternal( 9999, "hb_xrealloc called with a NULL pointer", NULL, NULL ); + hb_errInternal( IE_XREALLOCNULL, NULL, NULL, NULL ); pMemBlock = ( PHB_MEMINFO ) ( ( char * ) pMem - sizeof( HB_MEMINFO ) ); if( pMemBlock->ulSignature != HB_MEMINFO_SIGNATURE ) - hb_errInternal( 9999, "hb_xrealloc called with an invalid pointer", NULL, NULL ); + hb_errInternal( IE_XREALLOCINV, NULL, NULL, NULL ); ulMemSize = pMemBlock->ulSize; @@ -266,7 +266,7 @@ void * hb_xrealloc( void * pMem, ULONG ulSize ) /* reallocates memory */ s_lMemoryMaxConsumed = s_lMemoryConsumed; if( ! pMem ) - hb_errInternal( 9999, "hb_xrealloc can't reallocate memory", NULL, NULL ); + hb_errInternal( IE_XREALLOC, NULL, NULL, NULL ); ( ( PHB_MEMINFO ) pMem )->ulSize = ulSize; /* size of the memory block */ if( ( ( PHB_MEMINFO ) pMem )->pPrevBlock ) @@ -286,12 +286,12 @@ void * hb_xrealloc( void * pMem, ULONG ulSize ) /* reallocates memory */ HB_TRACE(HB_TR_DEBUG, ("hb_xrealloc(%p, %lu)", pMem, ulSize)); if( ! pMem ) - hb_errInternal( 9999, "hb_xrealloc called with a NULL pointer", NULL, NULL ); + hb_errInternal( IE_XREALLOCNULL, NULL, NULL, NULL ); pMem = realloc( pMem, ulSize ); if( ! pMem ) - hb_errInternal( 9999, "hb_xrealloc can't reallocate memory", NULL, NULL ); + hb_errInternal( IE_XREALLOC, NULL, NULL, NULL ); return pMem; @@ -309,7 +309,7 @@ void hb_xfree( void * pMem ) /* frees fixed memory */ PHB_MEMINFO pMemBlock = ( PHB_MEMINFO ) ( ( char * ) pMem - sizeof( HB_MEMINFO ) ); if( pMemBlock->ulSignature != HB_MEMINFO_SIGNATURE ) - hb_errInternal( 9999, "hb_xfree called with an invalid pointer", NULL, NULL ); + hb_errInternal( IE_XFREEINV, NULL, NULL, NULL ); s_lMemoryConsumed -= pMemBlock->ulSize; s_lMemoryBlocks--; @@ -327,7 +327,7 @@ void hb_xfree( void * pMem ) /* frees fixed memory */ free( ( void * ) pMemBlock ); } else - hb_errInternal( 9999, "hb_xfree called with a NULL pointer", NULL, NULL ); + hb_errInternal( IE_XFREENULL, NULL, NULL, NULL ); #else @@ -336,7 +336,7 @@ void hb_xfree( void * pMem ) /* frees fixed memory */ if( pMem ) free( pMem ); else - hb_errInternal( 9999, "hb_xfree called with a NULL pointer", NULL, NULL ); + hb_errInternal( IE_XFREENULL, NULL, NULL, NULL ); #endif } diff --git a/harbour/source/vm/hvm.c b/harbour/source/vm/hvm.c index 1c9d308bc6..a4bc0aa2af 100644 --- a/harbour/source/vm/hvm.c +++ b/harbour/source/vm/hvm.c @@ -290,12 +290,12 @@ void hb_vmInit( BOOL bStartMainProc ) if( pDynSym && pDynSym->pSymbol->pFunPtr ) s_pSymStart = pDynSym->pSymbol; else - hb_errInternal( 9999, "Can\'t locate the starting procedure: \'%s\'", HARBOUR_START_PROCEDURE, NULL ); + hb_errInternal( IE_VMBADSTARTUP, NULL, HARBOUR_START_PROCEDURE, NULL ); } #else #ifndef HB_C52_STRICT else if( ! s_pSymStart ) - hb_errInternal( 9999, "No starting procedure", NULL, NULL ); + hb_errInternal( IE_VMNOSTARTUP, NULL, NULL, NULL ); #endif #endif } @@ -1154,7 +1154,7 @@ void hb_vmExecute( BYTE * pCode, PHB_SYMB pSymbols ) default: /* TODO: Include to failing pcode in the error message */ - hb_errInternal( 9999, "Unsupported VM opcode", NULL, NULL ); + hb_errInternal( IE_VMBADOPCODE, NULL, NULL, NULL ); break; } @@ -1618,7 +1618,7 @@ static void hb_vmFuncPtr( void ) /* pushes a function address pointer. Removes hb_vmPushLong( ( ULONG ) pItem->item.asSymbol.value->pFunPtr ); } else - hb_errInternal( 9999, "Symbol item expected from hb_vmFuncPtr()", NULL, NULL ); + hb_errInternal( IE_VMNOTSYMBOL, NULL, "hb_vmFuncPtr()", NULL ); } /* ------------------------------- */ @@ -2552,7 +2552,7 @@ void hb_vmDo( USHORT uiParams ) { /* QUESTION: Is this call needed ? [vszakats] */ hb_stackDispLocal(); - hb_errInternal( 9999, "Symbol item expected as a base from hb_vmDo()", NULL, NULL ); + hb_errInternal( IE_VMNOTSYMBOL, NULL, "hb_vmDo()", NULL ); } #if 0 @@ -2560,7 +2560,7 @@ void hb_vmDo( USHORT uiParams ) { /* QUESTION: Is this call needed ? [vszakats] */ hb_stackDispLocal(); - hb_errInternal( 9999, "Invalid symbol type for self from hb_vmDo()", NULL, NULL ); + hb_errInternal( IE_VMINVSYMBOL, NULL, "hb_vmDo()", NULL ); } #endif @@ -2645,7 +2645,7 @@ static HARBOUR hb_vmDoBlock( void ) uiStackBase = hb_stack.pBase - hb_stack.pItems; /* as the stack memory block could change */ if( ! HB_IS_BLOCK( pBlock ) ) - hb_errInternal( 9999, "Codeblock expected from hb_vmDoBlock()", NULL, NULL ); + hb_errInternal( IE_VMNOTCBLOCK, NULL, "hb_vmDoBlock()", NULL ); /* Check for valid count of parameters */ iParam = pBlock->item.asBlock.paramcnt - hb_pcount(); @@ -3283,7 +3283,7 @@ static double hb_vmPopNumber( void ) break; default: - hb_errInternal( 9999, "Incorrect item type on the stack trying to pop a number", NULL, NULL ); + hb_errInternal( IE_VMPOPINVITEM, NULL, "hb_vmPopNumber()", NULL ); break; } @@ -3322,7 +3322,7 @@ static double hb_vmPopDouble( int * piDec ) break; default: - hb_errInternal( 9999, "Incorrect item type on the stack trying to pop a double", NULL, NULL ); + hb_errInternal( IE_VMPOPINVITEM, NULL, "hb_vmPopDouble()", NULL ); break; } @@ -3469,7 +3469,7 @@ void hb_stackPop( void ) HB_TRACE(HB_TR_DEBUG, ("hb_stackPop()")); if( --hb_stack.pPos < hb_stack.pItems ) - hb_errInternal( 9999, "Stack underflow", NULL, NULL ); + hb_errInternal( IE_STACKUFLOW, NULL, NULL, NULL ); if( hb_stack.pPos->type != HB_IT_NIL ) hb_itemClear( hb_stack.pPos ); @@ -3480,7 +3480,7 @@ static void hb_stackDec( void ) HB_TRACE(HB_TR_DEBUG, ("hb_stackDec()")); if( --hb_stack.pPos < hb_stack.pItems ) - hb_errInternal( 9999, "Stack underflow", NULL, NULL ); + hb_errInternal( IE_STACKUFLOW, NULL, NULL, NULL ); } static void hb_stackFree( void ) diff --git a/harbour/source/vm/itemapi.c b/harbour/source/vm/itemapi.c index 3970f985cf..ac4a54f2d9 100644 --- a/harbour/source/vm/itemapi.c +++ b/harbour/source/vm/itemapi.c @@ -1035,7 +1035,7 @@ void hb_itemCopy( PHB_ITEM pDest, PHB_ITEM pSource ) hb_itemClear( pDest ); if( pDest == pSource ) - hb_errInternal( 9999, "An item was going to be copied to itself from hb_itemCopy()", NULL, NULL ); + hb_errInternal( IE_ITEMBADCOPY, NULL, "hb_itemCopy()", NULL ); memcpy( pDest, pSource, sizeof( HB_ITEM ) ); diff --git a/harbour/source/vm/memvars.c b/harbour/source/vm/memvars.c index 71f1bfbf5f..44d6c0cf5d 100644 --- a/harbour/source/vm/memvars.c +++ b/harbour/source/vm/memvars.c @@ -390,7 +390,7 @@ void hb_memvarSetValue( PHB_SYMB pMemvarSymb, HB_ITEM_PTR pItem ) } } else - hb_errInternal( 9999, "Invalid symbol item passed as memvar %s", pMemvarSymb->szName, NULL ); + hb_errInternal( IE_MVBADSYMBOL, NULL, pMemvarSymb->szName, NULL ); } ERRCODE hb_memvarGet( HB_ITEM_PTR pItem, PHB_SYMB pMemvarSymb ) @@ -418,7 +418,7 @@ ERRCODE hb_memvarGet( HB_ITEM_PTR pItem, PHB_SYMB pMemvarSymb ) } } else - hb_errInternal( 9999, "Invalid symbol item passed as memvar %s", pMemvarSymb->szName, NULL ); + hb_errInternal( IE_MVBADSYMBOL, NULL, pMemvarSymb->szName, NULL ); return bSuccess; } @@ -503,7 +503,7 @@ void hb_memvarGetRefer( HB_ITEM_PTR pItem, PHB_SYMB pMemvarSymb ) } } else - hb_errInternal( 9999, "Invalid symbol item passed as memvar %s", pMemvarSymb->szName, NULL ); + hb_errInternal( IE_MVBADSYMBOL, NULL, pMemvarSymb->szName, NULL ); } /*