2012-11-01 18:12 UTC+0100 Viktor Szakats (harbour syenar.net)

* contrib/hbxpp/xppopc.c
  * contrib/xhb/xcstr.prg
  * contrib/xhb/xhbmsgs.c
  * extras/hbdoc/hbdoc.prg
  * extras/hbdoc/tmplates.prg
  * utils/hbmk2/hbmk2.prg
    * avoid #undef

  * ChangeLog
    * added missing change to prev:
       * src/common/hbver.c
         * use {;} for empty loop body
         ; TODO: Use one common syntax for empty blocks.
                 Harbour currently uses these:
                    {}, { ; }, {;}, {};
This commit is contained in:
Viktor Szakats
2012-11-01 17:14:00 +00:00
parent 175984ec71
commit 04dfdfac43
7 changed files with 60 additions and 49 deletions

View File

@@ -16,6 +16,26 @@
The license applies to all entries newer than 2009-04-28.
*/
2012-11-01 18:12 UTC+0100 Viktor Szakats (harbour syenar.net)
* contrib/hbxpp/xppopc.c
* contrib/xhb/xcstr.prg
* contrib/xhb/xhbmsgs.c
* extras/hbdoc/hbdoc.prg
* extras/hbdoc/tmplates.prg
* utils/hbmk2/hbmk2.prg
* avoid #undef
* ChangeLog
* added missing change to prev:
* src/common/hbver.c
* use {;} for empty loop body
; TODO: Use one common syntax for empty blocks.
Harbour currently uses these:
{}, { ; }, {;}, {};
2012-11-01 17:41 UTC+0100 Viktor Szakats (harbour syenar.net)
* ChangeLog
2012-11-01 17:33 UTC+0100 Viktor Szakats (harbour syenar.net)
* contrib/gtwvg/tests/demowvg.prg
* contrib/gtwvg/tests/wvtcls.prg
@@ -27,7 +47,6 @@
* contrib/hbnf/doc/en/video1.txt
* contrib/hbnf/tests/metaph.prg
* contrib/xhb/trpc.prg
* src/common/hbver.c
* src/rtl/gtchrmap.c
* tests/dttest.prg
* tests/mousetst.prg
@@ -36,6 +55,12 @@
* minor formatting and cleanups in docs
* use ANSI dates
* src/common/hbver.c
* use {;} for empty loop body
; TODO: Use one common syntax for empty blocks.
Harbour currently uses these:
{}, { ; }, {;}, {};
2012-11-01 16:04 UTC+0100 Viktor Szakats (harbour syenar.net)
* contrib/hbexpat/core.c
* minor change to avoid uncrustify formatting a tricky macro

View File

@@ -60,8 +60,7 @@
* in Xbase++ compatibility mode where negative indexes are used to access
* data from tail
*/
#undef HB_IS_VALID_INDEX
#define HB_IS_VALID_INDEX( idx, max ) ( ( ( HB_ISIZ ) ( idx ) < 0 ? ( idx ) += ( max ) + 1 : ( idx ) ) > 0 && ( HB_SIZE ) ( idx ) <= ( max ) )
#define XHB_IS_VALID_INDEX( idx, max ) ( ( ( HB_ISIZ ) ( idx ) < 0 ? ( idx ) += ( max ) + 1 : ( idx ) ) > 0 && ( HB_SIZE ) ( idx ) <= ( max ) )
HB_FUNC( XPP_INDEX )
{
@@ -77,7 +76,7 @@ HB_FUNC( XPP_INDEX )
if( HB_IS_ARRAY( pSelf ) )
{
HB_SIZE nLen = hb_arrayLen( pSelf );
if( HB_IS_VALID_INDEX( nIndex, nLen ) )
if( XHB_IS_VALID_INDEX( nIndex, nLen ) )
hb_itemMoveRef( hb_arrayGetItemPtr( pSelf, nIndex ), pValue );
else
hb_errRT_BASE( EG_BOUND, 1012, "Error in array index", hb_langDGetErrorDesc( EG_ARRASSIGN ), 1, pIndex );
@@ -85,7 +84,7 @@ HB_FUNC( XPP_INDEX )
else if( HB_IS_STRING( pSelf ) )
{
HB_SIZE nLen = hb_itemGetCLen( pSelf );
if( HB_IS_VALID_INDEX( nIndex, nLen ) )
if( XHB_IS_VALID_INDEX( nIndex, nLen ) )
{
char cValue = HB_IS_STRING( pValue ) ? hb_itemGetCPtr( pValue )[ 0 ] :
( char ) hb_itemGetNI( pValue );
@@ -118,7 +117,7 @@ HB_FUNC( XPP_INDEX )
if( HB_IS_ARRAY( pSelf ) )
{
HB_SIZE nLen = hb_arrayLen( pSelf );
if( HB_IS_VALID_INDEX( nIndex, nLen ) )
if( XHB_IS_VALID_INDEX( nIndex, nLen ) )
hb_itemReturn( hb_arrayGetItemPtr( pSelf, nIndex ) );
else
hb_errRT_BASE( EG_BOUND, 1132, NULL, hb_langDGetErrorDesc( EG_ARRACCESS ), 2, pSelf, pIndex ); /* TODO: Emulate exact XPP error msg */
@@ -126,7 +125,7 @@ HB_FUNC( XPP_INDEX )
else if( HB_IS_STRING( pSelf ) )
{
HB_SIZE nLen = hb_itemGetCLen( pSelf );
if( HB_IS_VALID_INDEX( nIndex, nLen ) )
if( XHB_IS_VALID_INDEX( nIndex, nLen ) )
hb_retclen( hb_itemGetCPtr( pSelf ) + nIndex - 1, 1 );
else
hb_errRT_BASE( EG_BOUND, 1132, NULL, hb_langDGetErrorDesc( EG_ARRACCESS ), 2, pSelf, pIndex ); /* TODO: Emulate exact XPP error msg */

View File

@@ -57,7 +57,7 @@
For performance NOT using OS indpendant R/T function,
this define only used in ValTpPrg() which currently only used in win32.
*/
#undef CRLF
#define CRLF Chr( 13 ) + Chr( 10 )
#xtranslate THROW( <oErr> ) => ( Eval( ErrorBlock(), <oErr> ), Break( <oErr> ) )

View File

@@ -308,8 +308,7 @@ HB_FUNC( XHB_GREATEREQ )
* in xHarbour compatibility mode where negative indexes are used to access
* data from tail
*/
#undef HB_IS_VALID_INDEX
#define HB_IS_VALID_INDEX( idx, max ) ( ( ( HB_ISIZ ) ( idx ) < 0 ? ( idx ) += ( max ) + 1 : ( idx ) ) > 0 && ( HB_SIZE ) ( idx ) <= ( max ) )
#define XHB_IS_VALID_INDEX( idx, max ) ( ( ( HB_ISIZ ) ( idx ) < 0 ? ( idx ) += ( max ) + 1 : ( idx ) ) > 0 && ( HB_SIZE ) ( idx ) <= ( max ) )
HB_FUNC( XHB_INDEX )
{
@@ -325,7 +324,7 @@ HB_FUNC( XHB_INDEX )
if( HB_IS_ARRAY( pSelf ) )
{
HB_SIZE nLen = hb_arrayLen( pSelf );
if( HB_IS_VALID_INDEX( nIndex, nLen ) )
if( XHB_IS_VALID_INDEX( nIndex, nLen ) )
hb_itemMoveRef( hb_arrayGetItemPtr( pSelf, nIndex ), pValue );
else
hb_errRT_BASE( EG_BOUND, 1133, NULL, hb_langDGetErrorDesc( EG_ARRASSIGN ), 1, pIndex );
@@ -333,7 +332,7 @@ HB_FUNC( XHB_INDEX )
else if( HB_IS_STRING( pSelf ) )
{
HB_SIZE nLen = hb_itemGetCLen( pSelf );
if( HB_IS_VALID_INDEX( nIndex, nLen ) )
if( XHB_IS_VALID_INDEX( nIndex, nLen ) )
{
char cValue = HB_IS_STRING( pValue ) ? hb_itemGetCPtr( pValue )[ 0 ] :
( char ) hb_itemGetNI( pValue );
@@ -366,7 +365,7 @@ HB_FUNC( XHB_INDEX )
if( HB_IS_ARRAY( pSelf ) )
{
HB_SIZE nLen = hb_arrayLen( pSelf );
if( HB_IS_VALID_INDEX( nIndex, nLen ) )
if( XHB_IS_VALID_INDEX( nIndex, nLen ) )
hb_itemReturn( hb_arrayGetItemPtr( pSelf, nIndex ) );
else
hb_errRT_BASE( EG_BOUND, 1132, NULL, hb_langDGetErrorDesc( EG_ARRACCESS ), 2, pSelf, pIndex );
@@ -374,7 +373,7 @@ HB_FUNC( XHB_INDEX )
else if( HB_IS_STRING( pSelf ) )
{
HB_SIZE nLen = hb_itemGetCLen( pSelf );
if( HB_IS_VALID_INDEX( nIndex, nLen ) )
if( XHB_IS_VALID_INDEX( nIndex, nLen ) )
hb_retclen( hb_itemGetCPtr( pSelf ) + nIndex - 1, 1 );
else
hb_errRT_BASE( EG_BOUND, 1132, NULL, hb_langDGetErrorDesc( EG_ARRACCESS ), 2, pSelf, pIndex );

View File

@@ -106,6 +106,10 @@ REQUEST HB_GT_CGI_DEFAULT
#define BASE_DIR ".." + hb_ps() + ".." + hb_ps()
#define OnOrOff( b ) iif( b, "excluded", "included" )
#define YesOrNo( b ) iif( b, "yes", "no" )
#define IsDefault( b ) iif( b, "; default", "" )
STATIC sc_aExclusions := { "class_tp.txt", "hdr_tpl.txt" }
MEMVAR p_hsSwitches
@@ -918,10 +922,6 @@ PROCEDURE ShowHelp( cExtraMessage, aArgs )
LOCAL nMode := 1
#define OnOrOff( b ) iif( b, "excluded", "included" )
#define YesOrNo( b ) iif( b, "yes", "no" )
#define IsDefault( b ) iif( b, "; default", "" )
LOCAL aHelp
DO CASE
@@ -989,9 +989,6 @@ PROCEDURE ShowHelp( cExtraMessage, aArgs )
ENDCASE
#undef OnOrOff
#undef YesOrNo
// using hbmk2 style
AEval( aHelp, {| x | ShowSubHelp( x, @nMode, 0 ) } )

View File

@@ -87,39 +87,29 @@ CREATE CLASS Entry
{ "END", "End" } ;
}
#define S TPL_START
#define E TPL_END
#define T TPL_TEMPLATE
#define R TPL_REQUIRED
#define O TPL_OPTIONAL
#define P TPL_PREFORMATTED
#define U TPL_OUTPUT
#define x 0
#define _S TPL_START
#define _E TPL_END
#define _T TPL_TEMPLATE
#define _R TPL_REQUIRED
#define _O TPL_OPTIONAL
#define _P TPL_PREFORMATTED
#define _U TPL_OUTPUT
// this is best viewed with a fixed-width font
// the columns of this array correspond to the elements of Fields
CLASS VAR Templates AS ARRAY INIT { ;
{ "Template" , { S, T, x+U, x, O , x+U, x+U, x+U, x+U, x+U, x+U, x+U, x+U, x+U, x +U, x +U, x+U, x+U, x+U, x+U, x+U, E } }, ;
{ "Document" , { S, T, R+U, R, O+U, O+U, x+U, x+U, x+U, R+U, x+U, x+U, x+U, x+U, x +U, x +U, x+U, x+U, O+U, O+U, O+U, E } }, ;
{ "Function" , { S, T, R+U, R, R , O+U, O+U, O+U, O+U, O+U, x+U, x+U, x+U, x+U, P+O+U, P+O+U, O+U, O+U, O+U, O+U, O+U, E } }, ;
{ "C Function" , { S, T, R+U, R, R , O+U, O+U, O+U, O+U, O+U, x+U, x+U, x+U, x+U, P+O+U, P+O+U, O+U, O+U, O+U, O+U, O+U, E } }, ;
{ "Procedure" , { S, T, R+U, R, R , O+U, O+U, O+U, x, O+U, x+U, x+U, x+U, x+U, P+O+U, P+O+U, O+U, O+U, O+U, O+U, O+U, E } }, ;
{ "Command" , { S, T, R+U, R, R , O+U, R+U, R+U, x+U, R+U, x+U, x+U, x+U, x+U, P+O+U, P+O+U, O+U, O+U, O+U, O+U, O+U, E } }, ;
{ "Class" , { S, T, R+U, R, R , O+U, R+U, R+U, R+U, R+U, O+U, O+U, O+U, O+U, P+O+U, P+O+U, O+U, O+U, O+U, O+U, O+U, E } }, ;
{ "Class method" , { S, T, R+U, R, R , O+U, R+U, R+U, R+U, R+U, x+U, x+U, x+U, x+U, P+O+U, x +U, x+U, x+U, x+U, x+U, O+U, E } }, ;
{ "Class data" , { S, T, R+U, R, R , O+U, R+U, x+U, x+U, R+U, x+U, x+U, x+U, x+U, P+O+U, x +U, x+U, x+U, x+U, x+U, O+U, E } }, ;
{ "Run time error", { S, T, R+U, R, x , O+U, x+U, x+U, x+U, R+U, x+U, x+U, x+U, x+U, P+O+U, x +U, x+U, O+U, x+U, x+U, O+U, E } }, ;
{ "Template" , { _S, _T, 0+_U, 0, _O , 0+_U, 0+_U, 0+_U, 0+_U, 0+_U, 0+_U, 0+_U, 0+_U, 0+_U, 0 +_U, 0 +_U, 0+_U, 0+_U, 0+_U, 0+_U, 0+_U, _E } }, ;
{ "Document" , { _S, _T, _R+_U, _R, _O+_U, _O+_U, 0+_U, 0+_U, 0+_U, _R+_U, 0+_U, 0+_U, 0+_U, 0+_U, 0 +_U, 0 +_U, 0+_U, 0+_U, _O+_U, _O+_U, _O+_U, _E } }, ;
{ "Function" , { _S, _T, _R+_U, _R, _R , _O+_U, _O+_U, _O+_U, _O+_U, _O+_U, 0+_U, 0+_U, 0+_U, 0+_U, _P+_O+_U, _P+_O+_U, _O+_U, _O+_U, _O+_U, _O+_U, _O+_U, _E } }, ;
{ "C Function" , { _S, _T, _R+_U, _R, _R , _O+_U, _O+_U, _O+_U, _O+_U, _O+_U, 0+_U, 0+_U, 0+_U, 0+_U, _P+_O+_U, _P+_O+_U, _O+_U, _O+_U, _O+_U, _O+_U, _O+_U, _E } }, ;
{ "Procedure" , { _S, _T, _R+_U, _R, _R , _O+_U, _O+_U, _O+_U, 0, _O+_U, 0+_U, 0+_U, 0+_U, 0+_U, _P+_O+_U, _P+_O+_U, _O+_U, _O+_U, _O+_U, _O+_U, _O+_U, _E } }, ;
{ "Command" , { _S, _T, _R+_U, _R, _R , _O+_U, _R+_U, _R+_U, 0+_U, _R+_U, 0+_U, 0+_U, 0+_U, 0+_U, _P+_O+_U, _P+_O+_U, _O+_U, _O+_U, _O+_U, _O+_U, _O+_U, _E } }, ;
{ "Class" , { _S, _T, _R+_U, _R, _R , _O+_U, _R+_U, _R+_U, _R+_U, _R+_U, _O+_U, _O+_U, _O+_U, _O+_U, _P+_O+_U, _P+_O+_U, _O+_U, _O+_U, _O+_U, _O+_U, _O+_U, _E } }, ;
{ "Class method" , { _S, _T, _R+_U, _R, _R , _O+_U, _R+_U, _R+_U, _R+_U, _R+_U, 0+_U, 0+_U, 0+_U, 0+_U, _P+_O+_U, 0 +_U, 0+_U, 0+_U, 0+_U, 0+_U, _O+_U, _E } }, ;
{ "Class data" , { _S, _T, _R+_U, _R, _R , _O+_U, _R+_U, 0+_U, 0+_U, _R+_U, 0+_U, 0+_U, 0+_U, 0+_U, _P+_O+_U, 0 +_U, 0+_U, 0+_U, 0+_U, 0+_U, _O+_U, _E } }, ;
{ "Run time error", { _S, _T, _R+_U, _R, 0 , _O+_U, 0+_U, 0+_U, 0+_U, _R+_U, 0+_U, 0+_U, 0+_U, 0+_U, _P+_O+_U, 0 +_U, 0+_U, _O+_U, 0+_U, 0+_U, _O+_U, _E } }, ;
}
#undef S
#undef E
#undef T
#undef R
#undef O
#undef P
#undef U
#undef x
METHOD New( cType ) CONSTRUCTOR
METHOD IsField( c, nType )
METHOD IsTemplate( cType )

View File

@@ -168,8 +168,9 @@ EXTERNAL HB_GT_CGI_DEFAULT
EXTERNAL hbmk_KEYW
/* needed for -u */
#undef HB_SYMBOL_UNUSED
#ifndef HB_SYMBOL_UNUSED
#define HB_SYMBOL_UNUSED( symbol ) ( ( symbol ) )
#endif
#define _SELF_NAME_ "hbmk2"