From 500a63d956d6240fa1fcfb4a94fefe232d0e5e9c Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 17 Nov 2009 00:06:04 +0000 Subject: [PATCH] 2009-11-17 01:05 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * src/rdd/dbfntx/dbfntx1.c * src/rdd/dbfnsx/dbfnsx1.c * src/rdd/dbfcdx/dbfcdx1.c * src/rdd/dbffpt/dbffpt1.c * contrib/xhb/xhbfunc.c * contrib/hbnf/fttext.c * contrib/hbbmcdx/bmdbfcdx.c + Changed to use HB_ERRCODE. * contrib/hbmzip/hbmzip.c * Minor formatting. ; NOTE/TOFIX: Here there is again 'int' used as error code. * contrib/rddsql/sddodbc/tests/test1.prg * contrib/rddsql/sddodbc/tests/test2.prg ! Fixed to use manifest constants instead of literals in SET() calls. --- harbour/ChangeLog | 18 ++++++++++++++++++ harbour/contrib/hbbmcdx/bmdbfcdx.c | 4 ++-- harbour/contrib/hbmzip/hbmzip.c | 4 ---- harbour/contrib/hbnf/fttext.c | 8 ++++---- harbour/contrib/rddsql/sddodbc/tests/test1.prg | 2 +- harbour/contrib/rddsql/sddodbc/tests/test2.prg | 2 +- harbour/contrib/xhb/xhbfunc.c | 5 ++--- harbour/src/rdd/dbfcdx/dbfcdx1.c | 4 ++-- harbour/src/rdd/dbffpt/dbffpt1.c | 4 ++-- harbour/src/rdd/dbfnsx/dbfnsx1.c | 4 ++-- harbour/src/rdd/dbfntx/dbfntx1.c | 4 ++-- 11 files changed, 36 insertions(+), 23 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 1c813c3f36..96c127d092 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,24 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-11-17 01:05 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + * src/rdd/dbfntx/dbfntx1.c + * src/rdd/dbfnsx/dbfnsx1.c + * src/rdd/dbfcdx/dbfcdx1.c + * src/rdd/dbffpt/dbffpt1.c + * contrib/xhb/xhbfunc.c + * contrib/hbnf/fttext.c + * contrib/hbbmcdx/bmdbfcdx.c + + Changed to use HB_ERRCODE. + + * contrib/hbmzip/hbmzip.c + * Minor formatting. + ; NOTE/TOFIX: Here there is again 'int' used as error code. + + * contrib/rddsql/sddodbc/tests/test1.prg + * contrib/rddsql/sddodbc/tests/test2.prg + ! Fixed to use manifest constants instead of literals in SET() calls. + 2009-11-17 00:36 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/config/win/bcc.mk ! always use \ in paths used as ilink32.exe parameters - ilink does not diff --git a/harbour/contrib/hbbmcdx/bmdbfcdx.c b/harbour/contrib/hbbmcdx/bmdbfcdx.c index dcd40861ff..b64ca488c9 100644 --- a/harbour/contrib/hbbmcdx/bmdbfcdx.c +++ b/harbour/contrib/hbbmcdx/bmdbfcdx.c @@ -363,8 +363,8 @@ static void hb_cdxErrInternal( const char * szMsg ) /* * generate Run-Time error */ -static HB_ERRCODE hb_cdxErrorRT( CDXAREAP pArea, USHORT uiGenCode, USHORT uiSubCode, - const char * filename, USHORT uiOsCode, +static HB_ERRCODE hb_cdxErrorRT( CDXAREAP pArea, HB_ERRCODE uiGenCode, HB_ERRCODE uiSubCode, + const char * filename, HB_ERRCODE uiOsCode, USHORT uiFlags, PHB_ITEM * pErrorPtr ) { PHB_ITEM pError; diff --git a/harbour/contrib/hbmzip/hbmzip.c b/harbour/contrib/hbmzip/hbmzip.c index ab8bf80704..b65c6d67a2 100644 --- a/harbour/contrib/hbmzip/hbmzip.c +++ b/harbour/contrib/hbmzip/hbmzip.c @@ -932,9 +932,7 @@ static int hb_zipStoreFile( zipFile hZip, const char* szFileName, const char* sz hb_fsClose( hFile ); } else - { iResult = -200 - hb_fsError(); - } } hb_xfree( szZipName ); return iResult; @@ -1123,9 +1121,7 @@ static int hb_unzipExtractCurrentFile( unzFile hUnzip, const char* szFileName, c hb_fsClose( hFile ); } else - { iResult = -200 - hb_fsError(); - } } unzCloseCurrentFile( hUnzip ); diff --git a/harbour/contrib/hbnf/fttext.c b/harbour/contrib/hbnf/fttext.c index 212e5e37c4..0262623eaa 100644 --- a/harbour/contrib/hbnf/fttext.c +++ b/harbour/contrib/hbnf/fttext.c @@ -204,7 +204,7 @@ static long last_off[TEXT_WORKAREAS]; static long lastbyte[TEXT_WORKAREAS]; static int isBof[ TEXT_WORKAREAS]; static int isEof[ TEXT_WORKAREAS]; -static int error[ TEXT_WORKAREAS]; +static HB_ERRCODE error[ TEXT_WORKAREAS]; /* for debugging purposes */ static int doInt = 0; @@ -518,7 +518,7 @@ HB_FUNC( FT_FGOTOP ) HB_FUNC( FT_FERROR ) { - hb_retni( error[area] ); + hb_retnl( error[area] ); } @@ -1072,7 +1072,7 @@ HB_FUNC( FT_FDELETE ) hb_xfree( ( void * ) Buff ); - hb_retl( (error[area]) ? 0 : 1 ); + hb_retl( error[area] ? 0 : 1 ); } @@ -1262,7 +1262,7 @@ HB_FUNC( FT_FAPPEND ) hb_xfree( ( void * ) buff ); - hb_retl( (error[area]) ? 0 : 1 ); + hb_retl( error[area] ? 0 : 1 ); } diff --git a/harbour/contrib/rddsql/sddodbc/tests/test1.prg b/harbour/contrib/rddsql/sddodbc/tests/test1.prg index dfdd9b4621..addaaaadec 100644 --- a/harbour/contrib/rddsql/sddodbc/tests/test1.prg +++ b/harbour/contrib/rddsql/sddodbc/tests/test1.prg @@ -8,7 +8,7 @@ REQUEST SDDODBC, SQLMIX PROC main() RDDSETDEFAULT( "SQLMIX" ) - SET( 4, "yyyy-mm-dd" ) + SET( _SET_DATEFORMAT, "yyyy-mm-dd" ) ? "Connect:", RDDINFO( RDDI_CONNECT, { "ODBC", "DBQ=" + hb_DirBase() + "\..\..\..\hbodbc\tests\test.mdb;Driver={Microsoft Access Driver (*.mdb)}" } ) ? "Use:", DBUSEAREA( .T.,, "select * from test", "test" ) ? "Alias:", ALIAS() diff --git a/harbour/contrib/rddsql/sddodbc/tests/test2.prg b/harbour/contrib/rddsql/sddodbc/tests/test2.prg index c4cdef8d2a..7debaaa5c1 100644 --- a/harbour/contrib/rddsql/sddodbc/tests/test2.prg +++ b/harbour/contrib/rddsql/sddodbc/tests/test2.prg @@ -11,7 +11,7 @@ PROC main() LOCAL nConnection, nI, aI RDDSETDEFAULT( "SQLMIX" ) - SET( 4, "yyyy-mm-dd" ) + SET( _SET_DATEFORMAT, "yyyy-mm-dd" ) nConnection := RDDINFO( RDDI_CONNECT, { "ODBC", "DBQ=Server=localhost;Driver={MySQL ODBC 5.1 Driver};dsn=;User=test;database=test;" } ) IF nConnection == 0 ? "Unable connect to server" diff --git a/harbour/contrib/xhb/xhbfunc.c b/harbour/contrib/xhb/xhbfunc.c index d13de85abf..d786e0be81 100644 --- a/harbour/contrib/xhb/xhbfunc.c +++ b/harbour/contrib/xhb/xhbfunc.c @@ -214,7 +214,7 @@ HB_FUNC( HB_CHECKSUM ) HB_FUNC( HB_F_EOF ) { - USHORT uiError = 6; + HB_ERRCODE uiError = 6; if( HB_ISNUM( 1 ) ) { @@ -222,9 +222,8 @@ HB_FUNC( HB_F_EOF ) uiError = hb_fsError(); } else - { hb_retl( TRUE ); - } + hb_fsSetFError( uiError ); } diff --git a/harbour/src/rdd/dbfcdx/dbfcdx1.c b/harbour/src/rdd/dbfcdx/dbfcdx1.c index e39c07e1c1..5b4e3fd662 100644 --- a/harbour/src/rdd/dbfcdx/dbfcdx1.c +++ b/harbour/src/rdd/dbfcdx/dbfcdx1.c @@ -188,8 +188,8 @@ static void hb_cdxErrInternal( const char * szMsg ) /* * generate Run-Time error */ -static HB_ERRCODE hb_cdxErrorRT( CDXAREAP pArea, USHORT uiGenCode, USHORT uiSubCode, - const char * filename, USHORT uiOsCode, +static HB_ERRCODE hb_cdxErrorRT( CDXAREAP pArea, HB_ERRCODE uiGenCode, HB_ERRCODE uiSubCode, + const char * filename, HB_ERRCODE uiOsCode, USHORT uiFlags, PHB_ITEM * pErrorPtr ) { PHB_ITEM pError; diff --git a/harbour/src/rdd/dbffpt/dbffpt1.c b/harbour/src/rdd/dbffpt/dbffpt1.c index fd5685fd38..781b8fba3b 100644 --- a/harbour/src/rdd/dbffpt/dbffpt1.c +++ b/harbour/src/rdd/dbffpt/dbffpt1.c @@ -95,8 +95,8 @@ static RDDFUNCS fptSuper; /* * generate Run-Time error */ -static HB_ERRCODE hb_memoErrorRT( FPTAREAP pArea, USHORT uiGenCode, USHORT uiSubCode, - char * szFileName, USHORT uiOsCode, USHORT uiFlags ) +static HB_ERRCODE hb_memoErrorRT( FPTAREAP pArea, HB_ERRCODE uiGenCode, HB_ERRCODE uiSubCode, + char * szFileName, HB_ERRCODE uiOsCode, USHORT uiFlags ) { HB_ERRCODE errCode = HB_FAILURE; diff --git a/harbour/src/rdd/dbfnsx/dbfnsx1.c b/harbour/src/rdd/dbfnsx/dbfnsx1.c index bb5ef28c7d..531a4515c4 100644 --- a/harbour/src/rdd/dbfnsx/dbfnsx1.c +++ b/harbour/src/rdd/dbfnsx/dbfnsx1.c @@ -468,8 +468,8 @@ static USHORT hb_nsxLeafPutKey( LPTAGINFO pTag, LPPAGEINFO pPage, USHORT uiOffse /* * generate Run-Time error */ -static HB_ERRCODE hb_nsxErrorRT( NSXAREAP pArea, USHORT uiGenCode, USHORT uiSubCode, - const char * szFileName, USHORT uiOsCode, +static HB_ERRCODE hb_nsxErrorRT( NSXAREAP pArea, HB_ERRCODE uiGenCode, HB_ERRCODE uiSubCode, + const char * szFileName, HB_ERRCODE uiOsCode, USHORT uiFlags, PHB_ITEM * pErrorPtr ) { PHB_ITEM pError; diff --git a/harbour/src/rdd/dbfntx/dbfntx1.c b/harbour/src/rdd/dbfntx/dbfntx1.c index 040825a68d..9fd6c14e73 100644 --- a/harbour/src/rdd/dbfntx/dbfntx1.c +++ b/harbour/src/rdd/dbfntx/dbfntx1.c @@ -250,8 +250,8 @@ static ULONG hb_ntxGetKeyRec( LPPAGEINFO pPage, SHORT iKey ) /* * generate Run-Time error */ -static HB_ERRCODE hb_ntxErrorRT( NTXAREAP pArea, USHORT uiGenCode, USHORT uiSubCode, - const char * szFileName, USHORT uiOsCode, +static HB_ERRCODE hb_ntxErrorRT( NTXAREAP pArea, HB_ERRCODE uiGenCode, HB_ERRCODE uiSubCode, + const char * szFileName, HB_ERRCODE uiOsCode, USHORT uiFlags, PHB_ITEM * pErrorPtr ) { PHB_ITEM pError;