diff --git a/harbour/ChangeLog b/harbour/ChangeLog index f6337ace99..28da6b9ef1 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,27 @@ 2008-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org) */ +2008-11-06 02:18 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/tests/wcecon.prg + ! added missing REQUEST DBFCDX + + * harbour/contrib/rddsql/Makefile + ! added missing include $(TOP)$(ROOT)config/lib.cf + + * harbour/contrib/rddsql/hbsqldd.h + * harbour/contrib/rddsql/sqlbase.c + * harbour/contrib/rddsql/mysqldd.c + * added missing const to some char * parameters/members + ; added note about using sizeof() in preprocesor conditional directives + + * harbour/contrib/rddsql/sqlmix.c + ! fixed printf() format + + TOFIX for author: + mysqldd.c:258: warning: ‘pItemEof’ may be used uninitialized in this function + sqlbase.c:509: warning: comparison of unsigned expression < 0 is always false + Mindaugas can you look at it? + 2008-11-05 23:27 UTC+0200 Viktor Szakats (harbour.01 syenar hu) * make_vc.bat * contrib/hbgt/doc/gendoc.bat diff --git a/harbour/contrib/rddsql/Makefile b/harbour/contrib/rddsql/Makefile index e402f4366d..384bbcf8c1 100644 --- a/harbour/contrib/rddsql/Makefile +++ b/harbour/contrib/rddsql/Makefile @@ -23,6 +23,7 @@ C_SOURCES=\ sqlbase.c \ sqlmix.c \ +include $(TOP)$(ROOT)config/lib.cf else include $(TOP)$(ROOT)config/none.cf endif diff --git a/harbour/contrib/rddsql/hbsqldd.h b/harbour/contrib/rddsql/hbsqldd.h index 333eb0f590..86c983b147 100644 --- a/harbour/contrib/rddsql/hbsqldd.h +++ b/harbour/contrib/rddsql/hbsqldd.h @@ -323,7 +323,7 @@ typedef struct _SDDNODE { struct _SDDNODE * pNext; - char* Name; + const char* Name; SDDFUNC_CONNECT Connect; SDDFUNC_DISCONNECT Disconnect; SDDFUNC_EXECUTE Execute; diff --git a/harbour/contrib/rddsql/mysqldd.c b/harbour/contrib/rddsql/mysqldd.c index 7087195fe0..6b06c85123 100644 --- a/harbour/contrib/rddsql/mysqldd.c +++ b/harbour/contrib/rddsql/mysqldd.c @@ -63,7 +63,15 @@ typedef int my_socket; #include "mysql.h" /* TOFIX: HACK to make it compile under MSVC to avoid 'invalid integer constant expression' errors. */ -#if !defined( _MSC_VER ) && !defined( __MINGW32__ ) + +/* sizeof() inside #if will not work with any C compiler which has + * preprocessor separated from compiler so it will not work with most of + * existing C compilers. To make it working is necessary to mix preprocessor + * and compiler logic so sizeof() for newly defined types by 'typedef' will + * work. It's rather seldom situation when C compiler authors make sth like + * that. + */ +#if defined( __BORLANDC__ ) #if sizeof( MYSQL_ROW_OFFSET ) != sizeof( void* ) #error "MySQLDD error: sizeof( MYSQL_ROW_OFFSET ) != sizeof( void* )" @@ -132,7 +140,7 @@ HB_FUNC( MYSQLDD ) {;} HB_INIT_SYMBOLS_BEGIN( mysqldd__InitSymbols ) -{ "MYSQLDD", HB_FS_PUBLIC, HB_FUNCNAME( MYSQLDD ), NULL }, +{ "MYSQLDD", {HB_FS_PUBLIC}, {HB_FUNCNAME( MYSQLDD )}, NULL }, HB_INIT_SYMBOLS_END( mysqldd__InitSymbols ) HB_CALL_ON_STARTUP_BEGIN( _hb_mysqldd_init_ ) @@ -154,7 +162,7 @@ HB_CALL_ON_STARTUP_END( _hb_mysqldd_init_ ) /*=====================================================================================*/ -static USHORT hb_errRT_MySQLDD( ULONG ulGenCode, ULONG ulSubCode, char * szDescription, char * szOperation, USHORT uiOsCode ) +static USHORT hb_errRT_MySQLDD( ULONG ulGenCode, ULONG ulSubCode, const char * szDescription, const char * szOperation, USHORT uiOsCode ) { USHORT uiAction; PHB_ITEM pError; diff --git a/harbour/contrib/rddsql/sqlbase.c b/harbour/contrib/rddsql/sqlbase.c index c5a8621863..1941b65608 100644 --- a/harbour/contrib/rddsql/sqlbase.c +++ b/harbour/contrib/rddsql/sqlbase.c @@ -94,7 +94,7 @@ static ULONG s_ulConnectionCurrent = 0; static RDDFUNCS sqlbaseSuper; -static ERRCODE hb_errRT_SQLBASE( ULONG ulGenCode, ULONG ulSubCode, char * szDescription, char * szOperation ) +static ERRCODE hb_errRT_SQLBASE( ULONG ulGenCode, ULONG ulSubCode, const char * szDescription, const char * szOperation ) { PHB_ITEM pError; ERRCODE iRet = FAILURE; @@ -1132,8 +1132,8 @@ HB_FUNC( SQLBASE_GETFUNCTABLE ) HB_INIT_SYMBOLS_BEGIN( sqlbase1__InitSymbols ) -{ "SQLBASE", HB_FS_PUBLIC, HB_FUNCNAME( SQLBASE ), NULL }, -{ "SQLBASE_GETFUNCTABLE", HB_FS_PUBLIC, HB_FUNCNAME( SQLBASE_GETFUNCTABLE ), NULL } +{ "SQLBASE", {HB_FS_PUBLIC}, {HB_FUNCNAME( SQLBASE )}, NULL }, +{ "SQLBASE_GETFUNCTABLE", {HB_FS_PUBLIC}, {HB_FUNCNAME( SQLBASE_GETFUNCTABLE )}, NULL } HB_INIT_SYMBOLS_END( sqlbase1__InitSymbols ) HB_CALL_ON_STARTUP_BEGIN( _hb_sqlbase_init_ ) diff --git a/harbour/contrib/rddsql/sqlmix.c b/harbour/contrib/rddsql/sqlmix.c index dbeb28b8f2..7480446b06 100644 --- a/harbour/contrib/rddsql/sqlmix.c +++ b/harbour/contrib/rddsql/sqlmix.c @@ -388,7 +388,7 @@ static void hb_mixTagPrintNode( PMIXTAG pTag, PMIXNODE pNode, int iLevel ) hb_mixTagPrintNode( pTag, pNode->Child[ i ], iLevel + 1 ); } - printf("%*d %*s\n", iLevel * 10 + 5, MIX_KEY( pTag, pNode, i )->rec, pTag->uiKeyLen, + printf("%*ld %*s\n", iLevel * 10 + 5, MIX_KEY( pTag, pNode, i )->rec, pTag->uiKeyLen, MIX_KEY( pTag, pNode, i )->notnul ? ( char * ) MIX_KEY( pTag, pNode, i )->val : "NULL" ); } diff --git a/harbour/tests/wcecon.prg b/harbour/tests/wcecon.prg index 9ab4f0801a..1ef193cd0e 100644 --- a/harbour/tests/wcecon.prg +++ b/harbour/tests/wcecon.prg @@ -13,6 +13,8 @@ #include "hbgtinfo.ch" +request DBFCDX + proc main() field F1, F2, FX