diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 6cdc7eb48e..5949465e57 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,16 @@ +2000-06-17 18:58 UTC+0100 Victor Szakats + + * source/compiler/harbour.y + + One TODO readded + + * source/rtl/scroll.c + * source/rtl/saverest.c + * source/rtl/mouseapi.c + % Some optimizations. + + * source/rtl/setcolor.c + * Minor code standardization. + 2000-05-07 23:30 CET Patrick Mast * tests/testhtml.prg * changed the Default() function into If(...) @@ -19,7 +32,6 @@ % Better Table support, Now it generate true Tables * Many thanks for Maurilio Longo.With out his help this changes was not possible - 2000-06-16 21:28 UTC+0100 Victor Szakats diff --git a/harbour/source/compiler/harbour.y b/harbour/source/compiler/harbour.y index 3b032be1aa..4179a9e292 100644 --- a/harbour/source/compiler/harbour.y +++ b/harbour/source/compiler/harbour.y @@ -35,7 +35,9 @@ */ /* TODO list - * 1) Support this syntax: nPtr := @Hello() + * 1) Change the pcode generated by ::cVar from Self:cVar to QSELF():cVar + * The major problem to solve is how to support QSELF() inside a codeblock. + * 2) Support this syntax: nPtr := @Hello() */ #include diff --git a/harbour/source/rtl/mouseapi.c b/harbour/source/rtl/mouseapi.c index d1e6e75c85..bee6ce1862 100644 --- a/harbour/source/rtl/mouseapi.c +++ b/harbour/source/rtl/mouseapi.c @@ -303,8 +303,8 @@ HB_FUNC( MRESTSTATE ) HB_FUNC( MSETBOUNDS ) { - hb_mouseSetBounds( ISNUM( 1 ) ? hb_parni( 1 ) : 0, - ISNUM( 2 ) ? hb_parni( 2 ) : 0, + hb_mouseSetBounds( hb_parni( 1 ), /* Defaults to zero on bad type */ + hb_parni( 2 ), /* Defaults to zero on bad type */ ISNUM( 3 ) ? hb_parni( 3 ) : hb_gtMaxRow(), ISNUM( 4 ) ? hb_parni( 4 ) : hb_gtMaxCol() ); } diff --git a/harbour/source/rtl/saverest.c b/harbour/source/rtl/saverest.c index f7c12658da..37c18221f2 100644 --- a/harbour/source/rtl/saverest.c +++ b/harbour/source/rtl/saverest.c @@ -38,8 +38,8 @@ HB_FUNC( SAVESCREEN ) { - USHORT uiTop = ISNUM( 1 ) ? hb_parni( 1 ) : 0; - USHORT uiLeft = ISNUM( 2 ) ? hb_parni( 2 ) : 0; + USHORT uiTop = hb_parni( 1 ); /* Defaults to zero on bad type */ + USHORT uiLeft = hb_parni( 2 ); /* Defaults to zero on bad type */ USHORT uiBottom = ISNUM( 3 ) ? hb_parni( 3 ) : hb_gtMaxRow(); USHORT uiRight = ISNUM( 4 ) ? hb_parni( 4 ) : hb_gtMaxCol(); @@ -58,8 +58,8 @@ HB_FUNC( SAVESCREEN ) HB_FUNC( RESTSCREEN ) { if( ISCHAR( 5 ) ) - hb_gtRest( ISNUM( 1 ) ? hb_parni( 1 ) : 0, - ISNUM( 2 ) ? hb_parni( 2 ) : 0, + hb_gtRest( hb_parni( 1 ), /* Defaults to zero on bad type */ + hb_parni( 2 ), /* Defaults to zero on bad type */ ISNUM( 3 ) ? hb_parni( 3 ) : hb_gtMaxRow(), ISNUM( 4 ) ? hb_parni( 4 ) : hb_gtMaxCol(), ( void * ) hb_parc( 5 ) ); diff --git a/harbour/source/rtl/scroll.c b/harbour/source/rtl/scroll.c index 7c8f46f1fd..2867f45ce1 100644 --- a/harbour/source/rtl/scroll.c +++ b/harbour/source/rtl/scroll.c @@ -43,30 +43,44 @@ HB_FUNC( SCROLL ) int iMaxRow = hb_gtMaxRow(); int iMaxCol = hb_gtMaxCol(); - int iTop = ISNUM( 1 ) ? hb_parni( 1 ) : 0; - int iLeft = ISNUM( 2 ) ? hb_parni( 2 ) : 0; - int iBottom = ISNUM( 3 ) ? hb_parni( 3 ) : iMaxRow; - int iRight = ISNUM( 4 ) ? hb_parni( 4 ) : iMaxCol; + int iTop; + int iLeft; + int iBottom; + int iRight; /* Enforce limits of (0,0) to (MAXROW(),MAXCOL()) */ + iTop = hb_parni( 1 ); if( iTop < 0 ) iTop = 0; else if( iTop > iMaxRow ) iTop = iMaxRow; + iLeft = hb_parni( 2 ); if( iLeft < 0 ) iLeft = 0; else if( iLeft > iMaxCol ) iLeft = iMaxCol; - if( iBottom < 0 ) iBottom = 0; - else if( iBottom > iMaxRow ) iBottom = iMaxRow; + if( ISNUM( 3 ) ) + { + iBottom = hb_parni( 3 ); + if( iBottom < 0 ) iBottom = 0; + else if( iBottom > iMaxRow ) iBottom = iMaxRow; + } + else + iBottom = iMaxRow; - if( iRight < 0 ) iRight = 0; - else if( iRight > iMaxCol ) iRight = iMaxCol; + if( ISNUM( 4 ) ) + { + iRight = hb_parni( 4 ); + if( iRight < 0 ) iRight = 0; + else if( iRight > iMaxCol ) iRight = iMaxCol; + } + else + iRight = iMaxCol; hb_gtScroll( ( USHORT ) iTop, ( USHORT ) iLeft, ( USHORT ) iBottom, ( USHORT ) iRight, - ISNUM( 5 ) ? hb_parni( 5 ) : 0, - ISNUM( 6 ) ? hb_parni( 6 ) : 0 ); + hb_parni( 5 ), /* Defaults to zero on bad type */ + hb_parni( 6 ) ); /* Defaults to zero on bad type */ } diff --git a/harbour/source/rtl/setcolor.c b/harbour/source/rtl/setcolor.c index 0c2f56f040..299feb425a 100644 --- a/harbour/source/rtl/setcolor.c +++ b/harbour/source/rtl/setcolor.c @@ -65,9 +65,10 @@ HB_FUNC( SETBLINK ) BOOL bPreviousBlink; hb_gtGetBlink( &bPreviousBlink ); - if( ISLOG( 1 ) ) - hb_gtSetBlink( hb_parl( 1 ) ); hb_retl( bPreviousBlink ); + + if( ISLOG( 1 ) ) + hb_gtSetBlink( hb_parl( 1 ) ); }