2011-05-09 21:44 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* include/Makefile
+ include/hbstrict.ch
* contrib/hbpost.hbm
+ added experimental -u+ header to catch some common code style
problems. currently IF() is caught, but it interferec with std.ch
hbsix.ch and possibly more, so it's not enabled
* config/global.mk
* src/dynlib/2nd/Makefile
* src/dynlib/Makefile
* secondary harbour dynlib is now enabled by __HB_BUILD_DYN_2ND=yes
* renamed secondary harbour dynlib to harbour2*
+ it's now possible (again) to build harbour .dll in ST mode by
using __HB_BUILD_DYN_ST=yes. if used together with __HB_BUILD_DYN_2ND=yes,
the secondary dynlib will be MT. (pls note the secondary dynlib
is never directly used by hbmk2, so it's there for mere build convenience
only)
* contrib/hbxbp/xbpmenubar.prg
* contrib/hbxbp/xbprtf.prg
* contrib/hbxbp/xbpfiledialog.prg
* contrib/hbxbp/xbpprintdialog.prg
* contrib/hbxbp/xbpscrollbar.prg
* contrib/hbxbp/xbpprinter.prg
* contrib/hbxbp/xbpdataref.prg
! IF() -> IIF() (with the help of hbstrict.ch)
* contrib/hbformat/hbfmtcls.prg
! fixed mistakenly changed '==' to LEFTEQUAL() in prev commit
This commit is contained in:
@@ -16,6 +16,37 @@
|
||||
The license applies to all entries newer than 2009-04-28.
|
||||
*/
|
||||
|
||||
2011-05-09 21:44 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
|
||||
* include/Makefile
|
||||
+ include/hbstrict.ch
|
||||
* contrib/hbpost.hbm
|
||||
+ added experimental -u+ header to catch some common code style
|
||||
problems. currently IF() is caught, but it interferec with std.ch
|
||||
hbsix.ch and possibly more, so it's not enabled
|
||||
|
||||
* config/global.mk
|
||||
* src/dynlib/2nd/Makefile
|
||||
* src/dynlib/Makefile
|
||||
* secondary harbour dynlib is now enabled by __HB_BUILD_DYN_2ND=yes
|
||||
* renamed secondary harbour dynlib to harbour2*
|
||||
+ it's now possible (again) to build harbour .dll in ST mode by
|
||||
using __HB_BUILD_DYN_ST=yes. if used together with __HB_BUILD_DYN_2ND=yes,
|
||||
the secondary dynlib will be MT. (pls note the secondary dynlib
|
||||
is never directly used by hbmk2, so it's there for mere build convenience
|
||||
only)
|
||||
|
||||
* contrib/hbxbp/xbpmenubar.prg
|
||||
* contrib/hbxbp/xbprtf.prg
|
||||
* contrib/hbxbp/xbpfiledialog.prg
|
||||
* contrib/hbxbp/xbpprintdialog.prg
|
||||
* contrib/hbxbp/xbpscrollbar.prg
|
||||
* contrib/hbxbp/xbpprinter.prg
|
||||
* contrib/hbxbp/xbpdataref.prg
|
||||
! IF() -> IIF() (with the help of hbstrict.ch)
|
||||
|
||||
* contrib/hbformat/hbfmtcls.prg
|
||||
! fixed mistakenly changed '==' to LEFTEQUAL() in prev commit
|
||||
|
||||
2011-05-09 20:03 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
|
||||
* src/rtl/hbi18n2.prg
|
||||
* utils/hbi18n/hbi18n.prg
|
||||
|
||||
@@ -1899,13 +1899,8 @@ ifeq ($(HB_INIT_DONE),)
|
||||
|
||||
export HB_DYNLIB_BASE := harbour$(HB_DYNLIB_PLOC)
|
||||
|
||||
ifeq ($(_HB_BUILD_DYN_ST),yes)
|
||||
ifneq ($(filter $(HB_PLATFORM),dos os2),)
|
||||
HB_DYNLIB_BASE_2ND := harbours$(HB_DYNLIB_PLOC)
|
||||
else
|
||||
HB_DYNLIB_BASE_2ND := harbourst$(HB_DYNLIB_PLOC)
|
||||
endif
|
||||
export HB_DYNLIB_BASE_2ND
|
||||
ifeq ($(__HB_BUILD_DYN_2ND),yes)
|
||||
export HB_DYNLIB_BASE_2ND := harbour2$(HB_DYNLIB_PLOC)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -317,8 +317,8 @@ METHOD Reformat( aFile ) CLASS HBFORMATCODE
|
||||
ELSEIF nLenToken >= 4 .AND. ( ( LEFTEQUAL( "static", cToken1 ) .AND. ;
|
||||
( LEFTEQUAL( "function", cToken2 ) .OR. LEFTEQUAL( "procedure", cToken2 ) ) ) .OR. ;
|
||||
LEFTEQUAL( "function", cToken1 ) .OR. LEFTEQUAL( "procedure", cToken1 ) ;
|
||||
.OR. ( LEFTEQUAL( "method", cToken1 ) .AND. !lClass ) .OR. ;
|
||||
( LEFTEQUAL( "class", cToken1 ) .AND. !lClass ) )
|
||||
.OR. ( "method" == cToken1 .AND. !lClass ) .OR. ;
|
||||
( "class" == cToken1 .AND. !lClass ) )
|
||||
IF nDeep == 0
|
||||
nState := RF_STATE_FUNC
|
||||
IF "class" == cToken1
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
-prgflag=-es2
|
||||
-prgflag=-kmo
|
||||
-prgflag=-i-
|
||||
#-prgflag=-u+hbstrict.ch
|
||||
|
||||
# It is also supported by official mingw 4.4.x and mingw64 4.4.x,
|
||||
# but not supported by mingw tdm 4.4.x, so I only enable it on or
|
||||
|
||||
@@ -140,7 +140,7 @@ METHOD DataRef:setData( xValue, mp2 )
|
||||
|
||||
HB_SYMBOL_UNUSED( mp2 )
|
||||
|
||||
//HB_TRACE( HB_TR_DEBUG, cClass +' '+ ::cargo +"..."+ IF(empty(xValue)," empty ",valtype(xValue)) )
|
||||
//HB_TRACE( HB_TR_DEBUG, cClass +' '+ ::cargo +"..."+ IIF(empty(xValue)," empty ",valtype(xValue)) )
|
||||
|
||||
IF hb_isBlock( ::dataLink )
|
||||
::sl_editBuffer := eval( ::dataLink, xValue )
|
||||
@@ -155,7 +155,7 @@ METHOD DataRef:setData( xValue, mp2 )
|
||||
::oWidget:setChecked( ::sl_editBuffer )
|
||||
|
||||
CASE cClass == "XBP3STATE"
|
||||
::oWidget:setCheckState( IF( ::sl_editBuffer == 1, 2, IF( ::sl_editBuffer == 2, 1, 0 ) ) )
|
||||
::oWidget:setCheckState( IIF( ::sl_editBuffer == 1, 2, IIF( ::sl_editBuffer == 2, 1, 0 ) ) )
|
||||
|
||||
CASE cClass == "XBPLISTBOX"
|
||||
IF !empty( ::sl_editBuffer )
|
||||
|
||||
@@ -259,7 +259,7 @@ METHOD XbpFileDialog:open( cDefaultFile, lCenter, lAllowMultiple, lCreateNewFile
|
||||
nResult := ::oWidget:exec()
|
||||
qFocus:setFocus( 0 )
|
||||
|
||||
RETURN IF( nResult == QDialog_Accepted, ::extractFileNames( lAllowMultiple ), NIL )
|
||||
RETURN IIF( nResult == QDialog_Accepted, ::extractFileNames( lAllowMultiple ), NIL )
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
@@ -308,7 +308,7 @@ METHOD XbpFileDialog:saveAs( cDefaultFile, lFileList, lCenter )
|
||||
nResult := ::oWidget:exec()
|
||||
qFocus:setFocus( 0 )
|
||||
|
||||
RETURN IF( nResult == QDialog_Accepted, ::extractFileNames(), NIL )
|
||||
RETURN IIF( nResult == QDialog_Accepted, ::extractFileNames(), NIL )
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
|
||||
@@ -336,7 +336,7 @@ METHOD xbpMenuBar:placeItem( xCaption, bAction, nStyle, nAttrb, nMode, nPos )
|
||||
aItem := { QMF_STRING, nMenuItemID, oAction:text(), bAction, oAction }
|
||||
|
||||
CASE cType == "O"
|
||||
cCaption := IF( bAction == NIL, xCaption:title, bAction )
|
||||
cCaption := IIF( bAction == NIL, xCaption:title, bAction )
|
||||
aItem := { QMF_POPUP, xCaption:oWidget, cCaption, xCaption, NIL }
|
||||
IF hb_isChar( cCaption )
|
||||
xCaption:oWidget:setTitle( strtran( cCaption, '~','&' ) )
|
||||
@@ -428,7 +428,7 @@ METHOD xbpMenuBar:checkItem( nItemIndex, lCheck )
|
||||
lChecked := ::aMenuItems[ nItemIndex, 5 ]:isChecked()
|
||||
ENDIF
|
||||
|
||||
RETURN IF( lCheck, lChecked, !lChecked )
|
||||
RETURN IIF( lCheck, lChecked, !lChecked )
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
|
||||
@@ -179,7 +179,7 @@ METHOD XbpPrintDialog:display( oXbpPrinter )
|
||||
::printToFile := hb_bitAnd( nOpt, QAbstractPrintDialog_PrintToFile ) == QAbstractPrintDialog_PrintToFile
|
||||
|
||||
n := oXbpPrinter:oWidget:setPrintRange()
|
||||
::printRange := IF( n == 0, XBPPDLG_PRINT_ALLPAGES, IF( n == 1, XBPPDLG_PRINT_MARK, XBPPDLG_PRINT_PAGERANGE ) )
|
||||
::printRange := IIF( n == 0, XBPPDLG_PRINT_ALLPAGES, IIF( n == 1, XBPPDLG_PRINT_MARK, XBPPDLG_PRINT_PAGERANGE ) )
|
||||
|
||||
::pageRangeSelected := { oXbpPrinter:oWidget:fromPage(), oXbpPrinter:oWidget:toPage() }
|
||||
ENDIF
|
||||
|
||||
@@ -225,10 +225,10 @@ METHOD XbpPrinter:resolution()
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
METHOD XbpPrinter:setCollationMode( nMode )
|
||||
LOCAL nModeOld := IF( ::oWidget:collateCopies(), XBPPRN_COLLATIONMODE_ON, XBPPRN_COLLATIONMODE_OFF )
|
||||
LOCAL nModeOld := IIF( ::oWidget:collateCopies(), XBPPRN_COLLATIONMODE_ON, XBPPRN_COLLATIONMODE_OFF )
|
||||
|
||||
IF hb_isNumeric( nMode )
|
||||
::oWidget:setCollateCopies( IF( nMode == XBPPRN_COLLATIONMODE_ON, .t., .f. ) )
|
||||
::oWidget:setCollateCopies( IIF( nMode == XBPPRN_COLLATIONMODE_ON, .t., .f. ) )
|
||||
ENDIF
|
||||
|
||||
RETURN nModeOld
|
||||
@@ -236,10 +236,10 @@ METHOD XbpPrinter:setCollationMode( nMode )
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
METHOD XbpPrinter:setColorMode( nMode )
|
||||
LOCAL nModeOld := IF( ::oWidget:colorMode() == QPrinter_Color, XBPPRN_COLORMODE_ON, XBPPRN_COLORMODE_OFF )
|
||||
LOCAL nModeOld := IIF( ::oWidget:colorMode() == QPrinter_Color, XBPPRN_COLORMODE_ON, XBPPRN_COLORMODE_OFF )
|
||||
|
||||
IF hb_isNumeric( nMode )
|
||||
::oWidget:setColorMode( IF( nMode == XBPPRN_COLORMODE_ON, QPrinter_Color, QPrinter_GrayScale ) )
|
||||
::oWidget:setColorMode( IIF( nMode == XBPPRN_COLORMODE_ON, QPrinter_Color, QPrinter_GrayScale ) )
|
||||
ENDIF
|
||||
|
||||
RETURN nModeOld
|
||||
@@ -399,10 +399,10 @@ METHOD XbpPrinter:setNumCopies( nNumCopies )
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
METHOD XbpPrinter:setOrientation( nOrientation )
|
||||
LOCAL nOldOrientation := IF( ::oWidget:orientation() == QPrinter_Landscape, XBPPRN_ORIENT_LANDSCAPE, XBPPRN_ORIENT_PORTRAIT )
|
||||
LOCAL nOldOrientation := IIF( ::oWidget:orientation() == QPrinter_Landscape, XBPPRN_ORIENT_LANDSCAPE, XBPPRN_ORIENT_PORTRAIT )
|
||||
|
||||
IF hb_isNumeric( nOrientation )
|
||||
::oWidget:setOrientation( if( nOrientation == XBPPRN_ORIENT_LANDSCAPE, QPrinter_Landscape, QPrinter_Portrait ) )
|
||||
::oWidget:setOrientation( iif( nOrientation == XBPPRN_ORIENT_LANDSCAPE, QPrinter_Landscape, QPrinter_Portrait ) )
|
||||
ENDIF
|
||||
|
||||
RETURN nOldOrientation
|
||||
@@ -472,7 +472,7 @@ METHOD XbpPrinter:setResolution( anResolution )
|
||||
LOCAL aOldResolution := { ::getEngineProperty( QPrintEngine_PPK_Resolution ), ::oWidget:resolution() }
|
||||
|
||||
IF hb_isNumeric( anResolution ) .or. hb_isArray( anResolution )
|
||||
::oWidget:setResolution( IF( hb_isNumeric( anResolution ), anResolution, anResolution[ 1 ] ) )
|
||||
::oWidget:setResolution( IIF( hb_isNumeric( anResolution ), anResolution, anResolution[ 1 ] ) )
|
||||
ENDIF
|
||||
|
||||
RETURN aOldResolution
|
||||
|
||||
@@ -481,7 +481,7 @@ METHOD XbpRtf:selCharOffset( ... ) // 0
|
||||
IF len( aP ) >= 1 .and. hb_isNumeric( aP[ 1 ] )
|
||||
::oTextCharFormat := ::oCurCursor:charFormat()
|
||||
IF ::oTextCharFormat:isValid()
|
||||
nAlign := IF( aP[ 1 ] < 0, -1, IF( aP[ 1 ] > 0, 1, 0 ) )
|
||||
nAlign := IIF( aP[ 1 ] < 0, -1, IIF( aP[ 1 ] > 0, 1, 0 ) )
|
||||
xRet := ::oTextCharFormat:verticalAlignment()
|
||||
::oTextCharFormat:setVerticalAlignment( hbxbp_ConvertAFactFromXBP( "RtfVerticalAlign", nAlign ) )
|
||||
::oCurCursor:setCharFormat( ::oTextCharFormat )
|
||||
@@ -673,7 +673,7 @@ METHOD XbpRtf:selText( ... ) // ""
|
||||
LOCAL xRet := ""
|
||||
LOCAL aP := hb_aParams()
|
||||
|
||||
IF( ::oCurCursor:hasSelection() )
|
||||
IF ::oCurCursor:hasSelection()
|
||||
xRet := ::oCurCursor:selectedText()
|
||||
ENDIF
|
||||
IF len( aP ) >= 1 .and. hb_isChar( aP[ 1 ] )
|
||||
|
||||
@@ -115,7 +115,7 @@ METHOD XbpScrollBar:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible
|
||||
::xbpWindow:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
|
||||
|
||||
::oWidget := QScrollBar( ::pParent )
|
||||
::oWidget:setOrientation( IF( ::type == XBPSCROLL_VERTICAL, 2, 1 ) )
|
||||
::oWidget:setOrientation( IIF( ::type == XBPSCROLL_VERTICAL, 2, 1 ) )
|
||||
::oWidget:setTracking( ::autoTrack )
|
||||
|
||||
::connect()
|
||||
|
||||
@@ -130,6 +130,7 @@ PRG_HEADERS := \
|
||||
hbsix.ch \
|
||||
hbsocket.ch \
|
||||
hbstdgen.ch \
|
||||
hbstrict.ch \
|
||||
hbsxdef.ch \
|
||||
hbthread.ch \
|
||||
hbtrace.ch \
|
||||
|
||||
59
harbour/include/hbstrict.ch
Normal file
59
harbour/include/hbstrict.ch
Normal file
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Header file for stricter syntax checking
|
||||
*
|
||||
* Copyright 2011 Viktor Szakats (harbour.01 syenar.hu)
|
||||
* www - http://harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this software; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
|
||||
*
|
||||
* As a special exception, the Harbour Project gives permission for
|
||||
* additional uses of the text contained in its release of Harbour.
|
||||
*
|
||||
* The exception is that, if you link the Harbour libraries with other
|
||||
* files to produce an executable, this does not by itself cause the
|
||||
* resulting executable to be covered by the GNU General Public License.
|
||||
* Your use of that executable is in no way restricted on account of
|
||||
* linking the Harbour library code into it.
|
||||
*
|
||||
* This exception does not however invalidate any other reasons why
|
||||
* the executable file might be covered by the GNU General Public License.
|
||||
*
|
||||
* This exception applies only to the code released by the Harbour
|
||||
* Project under the name Harbour. If you copy code from other
|
||||
* Harbour Project or Free Software Foundation releases into a copy of
|
||||
* Harbour, as the General Public License permits, the exception does
|
||||
* not apply to the code that you add in this way. To avoid misleading
|
||||
* anyone as to the status of such modified files, you must delete
|
||||
* this exception notice from them.
|
||||
*
|
||||
* If you write modifications of your own for Harbour, it is your choice
|
||||
* whether to permit this exception to apply to your modifications.
|
||||
* If you do not wish that, delete this exception notice.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef HB_STRICT_CH_
|
||||
#define HB_STRICT_CH_
|
||||
|
||||
/* force compiler error */
|
||||
#translate IF( <x>, <y>, <z> ) => IIF()
|
||||
|
||||
#endif /* HB_STRICT_CH_ */
|
||||
@@ -8,7 +8,11 @@ include $(TOP)$(ROOT)config/global.mk
|
||||
|
||||
ifneq ($(DYNDIRLIST_BASE),)
|
||||
|
||||
DYNDIRLIST := $(DYNDIRLIST_BASE) src/vm
|
||||
ifeq ($(__HB_BUILD_DYN_ST),yes)
|
||||
DYNDIRLIST := $(DYNDIRLIST_BASE) src/vm/vmmt
|
||||
else
|
||||
DYNDIRLIST := $(DYNDIRLIST_BASE) src/vm
|
||||
endif
|
||||
DYNNAME := $(HB_DYNLIB_BASE_2ND)
|
||||
|
||||
include $(TOP)$(ROOT)config/dyn.mk
|
||||
|
||||
@@ -8,12 +8,16 @@ include $(TOP)$(ROOT)config/global.mk
|
||||
|
||||
ifneq ($(DYNDIRLIST_BASE),)
|
||||
|
||||
DYNDIRLIST := $(DYNDIRLIST_BASE) src/vm/vmmt
|
||||
ifeq ($(__HB_BUILD_DYN_ST),yes)
|
||||
DYNDIRLIST := $(DYNDIRLIST_BASE) src/vm
|
||||
else
|
||||
DYNDIRLIST := $(DYNDIRLIST_BASE) src/vm/vmmt
|
||||
endif
|
||||
DYNNAME := $(HB_DYNLIB_BASE)
|
||||
|
||||
include $(TOP)$(ROOT)config/dyn.mk
|
||||
|
||||
ifeq ($(_HB_BUILD_DYN_ST),yes)
|
||||
ifeq ($(__HB_BUILD_DYN_2ND),yes)
|
||||
DIRS := 2nd
|
||||
include $(TOP)$(ROOT)config/dir.mk
|
||||
endif
|
||||
|
||||
Reference in New Issue
Block a user