From bd5452a48f3328a7e4b19dc1703ea8e335e23dd0 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 25 Jun 2009 11:59:09 +0000 Subject: [PATCH] 2009-06-25 13:58 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * utils/hbformat/hbformac.c * examples/superlib/superlib.dif * examples/hbsqlit2/hbsqlit2.c * examples/uhttpd2/socket.c * 'const' cleanup. --- harbour/ChangeLog | 7 +++++++ harbour/examples/hbsqlit2/hbsqlit2.c | 24 ++++++++++++------------ harbour/examples/superlib/superlib.dif | 4 ++-- harbour/examples/uhttpd2/socket.c | 8 ++++---- harbour/utils/hbformat/hbformac.c | 5 +++-- 5 files changed, 28 insertions(+), 20 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 19686008c8..1cdc518c56 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,13 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-06-25 13:58 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * utils/hbformat/hbformac.c + * examples/superlib/superlib.dif + * examples/hbsqlit2/hbsqlit2.c + * examples/uhttpd2/socket.c + * 'const' cleanup. + 2009-06-25 13:40 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbmzip/hbmzip.c * contrib/hbblat/blatwrp.c diff --git a/harbour/examples/hbsqlit2/hbsqlit2.c b/harbour/examples/hbsqlit2/hbsqlit2.c index d31a08a275..ce6bfc83b1 100644 --- a/harbour/examples/hbsqlit2/hbsqlit2.c +++ b/harbour/examples/hbsqlit2/hbsqlit2.c @@ -88,7 +88,7 @@ HB_FUNC( SQLITE_EXECUTE ) /* Execute a query over the passed table */ HB_FUNC( SQLITE_QUERY ) { - char * szSQLcom = hb_parcx( 1 ); + const char * szSQLcom = hb_parcx( 1 ); if( hb_sqlite2_db && sqlite_exec( hb_sqlite2_db, szSQLcom, NULL, NULL, &hb_sqlite2_szErrMsg ) == SQLITE_OK ) { @@ -154,36 +154,36 @@ HB_FUNC( SQLITE_SYSCOLUMNS ) if( hb_sqlite2_db ) { struct Table * pTable = ( struct Table * ) sqliteFindTable( hb_sqlite2_db, ( const char * ) hb_parcx( 1 ), NULL ); - + if( pTable ) { /* dimension rows array: 1 is table name 2 is field number - 3 to n cols data */ - PHB_ITEM paRows = hb_itemArrayNew( 2 + pTable->nCol ); + 3 to n cols data */ + PHB_ITEM paRows = hb_itemArrayNew( 2 + pTable->nCol ); int iField; - + /* the Table structure itself */ hb_arraySetC( paRows, 1, pTable->zName ); /* save name of table */ hb_arraySetNL( paRows, 2, pTable->nCol ); /* save number of cols/fields */ - + for( iField = 0; iField < pTable->nCol; iField++ ) { /* it's a multidimensional array */ /* four data columns name, default, type, isprimarykey per field */ PHB_ITEM paCols = hb_itemArrayNew( 4 ); - + hb_arraySetC( paCols, 1, pTable->aCol[ iField ].zName ); hb_arraySetC( paCols, 2, pTable->aCol[ iField ].zDflt ); hb_arraySetC( paCols, 3, pTable->aCol[ iField ].zType ); hb_arraySetL( paCols, 4, pTable->aCol[ iField ].isPrimKey ); - + /* put data onto subarray of records */ hb_itemArrayPut( paRows, 3 + iField, paCols ); hb_itemRelease( paCols ); } - + hb_itemReturnRelease( paRows ); return; } @@ -198,14 +198,14 @@ HB_FUNC( SQLITE_FIELDS ) if( hb_sqlite2_db ) { struct Table * pTable = ( struct Table * ) sqliteFindTable( hb_sqlite2_db, ( const char * ) hb_parcx( 1 ), NULL ); - + if( pTable ) { int i; - + /* the Table structure itself */ hb_reta( pTable->nCol ); - + for( i = 0; i < pTable->nCol; i++ ) hb_storc( pTable->aCol[ i ].zName, -1, 1 + i ); diff --git a/harbour/examples/superlib/superlib.dif b/harbour/examples/superlib/superlib.dif index e4abaddd22..deceb88465 100644 --- a/harbour/examples/superlib/superlib.dif +++ b/harbour/examples/superlib/superlib.dif @@ -21,7 +21,7 @@ diff -u superori/between.c superpat/between.c result[knt] = NIL; diff -u superori/mline.c superpat/mline.c --- superori/mline.c 1993-09-14 14:17:34.000000000 +0200 -+++ superpat/mline.c 2009-06-10 08:44:26.000000000 +0200 ++++ superpat/mline.c 2009-06-25 13:53:22.000000000 +0200 @@ -1,19 +1,19 @@ -#include "extend.api" -#include "vm.api" @@ -65,7 +65,7 @@ diff -u superori/mline.c superpat/mline.c - char *string = _parc(1); - unsigned int strlen = _parclen(1); - int linelen = _parni(2); -+ char *string = hb_parc(1); ++ const char *string = hb_parc(1); + unsigned int strlen = hb_parclen(1); + int linelen = hb_parni(2); int gotten = 0; diff --git a/harbour/examples/uhttpd2/socket.c b/harbour/examples/uhttpd2/socket.c index efbb09f474..9f24c08016 100644 --- a/harbour/examples/uhttpd2/socket.c +++ b/harbour/examples/uhttpd2/socket.c @@ -279,10 +279,10 @@ HB_FUNC( SOCKET_RECV ) HB_FUNC( SOCKET_SEND ) { - SOCKET socket = hb_parsocket( 1 ); - char* pBuf = hb_parc( 2 ); - ULONG ulLen = hb_parclen( 2 ); - int iRet, iFlags = hb_parnidef( 3, 0 ); + SOCKET socket = hb_parsocket( 1 ); + const char* pBuf = hb_parc( 2 ); + ULONG ulLen = hb_parclen( 2 ); + int iRet, iFlags = hb_parnidef( 3, 0 ); hb_vmUnlock(); iRet = send( socket, pBuf, ulLen, iFlags ); diff --git a/harbour/utils/hbformat/hbformac.c b/harbour/utils/hbformat/hbformac.c index 8ffc46396c..26a280cbfd 100644 --- a/harbour/utils/hbformat/hbformac.c +++ b/harbour/utils/hbformat/hbformac.c @@ -56,8 +56,9 @@ /* rf_FileRead( cText, @cEol ) */ HB_FUNC( RF_FILEREAD ) { - char * szText = hb_parcx( 1 ); - char * ptr, * ptr1; + const char * szText = hb_parcx( 1 ); + const char * ptr; + const char * ptr1; unsigned long ul, ulLines = 0; PHB_ITEM arr;