From acc4d55c3f3067bf61e723f3bfd0f5e53e3c6d8d Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sat, 5 Sep 2009 01:38:51 +0000 Subject: [PATCH] 2009-09-05 03:37 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * config/global.mk ! Fixed svnversion command call to work with older svn versions. Thanks to Tamas Tevesz. * contrib/hbfbird/firebird.c ! Fixed all remaining 64-bit compiler warnings. (msvc64, mingw64) + contrib/hbnetio/hbnetio.hbc - contrib/hbnetio/tests/netiotst.hbp + contrib/hbnetio/tests/hbmk.hbm + Added .hbc file. * Changed .prg specific .hbp file to generic autoprocessed .hbm file, referring to .hbc file. This way it's in sync with rest of contribs and makes it possible to add new tests in a lighter way) --- harbour/ChangeLog | 16 ++++++ harbour/config/global.mk | 2 +- harbour/contrib/hbfbird/firebird.c | 62 +++++++++++----------- harbour/contrib/hbnetio/hbnetio.hbc | 5 ++ harbour/contrib/hbnetio/tests/hbmk.hbm | 6 +++ harbour/contrib/hbnetio/tests/netiotst.hbp | 7 --- 6 files changed, 59 insertions(+), 39 deletions(-) create mode 100644 harbour/contrib/hbnetio/hbnetio.hbc create mode 100644 harbour/contrib/hbnetio/tests/hbmk.hbm delete mode 100644 harbour/contrib/hbnetio/tests/netiotst.hbp diff --git a/harbour/ChangeLog b/harbour/ChangeLog index a8c79dd2e3..ab56b73982 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,22 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-09-05 03:37 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * config/global.mk + ! Fixed svnversion command call to work with older svn versions. + Thanks to Tamas Tevesz. + + * contrib/hbfbird/firebird.c + ! Fixed all remaining 64-bit compiler warnings. (msvc64, mingw64) + + + contrib/hbnetio/hbnetio.hbc + - contrib/hbnetio/tests/netiotst.hbp + + contrib/hbnetio/tests/hbmk.hbm + + Added .hbc file. + * Changed .prg specific .hbp file to generic autoprocessed .hbm file, + referring to .hbc file. This way it's in sync with rest of contribs + and makes it possible to add new tests in a lighter way) + 2009-09-05 02:22 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * utils/hbmk2/hbmk2.prg + Added experimental support for @.clp files. diff --git a/harbour/config/global.mk b/harbour/config/global.mk index e4f84dfd0f..e313d53b11 100644 --- a/harbour/config/global.mk +++ b/harbour/config/global.mk @@ -1203,7 +1203,7 @@ ifeq ($(HB_INIT_DONE),) $(info ! HB_INSTALL_PREFIX automatically set to: $(HB_INSTALL_PREFIX)) endif ifeq ($(ROOT),./) - ifneq ($(call find_in_path,svnversion),) + ifneq ($(call find_in_path,svnversion .),) $(info ! REVISION: $(shell svnversion)) endif endif diff --git a/harbour/contrib/hbfbird/firebird.c b/harbour/contrib/hbfbird/firebird.c index af7416a8c0..2a4665ec83 100644 --- a/harbour/contrib/hbfbird/firebird.c +++ b/harbour/contrib/hbfbird/firebird.c @@ -81,8 +81,8 @@ HB_FUNC( FBCREATEDB ) { if( hb_pcount() == 6 ) { - isc_db_handle newdb = NULL; - isc_tr_handle trans = NULL; + isc_db_handle newdb = ( isc_db_handle ) 0; + isc_tr_handle trans = ( isc_tr_handle ) 0; ISC_STATUS status[ 20 ]; char create_db[ MAX_BUFFER ]; @@ -109,7 +109,7 @@ HB_FUNC( FBCREATEDB ) HB_FUNC( FBCONNECT ) { ISC_STATUS status[ MAX_FIELDS ]; - isc_db_handle db = NULL; + isc_db_handle db = ( isc_db_handle ) 0; const char * db_connect = hb_parcx( 1 ); const char * user = hb_parcx( 2 ); const char * passwd = hb_parcx( 3 ); @@ -120,14 +120,14 @@ HB_FUNC( FBCONNECT ) /* TOFIX: Possible buffer overflow. Use hb_snprintf(). */ dpb[ i++ ] = isc_dpb_version1; dpb[ i++ ] = isc_dpb_user_name; - len = strlen( user ); + len = ( int ) strlen( user ); if( len > ( int ) ( sizeof( dpb ) - i - 4 ) ) len = ( int ) ( sizeof( dpb ) - i - 4 ); dpb[ i++ ] = ( char ) len; hb_strncpy( &( dpb[ i ] ), user, len ); i += ( short ) len; dpb[ i++ ] = isc_dpb_password; - len = strlen( passwd ); + len = ( int ) strlen( passwd ); if( len > ( int ) ( sizeof( dpb ) - i - 2 ) ) len = ( int ) ( sizeof( dpb ) - i - 2 ); dpb[ i++ ] = ( char ) len; @@ -137,13 +137,13 @@ HB_FUNC( FBCONNECT ) if( isc_attach_database( status, 0, db_connect, &db, i, dpb ) ) hb_retnl( isc_sqlcode( status ) ); else - hb_retptr( ( void * ) db ); + hb_retptr( ( void * ) ( HB_PTRDIFF ) db ); } HB_FUNC( FBCLOSE ) { - isc_db_handle db = ( isc_db_handle ) hb_parptr( 1 ); + isc_db_handle db = ( isc_db_handle ) ( HB_PTRDIFF ) hb_parptr( 1 ); ISC_STATUS status[ 20 ]; if( isc_detach_database( status, &db ) ) @@ -166,19 +166,19 @@ HB_FUNC( FBERROR ) HB_FUNC( FBSTARTTRANSACTION ) { - isc_db_handle db = ( isc_db_handle ) hb_parptr( 1 ); - isc_tr_handle trans = NULL; + isc_db_handle db = ( isc_db_handle ) ( HB_PTRDIFF ) hb_parptr( 1 ); + isc_tr_handle trans = ( isc_tr_handle ) 0; ISC_STATUS status[ MAX_FIELDS ]; if( isc_start_transaction( status, &trans, 1, &db, 0, NULL ) ) hb_retnl( isc_sqlcode( status ) ); else - hb_retptr( ( void * ) trans ); + hb_retptr( ( void * ) ( HB_PTRDIFF ) trans ); } HB_FUNC( FBCOMMIT ) { - isc_tr_handle trans = ( isc_db_handle ) hb_parptr( 1 ); + isc_tr_handle trans = ( isc_db_handle ) ( HB_PTRDIFF ) hb_parptr( 1 ); ISC_STATUS status[ MAX_FIELDS ]; if( isc_commit_transaction( status, &trans ) ) @@ -189,7 +189,7 @@ HB_FUNC( FBCOMMIT ) HB_FUNC( FBROLLBACK ) { - isc_tr_handle trans = ( isc_db_handle ) hb_parptr( 1 ); + isc_tr_handle trans = ( isc_db_handle ) ( HB_PTRDIFF ) hb_parptr( 1 ); ISC_STATUS status[ MAX_FIELDS ]; if( isc_rollback_transaction( status, &trans ) ) @@ -200,8 +200,8 @@ HB_FUNC( FBROLLBACK ) HB_FUNC( FBEXECUTE ) { - isc_db_handle db = ( isc_db_handle ) hb_parptr( 1 ); - isc_tr_handle trans = NULL; + isc_db_handle db = ( isc_db_handle ) ( HB_PTRDIFF ) hb_parptr( 1 ); + isc_tr_handle trans = ( isc_tr_handle ) 0; const char * exec_str = hb_parcx( 2 ); ISC_STATUS status[ 20 ]; ISC_STATUS status_rollback[ 20 ]; @@ -209,7 +209,7 @@ HB_FUNC( FBEXECUTE ) if( HB_ISPOINTER( 4 ) ) { - trans = ( isc_tr_handle ) hb_parptr( 4 ); + trans = ( isc_tr_handle ) ( HB_PTRDIFF ) hb_parptr( 4 ); } else { @@ -243,11 +243,11 @@ HB_FUNC( FBEXECUTE ) HB_FUNC( FBQUERY ) { - isc_db_handle db = ( isc_db_handle ) hb_parptr( 1 ); - isc_tr_handle trans = NULL; + isc_db_handle db = ( isc_db_handle ) ( HB_PTRDIFF ) hb_parptr( 1 ); + isc_tr_handle trans = ( isc_tr_handle ) 0; ISC_STATUS status[ MAX_FIELDS ]; XSQLDA * sqlda; - isc_stmt_handle stmt = NULL; + isc_stmt_handle stmt = ( isc_stmt_handle ) 0; XSQLVAR * var; char sel_str[ MAX_LEN ]; @@ -264,7 +264,7 @@ HB_FUNC( FBQUERY ) if( HB_ISPOINTER( 4 ) ) { - trans = ( isc_tr_handle ) hb_parptr( 4 ); + trans = ( isc_tr_handle ) ( HB_PTRDIFF ) hb_parptr( 4 ); } else if( isc_start_transaction( status, &trans, 1, &db, 0, NULL ) ) { @@ -369,11 +369,11 @@ HB_FUNC( FBQUERY ) qry_handle = hb_itemArrayNew( 6 ); - hb_arraySetPtr( qry_handle, 1, ( void * ) stmt ); - hb_arraySetPtr( qry_handle, 2, ( void * ) sqlda ); + hb_arraySetPtr( qry_handle, 1, ( void * ) ( HB_PTRDIFF ) stmt ); + hb_arraySetPtr( qry_handle, 2, ( void * ) ( HB_PTRDIFF ) sqlda ); if( ! HB_ISPOINTER( 4 ) ) - hb_arraySetPtr( qry_handle, 3, ( void * ) trans ); + hb_arraySetPtr( qry_handle, 3, ( void * ) ( HB_PTRDIFF ) trans ); hb_arraySetNL( qry_handle, 4, ( long ) num_cols ); hb_arraySetNI( qry_handle, 5, ( int ) dialect ); @@ -389,11 +389,11 @@ HB_FUNC( FBFETCH ) { PHB_ITEM aParam = hb_param( 1, HB_IT_ARRAY ); - isc_stmt_handle stmt = ( isc_stmt_handle ) hb_itemGetPtr( hb_itemArrayGet( aParam, 1 ) ); + isc_stmt_handle stmt = ( isc_stmt_handle ) ( HB_PTRDIFF ) hb_itemGetPtr( hb_itemArrayGet( aParam, 1 ) ); ISC_STATUS status[ MAX_FIELDS ]; XSQLDA * sqlda = ( XSQLDA * ) hb_itemGetPtr( hb_itemArrayGet( aParam, 2 ) ); unsigned short dialect = ( unsigned short ) hb_itemGetNI( hb_itemArrayGet( aParam, 5 ) ); - long fetch_stat; + ISC_STATUS fetch_stat; /* TOFIX */ fetch_stat = isc_dsql_fetch( status, &stmt, dialect, sqlda ); @@ -413,9 +413,9 @@ HB_FUNC( FBFREE ) { PHB_ITEM aParam = hb_param( 1, HB_IT_ARRAY ); - isc_stmt_handle stmt = ( isc_stmt_handle ) hb_itemGetPtr( hb_itemArrayGet( aParam, 1 ) ); + isc_stmt_handle stmt = ( isc_stmt_handle ) ( HB_PTRDIFF ) hb_itemGetPtr( hb_itemArrayGet( aParam, 1 ) ); XSQLDA * sqlda = ( XSQLDA * ) hb_itemGetPtr( hb_itemArrayGet( aParam, 2 ) ); - isc_tr_handle trans = ( isc_tr_handle ) hb_itemGetPtr( hb_itemArrayGet( aParam, 3 ) ); + isc_tr_handle trans = ( isc_tr_handle ) ( HB_PTRDIFF ) hb_itemGetPtr( hb_itemArrayGet( aParam, 3 ) ); ISC_STATUS status[ MAX_FIELDS ]; if( isc_dsql_free_statement( status, &stmt, DSQL_drop ) ) @@ -607,18 +607,18 @@ HB_FUNC( FBGETDATA ) HB_FUNC( FBGETBLOB ) { ISC_STATUS status[ MAX_FIELDS ]; - isc_db_handle db = ( isc_db_handle ) hb_parptr( 1 ); - isc_tr_handle trans = NULL; - isc_blob_handle blob_handle = NULL; + isc_db_handle db = ( isc_db_handle ) ( HB_PTRDIFF ) hb_parptr( 1 ); + isc_tr_handle trans = ( isc_tr_handle ) 0; + isc_blob_handle blob_handle = ( isc_blob_handle ) 0; short blob_seg_len; char blob_segment[ 512 ]; ISC_QUAD * blob_id = ( ISC_QUAD * ) hb_parptr( 2 ); char p[ MAX_BUFFER ]; - long blob_stat; + ISC_STATUS blob_stat; if( HB_ISPOINTER( 3 ) ) { - trans = ( isc_tr_handle ) hb_parptr( 3 ); + trans = ( isc_tr_handle ) ( HB_PTRDIFF ) hb_parptr( 3 ); } else { diff --git a/harbour/contrib/hbnetio/hbnetio.hbc b/harbour/contrib/hbnetio/hbnetio.hbc new file mode 100644 index 0000000000..1710b9d096 --- /dev/null +++ b/harbour/contrib/hbnetio/hbnetio.hbc @@ -0,0 +1,5 @@ +# +# $Id$ +# + +libs=hbnetio diff --git a/harbour/contrib/hbnetio/tests/hbmk.hbm b/harbour/contrib/hbnetio/tests/hbmk.hbm new file mode 100644 index 0000000000..5f867f7453 --- /dev/null +++ b/harbour/contrib/hbnetio/tests/hbmk.hbm @@ -0,0 +1,6 @@ +# +# $Id: hbmk.hbm 11362 2009-06-15 12:46:55Z vszakats $ +# + +../hbnetio.hbc +-mt diff --git a/harbour/contrib/hbnetio/tests/netiotst.hbp b/harbour/contrib/hbnetio/tests/netiotst.hbp deleted file mode 100644 index 762bf37aa6..0000000000 --- a/harbour/contrib/hbnetio/tests/netiotst.hbp +++ /dev/null @@ -1,7 +0,0 @@ -# -# $Id: uhttpd2.hbp 11370 2009-06-15 18:22:09Z vszakats $ -# - -netiotst.prg --lhbnetio --mt