From f52e6b0f52477a577b3c9eb6a3401054aded856a Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 25 Jun 2009 10:18:21 +0000 Subject: [PATCH] 2009-06-25 12:15 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * INSTALL * Minor * contrib/hbmysql/mysql.c * contrib/hbodbc/odbc.c * contrib/hbtpathy/tpcommon.c * contrib/hbsqlit3/hbsqlit3.c * contrib/hbpgsql/postgres.c * contrib/hbmisc/strfmt.c * contrib/hbwin/win_prn2.c * contrib/hbwin/win_prt.c * contrib/hbwin/win_prn1.c * contrib/hbqt/hbqt_slots.cpp * 'const' cleanup. * contrib/hbqt/generator/hbqtgen.prg + contrib/hbqt/generator/hbmk.hbm ! Fixed all warnings. ! Fixed to generate different Harbour interface code for different QT integer types. * Some formatting. (IF() -> iif(), spaces) + Added .hbm file to ensure warning-free code. * contrib/hbqt/hbqt_qimage.cpp * contrib/hbqt/hbqt_qlatin1char.cpp * contrib/hbqt/hbqt_qdatetime.cpp * contrib/hbqt/hbqt_qfilesystemmodel.cpp * contrib/hbqt/hbqt_qpalette.cpp * contrib/hbqt/hbqt_qicon.cpp * contrib/hbqt/hbqt_qhttp.cpp * contrib/hbqt/hbqt_qftp.cpp * contrib/hbqt/hbqt_qwebpage.cpp * contrib/hbqt/hbqt_qresource.cpp * contrib/hbqt/hbqt_qvariant.cpp * contrib/hbqt/hbqt_qcolordialog.cpp * contrib/hbqt/hbqt_qpixmap.cpp * contrib/hbqt/hbqt_qlatin1string.cpp * contrib/hbqt/Makefile_gen * contrib/hbqt/hbqt_qkeyevent.cpp * contrib/hbqt/hbqt_qcoreapplication.cpp * contrib/hbqt/hbqt_qcolor.cpp * contrib/hbqt/hbqt_qtextstream.cpp * contrib/hbqt/hbqt_qmodelindex.cpp * Regenerated after generator fixes. --- harbour/ChangeLog | 48 ++++- harbour/INSTALL | 2 +- harbour/contrib/hbmisc/strfmt.c | 4 +- harbour/contrib/hbmysql/mysql.c | 4 +- harbour/contrib/hbodbc/odbc.c | 4 +- harbour/contrib/hbpgsql/postgres.c | 6 +- harbour/contrib/hbqt/Makefile_gen | 2 +- harbour/contrib/hbqt/generator/hbmk.hbm | 5 + harbour/contrib/hbqt/generator/hbqtgen.prg | 164 +++++++++++------- harbour/contrib/hbqt/hbqt_qcolor.cpp | 12 +- harbour/contrib/hbqt/hbqt_qcolordialog.cpp | 6 +- .../contrib/hbqt/hbqt_qcoreapplication.cpp | 2 +- harbour/contrib/hbqt/hbqt_qdatetime.cpp | 2 +- .../contrib/hbqt/hbqt_qfilesystemmodel.cpp | 2 +- harbour/contrib/hbqt/hbqt_qftp.cpp | 4 +- harbour/contrib/hbqt/hbqt_qhttp.cpp | 4 +- harbour/contrib/hbqt/hbqt_qicon.cpp | 2 +- harbour/contrib/hbqt/hbqt_qimage.cpp | 12 +- harbour/contrib/hbqt/hbqt_qkeyevent.cpp | 6 +- harbour/contrib/hbqt/hbqt_qlatin1char.cpp | 1 + harbour/contrib/hbqt/hbqt_qlatin1string.cpp | 1 + harbour/contrib/hbqt/hbqt_qmodelindex.cpp | 2 +- harbour/contrib/hbqt/hbqt_qpalette.cpp | 2 +- harbour/contrib/hbqt/hbqt_qpixmap.cpp | 2 +- harbour/contrib/hbqt/hbqt_qresource.cpp | 2 +- harbour/contrib/hbqt/hbqt_qtextstream.cpp | 9 +- harbour/contrib/hbqt/hbqt_qvariant.cpp | 4 +- harbour/contrib/hbqt/hbqt_qwebpage.cpp | 4 +- harbour/contrib/hbqt/hbqt_slots.cpp | 4 +- harbour/contrib/hbsqlit3/hbsqlit3.c | 2 +- harbour/contrib/hbtpathy/tpcommon.c | 4 +- harbour/contrib/hbwin/win_prn1.c | 8 +- harbour/contrib/hbwin/win_prn2.c | 12 +- harbour/contrib/hbwin/win_prt.c | 2 +- 34 files changed, 225 insertions(+), 125 deletions(-) create mode 100644 harbour/contrib/hbqt/generator/hbmk.hbm diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 36b192ea5e..83c4ddd706 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,52 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-06-25 12:15 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * INSTALL + * Minor + + * contrib/hbmysql/mysql.c + * contrib/hbodbc/odbc.c + * contrib/hbtpathy/tpcommon.c + * contrib/hbsqlit3/hbsqlit3.c + * contrib/hbpgsql/postgres.c + * contrib/hbmisc/strfmt.c + * contrib/hbwin/win_prn2.c + * contrib/hbwin/win_prt.c + * contrib/hbwin/win_prn1.c + * contrib/hbqt/hbqt_slots.cpp + * 'const' cleanup. + + * contrib/hbqt/generator/hbqtgen.prg + + contrib/hbqt/generator/hbmk.hbm + ! Fixed all warnings. + ! Fixed to generate different Harbour interface code + for different QT integer types. + * Some formatting. (IF() -> iif(), spaces) + + Added .hbm file to ensure warning-free code. + + * contrib/hbqt/hbqt_qimage.cpp + * contrib/hbqt/hbqt_qlatin1char.cpp + * contrib/hbqt/hbqt_qdatetime.cpp + * contrib/hbqt/hbqt_qfilesystemmodel.cpp + * contrib/hbqt/hbqt_qpalette.cpp + * contrib/hbqt/hbqt_qicon.cpp + * contrib/hbqt/hbqt_qhttp.cpp + * contrib/hbqt/hbqt_qftp.cpp + * contrib/hbqt/hbqt_qwebpage.cpp + * contrib/hbqt/hbqt_qresource.cpp + * contrib/hbqt/hbqt_qvariant.cpp + * contrib/hbqt/hbqt_qcolordialog.cpp + * contrib/hbqt/hbqt_qpixmap.cpp + * contrib/hbqt/hbqt_qlatin1string.cpp + * contrib/hbqt/Makefile_gen + * contrib/hbqt/hbqt_qkeyevent.cpp + * contrib/hbqt/hbqt_qcoreapplication.cpp + * contrib/hbqt/hbqt_qcolor.cpp + * contrib/hbqt/hbqt_qtextstream.cpp + * contrib/hbqt/hbqt_qmodelindex.cpp + * Regenerated after generator fixes. + 2009-06-25 01:14 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) * harbour/contrib/hbxbp/xbpdialog.prg * harbour/contrib/hbxbp/xbpgeneric.prg @@ -25,7 +71,7 @@ * harbour/contrib/hbxbp/tests/demoxbp.prg + Implemented new mechanism of event handelling. Now you can click on X button and it will show up a dialog. - Still one point to control but is in working stage. + Still one point to control but is in working stage. 2009-06-25 01:05 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) * harbour/contrib/hbqt/Makefile_gen diff --git a/harbour/INSTALL b/harbour/INSTALL index 35c68091f1..8192fdfe45 100644 --- a/harbour/INSTALL +++ b/harbour/INSTALL @@ -689,7 +689,7 @@ QUICK START TO BUILD YOUR OWN HARBOUR APPLICATIONS 'hbmk2 -help' Besides the ones listed, you can use all regular Harbour compiler command line options, like: - -l, -b, -n, -w3 + -l, -b, -n, -w3 (etc...) - To make it easier to work with Harbour, it's recommended to put Harbour binary dir into the PATH: set PATH=C:\harbour\bin;%PATH% (on Windows) diff --git a/harbour/contrib/hbmisc/strfmt.c b/harbour/contrib/hbmisc/strfmt.c index 6c9030a631..9fc8531974 100644 --- a/harbour/contrib/hbmisc/strfmt.c +++ b/harbour/contrib/hbmisc/strfmt.c @@ -73,7 +73,7 @@ HB_FUNC( STRFORMAT ) if( nParNum >= 1 ) { - char * pszMask = hb_parcx( 1 ); + const char * pszMask = hb_parcx( 1 ); ULONG nMaskLen = hb_parclen( 1 ); ULONG nMaskPos; ULONG nPos; @@ -142,7 +142,7 @@ HB_FUNC( STRFORMAT ) hb_retclen_buffer( pszRetValSave, nRetValLen ); - /* Free parameter buffers */ + /* Free parameter buffers */ for( nPos = 0; nPos < HB_STRFORMAT_PARNUM_MAX_; nPos++ ) { if( strpar[ nPos ].raw && strpar[ nPos ].bFreeReq ) diff --git a/harbour/contrib/hbmysql/mysql.c b/harbour/contrib/hbmysql/mysql.c index 38143526ca..e70d0bc245 100644 --- a/harbour/contrib/hbmysql/mysql.c +++ b/harbour/contrib/hbmysql/mysql.c @@ -277,7 +277,7 @@ HB_FUNC( MYSQL_LIST_DBS ) /* MYSQL_RES * mysql_list_dbs( MYSQL *, char * wild ); HB_FUNC( MYSQL_LIST_TABLES ) /* MYSQL_RES * mysql_list_tables( MYSQL *, char * wild ); */ { MYSQL * mysql = ( MYSQL * ) HB_PARPTR( 1 ); - char * cWild = hb_parc( 2 ); + const char * cWild = hb_parc( 2 ); MYSQL_RES * mresult = mysql_list_tables( mysql, cWild ); long nr = ( long ) mysql_num_rows( mresult ); PHB_ITEM aTables = hb_itemArrayNew( nr ); @@ -317,7 +317,7 @@ HB_FUNC( MYSQL_ESCAPE_STRING ) hb_retclen_buffer( ( char * ) buffer, iSize ); } -static char * filetoBuff( char * fname, int * size ) +static char * filetoBuff( const char * fname, int * size ) { char * buffer = NULL; HB_FHANDLE handle = hb_fsOpen( ( BYTE * ) fname, FO_READWRITE ); diff --git a/harbour/contrib/hbodbc/odbc.c b/harbour/contrib/hbodbc/odbc.c index 53d476c1f1..83c9790ec1 100644 --- a/harbour/contrib/hbodbc/odbc.c +++ b/harbour/contrib/hbodbc/odbc.c @@ -634,8 +634,8 @@ HB_FUNC( SQLSTOD ) { if( hb_parclen( 1 ) >= 10 ) { - char * szSqlDate = hb_parc( 1 ); /* YYYY-MM-DD */ - char szHrbDate[ 9 ]; /* YYYYMMDD */ + const char * szSqlDate = hb_parc( 1 ); /* YYYY-MM-DD */ + char szHrbDate[ 9 ]; /* YYYYMMDD */ szHrbDate[ 0 ] = szSqlDate[ 0 ]; szHrbDate[ 1 ] = szSqlDate[ 1 ]; diff --git a/harbour/contrib/hbpgsql/postgres.c b/harbour/contrib/hbpgsql/postgres.c index 9413c4fa58..1948defbae 100644 --- a/harbour/contrib/hbpgsql/postgres.c +++ b/harbour/contrib/hbpgsql/postgres.c @@ -269,12 +269,12 @@ HB_FUNC( PQEXECPARAMS ) long n = hb_arrayLen( aParam ); long i; - char ** paramvalues = ( char ** ) hb_xgrab( sizeof( char * ) * n ); + const char ** paramvalues = ( const char ** ) hb_xgrab( sizeof( char * ) * n ); for( i = 0; i < n; i++ ) paramvalues[ i ] = hb_arrayGetCPtr( aParam, i + 1 ); - res = PQexecParams( PGconn_par( 1 ), hb_parcx( 2 ), n, NULL, ( const char * const * ) paramvalues, NULL, NULL, 1 ); + res = PQexecParams( PGconn_par( 1 ), hb_parcx( 2 ), n, NULL, paramvalues, NULL, NULL, 1 ); hb_xfree( paramvalues ); } @@ -552,7 +552,7 @@ HB_FUNC( PQCMDTUPLES ) HB_FUNC( PQESCAPESTRING ) { - char * source = hb_parcx( 1 ); + const char * source = hb_parcx( 1 ); size_t size = strlen( source ); char * dest = ( char * ) hb_xgrab( size * 2 + 1 ); diff --git a/harbour/contrib/hbqt/Makefile_gen b/harbour/contrib/hbqt/Makefile_gen index 1efb7ea222..be4639b9e0 100644 --- a/harbour/contrib/hbqt/Makefile_gen +++ b/harbour/contrib/hbqt/Makefile_gen @@ -228,7 +228,6 @@ PRG_SOURCES=\ TQAbstractSpinBox.prg \ TQAbstractTableModel.prg \ TQAction.prg \ - TQCoreApplication.prg \ TQApplication.prg \ TQBitmap.prg \ TQBoxLayout.prg \ @@ -242,6 +241,7 @@ PRG_SOURCES=\ TQCommandLinkButton.prg \ TQCommonStyle.prg \ TQConicalGradient.prg \ + TQCoreApplication.prg \ TQDateEdit.prg \ TQDateTime.prg \ TQDateTimeEdit.prg \ diff --git a/harbour/contrib/hbqt/generator/hbmk.hbm b/harbour/contrib/hbqt/generator/hbmk.hbm new file mode 100644 index 0000000000..172739e229 --- /dev/null +++ b/harbour/contrib/hbqt/generator/hbmk.hbm @@ -0,0 +1,5 @@ +# +# $Id$ +# + +-w3 -es2 diff --git a/harbour/contrib/hbqt/generator/hbqtgen.prg b/harbour/contrib/hbqt/generator/hbqtgen.prg index 64c4d4b579..5f742e6cd8 100644 --- a/harbour/contrib/hbqt/generator/hbqtgen.prg +++ b/harbour/contrib/hbqt/generator/hbqtgen.prg @@ -66,7 +66,6 @@ FUNCTION Main( ... ) LOCAL x, cPath, cFile, cExt LOCAL aPrjFiles := {} LOCAL aProFiles := {} - LOCAL lBuilds := .f. s_NewLine := hb_OsNewLine() s_PathSep := hb_OsPathSeparator() @@ -271,8 +270,8 @@ STATIC FUNCTION PullOutSection( cQth, cSec ) STATIC FUNCTION GenSource( cProFile, cPathIn, cPathOut, cPathDoc ) LOCAL cFile, cWidget, cExt, cPath, cOrg, cCPP, cPRG LOCAL cQth, cFileCpp - LOCAL s, n, hHandle, nFuncs, nCnvrtd - LOCAL b_, txt_, enum_, code_, func_, dummy_, cpp_, cmntd_, doc_, vrb_, varbls_ + LOCAL s, n, nFuncs, nCnvrtd + LOCAL b_, txt_, enum_, code_, func_, dummy_, cpp_, cmntd_, doc_, varbls_ LOCAL class_, cls_, protos_, slots_, enums_ hb_fNameSplit( cProFile, @cPath, @cWidget, @cExt ) @@ -427,7 +426,7 @@ STATIC FUNCTION GenSource( cProFile, cPathIn, cPathOut, cPathDoc ) #if 0 IF !empty( enums_ ) aadd( cpp_, '/*' ) - aeval( enums_, {|e| IF( !empty( e ), aadd( cpp_, ' * ' + e ), NIL ) } ) + aeval( enums_, {|e| iif( !empty( e ), aadd( cpp_, ' * ' + e ), NIL ) } ) aadd( cpp_, ' */ ' ) aadd( cpp_, '' ) ENDIF @@ -509,7 +508,9 @@ STATIC FUNCTION ParseProto( cProto, cWidget, txt_, doc_, aEnum, func_ ) LOCAL cPre, cPar, cRet, cFun, cParas, cDocs, cCmd, cPas, s, ss LOCAL cWdg, cCmn, cPrgRet, cHBFunc, cHBIdx, cDocNM LOCAL lSuccess - LOCAL cIntegers := 'int,qint16,qint32,qint64,quint16,quint32,quint64,qlonglong,qulonglong,QRgb,QChar' + LOCAL cInt := 'int,qint16,quint16,QChar' + LOCAL cIntLong := 'qint32,quint32,QRgb' + LOCAL cIntLongLong := 'qint64,quint64,qlonglong,qulonglong' cParas := '' cDocs := '' @@ -559,7 +560,7 @@ STATIC FUNCTION ParseProto( cProto, cWidget, txt_, doc_, aEnum, func_ ) ENDIF aRet[ PRT_NAME ] := aRet[ PRT_CAST ] - IF ascan( aEnum, {|e| IF( empty( e ), .f., e == aRet[ PRT_CAST ] ) } ) > 0 + IF ascan( aEnum, {|e| iif( empty( e ), .f., e == aRet[ PRT_CAST ] ) } ) > 0 aRet[ PRT_CAST ] := cWidget + '::' + aRet[ PRT_CAST ] ENDIF @@ -611,7 +612,7 @@ STATIC FUNCTION ParseProto( cProto, cWidget, txt_, doc_, aEnum, func_ ) aA[ PRT_NAME ] := cPre ENDIF - IF ascan( aEnum, {|e| IF( empty( e ), .f., e == aA[ PRT_CAST ] ) } ) > 0 + IF ascan( aEnum, {|e| iif( empty( e ), .f., e == aA[ PRT_CAST ] ) } ) > 0 aA[ PRT_CAST ] := cWidget + '::' + aA[ PRT_CAST ] ENDIF @@ -628,12 +629,22 @@ STATIC FUNCTION ParseProto( cProto, cWidget, txt_, doc_, aEnum, func_ ) aA[ PRT_DOC ] := 'x'+ cDocNM /* Values by reference */ - CASE aA[ PRT_CAST ] $ cIntegers .and. aA[ PRT_L_FAR ] - aadd( aPre, { 'int i'+cDocNM+' = 0;', nHBIdx, 'i'+ cDocNM, 'hb_storni' } ) - aA[ PRT_BODY ] := '&i'+cDocNM + CASE aA[ PRT_CAST ] $ cInt .and. aA[ PRT_L_FAR ] + aadd( aPre, { aA[ PRT_CAST ] + ' i' + cDocNM + ' = 0;', nHBIdx, 'i'+ cDocNM, 'hb_storni' } ) + aA[ PRT_BODY ] := '&i' + cDocNM aA[ PRT_DOC ] := '@n'+ cDocNM - CASE aA[ PRT_CAST ] $ cIntegers + CASE aA[ PRT_CAST ] $ cIntLong .and. aA[ PRT_L_FAR ] + aadd( aPre, { aA[ PRT_CAST ] + ' i' + cDocNM + ' = 0;', nHBIdx, 'i'+ cDocNM, 'hb_stornl' } ) + aA[ PRT_BODY ] := '&i' + cDocNM + aA[ PRT_DOC ] := '@n'+ cDocNM + + CASE aA[ PRT_CAST ] $ cIntLongLong .and. aA[ PRT_L_FAR ] + aadd( aPre, { aA[ PRT_CAST ] + ' i' + cDocNM + ' = 0;', nHBIdx, 'i'+ cDocNM, 'hb_stornint' } ) + aA[ PRT_BODY ] := '&i' + cDocNM + aA[ PRT_DOC ] := '@n'+ cDocNM + + CASE aA[ PRT_CAST ] $ cInt s := 'hb_parni( '+ cHBIdx +' )' IF !empty( aA[ PRT_DEFAULT ] ) .AND. !( aA[ PRT_DEFAULT ] == "0" ) aA[ PRT_BODY ] := '( HB_ISNUM( '+cHBIdx+' ) ? ' + s + ' : ' + aA[ PRT_DEFAULT ] + ' )' @@ -642,9 +653,27 @@ STATIC FUNCTION ParseProto( cProto, cWidget, txt_, doc_, aEnum, func_ ) ENDIF aA[ PRT_DOC ] := 'n'+ cDocNM + CASE aA[ PRT_CAST ] $ cIntLong + s := 'hb_parnl( '+ cHBIdx +' )' + IF !empty( aA[ PRT_DEFAULT ] ) .AND. !( aA[ PRT_DEFAULT ] == "0" ) + aA[ PRT_BODY ] := '( HB_ISNUM( '+cHBIdx+' ) ? ' + s + ' : ' + aA[ PRT_DEFAULT ] + ' )' + ELSE + aA[ PRT_BODY ] := s + ENDIF + aA[ PRT_DOC ] := 'n'+ cDocNM + + CASE aA[ PRT_CAST ] $ cIntLongLong + s := 'hb_parnint( '+ cHBIdx +' )' + IF !empty( aA[ PRT_DEFAULT ] ) .AND. !( aA[ PRT_DEFAULT ] == "0" ) + aA[ PRT_BODY ] := '( HB_ISNUM( '+cHBIdx+' ) ? ' + s + ' : ' + aA[ PRT_DEFAULT ] + ' )' + ELSE + aA[ PRT_BODY ] := s + ENDIF + aA[ PRT_DOC ] := 'n'+ cDocNM + CASE aA[ PRT_CAST ] $ 'double,qreal' .and. aA[ PRT_L_FAR ] - aadd( aPre, { 'qreal qr'+cDocNM+' = 0;', nHBIdx, 'qr'+ cDocNM, 'hb_stornd' } ) - aA[ PRT_BODY ] := '&qr'+cDocNM + aadd( aPre, { 'qreal qr' + cDocNM + ' = 0;', nHBIdx, 'qr'+ cDocNM, 'hb_stornd' } ) + aA[ PRT_BODY ] := '&qr' + cDocNM aA[ PRT_DOC ] := '@n'+ cDocNM CASE aA[ PRT_CAST ] $ 'double,qreal,float' @@ -656,8 +685,8 @@ STATIC FUNCTION ParseProto( cProto, cWidget, txt_, doc_, aEnum, func_ ) aA[ PRT_DOC ] := 'n'+ cDocNM CASE ( '::' $ aA[ PRT_CAST ] ) .and. aA[ PRT_L_FAR ] - aadd( aPre, { aA[ PRT_CAST ]+' i'+cDocNM+';', nHBIdx, 'i'+ cDocNM, 'hb_storni' } ) - aA[ PRT_BODY ] := '&i'+cDocNM + aadd( aPre, { aA[ PRT_CAST ]+' i' + cDocNM + ';', nHBIdx, 'i'+ cDocNM, 'hb_storni' } ) + aA[ PRT_BODY ] := '&i' + cDocNM aA[ PRT_DOC ] := '@n'+ cDocNM CASE ( '::' $ aA[ PRT_CAST ] ) @@ -666,8 +695,8 @@ STATIC FUNCTION ParseProto( cProto, cWidget, txt_, doc_, aEnum, func_ ) IF ascan( aEnum, aA[ PRT_DEFAULT ] ) > 0 ss := cWidget+'::'+aA[ PRT_DEFAULT ] ELSE - ss := IF( '::' $ aA[ PRT_DEFAULT ], aA[ PRT_DEFAULT ], ; - IF( isDigit( left( aA[ PRT_DEFAULT ], 1 ) ), aA[ PRT_DEFAULT ], cWidget+'::'+aA[ PRT_DEFAULT ] ) ) + ss := iif( '::' $ aA[ PRT_DEFAULT ], aA[ PRT_DEFAULT ], ; + iif( isDigit( left( aA[ PRT_DEFAULT ], 1 ) ), aA[ PRT_DEFAULT ], cWidget+'::'+aA[ PRT_DEFAULT ] ) ) ENDIF ss := '( '+ aA[ PRT_CAST ] +' ) '+ss aA[ PRT_BODY ] := '( HB_ISNUM( '+cHBIdx+' ) ? ' + s + ' : ' + ss + ' )' @@ -677,8 +706,8 @@ STATIC FUNCTION ParseProto( cProto, cWidget, txt_, doc_, aEnum, func_ ) aA[ PRT_DOC ] := 'n'+ cDocNM CASE aA[ PRT_CAST ] == 'bool' .and. aA[ PRT_L_FAR ] - aadd( aPre, { 'bool i'+cDocNM+' = 0;', nHBIdx, 'i'+ cDocNM, 'hb_stornl' } ) - aA[ PRT_BODY ] := '&i'+cDocNM + aadd( aPre, { 'bool i' + cDocNM + ' = 0;', nHBIdx, 'i'+ cDocNM, 'hb_stornl' } ) + aA[ PRT_BODY ] := '&i' + cDocNM aA[ PRT_DOC ] := '@l'+ cDocNM CASE aA[ PRT_CAST ] == 'bool' @@ -741,65 +770,73 @@ STATIC FUNCTION ParseProto( cProto, cWidget, txt_, doc_, aEnum, func_ ) DO CASE CASE aA[ PRT_CAST ] == 'T' cCmd := 'hb_retptr( '+ cCmn +' )' - cPrgRet := 'p'+cDocNM + cPrgRet := 'p' + cDocNM CASE aA[ PRT_CAST ] == 'void' cCmd := cCmn cPrgRet := 'NIL' - CASE aA[ PRT_CAST ] $ cIntegers + CASE aA[ PRT_CAST ] $ cInt cCmd := 'hb_retni( '+ cCmn +' )' - cPrgRet := 'n'+cDocNM + cPrgRet := 'n' + cDocNM + + CASE aA[ PRT_CAST ] $ cIntLong + cCmd := 'hb_retnl( '+ cCmn +' )' + cPrgRet := 'n' + cDocNM + + CASE aA[ PRT_CAST ] $ cIntLongLong + cCmd := 'hb_retnint( '+ cCmn +' )' + cPrgRet := 'n' + cDocNM CASE aA[ PRT_CAST ] $ 'double,qreal' cCmd := 'hb_retnd( '+ cCmn +' )' - cPrgRet := 'n'+cDocNM + cPrgRet := 'n' + cDocNM CASE ( '::' $ aA[ PRT_CAST ] ) cCmd := 'hb_retni( ( '+ aA[ PRT_CAST ] +' ) ' + cCmn +' )' - cPrgRet := 'n'+cDocNM + cPrgRet := 'n' + cDocNM CASE aA[ PRT_CAST ] == 'bool' cCmd := 'hb_retl( '+ cCmn +' )' - cPrgRet := 'l'+cDocNM + cPrgRet := 'l' + cDocNM CASE aA[ PRT_CAST ] == 'char' .AND. aA[ PRT_L_FAR ] cCmd := 'hb_retc( '+ cCmn +' )' - cPrgRet := 'c'+cDocNM + cPrgRet := 'c' + cDocNM CASE aA[ PRT_CAST ] == 'char' cCmd := 'hb_retni( '+ cCmn +' )' - cPrgRet := 'c'+cDocNM + cPrgRet := 'c' + cDocNM CASE aA[ PRT_CAST ] == 'QString' cCmd := 'hb_retc( '+ cCmn +'.toLatin1().data()' +' )' - cPrgRet := 'c'+cDocNM + cPrgRet := 'c' + cDocNM CASE aA[ PRT_CAST ] == 'FT_Face' cCmd := 'hb_retc( '+ cCmn +' )' - cPrgRet := 'c'+cDocNM + cPrgRet := 'c' + cDocNM CASE aA[ PRT_L_FAR ] cCmd := 'hb_retptr( ( '+ aA[ PRT_CAST ] + '* ) ' + cCmn + ' )' - cPrgRet := 'p'+cDocNM + cPrgRet := 'p' + cDocNM CASE aA[ PRT_L_AND ] .and. aA[ PRT_L_CONST ] cCmd := 'hb_retptr( new '+ aA[ PRT_CAST ] + '( ' + cCmn + ' ) )' - cPrgRet := 'p'+cDocNM + cPrgRet := 'p' + cDocNM CASE aA[ PRT_L_CONST ] cCmd := 'hb_retptr( new '+ aA[ PRT_CAST ] + '( ' + cCmn + ' ) )' - cPrgRet := 'p'+cDocNM + cPrgRet := 'p' + cDocNM CASE aA[ PRT_L_AND ] cCmd := 'hb_retptr( ( '+ aA[ PRT_CAST ] + '* ) ' + cCmn + ' )' - cPrgRet := 'p'+cDocNM + cPrgRet := 'p' + cDocNM OTHERWISE /* No attribute is attached to return value */ IF left( aA[ PRT_CAST ], 1 ) == 'Q' cCmd := 'hb_retptr( new '+ aA[ PRT_CAST ] + '( ' + cCmn + ' ) )' - cPrgRet := 'p'+cDocNM + cPrgRet := 'p' + cDocNM ELSE OutStd( '<<< '+cProto + ' | ' + aA[ PRT_CAST ]+' >>>' + s_NewLine ) @@ -856,7 +893,7 @@ STATIC FUNCTION ParseProto( cProto, cWidget, txt_, doc_, aEnum, func_ ) aadd( txt_, "" ) aadd( doc_, 'Qt_'+ cWidget + '_' + cHBFunc +'( p'+ cWidget + ; - IF( empty( cDocs ), '', ', '+ cDocs ) +' ) -> '+ cPrgRet ) + iif( empty( cDocs ), '', ', '+ cDocs ) +' ) -> '+ cPrgRet ) aadd( doc_, '' ) ENDIF @@ -865,17 +902,19 @@ STATIC FUNCTION ParseProto( cProto, cWidget, txt_, doc_, aEnum, func_ ) /*----------------------------------------------------------------------*/ STATIC FUNCTION ParseVariables( cProto, cWidget, txt_, doc_, aEnum, func_ ) - LOCAL aRet, aA, aArgus, aArg, aPar, aPre - LOCAL n, nn, nHBIdx - LOCAL cPre, cPar, cRet, cFun, cParas, cDocs, cCmd, cPas, s, ss - LOCAL cWdg, cCmn, cPrgRet, cHBFunc, cHBIdx, cDocNM + LOCAL aRet, aA, aPre + LOCAL n + LOCAL cRet, cFun, cDocs, cCmd + LOCAL cWdg, cCmn, cPrgRet, cHBFunc, cDocNM LOCAL lSuccess - LOCAL cIntegers := 'int,qint16,qint32,qint64,quint16,quint32,quint64,qlonglong,qulonglong,QRgb,QChar' + LOCAL cInt := 'int,qint16,quint16,QChar' + LOCAL cIntLong := 'qint32,quint32,QRgb' + LOCAL cIntLongLong := 'qint64,quint64,qlonglong,qulonglong' - cParas := '' + aPre := {} cDocs := '' - aRet := {}; aArgus := {} + aRet := {} n := at( ' ', cProto ) IF n > 0 IF .t. @@ -888,7 +927,7 @@ STATIC FUNCTION ParseVariables( cProto, cWidget, txt_, doc_, aEnum, func_ ) aRet[ PRT_CAST ] := cRet aRet[ PRT_NAME ] := aRet[ PRT_CAST ] - IF ascan( aEnum, {|e| IF( empty( e ), .f., e == aRet[ PRT_CAST ] ) } ) > 0 + IF ascan( aEnum, {|e| iif( empty( e ), .f., e == aRet[ PRT_CAST ] ) } ) > 0 aRet[ PRT_CAST ] := cWidget + '::' + aRet[ PRT_CAST ] ENDIF @@ -902,48 +941,56 @@ STATIC FUNCTION ParseVariables( cProto, cWidget, txt_, doc_, aEnum, func_ ) DO CASE CASE aA[ PRT_CAST ] == 'T' cCmd := 'hb_ret( '+ cCmn +' )' - cPrgRet := 'x'+cDocNM + cPrgRet := 'x' + cDocNM - CASE aA[ PRT_CAST ] $ cIntegers + CASE aA[ PRT_CAST ] $ cInt cCmd := 'hb_retni( '+ cCmn +' )' - cPrgRet := 'n'+cDocNM + cPrgRet := 'n' + cDocNM + + CASE aA[ PRT_CAST ] $ cIntLong + cCmd := 'hb_retnl( '+ cCmn +' )' + cPrgRet := 'n' + cDocNM + + CASE aA[ PRT_CAST ] $ cIntLongLong + cCmd := 'hb_retnint( '+ cCmn +' )' + cPrgRet := 'n' + cDocNM CASE aA[ PRT_CAST ] $ 'double,qreal' cCmd := 'hb_retnd( '+ cCmn +' )' - cPrgRet := 'n'+cDocNM + cPrgRet := 'n' + cDocNM CASE ( '::' $ aA[ PRT_CAST ] ) cCmd := 'hb_retni( ( '+ aA[ PRT_CAST ] +' ) ' + cCmn +' )' - cPrgRet := 'n'+cDocNM + cPrgRet := 'n' + cDocNM CASE aA[ PRT_CAST ] == 'bool' cCmd := 'hb_retl( '+ cCmn +' )' - cPrgRet := 'l'+cDocNM + cPrgRet := 'l' + cDocNM CASE aA[ PRT_CAST ] == 'char*' cCmd := 'hb_retc( '+ cCmn +' )' - cPrgRet := 'c'+cDocNM + cPrgRet := 'c' + cDocNM CASE aA[ PRT_CAST ] == 'char' cCmd := 'hb_retni( '+ cCmn +' )' - cPrgRet := 'c'+cDocNM + cPrgRet := 'c' + cDocNM CASE aA[ PRT_CAST ] == 'QString' cCmd := 'hb_retc( '+ cCmn +'.toLatin1().data()' +' )' - cPrgRet := 'c'+cDocNM + cPrgRet := 'c' + cDocNM CASE aA[ PRT_CAST ] == 'FT_Face' cCmd := 'hb_retc( '+ cCmn +' )' - cPrgRet := 'c'+cDocNM + cPrgRet := 'c' + cDocNM OTHERWISE /* No attribute is attached to return value */ IF left( aA[ PRT_CAST ], 1 ) == 'Q' cCmd := 'hb_retptr( new '+ aA[ PRT_CAST ] + '( ' + cCmn + ' ) )' - cPrgRet := 'p'+cDocNM + cPrgRet := 'p' + cDocNM ELSE - OutStd( '<<< '+cProto + ' | ' + aA[ PRT_CAST ]+' >>>' + s_NewLine ) + OutStd( '<<< ' + cProto + ' | ' + aA[ PRT_CAST ] + ' >>>' + s_NewLine ) cCmd := '' cPrgRet := '' @@ -997,7 +1044,7 @@ STATIC FUNCTION ParseVariables( cProto, cWidget, txt_, doc_, aEnum, func_ ) aadd( txt_, "" ) aadd( doc_, 'Qt_'+ cWidget + '_' + cHBFunc +'( p'+ cWidget + ; - IF( empty( cDocs ), '', ', '+ cDocs ) +' ) -> '+ cPrgRet ) + iif( empty( cDocs ), '', ', '+ cDocs ) +' ) -> '+ cPrgRet ) aadd( doc_, '' ) ENDIF @@ -1192,7 +1239,7 @@ STATIC FUNCTION Build_Class( cWidget, cls_, doc_, cPathOut ) aadd( txt_, '' ) n := ascan( cls_, {|e_| left( lower( e_[ 1 ] ),7 ) == 'inherit' .and. !empty( e_[ 2 ] ) } ) - s := 'CREATE CLASS '+ cWidget + IF( n > 0, ' INHERIT ' + cls_[ n,2 ], '' ) + s := 'CREATE CLASS '+ cWidget + iif( n > 0, ' INHERIT ' + cls_[ n,2 ], '' ) aadd( txt_, s ) aadd( txt_, '' ) @@ -1219,7 +1266,7 @@ STATIC FUNCTION Build_Class( cWidget, cls_, doc_, cPathOut ) cM := strtran( cM, ss, '' ) cM := strtran( cM, '( )', '()' ) cM := strtran( cM, '( ', '( ' ) - cM := IF( len( cM ) > 35, cM, pad( cM,35 ) ) + cM := iif( len( cM ) > 35, cM, pad( cM,35 ) ) ss := 'p'+cWidget cCall := strtran( s, ss, '::pPtr' ) @@ -1295,4 +1342,3 @@ STATIC FUNCTION Build_MakeFile( cpp_, prg_, cPathOut ) RETURN CreateTarget( cFile, txt_ ) /*----------------------------------------------------------------------*/ - diff --git a/harbour/contrib/hbqt/hbqt_qcolor.cpp b/harbour/contrib/hbqt/hbqt_qcolor.cpp index 04b9350738..936d88cc64 100644 --- a/harbour/contrib/hbqt/hbqt_qcolor.cpp +++ b/harbour/contrib/hbqt/hbqt_qcolor.cpp @@ -387,7 +387,7 @@ HB_FUNC( QT_QCOLOR_REDF ) */ HB_FUNC( QT_QCOLOR_RGB ) { - hb_retni( hbqt_par_QColor( 1 )->rgb() ); + hb_retnl( hbqt_par_QColor( 1 )->rgb() ); } /* @@ -395,7 +395,7 @@ HB_FUNC( QT_QCOLOR_RGB ) */ HB_FUNC( QT_QCOLOR_RGBA ) { - hb_retni( hbqt_par_QColor( 1 )->rgba() ); + hb_retnl( hbqt_par_QColor( 1 )->rgba() ); } /* @@ -523,7 +523,7 @@ HB_FUNC( QT_QCOLOR_SETREDF ) */ HB_FUNC( QT_QCOLOR_SETRGB ) { - hbqt_par_QColor( 1 )->setRgb( hb_parni( 2 ) ); + hbqt_par_QColor( 1 )->setRgb( hb_parnl( 2 ) ); } /* @@ -539,7 +539,7 @@ HB_FUNC( QT_QCOLOR_SETRGB_1 ) */ HB_FUNC( QT_QCOLOR_SETRGBA ) { - hbqt_par_QColor( 1 )->setRgba( hb_parni( 2 ) ); + hbqt_par_QColor( 1 )->setRgba( hb_parnl( 2 ) ); } /* @@ -659,7 +659,7 @@ HB_FUNC( QT_QCOLOR_FROMHSVF ) */ HB_FUNC( QT_QCOLOR_FROMRGB ) { - hb_retptr( new QColor( hbqt_par_QColor( 1 )->fromRgb( hb_parni( 2 ) ) ) ); + hb_retptr( new QColor( hbqt_par_QColor( 1 )->fromRgb( hb_parnl( 2 ) ) ) ); } /* @@ -683,7 +683,7 @@ HB_FUNC( QT_QCOLOR_FROMRGBF ) */ HB_FUNC( QT_QCOLOR_FROMRGBA ) { - hb_retptr( new QColor( hbqt_par_QColor( 1 )->fromRgba( hb_parni( 2 ) ) ) ); + hb_retptr( new QColor( hbqt_par_QColor( 1 )->fromRgba( hb_parnl( 2 ) ) ) ); } diff --git a/harbour/contrib/hbqt/hbqt_qcolordialog.cpp b/harbour/contrib/hbqt/hbqt_qcolordialog.cpp index 295c012be1..d4a4d6c855 100644 --- a/harbour/contrib/hbqt/hbqt_qcolordialog.cpp +++ b/harbour/contrib/hbqt/hbqt_qcolordialog.cpp @@ -157,7 +157,7 @@ HB_FUNC( QT_QCOLORDIALOG_TESTOPTION ) */ HB_FUNC( QT_QCOLORDIALOG_CUSTOMCOLOR ) { - hb_retni( hbqt_par_QColorDialog( 1 )->customColor( hb_parni( 2 ) ) ); + hb_retnl( hbqt_par_QColorDialog( 1 )->customColor( hb_parni( 2 ) ) ); } /* @@ -189,7 +189,7 @@ HB_FUNC( QT_QCOLORDIALOG_GETCOLOR_1 ) */ HB_FUNC( QT_QCOLORDIALOG_SETCUSTOMCOLOR ) { - hbqt_par_QColorDialog( 1 )->setCustomColor( hb_parni( 2 ), hb_parni( 3 ) ); + hbqt_par_QColorDialog( 1 )->setCustomColor( hb_parni( 2 ), hb_parnl( 3 ) ); } /* @@ -197,7 +197,7 @@ HB_FUNC( QT_QCOLORDIALOG_SETCUSTOMCOLOR ) */ HB_FUNC( QT_QCOLORDIALOG_SETSTANDARDCOLOR ) { - hbqt_par_QColorDialog( 1 )->setStandardColor( hb_parni( 2 ), hb_parni( 3 ) ); + hbqt_par_QColorDialog( 1 )->setStandardColor( hb_parni( 2 ), hb_parnl( 3 ) ); } diff --git a/harbour/contrib/hbqt/hbqt_qcoreapplication.cpp b/harbour/contrib/hbqt/hbqt_qcoreapplication.cpp index 428c4fc7e7..1be4b4b54f 100644 --- a/harbour/contrib/hbqt/hbqt_qcoreapplication.cpp +++ b/harbour/contrib/hbqt/hbqt_qcoreapplication.cpp @@ -126,7 +126,7 @@ HB_FUNC( QT_QCOREAPPLICATION_APPLICATIONNAME ) */ HB_FUNC( QT_QCOREAPPLICATION_APPLICATIONPID ) { - hb_retni( hbqt_par_QCoreApplication( 1 )->applicationPid() ); + hb_retnint( hbqt_par_QCoreApplication( 1 )->applicationPid() ); } /* diff --git a/harbour/contrib/hbqt/hbqt_qdatetime.cpp b/harbour/contrib/hbqt/hbqt_qdatetime.cpp index 76eeb67bd3..7f071c6ef5 100644 --- a/harbour/contrib/hbqt/hbqt_qdatetime.cpp +++ b/harbour/contrib/hbqt/hbqt_qdatetime.cpp @@ -88,7 +88,7 @@ HB_FUNC( QT_QDATETIME_ADDDAYS ) */ HB_FUNC( QT_QDATETIME_ADDMSECS ) { - hb_retptr( new QDateTime( hbqt_par_QDateTime( 1 )->addMSecs( hb_parni( 2 ) ) ) ); + hb_retptr( new QDateTime( hbqt_par_QDateTime( 1 )->addMSecs( hb_parnint( 2 ) ) ) ); } /* diff --git a/harbour/contrib/hbqt/hbqt_qfilesystemmodel.cpp b/harbour/contrib/hbqt/hbqt_qfilesystemmodel.cpp index 3bc338206e..62cb5e5a0c 100644 --- a/harbour/contrib/hbqt/hbqt_qfilesystemmodel.cpp +++ b/harbour/contrib/hbqt/hbqt_qfilesystemmodel.cpp @@ -317,7 +317,7 @@ HB_FUNC( QT_QFILESYSTEMMODEL_SETROOTPATH ) */ HB_FUNC( QT_QFILESYSTEMMODEL_SIZE ) { - hb_retni( hbqt_par_QFileSystemModel( 1 )->size( *hbqt_par_QModelIndex( 2 ) ) ); + hb_retnint( hbqt_par_QFileSystemModel( 1 )->size( *hbqt_par_QModelIndex( 2 ) ) ); } /* diff --git a/harbour/contrib/hbqt/hbqt_qftp.cpp b/harbour/contrib/hbqt/hbqt_qftp.cpp index 8ca283afaf..062bf2cb73 100644 --- a/harbour/contrib/hbqt/hbqt_qftp.cpp +++ b/harbour/contrib/hbqt/hbqt_qftp.cpp @@ -77,7 +77,7 @@ HB_FUNC( QT_QFTP ) */ HB_FUNC( QT_QFTP_BYTESAVAILABLE ) { - hb_retni( hbqt_par_QFtp( 1 )->bytesAvailable() ); + hb_retnint( hbqt_par_QFtp( 1 )->bytesAvailable() ); } /* @@ -221,7 +221,7 @@ HB_FUNC( QT_QFTP_RAWCOMMAND ) */ HB_FUNC( QT_QFTP_READ ) { - hb_retni( hbqt_par_QFtp( 1 )->read( hbqt_par_char( 2 ), hb_parni( 3 ) ) ); + hb_retnint( hbqt_par_QFtp( 1 )->read( hbqt_par_char( 2 ), hb_parnint( 3 ) ) ); } /* diff --git a/harbour/contrib/hbqt/hbqt_qhttp.cpp b/harbour/contrib/hbqt/hbqt_qhttp.cpp index 816ff84a07..5122a251c8 100644 --- a/harbour/contrib/hbqt/hbqt_qhttp.cpp +++ b/harbour/contrib/hbqt/hbqt_qhttp.cpp @@ -79,7 +79,7 @@ HB_FUNC( QT_QHTTP ) */ HB_FUNC( QT_QHTTP_BYTESAVAILABLE ) { - hb_retni( hbqt_par_QHttp( 1 )->bytesAvailable() ); + hb_retnint( hbqt_par_QHttp( 1 )->bytesAvailable() ); } /* @@ -199,7 +199,7 @@ HB_FUNC( QT_QHTTP_POST_1 ) */ HB_FUNC( QT_QHTTP_READ ) { - hb_retni( hbqt_par_QHttp( 1 )->read( hbqt_par_char( 2 ), hb_parni( 3 ) ) ); + hb_retnint( hbqt_par_QHttp( 1 )->read( hbqt_par_char( 2 ), hb_parnint( 3 ) ) ); } /* diff --git a/harbour/contrib/hbqt/hbqt_qicon.cpp b/harbour/contrib/hbqt/hbqt_qicon.cpp index 21416d1219..ec5287e61f 100644 --- a/harbour/contrib/hbqt/hbqt_qicon.cpp +++ b/harbour/contrib/hbqt/hbqt_qicon.cpp @@ -115,7 +115,7 @@ HB_FUNC( QT_QICON_ADDPIXMAP ) */ HB_FUNC( QT_QICON_CACHEKEY ) { - hb_retni( hbqt_par_QIcon( 1 )->cacheKey() ); + hb_retnint( hbqt_par_QIcon( 1 )->cacheKey() ); } /* diff --git a/harbour/contrib/hbqt/hbqt_qimage.cpp b/harbour/contrib/hbqt/hbqt_qimage.cpp index af14f74219..ecd789e410 100644 --- a/harbour/contrib/hbqt/hbqt_qimage.cpp +++ b/harbour/contrib/hbqt/hbqt_qimage.cpp @@ -138,7 +138,7 @@ HB_FUNC( QT_QIMAGE_BYTESPERLINE ) */ HB_FUNC( QT_QIMAGE_CACHEKEY ) { - hb_retni( hbqt_par_QImage( 1 )->cacheKey() ); + hb_retnint( hbqt_par_QImage( 1 )->cacheKey() ); } /* @@ -146,7 +146,7 @@ HB_FUNC( QT_QIMAGE_CACHEKEY ) */ HB_FUNC( QT_QIMAGE_COLOR ) { - hb_retni( hbqt_par_QImage( 1 )->color( hb_parni( 2 ) ) ); + hb_retnl( hbqt_par_QImage( 1 )->color( hb_parni( 2 ) ) ); } /* @@ -194,7 +194,7 @@ HB_FUNC( QT_QIMAGE_CREATEHEURISTICMASK ) */ HB_FUNC( QT_QIMAGE_CREATEMASKFROMCOLOR ) { - hb_retptr( new QImage( hbqt_par_QImage( 1 )->createMaskFromColor( hb_parni( 2 ), ( HB_ISNUM( 3 ) ? ( Qt::MaskMode ) hb_parni( 3 ) : ( Qt::MaskMode ) Qt::MaskInColor ) ) ) ); + hb_retptr( new QImage( hbqt_par_QImage( 1 )->createMaskFromColor( hb_parnl( 2 ), ( HB_ISNUM( 3 ) ? ( Qt::MaskMode ) hb_parni( 3 ) : ( Qt::MaskMode ) Qt::MaskInColor ) ) ) ); } /* @@ -338,7 +338,7 @@ HB_FUNC( QT_QIMAGE_OFFSET ) */ HB_FUNC( QT_QIMAGE_PIXEL ) { - hb_retni( hbqt_par_QImage( 1 )->pixel( *hbqt_par_QPoint( 2 ) ) ); + hb_retnl( hbqt_par_QImage( 1 )->pixel( *hbqt_par_QPoint( 2 ) ) ); } /* @@ -346,7 +346,7 @@ HB_FUNC( QT_QIMAGE_PIXEL ) */ HB_FUNC( QT_QIMAGE_PIXEL_1 ) { - hb_retni( hbqt_par_QImage( 1 )->pixel( hb_parni( 2 ), hb_parni( 3 ) ) ); + hb_retnl( hbqt_par_QImage( 1 )->pixel( hb_parni( 2 ), hb_parni( 3 ) ) ); } /* @@ -450,7 +450,7 @@ HB_FUNC( QT_QIMAGE_SCANLINE_1 ) */ HB_FUNC( QT_QIMAGE_SETCOLOR ) { - hbqt_par_QImage( 1 )->setColor( hb_parni( 2 ), hb_parni( 3 ) ); + hbqt_par_QImage( 1 )->setColor( hb_parni( 2 ), hb_parnl( 3 ) ); } /* diff --git a/harbour/contrib/hbqt/hbqt_qkeyevent.cpp b/harbour/contrib/hbqt/hbqt_qkeyevent.cpp index 1cbcf31017..72a541fc01 100644 --- a/harbour/contrib/hbqt/hbqt_qkeyevent.cpp +++ b/harbour/contrib/hbqt/hbqt_qkeyevent.cpp @@ -116,7 +116,7 @@ HB_FUNC( QT_QKEYEVENT_MODIFIERS ) */ HB_FUNC( QT_QKEYEVENT_NATIVEMODIFIERS ) { - hb_retni( hbqt_par_QKeyEvent( 1 )->nativeModifiers() ); + hb_retnl( hbqt_par_QKeyEvent( 1 )->nativeModifiers() ); } /* @@ -124,7 +124,7 @@ HB_FUNC( QT_QKEYEVENT_NATIVEMODIFIERS ) */ HB_FUNC( QT_QKEYEVENT_NATIVESCANCODE ) { - hb_retni( hbqt_par_QKeyEvent( 1 )->nativeScanCode() ); + hb_retnl( hbqt_par_QKeyEvent( 1 )->nativeScanCode() ); } /* @@ -132,7 +132,7 @@ HB_FUNC( QT_QKEYEVENT_NATIVESCANCODE ) */ HB_FUNC( QT_QKEYEVENT_NATIVEVIRTUALKEY ) { - hb_retni( hbqt_par_QKeyEvent( 1 )->nativeVirtualKey() ); + hb_retnl( hbqt_par_QKeyEvent( 1 )->nativeVirtualKey() ); } /* diff --git a/harbour/contrib/hbqt/hbqt_qlatin1char.cpp b/harbour/contrib/hbqt/hbqt_qlatin1char.cpp index 8f8bed5adf..cb26e63846 100644 --- a/harbour/contrib/hbqt/hbqt_qlatin1char.cpp +++ b/harbour/contrib/hbqt/hbqt_qlatin1char.cpp @@ -91,3 +91,4 @@ HB_FUNC( QT_QLATIN1CHAR_UNICODE ) /*----------------------------------------------------------------------*/ #endif /* #if QT_VERSION >= 0x040500 */ /*----------------------------------------------------------------------*/ + diff --git a/harbour/contrib/hbqt/hbqt_qlatin1string.cpp b/harbour/contrib/hbqt/hbqt_qlatin1string.cpp index 5a26c7e4e1..ebdc41dd3a 100644 --- a/harbour/contrib/hbqt/hbqt_qlatin1string.cpp +++ b/harbour/contrib/hbqt/hbqt_qlatin1string.cpp @@ -83,3 +83,4 @@ HB_FUNC( QT_QLATIN1STRING_LATIN1 ) /*----------------------------------------------------------------------*/ #endif /* #if QT_VERSION >= 0x040500 */ /*----------------------------------------------------------------------*/ + diff --git a/harbour/contrib/hbqt/hbqt_qmodelindex.cpp b/harbour/contrib/hbqt/hbqt_qmodelindex.cpp index a0a43107bd..64d8e7333f 100644 --- a/harbour/contrib/hbqt/hbqt_qmodelindex.cpp +++ b/harbour/contrib/hbqt/hbqt_qmodelindex.cpp @@ -110,7 +110,7 @@ HB_FUNC( QT_QMODELINDEX_FLAGS ) */ HB_FUNC( QT_QMODELINDEX_INTERNALID ) { - hb_retni( hbqt_par_QModelIndex( 1 )->internalId() ); + hb_retnint( hbqt_par_QModelIndex( 1 )->internalId() ); } /* diff --git a/harbour/contrib/hbqt/hbqt_qpalette.cpp b/harbour/contrib/hbqt/hbqt_qpalette.cpp index 8117112f28..24d37c86a7 100644 --- a/harbour/contrib/hbqt/hbqt_qpalette.cpp +++ b/harbour/contrib/hbqt/hbqt_qpalette.cpp @@ -160,7 +160,7 @@ HB_FUNC( QT_QPALETTE_BUTTONTEXT ) */ HB_FUNC( QT_QPALETTE_CACHEKEY ) { - hb_retni( hbqt_par_QPalette( 1 )->cacheKey() ); + hb_retnint( hbqt_par_QPalette( 1 )->cacheKey() ); } /* diff --git a/harbour/contrib/hbqt/hbqt_qpixmap.cpp b/harbour/contrib/hbqt/hbqt_qpixmap.cpp index a21296018d..4cab95c6b5 100644 --- a/harbour/contrib/hbqt/hbqt_qpixmap.cpp +++ b/harbour/contrib/hbqt/hbqt_qpixmap.cpp @@ -90,7 +90,7 @@ HB_FUNC( QT_QPIXMAP_ALPHACHANNEL ) */ HB_FUNC( QT_QPIXMAP_CACHEKEY ) { - hb_retni( hbqt_par_QPixmap( 1 )->cacheKey() ); + hb_retnint( hbqt_par_QPixmap( 1 )->cacheKey() ); } /* diff --git a/harbour/contrib/hbqt/hbqt_qresource.cpp b/harbour/contrib/hbqt/hbqt_qresource.cpp index 410b0fa4f8..af4f4ce5b7 100644 --- a/harbour/contrib/hbqt/hbqt_qresource.cpp +++ b/harbour/contrib/hbqt/hbqt_qresource.cpp @@ -141,7 +141,7 @@ HB_FUNC( QT_QRESOURCE_SETLOCALE ) */ HB_FUNC( QT_QRESOURCE_SIZE ) { - hb_retni( hbqt_par_QResource( 1 )->size() ); + hb_retnint( hbqt_par_QResource( 1 )->size() ); } /* diff --git a/harbour/contrib/hbqt/hbqt_qtextstream.cpp b/harbour/contrib/hbqt/hbqt_qtextstream.cpp index babac58bf3..9b8996c4e1 100644 --- a/harbour/contrib/hbqt/hbqt_qtextstream.cpp +++ b/harbour/contrib/hbqt/hbqt_qtextstream.cpp @@ -178,7 +178,7 @@ HB_FUNC( QT_QTEXTSTREAM_NUMBERFLAGS ) */ HB_FUNC( QT_QTEXTSTREAM_POS ) { - hb_retni( hbqt_par_QTextStream( 1 )->pos() ); + hb_retnint( hbqt_par_QTextStream( 1 )->pos() ); } /* @@ -186,7 +186,7 @@ HB_FUNC( QT_QTEXTSTREAM_POS ) */ HB_FUNC( QT_QTEXTSTREAM_READ ) { - hb_retc( hbqt_par_QTextStream( 1 )->read( hb_parni( 2 ) ).toLatin1().data() ); + hb_retc( hbqt_par_QTextStream( 1 )->read( hb_parnint( 2 ) ).toLatin1().data() ); } /* @@ -202,7 +202,7 @@ HB_FUNC( QT_QTEXTSTREAM_READALL ) */ HB_FUNC( QT_QTEXTSTREAM_READLINE ) { - hb_retc( hbqt_par_QTextStream( 1 )->readLine( hb_parni( 2 ) ).toLatin1().data() ); + hb_retc( hbqt_par_QTextStream( 1 )->readLine( hb_parnint( 2 ) ).toLatin1().data() ); } /* @@ -242,7 +242,7 @@ HB_FUNC( QT_QTEXTSTREAM_RESETSTATUS ) */ HB_FUNC( QT_QTEXTSTREAM_SEEK ) { - hb_retl( hbqt_par_QTextStream( 1 )->seek( hb_parni( 2 ) ) ); + hb_retl( hbqt_par_QTextStream( 1 )->seek( hb_parnint( 2 ) ) ); } /* @@ -377,3 +377,4 @@ HB_FUNC( QT_QTEXTSTREAM_STATUS ) /*----------------------------------------------------------------------*/ #endif /* #if QT_VERSION >= 0x040500 */ /*----------------------------------------------------------------------*/ + diff --git a/harbour/contrib/hbqt/hbqt_qvariant.cpp b/harbour/contrib/hbqt/hbqt_qvariant.cpp index 8815c5c97d..bace2ff5f9 100644 --- a/harbour/contrib/hbqt/hbqt_qvariant.cpp +++ b/harbour/contrib/hbqt/hbqt_qvariant.cpp @@ -273,7 +273,7 @@ HB_FUNC( QT_QVARIANT_TOLONGLONG ) { bool iOk = 0; - hb_retni( hbqt_par_QVariant( 1 )->toLongLong( &iOk ) ); + hb_retnint( hbqt_par_QVariant( 1 )->toLongLong( &iOk ) ); hb_stornl( iOk, 2 ); } @@ -377,7 +377,7 @@ HB_FUNC( QT_QVARIANT_TOULONGLONG ) { bool iOk = 0; - hb_retni( hbqt_par_QVariant( 1 )->toULongLong( &iOk ) ); + hb_retnint( hbqt_par_QVariant( 1 )->toULongLong( &iOk ) ); hb_stornl( iOk, 2 ); } diff --git a/harbour/contrib/hbqt/hbqt_qwebpage.cpp b/harbour/contrib/hbqt/hbqt_qwebpage.cpp index 35517836ef..0c1ca890a4 100644 --- a/harbour/contrib/hbqt/hbqt_qwebpage.cpp +++ b/harbour/contrib/hbqt/hbqt_qwebpage.cpp @@ -86,7 +86,7 @@ HB_FUNC( QT_QWEBPAGE_ACTION ) */ HB_FUNC( QT_QWEBPAGE_BYTESRECEIVED ) { - hb_retni( hbqt_par_QWebPage( 1 )->bytesReceived() ); + hb_retnint( hbqt_par_QWebPage( 1 )->bytesReceived() ); } /* @@ -302,7 +302,7 @@ HB_FUNC( QT_QWEBPAGE_SWALLOWCONTEXTMENUEVENT ) */ HB_FUNC( QT_QWEBPAGE_TOTALBYTES ) { - hb_retni( hbqt_par_QWebPage( 1 )->totalBytes() ); + hb_retnint( hbqt_par_QWebPage( 1 )->totalBytes() ); } /* diff --git a/harbour/contrib/hbqt/hbqt_slots.cpp b/harbour/contrib/hbqt/hbqt_slots.cpp index 74dacded43..af553ca24b 100644 --- a/harbour/contrib/hbqt/hbqt_slots.cpp +++ b/harbour/contrib/hbqt/hbqt_slots.cpp @@ -748,7 +748,7 @@ HB_FUNC( QT_DISCONNECT_SIGNAL ) QWidget * widget = ( QWidget* ) hb_parptr( 1 ); if( widget ) { - char * event = hb_parcx( 2 ); + const char * event = hb_parcx( 2 ); int i = widget->property( event ).toInt(); if( i > 0 && i <= s_s->listBlock.size() ) @@ -809,7 +809,7 @@ MyMainWindow::MyMainWindow() Qt::WindowFlags flags = Qt::WindowCloseButtonHint | Qt::WindowMaximizeButtonHint | Qt::WindowMinimizeButtonHint | Qt::WindowSystemMenuHint | Qt::CustomizeWindowHint | Qt::WindowTitleHint | - Qt::Window ; + Qt::Window; setWindowFlags( flags ); setFocusPolicy( Qt::StrongFocus ); setAttribute( Qt::WA_DeleteOnClose ); diff --git a/harbour/contrib/hbsqlit3/hbsqlit3.c b/harbour/contrib/hbsqlit3/hbsqlit3.c index cc5aa4f846..96e8e850d5 100644 --- a/harbour/contrib/hbsqlit3/hbsqlit3.c +++ b/harbour/contrib/hbsqlit3/hbsqlit3.c @@ -737,7 +737,7 @@ HB_FUNC( SQLITE3_PREPARE ) if( SQL ) { - char *pSQL = hb_itemGetCPtr( SQL ); + const char *pSQL = hb_itemGetCPtr( SQL ); ULONG ulLen = hb_itemGetCLen( SQL ); psqlite3_stmt pStmt; const char *pszTail; diff --git a/harbour/contrib/hbtpathy/tpcommon.c b/harbour/contrib/hbtpathy/tpcommon.c index 3b96df7ec6..7c73482b93 100644 --- a/harbour/contrib/hbtpathy/tpcommon.c +++ b/harbour/contrib/hbtpathy/tpcommon.c @@ -99,7 +99,7 @@ static unsigned short crctab[ 256 ] = { HB_FUNC( P_CRC16 ) { - char *ptr = hb_parc( 1 ); + const char *ptr = hb_parc( 1 ); int count = hb_parclen( 1 ); register unsigned short crc = 0; @@ -164,7 +164,7 @@ static ULONG crc32tbl[ 256 ] = { HB_FUNC( P_CRC32 ) { - char * ptr = hb_parc( 1 ); + const char * ptr = hb_parc( 1 ); int count = hb_parclen( 1 ); register ULONG crc = CRC32INIT; diff --git a/harbour/contrib/hbwin/win_prn1.c b/harbour/contrib/hbwin/win_prn1.c index 79f6b2d5a1..a467b676ff 100644 --- a/harbour/contrib/hbwin/win_prn1.c +++ b/harbour/contrib/hbwin/win_prn1.c @@ -142,7 +142,7 @@ HB_FUNC( WIN_STARTDOC ) if( hDC ) { - char * szDocName = hb_parc( 2 ); + const char * szDocName = hb_parc( 2 ); LPTSTR lpDocName = szDocName ? HB_TCHAR_CONVTO( szDocName ) : NULL; sDoc.cbSize = sizeof( DOCINFO ); sDoc.lpszDocName = lpDocName; @@ -339,7 +339,7 @@ HB_FUNC( WIN_CREATEFONT ) BOOL Result = FALSE; HDC hDC = win_HDC_par( 1 ); HFONT hFont; - char * pszFont = hb_parc( 2 ); + const char * pszFont = hb_parc( 2 ); LPTSTR lpFont = pszFont ? HB_TCHAR_CONVTO( pszFont ) : NULL; int iHeight = hb_parni( 3 ); int iMul = hb_parni( 4 ); @@ -407,7 +407,7 @@ HB_FUNC( WIN_SETDOCUMENTPROPERTIES ) if( hDC ) { HANDLE hPrinter; - char * pszPrinterName = hb_parc( 2 ); + const char * pszPrinterName = hb_parc( 2 ); LPTSTR lpPrinterName = pszPrinterName ? HB_TCHAR_CONVTO( pszPrinterName ) : NULL; if( OpenPrinter( lpPrinterName, &hPrinter, NULL ) ) @@ -461,7 +461,7 @@ HB_FUNC( WIN_SETDOCUMENTPROPERTIES ) HB_FUNC( WIN_LOADBITMAPFILE ) { - char * pstrFileName = hb_parc( 1 ); + const char * pstrFileName = hb_parc( 1 ); BOOL bSuccess = FALSE; DWORD dwFileSize = 0, dwHighSize, dwBytesRead; HANDLE hFile; diff --git a/harbour/contrib/hbwin/win_prn2.c b/harbour/contrib/hbwin/win_prn2.c index 55e278728e..75eda54202 100644 --- a/harbour/contrib/hbwin/win_prn2.c +++ b/harbour/contrib/hbwin/win_prn2.c @@ -68,7 +68,7 @@ #define MAXBUFFERSIZE 255 -BOOL hb_isLegacyDevice( LPSTR pPrinterName ) +BOOL hb_isLegacyDevice( LPCSTR pPrinterName ) { BOOL bLegacyDev = FALSE; int n = 0; @@ -82,7 +82,7 @@ BOOL hb_isLegacyDevice( LPSTR pPrinterName ) return bLegacyDev; } -BOOL hb_PrinterExists( LPSTR pPrinterName ) +BOOL hb_PrinterExists( LPCSTR pPrinterName ) { BOOL Result = FALSE; @@ -324,7 +324,7 @@ static DWORD IsPrinterErrorn( HANDLE hPrinter ) return dwError; } -static DWORD hb_printerIsReadyn( char * pszPrinterName ) +static DWORD hb_printerIsReadyn( const char * pszPrinterName ) { DWORD dwPrinter = ( DWORD ) -1; HANDLE hPrinter; @@ -344,10 +344,10 @@ static DWORD hb_printerIsReadyn( char * pszPrinterName ) HB_FUNC( XISPRINTER ) { - char szDefaultPrinter[ MAXBUFFERSIZE ], * pszPrinterName; + char szDefaultPrinter[ MAXBUFFERSIZE ]; DWORD pdwBufferSize = sizeof( szDefaultPrinter ); + const char * pszPrinterName = hb_parc( 1 ); - pszPrinterName = hb_parc( 1 ); if( !pszPrinterName ) { hb_GetDefaultPrinter( szDefaultPrinter, &pdwBufferSize ); @@ -357,7 +357,7 @@ HB_FUNC( XISPRINTER ) } BOOL hb_GetPrinterNameByPort( char * pPrinterName, LPDWORD pdwBufferSize, - char * pPortName, BOOL bSubStr ) + const char * pPortName, BOOL bSubStr ) { BOOL Result = FALSE, bFound = FALSE; ULONG needed, returned; diff --git a/harbour/contrib/hbwin/win_prt.c b/harbour/contrib/hbwin/win_prt.c index e7b1e5779a..db2c81383c 100644 --- a/harbour/contrib/hbwin/win_prt.c +++ b/harbour/contrib/hbwin/win_prt.c @@ -320,7 +320,7 @@ HB_FUNC( WINPORTCLOSE ) HB_FUNC( WINPORTWRITE ) { int Port = hb_parni( 1 ); - char * lpBuffer = hb_parcx( 2 ); + const char * lpBuffer = hb_parcx( 2 ); LONG NumberofBytesToWrite = hb_parclen( 2 ); HANDLE hCommPort = s_PortData[ Port ].Port; DWORD NumberofBytesWritten;