diff --git a/harbour/ChangeLog b/harbour/ChangeLog index c1a3d507f8..622f388d8f 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,19 @@ +19990729-10:40 CET Victor Szel + ! source/vm/hvm.c - #include "itemapi.h" added + to fix a warning. + ! source/rtl/inkey.c - hb_inkeyPoll() #define-ed out + the kbhit() and getch() calls in Cygwin, until + some better solution is not found. + + include/ctoharb.h - PushNumber() declaration added. + + source/rtl/arrays.c/hb_arrayEval() now passes the index + to the codeblock as the second parameter. + + tests/working/arreval.prg + tests/working/Makefile + aEval() test program added. + - source/rtl/arrays.c - Removed duplicate declarations. + + tests/working/rtl_test.prg - Now return errorlevel 1 + if anything fails, and 0 if OK. + 19990729-01:40 EDT Paul Tucker * source/rtl/dir.c + #if !defined(FA_ENCRYPTED) @@ -5,7 +21,7 @@ * in FUNCINFO[] change: { SELECT, 0, 1 } -19990728-20:35 CET Victor Szel +19990729-05:25 CET Victor Szel * Changed all #include to #include "x", where x is a Harbour header file. Many source and header files involved. diff --git a/harbour/include/ctoharb.h b/harbour/include/ctoharb.h index 8c37ce2a12..346fb1eec0 100644 --- a/harbour/include/ctoharb.h +++ b/harbour/include/ctoharb.h @@ -33,6 +33,7 @@ void PushSymbol( PSYMBOL pSym ); /* pushes a function pointer onto the stack */ void Push( PHB_ITEM pItem ); /* pushes any item to the stack */ void PushNil( void ); /* in this case it places nil at self */ /* parameters should come here using Push...() */ +void PushNumber( double dNumber, WORD wDec ); /* pushes a number on to the stack and decides if it is integer, long or double */ void PushInteger( int iNumber ); void PushLong( long lNumber ); void PushDouble( double dNumber, WORD wDec ); diff --git a/harbour/source/rtl/arrays.c b/harbour/source/rtl/arrays.c index 2880b29bfc..9ef5098592 100644 --- a/harbour/source/rtl/arrays.c +++ b/harbour/source/rtl/arrays.c @@ -59,13 +59,9 @@ HB_INIT_SYMBOLS_END( Arrays__InitSymbols ); #pragma startup Arrays__InitSymbols #endif -PHB_ITEM hb_itemNew( PHB_ITEM ); -PHB_ITEM hb_itemArrayPut( PHB_ITEM , ULONG , PHB_ITEM ); - extern STACK stack; extern SYMBOL symEval; - /* * Internal */ @@ -551,7 +547,8 @@ void hb_arrayEval( PHB_ITEM pArray, PHB_ITEM bBlock, ULONG ulStart, ULONG ulCoun PushSymbol( &symEval ); Push( bBlock ); Push( pItem ); - Do( 1 ); + PushNumber( (double)(ulStart + 1), 0 ); + Do( 2 ); } } else diff --git a/harbour/source/rtl/inkey.c b/harbour/source/rtl/inkey.c index 00db3f7fcd..00f9c93135 100644 --- a/harbour/source/rtl/inkey.c +++ b/harbour/source/rtl/inkey.c @@ -160,7 +160,8 @@ void hb_inkeyPoll( void ) /* Poll the console keyboard to stuff the Harbour if( hb_set.HB_SET_TYPEAHEAD || s_inkeyPoll ) { int ch = 0; -#if defined(OS_DOS_COMPATIBLE) || defined(HARBOUR_GCC_OS2) || defined(__IBMCPP__) || defined(_Windows) +#if defined(__CYGNUS__) +#elif defined(OS_DOS_COMPATIBLE) || defined(HARBOUR_GCC_OS2) || defined(__IBMCPP__) || defined(_Windows) /* The reason for including _Windows here is that kbhit() and getch() appear to work properly in console mode. For true Windows mode, changes are needed. */ #if defined(HARBOUR_GCC_OS2) diff --git a/harbour/source/vm/hvm.c b/harbour/source/vm/hvm.c index 0c66cf4404..9a498693d0 100644 --- a/harbour/source/vm/hvm.c +++ b/harbour/source/vm/hvm.c @@ -47,6 +47,7 @@ #include "hbsetup.h" /* main configuration file */ #include "extend.h" #include "errorapi.h" +#include "itemapi.h" #include "pcode.h" #include "set.h" #include "inkey.h" diff --git a/harbour/tests/working/Makefile b/harbour/tests/working/Makefile index ea1850689c..aa30d6dcdf 100644 --- a/harbour/tests/working/Makefile +++ b/harbour/tests/working/Makefile @@ -10,6 +10,7 @@ PRG_SOURCES=\ array16.prg \ arrayidx.prg \ arrays.prg \ + arreval.prg \ arrindex.prg \ atest.prg \ box.prg \ diff --git a/harbour/tests/working/arreval.prg b/harbour/tests/working/arreval.prg new file mode 100644 index 0000000000..0c5b5e6aae --- /dev/null +++ b/harbour/tests/working/arreval.prg @@ -0,0 +1,12 @@ +// +// $Id$ +// + +function Main() + + local a := { 100, 200, 300 } + + aEval(a, {|nValue, nIndex| QOut(nValue, nIndex) }) + +return nil + diff --git a/harbour/tests/working/rtl_test.prg b/harbour/tests/working/rtl_test.prg index e71307b009..69cbbfd38c 100644 --- a/harbour/tests/working/rtl_test.prg +++ b/harbour/tests/working/rtl_test.prg @@ -129,11 +129,9 @@ FUNCTION Main() TEST_LINE( Left("ab" + Chr(0) + "def", 5) , "ab" + Chr(0) + "de") TEST_LINE( Right("ab" + Chr(0) + "def", 5) , "b" + Chr(0) + "def") - /* Show results */ + /* Show result, return ERRORLEVEL and exit */ - TEST_STAT() - - RETURN NIL + RETURN TEST_STAT() STATIC FUNCTION TEST_CALL(cBlock, bBlock, xResultExpected) LOCAL xResult := Eval(bBlock) @@ -159,7 +157,7 @@ STATIC FUNCTION TEST_STAT() "Test calls passed: " + Str(snPass) + Chr(13) + Chr(10) +; "Test calls failed: " + Str(snFail) + Chr(13) + Chr(10)) - RETURN NIL + RETURN iif(snFail > 0, 1, 0) STATIC FUNCTION XToStr(xValue) LOCAL cType := ValType(xValue)