From e5893c1f441d37ce6e27218d138c17f64d2b1e09 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 15 Oct 2012 20:17:42 +0000 Subject: [PATCH] 2012-10-15 22:14 UTC+0200 Viktor Szakats (harbour syenar.net) * tests/tstgtapi.c ! fixed to compile with current GT API * contrib/hbfbird/firebird.c ! fixed to use ANSI C comments * contrib/hbfbird/tfirebrd.prg ! fixed possible typo in prev in 'FBGetdata( qry, 1 )' instead of 'FBGetdata( qry, 3 )' ! formatted, long line split. * ChangeLog + added incompatibiliy note to 2012-10-15 21:48 UTC+0200. it will now force field names to their aliases. --- harbour/ChangeLog | 17 +++++++++++- harbour/contrib/hbfbird/firebird.c | 4 +-- harbour/contrib/hbfbird/tfirebrd.prg | 8 +++--- harbour/tests/tstgtapi.c | 39 ++++++++++++++-------------- 4 files changed, 43 insertions(+), 25 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index bb61c9d46b..dff894bda5 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,11 +16,26 @@ The license applies to all entries newer than 2009-04-28. */ +2012-10-15 22:14 UTC+0200 Viktor Szakats (harbour syenar.net) + * tests/tstgtapi.c + ! fixed to compile with current GT API + + * contrib/hbfbird/firebird.c + ! fixed to use ANSI C comments + * contrib/hbfbird/tfirebrd.prg + ! fixed possible typo in prev in 'FBGetdata( qry, 1 )' + instead of 'FBGetdata( qry, 3 )' + ! formatted, long line split. + * ChangeLog + + added incompatibiliy note to 2012-10-15 21:48 UTC+0200. + it will now force field names to their aliases. + 2012-10-15 21:48 UTC+0200 Jacek Kubica (jkubica/at/wssk.wroc.pl) * contrib/hbfbird/tfirebrd.prg * contrib/hbfbird/firebird.c + added missing support for aliases in sql queries - ! proper translation sql TIMESTAMP -> harbour`s T value type + [INCOMPATIBLE] + ! proper translation sql TIMESTAMP -> Harbour's T value type 2012-10-15 21:27 UTC+0200 Viktor Szakats (harbour syenar.net) * contrib/gtwvg/wvgwin.c diff --git a/harbour/contrib/hbfbird/firebird.c b/harbour/contrib/hbfbird/firebird.c index edffafb718..cfce4f8ed8 100644 --- a/harbour/contrib/hbfbird/firebird.c +++ b/harbour/contrib/hbfbird/firebird.c @@ -419,8 +419,8 @@ HB_FUNC( FBQUERY ) hb_arraySetNL( aTemp, 3, sqlda->sqlvar[ i ].sqllen ); hb_arraySetNL( aTemp, 4, sqlda->sqlvar[ i ].sqlscale ); hb_arraySetC( aTemp, 5, sqlda->sqlvar[ i ].relname ); - hb_arraySetNL( aTemp, 6, sqlda->sqlvar[ i ].aliasname_length ); // support for aliases - hb_arraySetC( aTemp, 7, sqlda->sqlvar[ i ].aliasname ); // support for aliases + hb_arraySetNL( aTemp, 6, sqlda->sqlvar[ i ].aliasname_length ); /* support for aliases */ + hb_arraySetC( aTemp, 7, sqlda->sqlvar[ i ].aliasname ); /* support for aliases */ hb_arraySetForward( aNew, i + 1, aTemp ); } diff --git a/harbour/contrib/hbfbird/tfirebrd.prg b/harbour/contrib/hbfbird/tfirebrd.prg index 2c394ffd8c..9783f3780d 100644 --- a/harbour/contrib/hbfbird/tfirebrd.prg +++ b/harbour/contrib/hbfbird/tfirebrd.prg @@ -982,7 +982,9 @@ STATIC FUNCTION StructConvert( aStru, db, dialect ) IF HB_ISARRAY( qry ) DO WHILE FBFetch( qry ) == 0 - AAdd( aDomains, { IIF(FBGetdata( qry, 1 )==NIL,"",FBGetdata( qry, 1 )), IIF(FBGetdata( qry, 2 )==NIL,"",FBGetdata( qry, 2 )), IIF(FBGetdata( qry, 1 )==NIL,"",FBGetdata( qry, 3 )) } ) + AAdd( aDomains, { iif( FBGetdata( qry, 1 ) == NIL, "", FBGetdata( qry, 1 ) ),; + iif( FBGetdata( qry, 2 ) == NIL, "", FBGetdata( qry, 2 ) ),; + iif( FBGetdata( qry, 3 ) == NIL, "", FBGetdata( qry, 3 ) ) } ) ENDDO FBFree( qry ) @@ -1010,8 +1012,8 @@ STATIC FUNCTION StructConvert( aStru, db, dialect ) cType := "C" EXIT CASE SQL_SHORT - /* Firebird doesn't have boolean field, so if you define domain with BOOL then i will consider logical, ex: - create domain boolean_field as smallint default 0 not null check (value in (0,1)) */ + /* Firebird doesn't have boolean field, so if you define domain with BOOL then i will consider logical, ex: + create domain boolean_field as smallint default 0 not null check (value in (0,1)) */ IF "BOOL" $ cDomain cType := "L" diff --git a/harbour/tests/tstgtapi.c b/harbour/tests/tstgtapi.c index 55f6246174..2bd787e5f9 100644 --- a/harbour/tests/tstgtapi.c +++ b/harbour/tests/tstgtapi.c @@ -4,22 +4,21 @@ #include "hbapigt.h" -void main( void ) +int main( void ) { - HB_BYTE * test = "Testing GT API Functions"; - HB_BYTE * test2 = "This message wraps!"; - int iRow, iCol; + const char * test = "Testing GT API Functions"; + const char * test2 = "This message wraps!"; /* NOTE: always have to initialze video subsystem */ - hb_gtInit(); + hb_gtInit( 0, 0, 0 ); /* save screen (doesn't work under DOS) */ /* - HB_BYTE * scr; + void * scr; HB_SIZE size; hb_gtRectSize( 1, 1, hb_gtMaxRow(), hb_gtMaxCol(), &size ); - scr = ( HB_BYTE * ) hb_xgrab( size ); + scr = hb_xgrab( size ); hb_gtSave( 1, 1, hb_gtMaxRow() - 1, hb_gtMaxCol() - 1, scr ); */ @@ -35,10 +34,10 @@ void main( void ) /* writing color text */ hb_gtSetColorStr( "W+/B, B/W" ); - hb_gtColorSelect( _CLR_STANDARD ); + hb_gtColorSelect( HB_CLR_STANDARD ); hb_gtWrite( "Enhanced color (B/W)", 20 ); hb_gtSetPos( 22, 62 ); - hb_gtColorSelect( _CLR_ENHANCED ); + hb_gtColorSelect( HB_CLR_ENHANCED ); hb_gtWrite( "Standard Color (W+/B)", 21 ); /* boxes */ @@ -49,28 +48,30 @@ void main( void ) hb_gtSetPos( 12, 1 ); /* none */ - hb_gtSetCursor( _SC_NONE ); - getch(); + hb_gtSetCursor( SC_NONE ); + hb_inkey( HB_TRUE, 0.0, INKEY_ALL ); /* underline */ - hb_gtSetCursor( _SC_NORMAL ); - getch(); + hb_gtSetCursor( SC_NORMAL ); + hb_inkey( HB_TRUE, 0.0, INKEY_ALL ); /* lower half block */ - hb_gtSetCursor( _SC_INSERT ); - getch(); + hb_gtSetCursor( SC_INSERT ); + hb_inkey( HB_TRUE, 0.0, INKEY_ALL ); /* full block */ - hb_gtSetCursor( _SC_SPECIAL1 ); - getch(); + hb_gtSetCursor( SC_SPECIAL1 ); + hb_inkey( HB_TRUE, 0.0, INKEY_ALL ); /* upper half block */ - hb_gtSetCursor( _SC_SPECIAL2 ); - getch(); + hb_gtSetCursor( SC_SPECIAL2 ); + hb_inkey( HB_TRUE, 0.0, INKEY_ALL ); /* restore screen (doesn't work under DOS) */ /* hb_gtRest( 1, 1, hb_gtMaxRow() - 1, hb_gtMaxCol() - 1, scr ); hb_xfree( scr ); */ + + return 0; }