diff --git a/harbour/ChangeLog.txt b/harbour/ChangeLog.txt index 3193f5ac1b..abdd54b915 100644 --- a/harbour/ChangeLog.txt +++ b/harbour/ChangeLog.txt @@ -10,6 +10,160 @@ * Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment */ +2013-03-11 12:07 UTC+0100 Viktor Szakats (harbour syenar.net) + * utils/hbmk2/hbmk2.prg + + added help and Markdown output for hbrun mode, + using same options as in hbmk2 mode, run 'hbrun -help' + + documented how to disable hbrun history + + documented script search and and script autodetection details + + documented opening .dbf files + + documented how to paste text into shell prompt + + documented limitation that in script INIT PROCEDUREs, + automatic selection of interactive GT doesn't work + + __Accept(), __Wait() to trigger interactive GT in scripts + + * src/rtl/objfunc.prg + ! __objGetMsgList(): fixed to not rely on any assumption + about the collation. In UTF8EX mode it was always + returning empty array. + Plus cleanup/optimizations + + * contrib/xhb/hbxml.c + ! fix to a memory double free + Thanks to Jose F. Gimenez for the patch. + + * contrib/hbtest/core.prg + * contrib/hbtest/tests/test.prg + * contrib/hbamf/tests/test.prg + + added support and tests for tests returning + array, hash and object types + * changed zero byte to be escaped to \0 (was \000) + + added memo tests and related engine cleanups + + * src/rtl/valtoexp.prg + + hb_ValToExp(): output for objects changed to use double + quotes for strings instead of a mixture of double/single + ones, to make it easier stringifying the result + + * src/rtl/hbfilehi.prg + % hb_DirSepDel(): minor optimization + + * tests/fixcase.hb + + correct casing of EXTERN/REQUEST references + + * contrib/hbwin/tests/olesrv4.prg + * contrib/hbxpp/hbxpp.ch + * contrib/xhb/hterrsys.prg + * contrib/xhb/xhb.ch + * extras/httpsrv/uhttpd.prg + * src/rdd/dbdelim.prg + * src/rtl/tgetint.prg + * src/rtl/tpersist.prg + * tests/ppapi.prg + * tests/set.prg + ! run fixcase.hb to format REQUEST/EXTERNs + + * contrib/hbmisc/spd.c + * contrib/hbmisc/hbnf.hbx + ! missing casing for one function + + + tests/extend1.hbp + * tests/extend1.prg + * tests/extend2.c + ! fixed to build and run again under Harbour + + * tests/debug.prg + * tests/dynobj.prg + * tests/for2.prg + * tests/memvar.prg + * tests/ppapi.prg + * tests/scroll.prg + * tests/set.prg + * tests/str.prg + * __Accept() changed to WAIT or Inkey( 0 ) + + - contrib/hbrun/hbrun.1 + * config/postinst.hb + * deleted hbrun's (outdated) man doc. + Now built into hbmk2.prg as hbrun help. + + * contrib/hbmisc/hb_f.c + * contrib/xhb/tests/xml1.prg + * tests/hrbext.prg + * comment/minor update + + * tests/hrb.prg + * tests/hrbext.prg + + hrb.prg to create .hrb file if it doesn't exist + + added INIT PROCEDURE + + * contrib/gtwvg/*.h + * contrib/gtwvg/gtwvgd.c + * contrib/hbnf/fttext.c + * contrib/hbwin/hbwinole.h + * contrib/rddads/adsfunc.c + * contrib/rddbm/bmdbfx.c + * doc/c_std.txt + * extras/gtwvw/docs/funclist.txt + * extras/gtwvw/wvwpush.c + * include/*.h + * src/codepage/cp_utf8.c + * src/common/*.c + * src/compiler/*.c + * src/rdd/dbfcdx/dbfcdx1.c + * src/rdd/dbffpt/dbffpt1.c + * src/rdd/dbfnsx/dbfnsx1.c + * src/rdd/dbfntx/dbfntx1.c + * src/rdd/hsx/hsx.c + * src/rdd/usrrdd/rdds/arrayrdd.prg + * src/rdd/*.c + * src/rtl/*.c + * src/rtl/gtsln/gtsln.h + * src/rtl/gttrm/gttrm.c + * src/rtl/gtwvt/gtwvt.c + * src/vm/*.c + * ! operator synced with uncrustify format + * minor corrections in comment/text + + * tests/codebl.prg + * tests/codebloc.prg + * tests/dates3.prg + * tests/foreach.prg + * tests/macro.prg + * tests/mouse.prg + * tests/onidle.prg + * tests/tbrowse.prg + * tests/vmasort.prg + * tests/wvtext.prg + * website/samples/codebl.prg.html + * website/samples/codebloc.prg.html + * website/samples/dates3.prg.html + * website/samples/foreach.prg.html + * website/samples/macro.prg.html + * website/samples/mouse.prg.html + * website/samples/onidle.prg.html + * website/samples/tbrowse.prg.html + % local functions marked STATIC + + * contrib/hbmisc/spd.c + * contrib/hbnf/clrsel.prg + * contrib/hbnf/doc/en/*.txt + * contrib/hbnf/popadder.prg + * contrib/hbnf/tests/clrsel.prg + * contrib/hbwin/win_tprn.prg + * doc/en/datetime.txt + * doc/en/set.txt + * doc/oldnews.txt + * extras/gfspell/spell.prg + * extras/gtwvw/docs/gtwvw.txt + * extras/gtwvw/hbgtwvw.h + * extras/gtwvw/tests/ebtest7.prg + * extras/gtwvw/wvwdraw.c + * extras/gtwvw/wvwpush.c + * tests/clsscope.prg + * tests/extend1.prg + ! few more dates converted to ISO format + 2013-03-10 14:14 UTC+0100 Viktor Szakats (harbour syenar.net) * contrib/hbtest/core.prg + use octal notation for all non-displayable bytes. diff --git a/harbour/config/postinst.hb b/harbour/config/postinst.hb index 28ff828add..9b64823240 100644 --- a/harbour/config/postinst.hb +++ b/harbour/config/postinst.hb @@ -124,8 +124,7 @@ PROCEDURE Main( ... ) IF hb_DirBuild( hb_DirSepToOS( GetEnvC( "HB_INSTALL_MAN" ) ) + hb_ps() + "man1" ) FOR EACH tmp IN { ; "src/main/harbour.1", ; - "src/pp/hbpp.1", ; - "contrib/hbrun/hbrun.1" } + "src/pp/hbpp.1" } mk_hb_FCopy( tmp, GetEnvC( "HB_INSTALL_MAN" ) + hb_ps() + "man1" + hb_ps(), .T. ) NEXT ELSE diff --git a/harbour/contrib/gtwvg/gtwgu.h b/harbour/contrib/gtwvg/gtwgu.h index 0d28e56a8a..5227c3d3c7 100644 --- a/harbour/contrib/gtwvg/gtwgu.h +++ b/harbour/contrib/gtwvg/gtwgu.h @@ -152,76 +152,79 @@ HB_EXTERN_BEGIN /*-*/ #if defined( __DMC__ ) - #if (_WIN32_IE >= 0x0300) - #if !defined( ICC_BAR_CLASSES ) + #if ( _WIN32_IE >= 0x0300 ) + #if ! defined( ICC_BAR_CLASSES ) #define ICC_BAR_CLASSES 0x00000004 #endif - #if !defined( COLOR16 ) + #if ! defined( COLOR16 ) typedef USHORT COLOR16; #endif - #if !defined( TRIVERTEX ) - typedef struct _TRIVERTEX { + #if ! defined( TRIVERTEX ) + typedef struct _TRIVERTEX + { LONG x; LONG y; COLOR16 Red; COLOR16 Green; COLOR16 Blue; COLOR16 Alpha; - }TRIVERTEX,*PTRIVERTEX,*LPTRIVERTEX; + } TRIVERTEX, * PTRIVERTEX, * LPTRIVERTEX; #endif - #if !defined( INITCOMMONCONTROLSEX ) - typedef struct tagINITCOMMONCONTROLSEX { + #if ! defined( INITCOMMONCONTROLSEX ) + typedef struct tagINITCOMMONCONTROLSEX + { DWORD dwSize; /* size of this structure */ DWORD dwICC; /* flags indicating which classes to be initialized */ - } INITCOMMONCONTROLSEX, *LPINITCOMMONCONTROLSEX; + } INITCOMMONCONTROLSEX, * LPINITCOMMONCONTROLSEX; #endif - #if !defined( InitCommonControlsEx ) - WINCOMMCTRLAPI BOOL WINAPI InitCommonControlsEx(LPINITCOMMONCONTROLSEX); + #if ! defined( InitCommonControlsEx ) + WINCOMMCTRLAPI BOOL WINAPI InitCommonControlsEx( LPINITCOMMONCONTROLSEX ); #endif #endif - typedef struct _GRADIENT_RECT { + typedef struct _GRADIENT_RECT + { ULONG UpperLeft; ULONG LowerRight; - } GRADIENT_RECT,*PGRADIENT_RECT,*LPGRADIENT_RECT; + } GRADIENT_RECT, * PGRADIENT_RECT, * LPGRADIENT_RECT; #ifndef TTM_SETTIPBKCOLOR - #define TTM_SETTIPBKCOLOR (WM_USER + 19) + #define TTM_SETTIPBKCOLOR ( WM_USER + 19 ) #endif #ifndef TTM_SETTIPTEXTCOLOR - #define TTM_SETTIPTEXTCOLOR (WM_USER + 20) + #define TTM_SETTIPTEXTCOLOR ( WM_USER + 20 ) #endif #ifndef TTM_GETTIPBKCOLOR - #define TTM_GETTIPBKCOLOR (WM_USER + 22) + #define TTM_GETTIPBKCOLOR ( WM_USER + 22 ) #endif #ifndef TTM_GETTIPTEXTCOLOR - #define TTM_GETTIPTEXTCOLOR (WM_USER + 23) + #define TTM_GETTIPTEXTCOLOR ( WM_USER + 23 ) #endif #ifndef TTM_SETMAXTIPWIDTH - #define TTM_SETMAXTIPWIDTH (WM_USER + 24) + #define TTM_SETMAXTIPWIDTH ( WM_USER + 24 ) #endif #ifndef TTM_GETMAXTIPWIDTH - #define TTM_GETMAXTIPWIDTH (WM_USER + 25) + #define TTM_GETMAXTIPWIDTH ( WM_USER + 25 ) #endif #ifndef TTM_SETMARGIN - #define TTM_SETMARGIN (WM_USER + 26) + #define TTM_SETMARGIN ( WM_USER + 26 ) #endif #endif #if defined( __BORLANDC__ ) && ( __BORLANDC__ == 0x0550 ) #ifdef __cplusplus - extern "C" { STDAPI OleLoadPicture(LPSTREAM,LONG,BOOL,REFIID,PVOID*); } + extern "C" { STDAPI OleLoadPicture( LPSTREAM, LONG, BOOL, REFIID, PVOID * ); } #else #if ! defined( HB_OS_WIN_CE ) - STDAPI OleLoadPicture(LPSTREAM,LONG,BOOL,REFIID,PVOID*); + STDAPI OleLoadPicture( LPSTREAM, LONG, BOOL, REFIID, PVOID * ); #endif #endif #endif /*-*/ -typedef BOOL ( WINAPI *wvtGradientFill ) ( +typedef BOOL ( WINAPI * wvtGradientFill ) ( HDC hdc, PTRIVERTEX pVertex, ULONG dwNumVertex, @@ -229,7 +232,7 @@ typedef BOOL ( WINAPI *wvtGradientFill ) ( ULONG dwNumMesh, ULONG dwMode ); -typedef BOOL ( WINAPI *wvtSetLayeredWindowAttributes )( +typedef BOOL ( WINAPI * wvtSetLayeredWindowAttributes )( HWND hwnd, COLORREF crKey, BYTE bAlpha, @@ -286,7 +289,7 @@ typedef struct PHB_CODEPAGE hostCDP; /* Host/HVM CodePage for unicode output translations */ PHB_CODEPAGE inCDP; /* Host/HVM CodePage for unicode input translations */ -#if !defined( UNICODE ) +#if ! defined( UNICODE ) BYTE keyTransTbl[ 256 ]; BYTE chrTransTbl[ 256 ]; #endif @@ -342,7 +345,7 @@ typedef struct /*-*/ #ifndef INVALID_FILE_SIZE - #define INVALID_FILE_SIZE (DWORD)0xFFFFFFFF + #define INVALID_FILE_SIZE ( DWORD ) 0xFFFFFFFF #endif #ifndef CC_ANYCOLOR @@ -350,7 +353,7 @@ typedef struct #endif #ifndef IDC_HAND - #define IDC_HAND MAKEINTRESOURCE(32649) + #define IDC_HAND MAKEINTRESOURCE( 32649 ) #endif #ifndef GRADIENT_FILL_RECT_H @@ -358,7 +361,7 @@ typedef struct #endif #ifndef GCLP_HCURSOR - #define GCLP_HCURSOR (-12) + #define GCLP_HCURSOR ( -12 ) #endif /*-*/ @@ -392,7 +395,7 @@ typedef enum /*-*/ /* xHarbour compatible definitions */ -#if !defined( K_SH_LEFT ) +#if ! defined( K_SH_LEFT ) #define K_SH_LEFT K_LEFT /* Shift-Left == Left */ #define K_SH_UP K_UP /* Shift-Up == Up */ #define K_SH_RIGHT K_RIGHT /* Shift-Right == Right */ @@ -413,15 +416,15 @@ typedef enum /*-*/ #if 0 -extern HB_BOOL wvt_Array2Rect(PHB_ITEM aRect, RECT *rc ); -extern PHB_ITEM wvt_Rect2Array( RECT *rc ); -extern HB_BOOL wvt_Array2Point(PHB_ITEM aPoint, POINT *pt ); -extern PHB_ITEM wvt_Point2Array( POINT *pt ); -extern HB_BOOL wvt_Array2Size(PHB_ITEM aSize, SIZE *siz ); -extern PHB_ITEM wvt_Size2Array( SIZE *siz ); -extern void wvt_Rect2ArrayEx( RECT *rc ,PHB_ITEM aRect ); -extern void wvt_Point2ArrayEx( POINT *pt , PHB_ITEM aPoint); -extern void wvt_Size2ArrayEx( SIZE *siz ,PHB_ITEM aSize ); +extern HB_BOOL wvt_Array2Rect( PHB_ITEM aRect, RECT * rc ); +extern PHB_ITEM wvt_Rect2Array( RECT * rc ); +extern HB_BOOL wvt_Array2Point( PHB_ITEM aPoint, POINT * pt ); +extern PHB_ITEM wvt_Point2Array( POINT * pt ); +extern HB_BOOL wvt_Array2Size( PHB_ITEM aSize, SIZE * siz ); +extern PHB_ITEM wvt_Size2Array( SIZE * siz ); +extern void wvt_Rect2ArrayEx( RECT * rc, PHB_ITEM aRect ); +extern void wvt_Point2ArrayEx( POINT * pt, PHB_ITEM aPoint); +extern void wvt_Size2ArrayEx( SIZE * siz, PHB_ITEM aSize ); #endif HB_EXTERN_END diff --git a/harbour/contrib/gtwvg/gtwvg.h b/harbour/contrib/gtwvg/gtwvg.h index 83a7ae4605..1273311a7d 100644 --- a/harbour/contrib/gtwvg/gtwvg.h +++ b/harbour/contrib/gtwvg/gtwvg.h @@ -150,76 +150,79 @@ HB_EXTERN_BEGIN /*-*/ #if defined( __DMC__ ) - #if (_WIN32_IE >= 0x0300) - #if !defined( ICC_BAR_CLASSES ) + #if ( _WIN32_IE >= 0x0300 ) + #if ! defined( ICC_BAR_CLASSES ) #define ICC_BAR_CLASSES 0x00000004 #endif - #if !defined( COLOR16 ) + #if ! defined( COLOR16 ) typedef USHORT COLOR16; #endif - #if !defined( TRIVERTEX ) - typedef struct _TRIVERTEX { + #if ! defined( TRIVERTEX ) + typedef struct _TRIVERTEX + { LONG x; LONG y; COLOR16 Red; COLOR16 Green; COLOR16 Blue; COLOR16 Alpha; - }TRIVERTEX,*PTRIVERTEX,*LPTRIVERTEX; + } TRIVERTEX, * PTRIVERTEX, * LPTRIVERTEX; #endif - #if !defined( INITCOMMONCONTROLSEX ) - typedef struct tagINITCOMMONCONTROLSEX { + #if ! defined( INITCOMMONCONTROLSEX ) + typedef struct tagINITCOMMONCONTROLSEX + { DWORD dwSize; /* size of this structure */ DWORD dwICC; /* flags indicating which classes to be initialized */ - } INITCOMMONCONTROLSEX, *LPINITCOMMONCONTROLSEX; + } INITCOMMONCONTROLSEX, * LPINITCOMMONCONTROLSEX; #endif - #if !defined( InitCommonControlsEx ) - WINCOMMCTRLAPI BOOL WINAPI InitCommonControlsEx(LPINITCOMMONCONTROLSEX); + #if ! defined( InitCommonControlsEx ) + WINCOMMCTRLAPI BOOL WINAPI InitCommonControlsEx( LPINITCOMMONCONTROLSEX ); #endif #endif - typedef struct _GRADIENT_RECT { + typedef struct _GRADIENT_RECT + { ULONG UpperLeft; ULONG LowerRight; - } GRADIENT_RECT,*PGRADIENT_RECT,*LPGRADIENT_RECT; + } GRADIENT_RECT, * PGRADIENT_RECT, * LPGRADIENT_RECT; #ifndef TTM_SETTIPBKCOLOR - #define TTM_SETTIPBKCOLOR (WM_USER + 19) + #define TTM_SETTIPBKCOLOR ( WM_USER + 19 ) #endif #ifndef TTM_SETTIPTEXTCOLOR - #define TTM_SETTIPTEXTCOLOR (WM_USER + 20) + #define TTM_SETTIPTEXTCOLOR ( WM_USER + 20 ) #endif #ifndef TTM_GETTIPBKCOLOR - #define TTM_GETTIPBKCOLOR (WM_USER + 22) + #define TTM_GETTIPBKCOLOR ( WM_USER + 22 ) #endif #ifndef TTM_GETTIPTEXTCOLOR - #define TTM_GETTIPTEXTCOLOR (WM_USER + 23) + #define TTM_GETTIPTEXTCOLOR ( WM_USER + 23 ) #endif #ifndef TTM_SETMAXTIPWIDTH - #define TTM_SETMAXTIPWIDTH (WM_USER + 24) + #define TTM_SETMAXTIPWIDTH ( WM_USER + 24 ) #endif #ifndef TTM_GETMAXTIPWIDTH - #define TTM_GETMAXTIPWIDTH (WM_USER + 25) + #define TTM_GETMAXTIPWIDTH ( WM_USER + 25 ) #endif #ifndef TTM_SETMARGIN - #define TTM_SETMARGIN (WM_USER + 26) + #define TTM_SETMARGIN ( WM_USER + 26 ) #endif #endif #if defined( __BORLANDC__ ) && ( __BORLANDC__ == 0x0550 ) #ifdef __cplusplus - extern "C" { STDAPI OleLoadPicture(LPSTREAM,LONG,BOOL,REFIID,PVOID*); } + extern "C" { STDAPI OleLoadPicture( LPSTREAM, LONG, BOOL, REFIID, PVOID * ); } #else #if ! defined( HB_OS_WIN_CE ) - STDAPI OleLoadPicture(LPSTREAM,LONG,BOOL,REFIID,PVOID*); + STDAPI OleLoadPicture( LPSTREAM, LONG, BOOL, REFIID, PVOID * ); #endif #endif #endif /*-*/ -typedef BOOL ( WINAPI *wvtGradientFill ) ( +typedef BOOL ( WINAPI * wvtGradientFill ) ( HDC hdc, PTRIVERTEX pVertex, ULONG dwNumVertex, @@ -227,7 +230,7 @@ typedef BOOL ( WINAPI *wvtGradientFill ) ( ULONG dwNumMesh, ULONG dwMode ); -typedef BOOL ( WINAPI *wvtSetLayeredWindowAttributes )( +typedef BOOL ( WINAPI * wvtSetLayeredWindowAttributes )( HWND hwnd, COLORREF crKey, BYTE bAlpha, @@ -475,7 +478,7 @@ typedef struct /*-*/ #ifndef INVALID_FILE_SIZE - #define INVALID_FILE_SIZE (DWORD)0xFFFFFFFF + #define INVALID_FILE_SIZE ( DWORD ) 0xFFFFFFFF #endif #ifndef CC_ANYCOLOR @@ -483,7 +486,7 @@ typedef struct #endif #ifndef IDC_HAND - #define IDC_HAND MAKEINTRESOURCE(32649) + #define IDC_HAND MAKEINTRESOURCE( 32649 ) #endif #ifndef GRADIENT_FILL_RECT_H @@ -491,7 +494,7 @@ typedef struct #endif #ifndef GCLP_HCURSOR - #define GCLP_HCURSOR (-12) + #define GCLP_HCURSOR ( -12 ) #endif #ifndef TVIS_EXPANDPARTIAL @@ -529,7 +532,7 @@ typedef enum /*-*/ /* xHarbour compatible definitions */ -#if !defined( K_SH_LEFT ) +#if ! defined( K_SH_LEFT ) #define K_SH_LEFT K_LEFT /* Shift-Left == Left */ #define K_SH_UP K_UP /* Shift-Up == Up */ #define K_SH_RIGHT K_RIGHT /* Shift-Right == Right */ @@ -564,7 +567,7 @@ typedef enum # define SC_MAXIMIZE 0xF030 #endif -#if defined( HB_OS_WIN_CE ) && !defined( __MINGW32CE__ ) +#if defined( HB_OS_WIN_CE ) && ! defined( __MINGW32CE__ ) BOOL SetMenu( HWND hWnd, HMENU hMenu ); HMENU GetMenu( HWND hWnd ); @@ -597,15 +600,15 @@ extern HB_EXPORT void hb_gt_wvt_PaintGObjects( PHB_GTWVT pWVT, RECT *uR /*-*/ -extern HB_BOOL wvt_Array2Rect(PHB_ITEM aRect, RECT *rc ); -extern PHB_ITEM wvt_Rect2Array( RECT *rc ); -extern HB_BOOL wvt_Array2Point(PHB_ITEM aPoint, POINT *pt ); -extern PHB_ITEM wvt_Point2Array( POINT *pt ); -extern HB_BOOL wvt_Array2Size(PHB_ITEM aSize, SIZE *siz ); -extern PHB_ITEM wvt_Size2Array( SIZE *siz ); -extern void wvt_Rect2ArrayEx( RECT *rc ,PHB_ITEM aRect ); -extern void wvt_Point2ArrayEx( POINT *pt , PHB_ITEM aPoint); -extern void wvt_Size2ArrayEx( SIZE *siz ,PHB_ITEM aSize ); +extern HB_BOOL wvt_Array2Rect( PHB_ITEM aRect, RECT * rc ); +extern PHB_ITEM wvt_Rect2Array( RECT * rc ); +extern HB_BOOL wvt_Array2Point( PHB_ITEM aPoint, POINT * pt ); +extern PHB_ITEM wvt_Point2Array( POINT * pt ); +extern HB_BOOL wvt_Array2Size( PHB_ITEM aSize, SIZE * siz ); +extern PHB_ITEM wvt_Size2Array( SIZE * siz ); +extern void wvt_Rect2ArrayEx( RECT *rc, PHB_ITEM aRect ); +extern void wvt_Point2ArrayEx( POINT * pt, PHB_ITEM aPoint ); +extern void wvt_Size2ArrayEx( SIZE * siz, PHB_ITEM aSize ); HB_EXTERN_END diff --git a/harbour/contrib/gtwvg/gtwvgd.c b/harbour/contrib/gtwvg/gtwvgd.c index 26de6e8252..051b820d6f 100644 --- a/harbour/contrib/gtwvg/gtwvgd.c +++ b/harbour/contrib/gtwvg/gtwvgd.c @@ -109,7 +109,7 @@ static HB_CRITICAL_NEW( s_wvtMtx ); #define HB_WVT_UNLOCK() hb_threadLeaveCriticalSection( &s_wvtMtx ) #if ( ( defined( _MSC_VER ) && ( _MSC_VER <= 1200 || defined( HB_OS_WIN_CE ) ) ) || \ - defined( __DMC__ ) ) && !defined( HB_ARCH_64BIT ) + defined( __DMC__ ) ) && ! defined( HB_ARCH_64BIT ) # ifndef GetWindowLongPtr # define GetWindowLongPtr GetWindowLong # endif diff --git a/harbour/contrib/hbamf/tests/test.prg b/harbour/contrib/hbamf/tests/test.prg index 200fcabd3c..6bf1fd88be 100644 --- a/harbour/contrib/hbamf/tests/test.prg +++ b/harbour/contrib/hbamf/tests/test.prg @@ -18,8 +18,8 @@ PROCEDURE Main() HBTEST amf3_Encode( 1000 ) IS e"\004\207h" HBTEST amf3_Encode( 1000000 ) IS e"\004\275\204@" HBTEST amf3_Encode( 268435455 ) IS e"\004\277\377\377\377" - HBTEST amf3_Encode( 268435456 ) IS e"\005A\260\000\000\000\000\000\000" - HBTEST amf3_Encode( 268435456000 ) IS e"\005BO@\000\000\000\000\000" + HBTEST amf3_Encode( 268435456 ) IS e"\005A\260\0\0\0\0\0\0" + HBTEST amf3_Encode( 268435456000 ) IS e"\005BO@\0\0\0\0\0" HBTEST amf3_Encode( -1 ) IS e"\004\377\377\377\377" HBTEST amf3_Encode( 9007199254740990 ) IS e"\005C?\377\377\377\377\377\376" HBTEST amf3_Encode( amf3_Decode( amf3_Encode( 9007199254740990 ) ) ) IS e"\005C?\377\377\377\377\377\376" diff --git a/harbour/contrib/hbmisc/hb_f.c b/harbour/contrib/hbmisc/hb_f.c index 8172bfaaef..0b433085e0 100644 --- a/harbour/contrib/hbmisc/hb_f.c +++ b/harbour/contrib/hbmisc/hb_f.c @@ -388,7 +388,7 @@ HB_FUNC( HB_FINFO ) /* used for debugging */ reader that presumes all hard returns are record separators. This function is useful right now to loop through a CSV file - while !hb_feof(), but it does NOT recognize the same record count + WHILE ! hb_FAtEof(), but it does NOT recognize the same record count and positioning that the other functions in this file use. It does its own skip and read, so an entire file can be read sequentially with just this function. diff --git a/harbour/contrib/hbmisc/hbmisc.hbx b/harbour/contrib/hbmisc/hbmisc.hbx index b185a413e7..c66680534f 100644 --- a/harbour/contrib/hbmisc/hbmisc.hbx +++ b/harbour/contrib/hbmisc/hbmisc.hbx @@ -131,7 +131,7 @@ DYNAMIC PtrStr DYNAMIC RestBox DYNAMIC Rot13 DYNAMIC SaveBox -DYNAMIC SQL_SPRINTF +DYNAMIC sql_sprintf DYNAMIC StrDump DYNAMIC StrFormat DYNAMIC StrPtr diff --git a/harbour/contrib/hbmisc/spd.c b/harbour/contrib/hbmisc/spd.c index 42f97dd479..f5aef1181c 100644 --- a/harbour/contrib/hbmisc/spd.c +++ b/harbour/contrib/hbmisc/spd.c @@ -4,7 +4,7 @@ /* * Harbour Project source code: - * SQL_SPRINTF() function + * sql_sprintf() function * * Copyright 2008 Xavi * @@ -149,36 +149,36 @@ static HB_UINT SCItm( char * cBuffer, HB_UINT ulMaxBuf, char * cParFrm, int iCOu /** * ANSI C sprintf() for ANSI SQL with DATE, DATETIME, LOGICAL, NIL, NUMERIC * ------------------------------------------------------------------------ - * cRes := Sql_sprintf( cFrm, ... ) + * cRes := sql_sprintf( cFrm, ... ) * * Full compatible ANSI C99 formats with C,S converters wchar_t (UNICODE) * Integer & Floating point converters with Width and Precision for NUMERIC & STRING * a,A converters Hexadecimal floating point format. Thanks Rafa. - * ? Sql_sprintf( "Phi = %A", (1 + 5**0.5) / 2 ) // Phi = 0X1,9E3779B97F4A8P+0 + * ? sql_sprintf( "Phi = %A", ( 1 + 5 ^ 0.5 ) / 2 ) // Phi = 0X1,9E3779B97F4A8P+0 * %m$,*m$ Index & Indirect arguments C99. Thanks Viktor. - * ? Sql_sprintf( "Phi = %2$0*3$.*1$f", 4, (1 + 5**0.5) / 2, 7 ) // Phi = 01.6180 + * ? sql_sprintf( "Phi = %2$0*3$.*1$f", 4, ( 1 + 5 ^ 0.5 ) / 2, 7 ) // Phi = 01.6180 * * s converter for format Harbour data types. * NUMERIC with FIXED DECIMALS = n | n.d STRING = String's ANSI\C * DATE = HB_SET_DATEFORMAT DATETIME = HB_SET_DATEFORMAT hh:mm:ss * New Internal Modifier {}. Thanks Mindaugas. - * Date and Time Format separate by first space {DD/MM/YYYY hh:mm:ss.fff pp} - * {DD/MM/YYYY} = Only Date | { hh:mm:ss.fff pp} = Only Time - * ? Sql_sprintf( "%s", Date() ) // 16/06/08 - * ? Sql_sprintf( "%s", HB_DateTime() ) // 16/06/08 04:11:21.531 - * ? Sql_sprintf( "%{YYYYMMDD}s", HB_DateTime() ) // 20080616 - * ? Sql_sprintf( "%{ hh:mm pp}s", HB_DateTime() ) // 04:11 AM + * Date and Time Format separate by first space {YYYY-MM-DD hh:mm:ss.fff pp} + * {YYYY-MM-DD} = Only Date | { hh:mm:ss.fff pp} = Only Time + * ? sql_sprintf( "%s", Date() ) // 2008-06-16 + * ? sql_sprintf( "%s", hb_DateTime() ) // 2008-06-16 04:11:21.531 + * ? sql_sprintf( "%{YYYYMMDD}s", hb_DateTime() ) // 20080616 + * ? sql_sprintf( "%{ hh:mm pp}s", hb_DateTime() ) // 04:11 AM * LOGICAL = TRUE | FALSE %d converter for LOGICAL = 1 | 0 * Accepts Internal Modifier TRUE and FALSE Format separate by first comma * {T .T.,F .F.} = TRUE & FALSE | {ON} = Only TRUE | {,OFF} = Only FALSE - * ? Sql_sprintf( "%{VERDADERO,FALSO}s", .F. ) // FALSO - * ? Sql_sprintf( "%{ONLY IF TRUE}s", .T. ) // ONLY IF TRUE + * ? sql_sprintf( "%{VERDADERO,FALSO}s", .F. ) // FALSO + * ? sql_sprintf( "%{ONLY IF TRUE}s", .T. ) // ONLY IF TRUE * * New t,T converter for format ANSI SQL types. * NUMERIC with FIXED DECIMALS = n | n.d STRING = 'String''s ANSI\\SQL' * Print DEFAULT if 0 length STRING for T converter * DATE = 'YYYY-MM-DD' DATETIME = 'YYYY-MM-DD HH:MM:SS' - * Accepts Internal Modifier like s converter {DD/MM/YYYY hh:mm:ss.fff pp} + * Accepts Internal Modifier like s converter {YYYY-MM-DD hh:mm:ss.fff pp} * Print DEFAULT if the DATE, DATETIME is EMPTY for T converter or print * DK_EMPTYDATE, DK_EMPTYDATETIME for t converter * LOGICAL = TRUE | FALSE Accepts Internal Modifier like s {ON,OFF} diff --git a/harbour/contrib/hbnetio/netiocli.c b/harbour/contrib/hbnetio/netiocli.c index 1672dba048..a5037f472e 100644 --- a/harbour/contrib/hbnetio/netiocli.c +++ b/harbour/contrib/hbnetio/netiocli.c @@ -735,7 +735,7 @@ static const char * s_fileDecode( const char * pszFilename, pszFilename += 2; pth = strchr( pszFilename, '/' ); psz = strchr( pszFilename, '\\' ); - if( !pth || ( psz && psz < pth ) ) + if( ! pth || ( psz && psz < pth ) ) { pth = psz; if( ! pth ) diff --git a/harbour/contrib/hbnf/clrsel.prg b/harbour/contrib/hbnf/clrsel.prg index 7a260a122d..defea210de 100644 --- a/harbour/contrib/hbnf/clrsel.prg +++ b/harbour/contrib/hbnf/clrsel.prg @@ -317,7 +317,7 @@ STATIC FUNCTION _ftShowIt( aOpt ) SetColor( aClr[ 2 ] ) hb_DispOutAt( 22, 53, " 199.95" ) SetColor( aClr[ 5 ] ) - hb_DispOutAt( 23, 53, "09/15/91" ) + hb_DispOutAt( 23, 53, DToC( 0d19910915 ) ) EXIT CASE "W" // Alert windows diff --git a/harbour/contrib/hbnf/doc/en/easter.txt b/harbour/contrib/hbnf/doc/en/easter.txt index e4b630378d..02d6064e09 100644 --- a/harbour/contrib/hbnf/doc/en/easter.txt +++ b/harbour/contrib/hbnf/doc/en/easter.txt @@ -24,6 +24,6 @@ This function can be useful in calender type programs that indicate when holidays occur. $EXAMPLES$ - dEdate := ft_Easter( 1990 ) // returns 04/15/1990 + dEdate := ft_Easter( 1990 ) // returns 1990-04-15 $END$ */ diff --git a/harbour/contrib/hbnf/doc/en/firstday.txt b/harbour/contrib/hbnf/doc/en/firstday.txt index 5c95d10192..23f9829137 100644 --- a/harbour/contrib/hbnf/doc/en/firstday.txt +++ b/harbour/contrib/hbnf/doc/en/firstday.txt @@ -23,8 +23,8 @@ supplied. $EXAMPLES$ dDate := hb_SToD( "19900915" ) - ? ft_FDay( dDate ) // 09/01/90 - ? ft_FDay() // 03/01/91 (current month) + ? ft_FDay( dDate ) // 1990-09-01 + ? ft_FDay() // 1991-03-01 (current month) $SEEALSO$ ft_LDay() $END$ diff --git a/harbour/contrib/hbnf/doc/en/lastday.txt b/harbour/contrib/hbnf/doc/en/lastday.txt index de9a2e7cd4..30b9b09320 100644 --- a/harbour/contrib/hbnf/doc/en/lastday.txt +++ b/harbour/contrib/hbnf/doc/en/lastday.txt @@ -23,8 +23,8 @@ supplied. $EXAMPLES$ dDate := hb_SToD( "19900915" ) - ? ft_LDay( dDate ) // 09/30/90 - ? ft_LDay() // 03/31/91 (current month) + ? ft_LDay( dDate ) // 1990-09-30 + ? ft_LDay() // 1991-03-31 (current month) $SEEALSO$ ft_FDay() $END$ diff --git a/harbour/contrib/hbnf/doc/en/madd.txt b/harbour/contrib/hbnf/doc/en/madd.txt index dbd55aa8fb..f62ed02d49 100644 --- a/harbour/contrib/hbnf/doc/en/madd.txt +++ b/harbour/contrib/hbnf/doc/en/madd.txt @@ -32,17 +32,17 @@ return the same day as the day of the passed date. $EXAMPLES$ dDate := hb_SToD( "19900915" ) - ? ft_MAdd( dDate, 1 ) // 10/15/90 - ? ft_MAdd( dDate, -2 ) // 07/15/90 + ? ft_MAdd( dDate, 1 ) // 1990-10-15 + ? ft_MAdd( dDate, -2 ) // 1990-07-15 // force EOM dDate := hb_SToD( "19910430" ) - ? ft_MAdd( dDate, 1 ) // 05/30/91 - ? ft_MAdd( dDate, 1, .T. ) // 05/31/91 <- forced EOM - ? ft_MAdd( dDate, 2 ) // 06/30/91 - ? ft_MAdd( dDate, 2, .T. ) // 06/30/91 <- June only has 30 days - ? ft_MAdd( dDate, 3 ) // 07/30/91 - ? ft_MAdd( dDate, 3, .T. ) // 07/31/91 <- forced EOM + ? ft_MAdd( dDate, 1 ) // 1991-05-30 + ? ft_MAdd( dDate, 1, .T. ) // 1991-05-31 <- forced EOM + ? ft_MAdd( dDate, 2 ) // 1991-06-30 + ? ft_MAdd( dDate, 2, .T. ) // 1991-06-30 <- June only has 30 days + ? ft_MAdd( dDate, 3 ) // 1991-07-30 + ? ft_MAdd( dDate, 3, .T. ) // 1991-07-31 <- forced EOM $SEEALSO$ ft_DayOfYr() ft_DayToBoW() $END$ diff --git a/harbour/contrib/hbnf/doc/en/wda.txt b/harbour/contrib/hbnf/doc/en/wda.txt index 27057dbe70..c7db3566d3 100644 --- a/harbour/contrib/hbnf/doc/en/wda.txt +++ b/harbour/contrib/hbnf/doc/en/wda.txt @@ -38,7 +38,7 @@ // Postdate 5 working days from the first of January dPost := hb_SToD( "19910101" ) dPost += ft_AddWkDy( dPost, 5 ) // returns 7 true days - ? dPost // 01/08/91 + ? dPost // 1991-01-08 $SEEALSO$ ft_Workdays() $END$ diff --git a/harbour/contrib/hbnf/doc/en/woy.txt b/harbour/contrib/hbnf/doc/en/woy.txt index b9502c0d98..d31c647505 100644 --- a/harbour/contrib/hbnf/doc/en/woy.txt +++ b/harbour/contrib/hbnf/doc/en/woy.txt @@ -30,7 +30,7 @@ dDate := hb_SToD( "19910101" ) nWkNum := ft_WoY( dDate ) // result: 1 - // presume DOS date to be 01/06/91 + // presume DOS date to be 1991-01-06 nWkNum := ft_WoY( Date() ) // result: 2 // date input @@ -69,7 +69,7 @@ dDate := hb_SToD( "19910101" ) nDayNum := ft_DoY( dDate ) // result: 1 - // presume DOS date to be 01/06/91 + // presume DOS date to be 1991-01-06 nDayNum := ft_DoY( Date() ) // result: 6 // date input diff --git a/harbour/contrib/hbnf/fttext.c b/harbour/contrib/hbnf/fttext.c index 5c3d55d2af..e10f8249e0 100644 --- a/harbour/contrib/hbnf/fttext.c +++ b/harbour/contrib/hbnf/fttext.c @@ -648,7 +648,7 @@ HB_FUNC( FT_FAPPEND ) ft_text->recno[ ft_text->area ]++; ft_text->offset[ ft_text->area ] = hb_fsSeekLarge( ft_text->handles[ ft_text->area ], 0, FS_RELATIVE ); #if 0 - no_lines--; /* !Harbour FIX! */ + no_lines--; /* Harbour FIX */ #endif } diff --git a/harbour/contrib/hbnf/popadder.prg b/harbour/contrib/hbnf/popadder.prg index dc9d3d4341..e8eac63696 100644 --- a/harbour/contrib/hbnf/popadder.prg +++ b/harbour/contrib/hbnf/popadder.prg @@ -890,7 +890,7 @@ STATIC FUNCTION _ftQuest( cMessage, xVarVal, cPict, bValid, lNoESC, nWinColor, n LOCAL cVarType := ValType( xVarVal ) LOCAL nVarLen := ; iif( cVarType == "C", Len( xVarVal ), ; - iif( cVarType == "D", 8, ; + iif( cVarType == "D", 10, ; iif( cVarType == "L", 1, ; iif( cVarType == "N", iif( cPict == NIL, 9, Len( cPict ) ), 0 ) ) ) ) LOCAL nOldLastKey := LastKey() @@ -937,7 +937,7 @@ STATIC FUNCTION _ftQuest( cMessage, xVarVal, cPict, bValid, lNoESC, nWinColor, n oNewGet:Picture := cPict ELSE // Else setup default pictures IF HB_ISDATE( xVarVal ) - oNewGet:Picture := "99/99/99" + oNewGet:Picture := "9999-99-99" ELSEIF HB_ISLOGICAL( xVarVal ) oNewGet:Picture := "Y" ELSEIF HB_ISNUMERIC( xVarVal ) diff --git a/harbour/contrib/hbnf/tests/clrsel.prg b/harbour/contrib/hbnf/tests/clrsel.prg index e3c94e46cc..050d4f27a8 100644 --- a/harbour/contrib/hbnf/tests/clrsel.prg +++ b/harbour/contrib/hbnf/tests/clrsel.prg @@ -15,6 +15,8 @@ PROCEDURE Main( cVidMode ) LOCAL lColour LOCAL aClrs + Set( _SET_DATEFORMAT, "yyyy-mm-dd" ) + __defaultNIL( @cVidMode, "" ) NoSnow( ( "NOSNOW" $ Upper( cVidMode ) ) ) diff --git a/harbour/contrib/hbrun/hbrun.1 b/harbour/contrib/hbrun/hbrun.1 deleted file mode 100644 index 0e5df99a59..0000000000 --- a/harbour/contrib/hbrun/hbrun.1 +++ /dev/null @@ -1,34 +0,0 @@ -.TH HBRUN 1 - -.SH NAME -hbrun \- "DOt Prompt" Console / runner for the Harbour Language - -.SH SYNOPSIS -\fBhbrun\fP \fB[\fP \fB[]]\fP - -.SH DESCRIPTION -\fBhbrun\fP is "DOt Prompt" console for the Harbour Language. -It can work as interpreter when run without parameters -or can execute xBase/Clipper source code in .prg file or compiled -Harbour Portable Objects (.hrb) given as first parameter. -Type of file is recognized by extension used with \fB\fP -parameter. If not given then .hrb is used. - -.PP -\fBhbrun\fP can be also used to execute .prg files as scripts -It's enough to add in the first line of .prg file: -.PP -\fB#!/usr/bin/hbrun\fP -.PP -and set executable attribute. - -.SH OPTIONS -.IP "\fB-h, -?, --help\fP" 10 -When given as first parameter display help -.PP -This program has no other options. \fB\fP are passed to -startup function in executed code coming from \fB\fP. - -.SH AUTHOR - -Viktor Szakats, Przemyslaw Czerpak, The Harbour Project (http://harbour-project.org) diff --git a/harbour/contrib/hbtest/core.prg b/harbour/contrib/hbtest/core.prg index b98afdf18a..5965b7bb83 100644 --- a/harbour/contrib/hbtest/core.prg +++ b/harbour/contrib/hbtest/core.prg @@ -215,11 +215,16 @@ STATIC FUNCTION XToStr( xValue, lInString ) CASE "D" ; RETURN iif( lInString, "0d" + iif( Empty( xValue ), "00000000", DToS( xValue ) ), 'hb_SToD( "' + DToS( xValue ) + '" )' ) CASE "U" ; RETURN "NIL" CASE "C" - xValue := __StrToExp( xValue ) - RETURN iif( lInString, xValue, '"' + xValue + '"' ) CASE "M" xValue := __StrToExp( xValue ) - RETURN "M:" + iif( lInString, xValue, '"' + xValue + '"' ) + RETURN iif( lInString, xValue, '"' + xValue + '"' ) + CASE "A" + CASE "H" + CASE "O" + IF ! lInString + RETURN hb_ValToExp( xValue, .T. ) + ENDIF + EXIT ENDSWITCH RETURN hb_CStr( xValue ) @@ -229,14 +234,13 @@ STATIC FUNCTION __StrToExp( cStr ) LOCAL cResult := "" LOCAL nLen, nPos - LOCAL nByte, cByte + LOCAL cByte nLen := hb_BLen( cStr ) FOR nPos := 1 TO nLen cByte := hb_BSubStr( cStr, nPos, 1 ) - nByte := hb_BCode( cByte ) - IF ! __ByteIsDisplayable( nByte ) .OR. cByte == '"' - cResult += "\" + __ByteToOctal( nByte ) + IF ! __ByteIsDisplayable( cByte ) .OR. cByte == '"' + cResult += "\" + __ByteEscape( hb_BCode( cByte ) ) ELSE cResult += cByte ENDIF @@ -244,17 +248,24 @@ STATIC FUNCTION __StrToExp( cStr ) RETURN cResult -STATIC FUNCTION __ByteIsDisplayable( nByte ) - RETURN nByte >= 32 .AND. nByte < 128 +STATIC FUNCTION __ByteIsDisplayable( cByte ) + RETURN ; + hb_BCode( cByte ) >= 32 .AND. ; + hb_BCode( cByte ) < 128 -STATIC FUNCTION __ByteToOctal( nValue ) +STATIC FUNCTION __ByteEscape( nByte ) - LOCAL cResult := "" + LOCAL cResult LOCAL nExp - FOR nExp := 2 TO 0 STEP -1 - cResult += SubStr( "01234567", Int( nValue / ( 8 ^ nExp ) ) + 1, 1 ) - nValue %= 8 ^ nExp - NEXT + IF nByte == 0 + RETURN "0" + ELSE + cResult := "" + FOR nExp := 2 TO 0 STEP -1 + cResult += SubStr( "01234567", Int( nByte / ( 8 ^ nExp ) ) + 1, 1 ) + nByte %= 8 ^ nExp + NEXT + ENDIF RETURN cResult diff --git a/harbour/contrib/hbtest/tests/test.prg b/harbour/contrib/hbtest/tests/test.prg index e7fc36c863..a778189c30 100644 --- a/harbour/contrib/hbtest/tests/test.prg +++ b/harbour/contrib/hbtest/tests/test.prg @@ -6,26 +6,49 @@ PROCEDURE Main() - HBTEST 2 + 2 IS 4 - HBTEST "a" + "b" IS "ab" - HBTEST Chr( 0 ) IS Chr( 0 ) - HBTEST 0d20111213 IS 0d20111213 - HBTEST NIL IS NIL - HBTEST .T. IS .T. - HBTEST " " + " " IS " " + LOCAL cTable := hb_FNameExtSet( __FILE__, ".dbf" ) + + dbCreate( cTable, { { "TESTM", "M", 10, 0 } }, NIL, .T., "w_TEST" ) + dbAppend() + w_TEST->TESTM := "hello" + + HBTEST 2 + 2 IS 4 + HBTEST "a" + "b" IS "ab" + HBTEST Chr( 0 ) IS Chr( 0 ) + HBTEST 0d20111213 IS 0d20111213 + HBTEST NIL IS NIL + HBTEST .T. IS .T. + HBTEST " " + " " IS " " + HBTEST w_TEST->TESTM IS "hello" + HBTEST { "a", {} } IS '{"a", {}}' + HBTEST { "a" => 100 } IS '{"a"=>100}' + HBTEST TestObj() IS '__itemSetObjRaw( {NIL, NIL, NIL, "Harbour", NIL, NIL, NIL, NIL, NIL, NIL, NIL, NIL}, {{"ERROR",}} )' /* RTEs */ - HBTEST 2 + "" IS "E 1 BASE 1081 Argument error (+) OS:0 #:0 A:2:N:2;C: F:S" - HBTEST 2 + Chr( 9 ) IS "E 1 BASE 1081 Argument error (+) OS:0 #:0 A:2:N:2;C:\011 F:S" - HBTEST 2 + '"' IS "E 1 BASE 1081 Argument error (+) OS:0 #:0 A:2:N:2;C:\042 F:S" - HBTEST 2 + "'" IS "E 1 BASE 1081 Argument error (+) OS:0 #:0 A:2:N:2;C:' F:S" - HBTEST "" + 0d20111213 IS "E 1 BASE 1081 Argument error (+) OS:0 #:0 A:2:C:;D:0d20111213 F:S" - HBTEST .T. - .F. IS "E 1 BASE 1082 Argument error (-) OS:0 #:0 A:2:L:.T.;L:.F. F:S" + HBTEST 2 + "" IS "E 1 BASE 1081 Argument error (+) OS:0 #:0 A:2:N:2;C: F:S" + HBTEST 2 + Chr( 9 ) IS "E 1 BASE 1081 Argument error (+) OS:0 #:0 A:2:N:2;C:\011 F:S" + HBTEST 2 + '"' IS "E 1 BASE 1081 Argument error (+) OS:0 #:0 A:2:N:2;C:\042 F:S" + HBTEST 2 + "'" IS "E 1 BASE 1081 Argument error (+) OS:0 #:0 A:2:N:2;C:' F:S" + HBTEST "" + 0d20111213 IS "E 1 BASE 1081 Argument error (+) OS:0 #:0 A:2:C:;D:0d20111213 F:S" + HBTEST .T. - .F. IS "E 1 BASE 1082 Argument error (-) OS:0 #:0 A:2:L:.T.;L:.F. F:S" + HBTEST w_TEST->TESTM + 0 IS "E 1 BASE 1081 Argument error (+) OS:0 #:0 A:2:M:hello;N:0 F:S" + HBTEST {} + 0 IS "E 1 BASE 1081 Argument error (+) OS:0 #:0 A:2:A:{ Array of 0 Items };N:0 F:S" /* mismatches */ - HBTEST hb_BChar( 254 ) IS hb_BChar( 255 ) - HBTEST 0d20111213 IS 0d20111214 - HBTEST 2 + 2 IS 5 - HBTEST .T. IS .F. + HBTEST hb_BChar( 254 ) IS hb_BChar( 255 ) + HBTEST 0d20111213 IS 0d20111214 + HBTEST 2 + 2 IS 5 + HBTEST .T. IS .F. + + dbCloseArea() + hb_dbDrop( cTable ) RETURN + +STATIC FUNCTION TestObj() + + LOCAL o := ErrorNew() + + o:description := "Harbour" + + RETURN o diff --git a/harbour/contrib/hbwin/hbwinole.h b/harbour/contrib/hbwin/hbwinole.h index 0546e47b9d..ace132ab74 100644 --- a/harbour/contrib/hbwin/hbwinole.h +++ b/harbour/contrib/hbwin/hbwinole.h @@ -68,7 +68,7 @@ * BCC when used with -P (C++ mode) switch. */ /* -#if defined( __cplusplus ) && !defined( CINTERFACE ) +#if defined( __cplusplus ) && ! defined( CINTERFACE ) #define CINTERFACE 1 #endif */ diff --git a/harbour/contrib/hbwin/tests/olesrv4.prg b/harbour/contrib/hbwin/tests/olesrv4.prg index 2e32811be4..5fbaa47a96 100644 --- a/harbour/contrib/hbwin/tests/olesrv4.prg +++ b/harbour/contrib/hbwin/tests/olesrv4.prg @@ -55,18 +55,18 @@ METHOD ref( p1, p2, p3, p4, p5, p6, p7 ) CLASS OleObjServer CREATE CLASS timerCls - MESSAGE date EXTERN date - MESSAGE time EXTERN time - MESSAGE now EXTERN hb_datetime + MESSAGE date EXTERN Date() + MESSAGE time EXTERN Time() + MESSAGE now EXTERN hb_DateTime() ENDCLASS CREATE CLASS infoCls - MESSAGE os EXTERN os - MESSAGE ver EXTERN version - MESSAGE compiler EXTERN hb_compiler - MESSAGE build EXTERN hb_builddate + MESSAGE os EXTERN OS() + MESSAGE ver EXTERN Version() + MESSAGE compiler EXTERN hb_Compiler() + MESSAGE build EXTERN hb_BuildDate() ENDCLASS diff --git a/harbour/contrib/hbwin/win_tprn.prg b/harbour/contrib/hbwin/win_tprn.prg index ab142c1267..fbaf0deb8e 100644 --- a/harbour/contrib/hbwin/win_tprn.prg +++ b/harbour/contrib/hbwin/win_tprn.prg @@ -188,8 +188,8 @@ CREATE CLASS win_Prn VAR fCharWidth INIT 0 HIDDEN VAR BitmapsOk INIT .F. VAR NumColors INIT 1 - VAR fDuplexType INIT 0 HIDDEN // WIN_DMDUP_SIMPLEX, 22/02/2007 change to 0 to use default printer settings - VAR fPrintQuality INIT 0 HIDDEN // WIN_DMRES_HIGH, 22/02/2007 change to 0 to use default printer settings + VAR fDuplexType INIT 0 HIDDEN + VAR fPrintQuality INIT 0 HIDDEN VAR fNewDuplexType INIT 0 HIDDEN VAR fNewPrintQuality INIT 0 HIDDEN VAR fOldLandScape INIT .F. HIDDEN diff --git a/harbour/contrib/hbxpp/hbxpp.ch b/harbour/contrib/hbxpp/hbxpp.ch index 2693c62254..94f366632a 100644 --- a/harbour/contrib/hbxpp/hbxpp.ch +++ b/harbour/contrib/hbxpp/hbxpp.ch @@ -65,7 +65,7 @@ #if ! defined( XPP_OP_OVERLOAD_OFF ) #pragma -ks+ - REQUEST XPP_OP_OVERLOAD + REQUEST xpp_op_Overload #endif #xtranslate IsPrinter( [] ) => hb_IsPrinter( ) diff --git a/harbour/contrib/rddads/adsfunc.c b/harbour/contrib/rddads/adsfunc.c index d67d7a962a..5627c16e6b 100644 --- a/harbour/contrib/rddads/adsfunc.c +++ b/harbour/contrib/rddads/adsfunc.c @@ -137,7 +137,7 @@ typedef struct ADSHANDLE hConnect; #if ! defined( ADS_LINUX ) PHB_ITEM pCallBack; -#endif /* !ADS_LINUX */ +#endif /* ! ADS_LINUX */ } HB_ADSDATA, * PHB_ADSDATA; #if ! defined( ADS_LINUX ) || defined( HB_ADS_TSD_CONNECTION ) @@ -151,7 +151,7 @@ static void hb_adsThreadRelease( void * cargo ) #if ! defined( ADS_LINUX ) if( pAdsData->pCallBack ) hb_itemRelease( pAdsData->pCallBack ); -#endif /* !ADS_LINUX */ +#endif /* ! ADS_LINUX */ } static HB_TSD_NEW( s_adsData, sizeof( HB_ADSDATA ), NULL, hb_adsThreadRelease ); @@ -219,7 +219,7 @@ static void hb_ads_setCallBack( PHB_ITEM pCallBack ) pAdsData->pCallBack = pCallBack ? hb_itemNew( pCallBack ) : NULL; } -#endif /* !ADS_LINUX */ +#endif /* ! ADS_LINUX */ /* Debug Implicit locks Set/Get call */ HB_FUNC( ADSTESTRECLOCKS ) @@ -1454,7 +1454,7 @@ UNSIGNED32 WINAPI hb_adsShowPercentageCB( UNSIGNED16 usPercentDone ) return 0; } -#endif /* !ADS_LINUX */ +#endif /* ! ADS_LINUX */ HB_FUNC( ADSREGCALLBACK ) { @@ -1478,7 +1478,7 @@ HB_FUNC( ADSREGCALLBACK ) else hb_ads_setCallBack( NULL ); } -#endif /* !ADS_LINUX */ +#endif /* ! ADS_LINUX */ hb_retl( fResult ); } diff --git a/harbour/contrib/rddbm/bmdbfx.c b/harbour/contrib/rddbm/bmdbfx.c index 6712aa8aa5..c3bbc7dfce 100644 --- a/harbour/contrib/rddbm/bmdbfx.c +++ b/harbour/contrib/rddbm/bmdbfx.c @@ -270,7 +270,7 @@ static HB_BOOL hb_bmCheckRecordFilter( AREAP pArea, HB_ULONG ulRecNo ) if( ! lResult && pArea->dbfi.itmCobExpr ) { PHB_ITEM pResult = hb_vmEvalBlock( pArea->dbfi.itmCobExpr ); - lResult = HB_IS_LOGICAL( pResult ) && !hb_itemGetL( pResult ); + lResult = HB_IS_LOGICAL( pResult ) && ! hb_itemGetL( pResult ); } } } diff --git a/harbour/contrib/xhb/hbxml.c b/harbour/contrib/xhb/hbxml.c index ff9dfdf3ab..7e7904b9dc 100644 --- a/harbour/contrib/xhb/hbxml.c +++ b/harbour/contrib/xhb/hbxml.c @@ -2342,7 +2342,7 @@ HB_FUNC( HBXML_NODE_TO_STRING ) out.u.vPtr = ( void * ) sgs; if( mxml_node_write( &out, pNode, iStyle ) == MXML_STATUS_OK ) - hb_retclen_buffer( mxml_sgs_extract( sgs ), sgs->length ); + hb_retclen( mxml_sgs_extract( sgs ), sgs->length ); mxml_sgs_destroy( sgs ); } diff --git a/harbour/contrib/xhb/hterrsys.prg b/harbour/contrib/xhb/hterrsys.prg index ee5929127b..36f50a5f5f 100644 --- a/harbour/contrib/xhb/hterrsys.prg +++ b/harbour/contrib/xhb/hterrsys.prg @@ -70,8 +70,8 @@ #command ? => ?? Chr( 13 ) + Chr( 10 ) ; ?? #command ?? => OutErr( ) -REQUEST HARDCR -REQUEST MEMOWRIT +REQUEST HardCR +REQUEST MemoWrit STATIC s_bFixCorrupt STATIC s_cErrFooter := " " diff --git a/harbour/contrib/xhb/tests/xml1.prg b/harbour/contrib/xhb/tests/xml1.prg index d1fa215104..66905e0edb 100644 --- a/harbour/contrib/xhb/tests/xml1.prg +++ b/harbour/contrib/xhb/tests/xml1.prg @@ -22,7 +22,7 @@ PROCEDURE Main() oDoc := TXMLDocument():New( cString, HBXML_STYLE_NOESCAPE ) IF oDoc:nError != HBXML_ERROR_NONE - WAIT "xml file parsing error " + Str( oDoc:nError ) + WAIT "xml file parsing error " + hb_ntos( oDoc:nError ) RETURN ENDIF diff --git a/harbour/contrib/xhb/xhb.ch b/harbour/contrib/xhb/xhb.ch index c81b1e7186..e2910a8a5d 100644 --- a/harbour/contrib/xhb/xhb.ch +++ b/harbour/contrib/xhb/xhb.ch @@ -59,7 +59,7 @@ #ifndef __XHARBOUR__ #pragma -ks+ - REQUEST XHB_LIB + REQUEST xhb_Lib #xtranslate __Keyboard( [] ) => xhb__Keyboard( ) #xtranslate __CopyFile( [] ) => xhb_CopyFile( ) diff --git a/harbour/doc/c_std.txt b/harbour/doc/c_std.txt index bd58e88ee3..5abe0d7a88 100644 --- a/harbour/doc/c_std.txt +++ b/harbour/doc/c_std.txt @@ -116,7 +116,7 @@ Standard C preprocessor instructions defined by ANSI (ISO/IEC 9899:1990) # ## #define #elif #else #endif #error #if -#if !defined #if defined #ifdef #ifndef +#if ! defined #if defined #ifdef #ifndef #include #line #pragma #undef __DATE__ __FILE__ __LINE__ __STDC__ __TIME__ diff --git a/harbour/doc/en/datetime.txt b/harbour/doc/en/datetime.txt index 29eeeb8db9..f845bc568f 100644 --- a/harbour/doc/en/datetime.txt +++ b/harbour/doc/en/datetime.txt @@ -153,7 +153,8 @@ improper character string is passed to the function, an empty date value will be returned. $EXAMPLES$ - ? CToD( "12/21/00" ) + Set( _SET_DATEFORMAT, "yyyy-mm-dd" ) + ? CToD( "2000-12-21" ) $STATUS$ R $COMPLIANCE$ diff --git a/harbour/doc/en/set.txt b/harbour/doc/en/set.txt index 021c8d83e8..1d40dfea4b 100644 --- a/harbour/doc/en/set.txt +++ b/harbour/doc/en/set.txt @@ -1174,8 +1174,8 @@ Base Century. $DESCRIPTION$ This command sets the base year value for dates that have only two - digits. The default setting is 1900. Dates between 01/01/0100 and - 12/31/2999 are fully supported. + digits. The default setting is 1900. Dates between 0100-01-01 and + 2999-12-31 are fully supported. $EXAMPLES$ SET EPOCH TO 2000 $STATUS$ diff --git a/harbour/doc/oldnews.txt b/harbour/doc/oldnews.txt index ddabb30c9d..374393f923 100644 --- a/harbour/doc/oldnews.txt +++ b/harbour/doc/oldnews.txt @@ -1388,7 +1388,7 @@ API because we will have to reduce functionality (supported date range) to reach it. In Clipper STOD(DTOS()) is not revertible, it is revertible in [x]Harbour for the whole supported in string - conversion range: 0000/01/01 : 9999/01/01. + conversion range: 0000-01-01 : 9999-01-01. - Fixed possible GPF in CTOD when badly formated date is given. - Optimized hb_dateEncode(). - Fixed RT error number in hb_vmAddInt() for negative values to be diff --git a/harbour/extras/gfspell/spell.prg b/harbour/extras/gfspell/spell.prg index fe29451662..67f606a45d 100644 --- a/harbour/extras/gfspell/spell.prg +++ b/harbour/extras/gfspell/spell.prg @@ -1090,7 +1090,7 @@ FUNCTION DBF2Dic( cDbf, cDictionary, lTalk ) // Create the dictionary file // - // ADDED - 02/08/96 - JAMES + // ADDED - 1996-02-08 - JAMES IF t_nHandle != F_ERROR // Is dictionary already open? FClose( t_nHandle ) // Yes, close it t_nHandle := F_ERROR diff --git a/harbour/extras/gtwvw/docs/funclist.txt b/harbour/extras/gtwvw/docs/funclist.txt index 915dae7b36..ea8359e79a 100644 --- a/harbour/extras/gtwvw/docs/funclist.txt +++ b/harbour/extras/gtwvw/docs/funclist.txt @@ -111,7 +111,7 @@ read the source code :-). //example: saved := wvw_nSetCurWindow(0) // ? "This will be displayed in Main Window" // wvw_nSetCurWindow(saved) -//notes: makes sense only if !s_bMainCoordMode +//notes: makes sense only if ! s_bMainCoordMode // //wvw_nRowOfs( [nWinNum] ) @@ -615,11 +615,11 @@ PART-2: WINDOW DEPENDENT (additional nWinNum parameter) which window to direct your output to. nWinNum parameter passed as NIL will be translated by gtwvw into : - if !MainCoordMode + IF ! MainCoordMode Current Window - else + ELSE Topmost Window - endif + ENDIF // diff --git a/harbour/extras/gtwvw/docs/gtwvw.txt b/harbour/extras/gtwvw/docs/gtwvw.txt index ad3924d2cf..e6a3a6715f 100644 --- a/harbour/extras/gtwvw/docs/gtwvw.txt +++ b/harbour/extras/gtwvw/docs/gtwvw.txt @@ -155,7 +155,7 @@ VERSION INFO This document is written when GTWVW version info is as follows. -Latest Update: 2004/10/25 +Latest Update: 2004-10-25 Latest Sync with: diff --git a/harbour/extras/gtwvw/hbgtwvw.h b/harbour/extras/gtwvw/hbgtwvw.h index 59270043fa..cb56d4511a 100644 --- a/harbour/extras/gtwvw/hbgtwvw.h +++ b/harbour/extras/gtwvw/hbgtwvw.h @@ -231,7 +231,7 @@ typedef __int64 LONG_PTR; */ #define WVW_DEFAULT_MAX_BMCACHE 20 -/* Como as descricoes sao grandes, precisei aumetar isso - Peluffo - 26/10/2007 +/* Como as descricoes sao grandes, precisei aumetar isso - Peluffo - 2007-10-26 #define WVW_TB_LABELMAXLENGTH 40 */ #define WVW_TB_LABELMAXLENGTH 100 diff --git a/harbour/extras/gtwvw/tests/ebtest7.prg b/harbour/extras/gtwvw/tests/ebtest7.prg index 44f4253970..807e9a854d 100644 --- a/harbour/extras/gtwvw/tests/ebtest7.prg +++ b/harbour/extras/gtwvw/tests/ebtest7.prg @@ -234,7 +234,7 @@ FUNCTION AddEBGet( aEBGets, mnrow, mncol, mxValue, mcVarName, mbAssign, mcLabel, mcPict := iif( HB_ISSTRING( mcPict ), mcPict, "999,999,999.99" ) mbText := {|| Transform( mxValue, mcPict ) } CASE mcVarType == "D" - mcPict := iif( HB_ISSTRING( mcPict ), mcPict, "99/99/9999" ) + mcPict := iif( HB_ISSTRING( mcPict ), mcPict, "9999-99-99" ) mbText := {|| DToC( mxValue ) } OTHERWISE // unsupported valtype @@ -582,7 +582,7 @@ STATIC PROCEDURE ProcessCharMask( mnwinnum, mnebid, mcvaltype, mcpict ) IF mcvaltype == "N" Mask := GetNumMask( mcpict, mcvaltype ) ELSEIF mcvaltype == "D" - Mask := mcpict // "99/99/9999" + Mask := mcpict // "9999-99-99" ELSE Mask := mcpict ENDIF diff --git a/harbour/extras/gtwvw/wvwdraw.c b/harbour/extras/gtwvw/wvwdraw.c index 7ada37b5bb..0ca05a9cda 100644 --- a/harbour/extras/gtwvw/wvwdraw.c +++ b/harbour/extras/gtwvw/wvwdraw.c @@ -1807,7 +1807,7 @@ HB_FUNC( WVW_DRAWRECTANGLE ) usLeft = ( USHORT ) hb_parni( 3 ), usBottom = ( USHORT ) hb_parni( 4 ), usRight = ( USHORT ) hb_parni( 5 ); - // Ref.: 28454 - Marson de Paula - 11/27/2007 + // Ref.: 28454 - Marson de Paula - 2007-11-27 BOOL bUsaCurrentPen = HB_ISNIL( 7 ) ? TRUE : hb_parl( 7 ); iOffTop = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 1 ) : 0; @@ -1830,7 +1830,7 @@ HB_FUNC( WVW_DRAWRECTANGLE ) iRight = xy.x - 1 + iOffRight; SelectObject( pWindowData->hdc, s_sApp->currentBrush ); - // Ref.: 28454 - Marson de Paula - 11/27/2007 + // Ref.: 28454 - Marson de Paula - 2007-11-27 if( bUsaCurrentPen ) SelectObject( pWindowData->hdc, s_sApp->currentPen ); else diff --git a/harbour/extras/gtwvw/wvwpush.c b/harbour/extras/gtwvw/wvwpush.c index 11446ade40..d080b3ba87 100644 --- a/harbour/extras/gtwvw/wvwpush.c +++ b/harbour/extras/gtwvw/wvwpush.c @@ -262,25 +262,19 @@ HB_FUNC( WVW_PBSETCODEBLOCK ) if( ! phiCodeBlock || pcd == NULL || pcd->bBusy ) { - /* - if (!HB_ISBLOCK(3)) - { +#if 0 + if( ! HB_ISBLOCK( 3 ) ) MessageBox( NULL, TEXT( "Codeblock Expected" ), pData->szAppName, MB_ICONERROR ); - } - if (pcd==NULL) - { + if( pcd == NULL ) MessageBox( NULL, TEXT( "Control Data not Found" ), pData->szAppName, MB_ICONERROR ); - } - if (pcd->bBusy) - { + if( pcd->bBusy ) MessageBox( NULL, TEXT( "Codeblock is busy" ), pData->szAppName, MB_ICONERROR ); - } - */ +#endif hb_retl( FALSE ); return; diff --git a/harbour/extras/httpsrv/uhttpd.prg b/harbour/extras/httpsrv/uhttpd.prg index 0340bbf53e..32a3d45453 100644 --- a/harbour/extras/httpsrv/uhttpd.prg +++ b/harbour/extras/httpsrv/uhttpd.prg @@ -96,7 +96,9 @@ REQUEST __HB_EXTERN__ #if defined( HBMK_HAS_HBGD ) // adding GD support -REQUEST GDIMAGE, GDIMAGECHAR, GDCHART +REQUEST GDChart +REQUEST GDImage +REQUEST GDImageCHAR # define APP_GD_SUPPORT "_GD" # stdout "Lib GD support enabled" #else @@ -286,11 +288,11 @@ PROCEDURE Main( ... ) nCmdConsoleCols := Val( hb_PValue( i++ ) ) CASE cPar == "--help" .OR. Lower( cPar ) == "-h" .OR. cPar == "-?" - help() + Help() RETURN OTHERWISE - help() + Help() RETURN ENDCASE ENDDO diff --git a/harbour/include/hb_io.h b/harbour/include/hb_io.h index 2462b7f14b..1456d72bf9 100644 --- a/harbour/include/hb_io.h +++ b/harbour/include/hb_io.h @@ -59,10 +59,10 @@ #if defined( __DJGPP__ ) || defined( __EMX__ ) #include #endif -#elif !defined( HB_OS_WIN_CE ) +#elif ! defined( HB_OS_WIN_CE ) #include #endif -#if defined( HB_OS_DOS ) && !defined( __RSX32__ ) +#if defined( HB_OS_DOS ) && ! defined( __RSX32__ ) #include #endif diff --git a/harbour/include/hbapifs.h b/harbour/include/hbapifs.h index 87cc998120..45f4ad8cc4 100644 --- a/harbour/include/hbapifs.h +++ b/harbour/include/hbapifs.h @@ -197,14 +197,14 @@ extern HB_EXPORT char * hb_fsLinkRead ( const char * pszFileName ); /* re #define hb_fsFLock( h, s, l ) hb_fsLock( h, s, l, FL_LOCK ) #define hb_fsFUnlock( h, s, l ) hb_fsLock( h, s, l, FL_UNLOCK ) -#if defined( HB_OS_UNIX ) && !defined( HB_USE_SHARELOCKS_OFF ) +#if defined( HB_OS_UNIX ) && ! defined( HB_USE_SHARELOCKS_OFF ) # define HB_USE_SHARELOCKS # define HB_SHARELOCK_POS 0x7fffffffUL # define HB_SHARELOCK_SIZE 0x1UL # if defined( HB_USE_BSDLOCKS_OFF ) # undef HB_USE_BSDLOCKS # elif defined( HB_OS_LINUX ) && \ - !defined( __WATCOMC__ ) && !defined( HB_USE_BSDLOCKS ) + ! defined( __WATCOMC__ ) && ! defined( HB_USE_BSDLOCKS ) /* default usage of BSD locks in *BSD systems for emulating * MS-DOS/Windows DENY_* flags has been disabled because tests * on FreeBSD 6.2 and OS X shows that this implementation diff --git a/harbour/include/hbapigt.h b/harbour/include/hbapigt.h index 25332841c2..18572b7bc3 100644 --- a/harbour/include/hbapigt.h +++ b/harbour/include/hbapigt.h @@ -120,7 +120,7 @@ HB_EXTERN_BEGIN #define HB_B_FULL_W { 0x2588, 0x2588, 0x2588, 0x2588, 0x2588, 0x2588, 0x2588, 0x2588, 0x0000 } -#if defined( HB_COMPAT_C53 ) && !defined( HB_CLP_STRICT ) +#if defined( HB_COMPAT_C53 ) && ! defined( HB_CLP_STRICT ) # define HB_DEFAULT_INKEY_BUFSIZE 50 #else # define HB_DEFAULT_INKEY_BUFSIZE 15 diff --git a/harbour/include/hbassert.h b/harbour/include/hbassert.h index 6e9dd8ac00..d202de5e3c 100644 --- a/harbour/include/hbassert.h +++ b/harbour/include/hbassert.h @@ -55,9 +55,9 @@ #include "hbapi.h" -#if ( defined( HB_OS_WIN_CE ) && defined( _MSC_VER ) ) || !defined( HB_TR_LEVEL_DEBUG ) +#if ( defined( HB_OS_WIN_CE ) && defined( _MSC_VER ) ) || ! defined( HB_TR_LEVEL_DEBUG ) #ifndef assert - #define assert(exp) ((void)0) + #define assert( exp ) ( ( void ) 0 ) #endif #else #include diff --git a/harbour/include/hbatomic.h b/harbour/include/hbatomic.h index 3a7ec7ec13..b4fb1721bb 100644 --- a/harbour/include/hbatomic.h +++ b/harbour/include/hbatomic.h @@ -94,7 +94,7 @@ HB_EXTERN_BEGIN # if defined( HB_USE_GCCATOMIC_OFF ) # undef HB_USE_GCCATOMIC # elif ( ( __GNUC__ > 4 ) || ( __GNUC__ == 4 && __GNUC_MINOR__ >= 1) ) && \ - !defined( __MINGW32CE__ ) && !defined( HB_USE_GCCATOMIC ) + ! defined( __MINGW32CE__ ) && ! defined( HB_USE_GCCATOMIC ) # define HB_USE_GCCATOMIC # endif @@ -170,10 +170,10 @@ HB_EXTERN_BEGIN { for( ;; ) { - if( !hb_spinlock_trylock( l ) ) + if( ! hb_spinlock_trylock( l ) ) return; #ifdef HB_SPINLOCK_REPEAT - if( !hb_spinlock_trylock( l ) ) + if( ! hb_spinlock_trylock( l ) ) return; #endif HB_SCHED_YIELD(); @@ -202,11 +202,11 @@ HB_EXTERN_BEGIN { for( ;; ) { - if( !__sync_lock_test_and_set( l, 1 ) ) + if( ! __sync_lock_test_and_set( l, 1 ) ) return; #ifdef HB_SPINLOCK_REPEAT - if( !__sync_lock_test_and_set( l, 1 ) ) + if( ! __sync_lock_test_and_set( l, 1 ) ) return; #endif HB_SCHED_YIELD(); @@ -338,11 +338,11 @@ HB_EXTERN_BEGIN { for( ;; ) { - if( !hb_spinlock_trylock( l ) ) + if( ! hb_spinlock_trylock( l ) ) return; #ifdef HB_SPINLOCK_REPEAT - if( !hb_spinlock_trylock( l ) ) + if( ! hb_spinlock_trylock( l ) ) return; #endif HB_SCHED_YIELD(); @@ -368,7 +368,7 @@ HB_EXTERN_BEGIN #if defined( HB_OS_WIN ) /* Atomic operations on memory reference counters */ -# if !defined( HB_ATOM_INC ) || !defined( HB_ATOM_DEC ) +# if ! defined( HB_ATOM_INC ) || ! defined( HB_ATOM_DEC ) # undef HB_ATOM_DEC # undef HB_ATOM_INC # undef HB_ATOM_GET @@ -387,17 +387,17 @@ HB_EXTERN_BEGIN # endif /* Spin locks */ -# if !defined( HB_SPINLOCK_T ) +# if ! defined( HB_SPINLOCK_T ) # define HB_SPINLOCK_T volatile LONG # define HB_SPINLOCK_INIT 0 -# define HB_SPINLOCK_TRY(l) (!InterlockedExchange( (LONG*)(l), 1 )) +# define HB_SPINLOCK_TRY(l) (! InterlockedExchange( (LONG*)(l), 1 )) # define HB_SPINLOCK_RELEASE(l) ( *(l) = 0 ) # endif #elif defined( HB_OS_DARWIN ) /* Atomic operations on memory reference counters */ -# if !defined( HB_ATOM_INC ) || !defined( HB_ATOM_DEC ) +# if ! defined( HB_ATOM_INC ) || ! defined( HB_ATOM_DEC ) # undef HB_ATOM_DEC # undef HB_ATOM_INC # undef HB_ATOM_GET @@ -416,7 +416,7 @@ HB_EXTERN_BEGIN # endif /* Spin locks */ -# if !defined( HB_SPINLOCK_T ) || 1 /* <= force using OSSpinLock */ +# if ! defined( HB_SPINLOCK_T ) || 1 /* <= force using OSSpinLock */ # undef HB_SPINLOCK_T # undef HB_SPINLOCK_INIT # undef HB_SPINLOCK_TRY @@ -432,7 +432,7 @@ HB_EXTERN_BEGIN #elif defined( HB_OS_SUNOS ) /* Atomic operations on memory reference counters */ -# if !defined( HB_ATOM_INC ) || !defined( HB_ATOM_DEC ) +# if ! defined( HB_ATOM_INC ) || ! defined( HB_ATOM_DEC ) # undef HB_ATOM_DEC # undef HB_ATOM_INC # undef HB_ATOM_GET @@ -444,7 +444,7 @@ HB_EXTERN_BEGIN # endif /* Spin locks */ -# if !defined( HB_SPINLOCK_T ) +# if ! defined( HB_SPINLOCK_T ) # define HB_SPINLOCK_T volatile uint_t # define HB_SPINLOCK_INIT 0 # define HB_SPINLOCK_TRY(l) ( ! atomic_swap_uint( (l), 1 ) ) @@ -454,7 +454,7 @@ HB_EXTERN_BEGIN #endif /* HB_OS_??? */ #if defined( HB_SPINLOCK_T ) -# if !defined( HB_SPINLOCK_ACQUIRE ) +# if ! defined( HB_SPINLOCK_ACQUIRE ) # ifdef HB_SPINLOCK_REPEAT # define HB_SPINLOCK_ACQUIRE(l) do { \ if( HB_SPINLOCK_TRY( l ) ) \ @@ -471,7 +471,7 @@ HB_EXTERN_BEGIN } while(1) # endif # endif -# if !defined( HB_SPINLOCK_R ) +# if ! defined( HB_SPINLOCK_R ) struct hb_spinlock_r { HB_SPINLOCK_T lock; @@ -578,7 +578,7 @@ HB_EXTERN_BEGIN # define HB_SPINLOCK_TRY_R(l) hb_spinlock_try_r(l) # define HB_SPINLOCK_RELEASE_R(l) hb_spinlock_release_r(l) # define HB_SPINLOCK_ACQUIRE_R(l) hb_spinlock_acquire_r(l) -# endif /* !HB_SPINLOCK_R */ +# endif /* ! HB_SPINLOCK_R */ #endif /* HB_SPINLOCK_T */ HB_EXTERN_END diff --git a/harbour/include/hbcdpreg.h b/harbour/include/hbcdpreg.h index 80d8d8e75f..e75175ad93 100644 --- a/harbour/include/hbcdpreg.h +++ b/harbour/include/hbcdpreg.h @@ -74,9 +74,9 @@ HB_CALL_ON_STARTUP_BEGIN( HB_MACRONAME_JOIN( _hb_codepage_Init_, HB_CP_ID ) ) #define HB_CP_PUT_FUNC NULL #define HB_CP_LEN_FUNC NULL #endif - #if !defined( HB_CP_UPPER_FUNC ) && \ - !defined( HB_CP_LOWER_FUNC ) && \ - !defined( HB_CP_FLAG_FUNC ) + #if ! defined( HB_CP_UPPER_FUNC ) && \ + ! defined( HB_CP_LOWER_FUNC ) && \ + ! defined( HB_CP_FLAG_FUNC ) #define HB_CP_UPPER_FUNC NULL #define HB_CP_LOWER_FUNC NULL #define HB_CP_FLAGS_FUNC NULL diff --git a/harbour/include/hbcomp.h b/harbour/include/hbcomp.h index 6ca68ddb86..bb4af199f2 100644 --- a/harbour/include/hbcomp.h +++ b/harbour/include/hbcomp.h @@ -253,7 +253,7 @@ extern HB_BOOL hb_compCheckUnclosedStru( HB_COMP_DECL, PHB_HFUNC ); #define hb_compWarnMeaningless( p, x ) #define hb_compErrorMacro( p, x ) -#elif !defined( HB_COMMON_SUPPORT ) +#elif ! defined( HB_COMMON_SUPPORT ) #define HB_GEN_FUNC1( func, p1 ) hb_compGen##func( p1, HB_COMP_PARAM ) #define HB_GEN_FUNC2( func, p1,p2 ) hb_compGen##func( p1, p2, HB_COMP_PARAM ) diff --git a/harbour/include/hbcompdf.h b/harbour/include/hbcompdf.h index 0aeedbfe04..b988709b5f 100644 --- a/harbour/include/hbcompdf.h +++ b/harbour/include/hbcompdf.h @@ -853,7 +853,7 @@ typedef struct extern PHB_COMP hb_comp_new( void ); extern void hb_comp_free( PHB_COMP ); -#endif /* !HB_MACRO_SUPPORT */ +#endif /* ! HB_MACRO_SUPPORT */ typedef struct _HB_COMP_FUNCS { diff --git a/harbour/include/hbdate.h b/harbour/include/hbdate.h index a90b41e4e8..44d4c916e6 100644 --- a/harbour/include/hbdate.h +++ b/harbour/include/hbdate.h @@ -155,7 +155,7 @@ HB_EXTERN_END defined( _BSD_SOURCE ) || defined( _SVID_SOURCE ) || \ defined( HB_OS_SUNOS ) || defined( HB_OS_BEOS ) || \ defined( HB_OS_ANDROID ) ) && \ - ! defined( HB_OS_DARWIN_5 ) && !defined( HB_HAS_LOCALTIME_R ) + ! defined( HB_OS_DARWIN_5 ) && ! defined( HB_HAS_LOCALTIME_R ) # define HB_HAS_LOCALTIME_R #endif diff --git a/harbour/include/hbdefs.h b/harbour/include/hbdefs.h index 7f43b19251..b5970be33f 100644 --- a/harbour/include/hbdefs.h +++ b/harbour/include/hbdefs.h @@ -197,7 +197,7 @@ /* Basic types */ #define HB_FALSE 0 -#define HB_TRUE (!0) +#define HB_TRUE ( ! 0 ) typedef int HB_BOOL; typedef signed char HB_SCHAR; @@ -356,7 +356,7 @@ typedef HB_UCHAR HB_U8; #undef FALSE #define FALSE 0 #undef TRUE - #define TRUE (!0) + #define TRUE ( ! 0 ) #undef UINT /* varies with platform */ typedef HB_UINT UINT; diff --git a/harbour/include/hbexprop.h b/harbour/include/hbexprop.h index a01add1318..0831ab828b 100644 --- a/harbour/include/hbexprop.h +++ b/harbour/include/hbexprop.h @@ -67,7 +67,7 @@ typedef HB_EXPR_FUNC( ( * PHB_EXPR_FUNC ) ); #define hb_comp_ExprTable hb_macro_ExprTable #endif -#if !defined( HB_COMMON_SUPPORT ) +#if ! defined( HB_COMMON_SUPPORT ) extern const PHB_EXPR_FUNC hb_comp_ExprTable[ HB_EXPR_COUNT ]; #define HB_EXPR_USE( pSelf, iMessage ) \ hb_comp_ExprTable[ (pSelf)->ExprType ]( (pSelf), (iMessage), HB_COMP_PARAM ) diff --git a/harbour/include/hbfloat.h b/harbour/include/hbfloat.h index de6e0b8c08..a87efd5cd0 100644 --- a/harbour/include/hbfloat.h +++ b/harbour/include/hbfloat.h @@ -64,7 +64,7 @@ /* workaround for some missing C99 math macros in SunOS GCC * used in C++ mode */ -#if !defined( __C99FEATURES__ ) && defined( __GNUC__ ) && defined( __sun__ ) +#if ! defined( __C99FEATURES__ ) && defined( __GNUC__ ) && defined( __sun__ ) # define __C99FEATURES__ #endif @@ -83,7 +83,7 @@ #endif -#if defined( HB_LONG_DOUBLE_OFF ) && !defined( __NO_LONGDOUBLE__ ) +#if defined( HB_LONG_DOUBLE_OFF ) && ! defined( __NO_LONGDOUBLE__ ) # define __NO_LONGDOUBLE__ #endif @@ -154,7 +154,7 @@ ( isinf( d ) < 0 ? _HB_NUM_NINF : \ _HB_NUM_PINF ) ) ); \ } while( 0 ) -# if !defined( __NO_LONGDOUBLE__ ) && !defined( HB_OS_SUNOS ) +# if ! defined( __NO_LONGDOUBLE__ ) && ! defined( HB_OS_SUNOS ) # define HB_NUMTYPEL( v, d ) do { \ v = ( finitel( d ) ? 0 : \ ( isnanl( d ) ? _HB_NUM_NAN : \ @@ -179,7 +179,7 @@ ( _isnan( d ) ? _HB_NUM_NAN : \ _HB_NUM_PINF ) ); \ } while( 0 ) -# if !defined( __NO_LONGDOUBLE__ ) +# if ! defined( __NO_LONGDOUBLE__ ) # define HB_NUMTYPEL( v, d ) do { \ v = ( _finitel( d ) ? 0 : \ ( _isnanl( d ) ? _HB_NUM_NAN : \ @@ -218,7 +218,7 @@ #endif -#if !defined( HB_NUMTYPEL ) +#if ! defined( HB_NUMTYPEL ) # define HB_NUMTYPEL( v, d ) HB_NUMTYPE( v, d ) #endif diff --git a/harbour/include/hbinit.h b/harbour/include/hbinit.h index 18548e94f5..3554c69726 100644 --- a/harbour/include/hbinit.h +++ b/harbour/include/hbinit.h @@ -62,9 +62,9 @@ extern HB_EXPORT PHB_SYMB hb_vmProcessSymbols( PHB_SYMB pSymbols, HB_USHORT uiSy #define HB_INIT_SYMBOLS_END( func ) HB_INIT_SYMBOLS_EX_END( func, __FILE__, 0L, 0x0000 ) /* By default in all C++ builds use static vars initialization as startup code */ -#if defined( __cplusplus ) && !defined( HB_STATIC_STARTUP ) && \ - !defined( HB_PRAGMA_STARTUP ) && !defined( HB_GNUC_STARTUP ) && \ - !defined( HB_INITSEG_STARTUP ) && !defined( HB_DATASEG_STARTUP ) +#if defined( __cplusplus ) && ! defined( HB_STATIC_STARTUP ) && \ + ! defined( HB_PRAGMA_STARTUP ) && ! defined( HB_GNUC_STARTUP ) && \ + ! defined( HB_INITSEG_STARTUP ) && ! defined( HB_DATASEG_STARTUP ) #define HB_STATIC_STARTUP #endif @@ -207,7 +207,7 @@ extern HB_EXPORT PHB_SYMB hb_vmProcessSymbols( PHB_SYMB pSymbols, HB_USHORT uiSy defined( __BORLANDC__ ) || defined( __LCC__ ) || \ defined( __POCC__ ) || defined( __XCC__ ) - #if !defined( HB_PRAGMA_STARTUP ) + #if ! defined( HB_PRAGMA_STARTUP ) #define HB_PRAGMA_STARTUP #endif diff --git a/harbour/include/hbmather.h b/harbour/include/hbmather.h index f133ddf379..ce10105b2c 100644 --- a/harbour/include/hbmather.h +++ b/harbour/include/hbmather.h @@ -87,12 +87,12 @@ HB_EXTERN_BEGIN #define matherr _matherr #define exception _exception #elif defined( __DJGPP__ ) - #if !defined( __cplusplus ) + #if ! defined( __cplusplus ) #define HB_MATH_HANDLER #endif #endif -#if !defined( HB_MATH_HANDLER ) && \ +#if ! defined( HB_MATH_HANDLER ) && \ ( defined( __GNUC__ ) || defined( HB_OS_UNIX ) ) #define HB_MATH_ERRNO #endif diff --git a/harbour/include/hbsetup.h b/harbour/include/hbsetup.h index 90e0ae02bd..7aa72dd6d5 100644 --- a/harbour/include/hbsetup.h +++ b/harbour/include/hbsetup.h @@ -515,7 +515,7 @@ * Extern "C" detection */ -#if defined( __cplusplus ) && !defined( __IBMCPP__ ) +#if defined( __cplusplus ) && ! defined( __IBMCPP__ ) #define HB_EXTERN_C extern "C" #define HB_EXTERN_BEGIN extern "C" { #define HB_EXTERN_END } @@ -544,17 +544,17 @@ #define HB_NORETURN_ATTR # endif # if ( ( __GNUC__ > 4 ) || ( __GNUC__ == 4 && __GNUC_MINOR__ >= 1 ) ) && \ - !defined( __ICC ) && !defined( __clang__ ) && \ - !defined( __PCC__ ) && \ - !defined( HB_OS_ANDROID ) && \ - !defined( HB_NO_FLATTEN ) + ! defined( __ICC ) && ! defined( __clang__ ) && \ + ! defined( __PCC__ ) && \ + ! defined( HB_OS_ANDROID ) && \ + ! defined( HB_NO_FLATTEN ) #define HB_FLATTEN_ATTR \ __attribute__ (( flatten )) # else #define HB_FLATTEN_ATTR # endif # if ( ( __GNUC__ > 4 ) || ( __GNUC__ == 4 && __GNUC_MINOR__ >= 3 ) ) && \ - !defined( __ICC ) && !defined( __OPENCC__ ) + ! defined( __ICC ) && ! defined( __OPENCC__ ) #define HB_ALLOC_SIZE_ATTR( _nParam ) \ __attribute__ (( alloc_size (_nParam))) #define HB_HOT_ATTR \ diff --git a/harbour/include/hbstack.h b/harbour/include/hbstack.h index 5a9db75012..cba46d51da 100644 --- a/harbour/include/hbstack.h +++ b/harbour/include/hbstack.h @@ -191,7 +191,7 @@ typedef struct #if defined( _HB_STACK_MACROS_ ) # if defined( HB_MT_VM ) # if defined( HB_USE_TLS ) -# if !defined( _HB_STACK_LOCAL_MACROS_ ) +# if ! defined( _HB_STACK_LOCAL_MACROS_ ) # if defined( __BORLANDC__ ) extern PHB_STACK HB_TLS_ATTR hb_stack_ptr; # else @@ -199,11 +199,11 @@ typedef struct # endif # endif # else -# if !defined( _HB_STACK_LOCAL_MACROS_ ) +# if ! defined( _HB_STACK_LOCAL_MACROS_ ) extern HB_TLS_KEY hb_stack_key; # endif # if defined( __BORLANDC__ ) && defined( HB_STACK_PRELOAD ) && \ - !defined( HB_OS_WIN_64 ) && !defined( HB_OS_WIN_CE ) && \ + ! defined( HB_OS_WIN_64 ) && ! defined( HB_OS_WIN_CE ) && \ defined( HB_ASM_TLS ) # if defined( _HB_STACK_LOCAL_MACROS_ ) static HB_TLS_KEY hb_stack_key; @@ -221,7 +221,7 @@ typedef struct } # define hb_stack_ptr_get() hb_stack_ptr_from_tls() # elif defined( __MINGW32__ ) && defined( HB_ASM_TLS ) && \ - !defined( HB_OS_WIN_64 ) && !defined( HB_OS_WIN_CE ) + ! defined( HB_OS_WIN_64 ) && ! defined( HB_OS_WIN_CE ) # if defined( _HB_STACK_LOCAL_MACROS_ ) static HB_TLS_KEY hb_stack_key; # endif @@ -239,11 +239,11 @@ typedef struct # define hb_stack_ptr_get() hb_stack_ptr_from_tls() # define hb_stack_ptr ( ( PHB_STACK ) hb_stack_ptr_from_tls() ) # endif -# if !defined( hb_stack_ptr ) +# if ! defined( hb_stack_ptr ) # define hb_stack_ptr ( ( PHB_STACK ) hb_tls_get( hb_stack_key ) ) # endif # endif -# if defined( HB_STACK_PRELOAD ) && !defined( HB_USE_TLS ) +# if defined( HB_STACK_PRELOAD ) && ! defined( HB_USE_TLS ) # if defined( hb_stack_ptr_get ) # define HB_STACK_TLS_RELOAD _hb_stack_ptr_ = ( PHB_STACK ) hb_stack_ptr_get(); # undef hb_stack_ptr @@ -258,13 +258,13 @@ typedef struct # define hb_stack_ref() ( hb_stack_ptr ) # endif # else -# if !defined( _HB_STACK_LOCAL_MACROS_ ) +# if ! defined( _HB_STACK_LOCAL_MACROS_ ) extern HB_STACK hb_stack; # endif # define hb_stack_ref() ( &hb_stack ) # endif #endif -#if !defined( HB_STACK_TLS_PRELOAD ) +#if ! defined( HB_STACK_TLS_PRELOAD ) # if defined( HB_STACK_PRELOAD ) # define HB_STACK_TLS_PRELOAD # define HB_STACK_TLS_RELOAD diff --git a/harbour/include/hbthread.h b/harbour/include/hbthread.h index d7a6ce4069..005c187d4f 100644 --- a/harbour/include/hbthread.h +++ b/harbour/include/hbthread.h @@ -75,7 +75,7 @@ # endif #elif defined( HB_OS_WIN ) # include -# if !defined( HB_OS_WIN_CE ) +# if ! defined( HB_OS_WIN_CE ) # include # endif #elif defined( HB_OS_OS2 ) @@ -155,25 +155,25 @@ HB_EXTERN_BEGIN # define HB_COND_OS_SUPPORT /* OS support for conditional variables */ # undef HB_COND_HARBOUR_SUPPORT -# if defined( PTHREAD_MUTEX_INITIALIZER ) && !defined( HB_CRITICAL_NEED_INIT ) +# if defined( PTHREAD_MUTEX_INITIALIZER ) && ! defined( HB_CRITICAL_NEED_INIT ) typedef pthread_mutex_t HB_CRITICAL_T; # define HB_CRITICAL_NEW( name ) HB_CRITICAL_T name = PTHREAD_MUTEX_INITIALIZER # define HB_CRITICAL_GET(v) ( v ) # else /* platform does not support static mutex initialization */ -# if !defined( HB_CRITICAL_NEED_INIT ) +# if ! defined( HB_CRITICAL_NEED_INIT ) # define HB_CRITICAL_NEED_INIT # endif # define HB_CRITICAL_GET(v) ( &( (v)->critical.value ) ) # endif -# if defined( PTHREAD_COND_INITIALIZER ) && !defined( HB_COND_NEED_INIT ) +# if defined( PTHREAD_COND_INITIALIZER ) && ! defined( HB_COND_NEED_INIT ) typedef pthread_cond_t HB_COND_T; # define HB_COND_NEW( name ) HB_COND_T name = PTHREAD_COND_INITIALIZER # define HB_COND_GET(v) ( v ) # else /* platform does not support static condition var initialization */ -# if !defined( HB_COND_NEED_INIT ) +# if ! defined( HB_COND_NEED_INIT ) # define HB_COND_NEED_INIT # endif # define HB_COND_GET(v) ( &( (v)->cond.value ) ) @@ -187,7 +187,7 @@ HB_EXTERN_BEGIN typedef HANDLE HB_OSCOND_T; # if defined( HB_OS_WIN_CE ) && \ - ( ( defined( __MINGW32CE__ ) && !defined( __MSVCRT__ ) ) || \ + ( ( defined( __MINGW32CE__ ) && ! defined( __MSVCRT__ ) ) || \ defined( __POCC__ ) ) || \ ( defined( _MSC_VER ) && ( _MSC_VER <= 1500 ) ) # define HB_THREAD_RAWWINAPI @@ -446,18 +446,18 @@ extern HB_BOOL hb_threadMutexSyncWait( PHB_ITEM pItemMtx, HB_ULONG ulMilliSec, P #if defined( HB_NO_TLS ) || defined( HB_TASK_THREAD ) # undef HB_USE_TLS -#elif !defined( HB_USE_TLS ) +#elif ! defined( HB_USE_TLS ) /* enable native compiler TLS support by default for this compilers * which are known that it will work correctly */ -# if ( defined( _MSC_VER ) && ( _MSC_VER > 1500 ) ) && !defined( __POCC__ ) && !defined( __XCC__ ) +# if ( defined( _MSC_VER ) && ( _MSC_VER > 1500 ) ) && ! defined( __POCC__ ) && ! defined( __XCC__ ) # define HB_USE_TLS # elif defined( __GNUC__ ) && __GNUC__ >= 3 && \ defined( __GLIBC__ ) && defined( __GLIBC_MINOR__ ) && \ ( __GLIBC__ > 2 || ( __GLIBC__ == 2 && __GLIBC_MINOR__ >= 6 ) ) && \ defined( HB_OS_LINUX ) && \ ( defined( __i386__ ) || defined( __x86_64__ ) ) && \ - !defined( __OPENCC__ ) + ! defined( __OPENCC__ ) # define HB_USE_TLS # endif #endif @@ -495,7 +495,7 @@ extern HB_BOOL hb_threadMutexSyncWait( PHB_ITEM pItemMtx, HB_ULONG ulMilliSec, P # define hb_tls_set(k,v) do { *k = ( ULONG ) (v); } while( 0 ) # define hb_tls_get(k) ( *k ) # endif -#endif /* !HB_USE_TLS */ +#endif /* ! HB_USE_TLS */ #endif /* HB_MT_VM */ diff --git a/harbour/include/hbvmint.h b/harbour/include/hbvmint.h index eb89f15f5a..2c1da5e399 100644 --- a/harbour/include/hbvmint.h +++ b/harbour/include/hbvmint.h @@ -62,6 +62,6 @@ #undef _HB_API_MACROS_ #undef _HB_STACK_MACROS_ -#if !defined( _HB_API_INTERNAL_ ) +#if ! defined( _HB_API_INTERNAL_ ) # define _HB_API_INTERNAL_ #endif diff --git a/harbour/include/hbvmopt.h b/harbour/include/hbvmopt.h index 2b3684d5d5..c1fe92c04c 100644 --- a/harbour/include/hbvmopt.h +++ b/harbour/include/hbvmopt.h @@ -58,14 +58,14 @@ * it was compiled and only if exactly the same C compiler switches * which interacts with alignment are used. [druzus] */ -#if !defined( HB_NO_DEFAULT_API_MACROS ) && !defined( _HB_API_MACROS_ ) +#if ! defined( HB_NO_DEFAULT_API_MACROS ) && ! defined( _HB_API_MACROS_ ) # define _HB_API_MACROS_ #endif -#if !defined( HB_NO_DEFAULT_STACK_MACROS ) && !defined( _HB_STACK_MACROS_ ) +#if ! defined( HB_NO_DEFAULT_STACK_MACROS ) && ! defined( _HB_STACK_MACROS_ ) # define _HB_STACK_MACROS_ #endif -#if !defined( _HB_API_INTERNAL_ ) +#if ! defined( _HB_API_INTERNAL_ ) # define _HB_API_INTERNAL_ #endif diff --git a/harbour/include/hbvmpub.h b/harbour/include/hbvmpub.h index 303ef0cd2c..945c029209 100644 --- a/harbour/include/hbvmpub.h +++ b/harbour/include/hbvmpub.h @@ -136,16 +136,16 @@ struct _HB_SYMB; typedef struct _HB_DYNS { struct _HB_SYMB * pSymbol; /* pointer to its relative local symbol */ -# if !defined( HB_MT_VM ) +# if ! defined( HB_MT_VM ) void * pMemvar; /* memvar pointer ( publics & privates ) */ HB_USHORT uiArea; /* Workarea number */ -# endif /* !HB_MT_VM */ +# endif /* ! HB_MT_VM */ HB_USHORT uiSymNum; /* dynamic symbol number */ -# if !defined( HB_NO_PROFILER ) +# if ! defined( HB_NO_PROFILER ) HB_ULONG ulCalls; /* profiler support */ HB_ULONG ulTime; /* profiler support */ HB_ULONG ulRecurse; /* profiler support */ -# endif /* !HB_NO_PROFILER */ +# endif /* ! HB_NO_PROFILER */ } HB_DYNS, * PHB_DYNS; /* pCode dynamic function - HRB */ @@ -155,7 +155,7 @@ struct _HB_SYMB; struct _HB_SYMB * pSymbols;/* module symbol table */ } HB_PCODEFUNC, * PHB_PCODEFUNC; -#else /* !_HB_API_INTERNAL_ */ +#else /* ! _HB_API_INTERNAL_ */ # undef _HB_API_MACROS_ # undef _HB_STACK_MACROS_ @@ -194,7 +194,7 @@ struct _HB_SYMB; typedef void * PHB_DYNS; #endif -#endif /* !_HB_API_INTERNAL_ */ +#endif /* ! _HB_API_INTERNAL_ */ /* symbol support structure */ typedef struct _HB_SYMB diff --git a/harbour/include/hbwince.h b/harbour/include/hbwince.h index d1b5113bb3..4a232d676e 100644 --- a/harbour/include/hbwince.h +++ b/harbour/include/hbwince.h @@ -153,27 +153,27 @@ HB_EXTERN_BEGIN #endif #endif -#if !defined( GetEnvironmentVariable ) +#if ! defined( GetEnvironmentVariable ) DWORD WINAPI GetEnvironmentVariableW( LPCWSTR name, LPWSTR value, DWORD size ); #define GetEnvironmentVariable GetEnvironmentVariableW #endif -#if !defined( SetEnvironmentVariable ) +#if ! defined( SetEnvironmentVariable ) BOOL WINAPI SetEnvironmentVariableW( LPCWSTR name, LPCWSTR value ); #define SetEnvironmentVariable SetEnvironmentVariableW #endif -#if !defined( SetCurrentDirectory ) +#if ! defined( SetCurrentDirectory ) BOOL WINAPI SetCurrentDirectoryW( LPCWSTR dirname ); #define SetCurrentDirectory SetCurrentDirectoryW #endif -#if !defined( GetCurrentDirectory ) +#if ! defined( GetCurrentDirectory ) DWORD WINAPI GetCurrentDirectoryW( DWORD len, LPWSTR buffer ); #define GetCurrentDirectory GetCurrentDirectoryW #endif -#if !defined( GetComputerName ) +#if ! defined( GetComputerName ) BOOL WINAPI GetComputerNameW( LPWSTR buffer, LPDWORD len ); #define GetComputerName GetComputerNameW #endif -#if !defined( GetUserName ) +#if ! defined( GetUserName ) BOOL WINAPI GetUserNameW( LPWSTR buffer, LPDWORD len ); #define GetUserName GetUserNameW #endif diff --git a/harbour/src/codepage/cp_utf8.c b/harbour/src/codepage/cp_utf8.c index 8e8cebf301..324ac49319 100644 --- a/harbour/src/codepage/cp_utf8.c +++ b/harbour/src/codepage/cp_utf8.c @@ -148,13 +148,13 @@ static HB_CDP_CMP_FUNC( UTF8_cmp ) iRet = 0; for( ;; ) { - if( !HB_CDPCHAR_GET( cdp, szSecond, nLenSecond, &nPos2, &wc2 ) ) + if( ! HB_CDPCHAR_GET( cdp, szSecond, nLenSecond, &nPos2, &wc2 ) ) { if( fExact && HB_CDPCHAR_GET( cdp, szFirst, nLenFirst, &nPos1, &wc1 ) ) iRet = 1; break; } - if( !HB_CDPCHAR_GET( cdp, szFirst, nLenFirst, &nPos1, &wc1 ) ) + if( ! HB_CDPCHAR_GET( cdp, szFirst, nLenFirst, &nPos1, &wc1 ) ) { iRet = -1; break; @@ -200,13 +200,13 @@ static HB_CDP_CMP_FUNC( UTF8_cmpi ) for( ;; ) { - if( !HB_CDPCHAR_GET( cdp, szSecond, nLenSecond, &nPos2, &wc2 ) ) + if( ! HB_CDPCHAR_GET( cdp, szSecond, nLenSecond, &nPos2, &wc2 ) ) { if( fExact && HB_CDPCHAR_GET( cdp, szFirst, nLenFirst, &nPos1, &wc1 ) ) iRet = 1; break; } - if( !HB_CDPCHAR_GET( cdp, szFirst, nLenFirst, &nPos1, &wc1 ) ) + if( ! HB_CDPCHAR_GET( cdp, szFirst, nLenFirst, &nPos1, &wc1 ) ) { iRet = -1; break; diff --git a/harbour/src/common/expropt2.c b/harbour/src/common/expropt2.c index 545c50badb..5bbc293ae5 100644 --- a/harbour/src/common/expropt2.c +++ b/harbour/src/common/expropt2.c @@ -2127,7 +2127,7 @@ HB_BOOL hb_compExprReduceLEN( PHB_EXPR pSelf, HB_COMP_DECL ) PHB_EXPR pArg = pParms->value.asList.pExprList; /* TOFIX: do not optimize when array/hash args have user expressions */ - if( ( pArg->ExprType == HB_ET_STRING && !HB_SUPPORT_USERCP ) || + if( ( pArg->ExprType == HB_ET_STRING && ! HB_SUPPORT_USERCP ) || pArg->ExprType == HB_ET_ARRAY || pArg->ExprType == HB_ET_HASH ) { diff --git a/harbour/src/common/hbprintf.c b/harbour/src/common/hbprintf.c index 502c5ec7db..988100774f 100644 --- a/harbour/src/common/hbprintf.c +++ b/harbour/src/common/hbprintf.c @@ -728,7 +728,7 @@ static int _hb_strnlen( const char * str, int len ) static size_t put_str( char *buffer, size_t bufsize, size_t size, const _x_str str, int flags, int width, int precision ) { - if( !str ) + if( ! str ) str = "(null)"; if( precision < 0 ) precision = ( int ) strlen( str ); @@ -768,7 +768,7 @@ static size_t put_wstr( char *buffer, size_t bufsize, size_t size, const _x_wstr wstr, int flags, int width, int precision ) { - if( !wstr ) + if( ! wstr ) { const _x_wchar wstr_null[] = { '(', 'n', 'u', 'l', 'l', ')', 0 }; wstr = wstr_null; @@ -1421,7 +1421,7 @@ int hb_vsnprintf( char * buffer, size_t nSize, const char * format, va_list argl #define _HB_SNPRINTF_ADD_EOS #elif defined( _MSC_VER ) && _MSC_VER >= 1400 result = _vsnprintf_s( buffer, nSize, _TRUNCATE, format, arglist ); -#elif ( defined( _MSC_VER ) || defined( __DMC__ ) ) && !defined( __XCC__ ) +#elif ( defined( _MSC_VER ) || defined( __DMC__ ) ) && ! defined( __XCC__ ) result = _vsnprintf( buffer, nSize, format, arglist ); #define _HB_SNPRINTF_ADD_EOS #elif defined( __WATCOMC__ ) && __WATCOMC__ < 1200 diff --git a/harbour/src/common/hbver.c b/harbour/src/common/hbver.c index f0a2755ba0..6b639da4d6 100644 --- a/harbour/src/common/hbver.c +++ b/harbour/src/common/hbver.c @@ -384,8 +384,8 @@ char * hb_verPlatform( void ) if( osVer.dwMajorVersion == 6 ) { -#if !defined( HB_OS_WIN_CE ) && !defined( __DMC__ ) && \ - ( !defined( _MSC_VER ) || _MSC_VER >= 1400 ) +#if ! defined( HB_OS_WIN_CE ) && ! defined( __DMC__ ) && \ + ( ! defined( _MSC_VER ) || _MSC_VER >= 1400 ) OSVERSIONINFOEX osVerEx; osVerEx.dwOSVersionInfoSize = sizeof( osVerEx ); @@ -422,8 +422,8 @@ char * hb_verPlatform( void ) } else if( osVer.dwMajorVersion == 5 && osVer.dwMinorVersion >= 2 ) { -#if !defined( HB_OS_WIN_CE ) && !defined( __DMC__ ) && \ - ( !defined( _MSC_VER ) || _MSC_VER >= 1400 ) +#if ! defined( HB_OS_WIN_CE ) && ! defined( __DMC__ ) && \ + ( ! defined( _MSC_VER ) || _MSC_VER >= 1400 ) OSVERSIONINFOEX osVerEx; osVerEx.dwOSVersionInfoSize = sizeof( osVerEx ); diff --git a/harbour/src/compiler/complex.c b/harbour/src/compiler/complex.c index 8f520d5e3c..a882ef6d2f 100644 --- a/harbour/src/compiler/complex.c +++ b/harbour/src/compiler/complex.c @@ -83,7 +83,7 @@ HB_PP_TOKEN_TYPE((t)->type) == HB_PP_TOKEN_RIGHT_SB || \ HB_PP_TOKEN_TYPE((t)->type) == HB_PP_TOKEN_RIGHT_CB || \ ( HB_PP_TOKEN_TYPE((t)->type) == HB_PP_TOKEN_SEND && \ - (t)->spaces == 0 && !HB_PP_LEX_SELF(t) ) ) + (t)->spaces == 0 && ! HB_PP_LEX_SELF(t) ) ) #define LOOKUP 0 #define OPERATOR -2 @@ -400,8 +400,8 @@ static int hb_comp_dayTimeDecode( PHB_COMP_LEX pLex, PHB_PP_TOKEN pToken, if( pMonth && HB_PP_TOKEN_TYPE( pMonth->type ) == HB_PP_TOKEN_NUMBER && pMonth->pNext && HB_PP_TOKEN_TYPE( pYear->pNext->type ) == HB_PP_TOKEN_TYPE( pMonth->pNext->type ) && - !hb_compStrToNum( pMonth->value, pMonth->len, &lMonth, &dNumber, - &iDec, &iWidth ) ) + ! hb_compStrToNum( pMonth->value, pMonth->len, &lMonth, &dNumber, + &iDec, &iWidth ) ) { pDay = pMonth->pNext->pNext; if( pDay && HB_PP_TOKEN_TYPE( pDay->type ) == HB_PP_TOKEN_NUMBER && @@ -1152,7 +1152,7 @@ int hb_comp_yylex( YYSTYPE * yylval_ptr, HB_COMP_DECL ) hb_strnicmp( "WHILE", pToken->pNext->value, pToken->pNext->len ) == 0 && /* check if it's not DO while [WITH ] */ - !HB_PP_TOKEN_ISEOC( pToken->pNext->pNext ) && + ! HB_PP_TOKEN_ISEOC( pToken->pNext->pNext ) && ( HB_PP_TOKEN_TYPE( pToken->pNext->pNext->type ) != HB_PP_TOKEN_KEYWORD || pToken->pNext->pNext->len != 4 || hb_stricmp( "WITH", pToken->pNext->pNext->value ) != 0 ) ) diff --git a/harbour/src/compiler/gencc.c b/harbour/src/compiler/gencc.c index c7394fd2a6..7be5b05a9c 100644 --- a/harbour/src/compiler/gencc.c +++ b/harbour/src/compiler/gencc.c @@ -617,7 +617,7 @@ static HB_GENC_FUNC( hb_p_jumpfalsenear ) HB_GENC_LABEL(); - fprintf( cargo->yyc, "\tif( hb_xvmPopLogical( &fValue ) ) break;\n\tif( !fValue )\n\t\tgoto lab%05" HB_PFS "d;\n", + fprintf( cargo->yyc, "\tif( hb_xvmPopLogical( &fValue ) ) break;\n\tif( ! fValue )\n\t\tgoto lab%05" HB_PFS "d;\n", HB_GENC_GETLABEL( nPCodePos + nOffset ) ); return 2; } @@ -628,7 +628,7 @@ static HB_GENC_FUNC( hb_p_jumpfalse ) HB_GENC_LABEL(); - fprintf( cargo->yyc, "\tif( hb_xvmPopLogical( &fValue ) ) break;\n\tif( !fValue )\n\t\tgoto lab%05" HB_PFS "d;\n", + fprintf( cargo->yyc, "\tif( hb_xvmPopLogical( &fValue ) ) break;\n\tif( ! fValue )\n\t\tgoto lab%05" HB_PFS "d;\n", HB_GENC_GETLABEL( nPCodePos + nOffset ) ); return 3; } @@ -639,7 +639,7 @@ static HB_GENC_FUNC( hb_p_jumpfalsefar ) HB_GENC_LABEL(); - fprintf( cargo->yyc, "\tif( hb_xvmPopLogical( &fValue ) ) break;\n\tif( !fValue )\n\t\tgoto lab%05" HB_PFS "d;\n", + fprintf( cargo->yyc, "\tif( hb_xvmPopLogical( &fValue ) ) break;\n\tif( ! fValue )\n\t\tgoto lab%05" HB_PFS "d;\n", HB_GENC_GETLABEL( nPCodePos + nOffset ) ); return 4; } @@ -1863,7 +1863,7 @@ static HB_GENC_FUNC( hb_p_switch ) nPCodePos += 5; break; case HB_P_PUSHSTRSHORT: - fprintf( cargo->yyc, "\t\tif( pszText && nLen == %d && !memcmp( pszText, ", + fprintf( cargo->yyc, "\t\tif( pszText && nLen == %d && ! memcmp( pszText, ", pFunc->pCode[ nPCodePos + 1 ] - 1 ); hb_compGenCString( cargo->yyc, &pFunc->pCode[ nPCodePos + 2 ], pFunc->pCode[ nPCodePos + 1 ] - 1 ); diff --git a/harbour/src/compiler/hbmain.c b/harbour/src/compiler/hbmain.c index af790d2044..a4b563986a 100644 --- a/harbour/src/compiler/hbmain.c +++ b/harbour/src/compiler/hbmain.c @@ -850,7 +850,7 @@ PHB_HVAR hb_compVariableFind( HB_COMP_DECL, const char * szVarName, int * piPos, pOutBlock = pFunc; pFunc = pFunc->pOwner; - if( !pFunc && !fGlobal ) + if( ! pFunc && ! fGlobal ) { /* instead of making this trick with pGlobal switching it will be * much cleaner to set pOwner in each compiled function to first @@ -2847,7 +2847,7 @@ void hb_compGenPushVarRef( const char * szVarName, HB_COMP_DECL ) /* generates t } } - if( !pVar ) + if( ! pVar ) { /* undeclared variable */ /* field cannot be passed by the reference - assume the memvar */ diff --git a/harbour/src/compiler/hbopt.c b/harbour/src/compiler/hbopt.c index c620d60635..a87f8595e2 100644 --- a/harbour/src/compiler/hbopt.c +++ b/harbour/src/compiler/hbopt.c @@ -349,7 +349,7 @@ static HB_OPT_FUNC( hb_p_duplicate ) { HB_ISIZ nJump; if( pFunc->pCode[ nNewPos + 1 ] != pFunc->pCode[ nPCodePos + 1 ] ) - fNot = !fNot; + fNot = ! fNot; nJump = fNot ? 4 : HB_PCODE_MKINT24( &pFunc->pCode[ nNewPos + 2 ] ); nOffset += nJump + 1; nNewPos = nPCodePos + 1 + nOffset; @@ -505,7 +505,7 @@ static HB_OPT_FUNC( hb_p_jumpfar ) case HB_P_JUMPFALSEFAR: nNewPos += HB_PCODE_MKINT24( &pFunc->pCode[ nNewPos + 1 ] ); - if( nNewPos == nPCodePos + 4 && ( !fLine || + if( nNewPos == nPCodePos + 4 && ( ! fLine || ( pFunc->pCode[ nNewPos ] == HB_P_LINE && pFunc->pCode[ nPCodePos + nOffset + 4 ] == HB_P_LINE ) ) ) { @@ -516,7 +516,7 @@ static HB_OPT_FUNC( hb_p_jumpfar ) case HB_P_JUMPTRUEFAR: nNewPos += HB_PCODE_MKINT24( &pFunc->pCode[ nNewPos + 1 ] ); - if( nNewPos == nPCodePos + 4 && ( !fLine || + if( nNewPos == nPCodePos + 4 && ( ! fLine || ( pFunc->pCode[ nNewPos ] == HB_P_LINE && pFunc->pCode[ nPCodePos + nOffset + 4 ] == HB_P_LINE ) ) ) { @@ -566,7 +566,7 @@ static HB_OPT_FUNC( hb_p_jumpfalsefar ) if( pFunc->pCode[ nNewPos ] == HB_P_JUMPFAR ) { nOffset += HB_PCODE_MKINT24( &pFunc->pCode[ nNewPos + 1 ] ); - if( !fLine || pFunc->pCode[ nPCodePos + nOffset ] == HB_P_LINE ) + if( ! fLine || pFunc->pCode[ nPCodePos + nOffset ] == HB_P_LINE ) HB_PUT_LE_UINT24( pAddr, nOffset ); } } @@ -1351,15 +1351,15 @@ static void hb_compPCodeEnumAssignedUnused( HB_COMP_DECL, PHB_HFUNC pFunc, PHB_O pFunc->pCode[ nPos ] == HB_P_POPLOCALNEAR ) && ! ( nPos > 0 && pFunc->pCode[ nLastPos ] == HB_P_PUSHNIL ); - if( !fCheck && ( pFunc->pCode[ nPos ] == HB_P_LOCALDEC || - pFunc->pCode[ nPos ] == HB_P_LOCALINC || - pFunc->pCode[ nPos ] == HB_P_LOCALADDINT || - pFunc->pCode[ nPos ] == HB_P_LOCALNEARADDINT ) ) + if( ! fCheck && ( pFunc->pCode[ nPos ] == HB_P_LOCALDEC || + pFunc->pCode[ nPos ] == HB_P_LOCALINC || + pFunc->pCode[ nPos ] == HB_P_LOCALADDINT || + pFunc->pCode[ nPos ] == HB_P_LOCALNEARADDINT ) ) { fCheck = HB_TRUE; } - if( !fCheck && pFunc->pCode[ nPos ] == HB_P_PUSHLOCALREF ) + if( ! fCheck && pFunc->pCode[ nPos ] == HB_P_PUSHLOCALREF ) { HB_SIZE nPosNext = nPos + hb_compPCodeSize( pFunc, nPos ); HB_BYTE bCodeNext = pFunc->pCode[ nPosNext ]; diff --git a/harbour/src/compiler/ppcomp.c b/harbour/src/compiler/ppcomp.c index 2702b2b7a3..f862a3931d 100644 --- a/harbour/src/compiler/ppcomp.c +++ b/harbour/src/compiler/ppcomp.c @@ -279,12 +279,12 @@ static HB_BOOL hb_pp_CompilerSwitch( void * cargo, const char * szSwitch, case 'j': case 'J': iFlag = HB_COMPFLAG_OPTJUMP; - iValue = !iValue; + iValue = ! iValue; break; case 'm': case 'M': iFlag = HB_COMPFLAG_MACROTEXT; - iValue = !iValue; + iValue = ! iValue; break; case 'd': case 'D': diff --git a/harbour/src/rdd/dbcmd.c b/harbour/src/rdd/dbcmd.c index b67ce1db52..c12ed82e2b 100644 --- a/harbour/src/rdd/dbcmd.c +++ b/harbour/src/rdd/dbcmd.c @@ -354,7 +354,7 @@ HB_FUNC( DBCREATE ) pStruct = hb_param( 2, HB_IT_ARRAY ); szDriver = hb_parc( 3 ); fKeepOpen = HB_ISLOG( 4 ); - fCurrArea = fKeepOpen && !hb_parl( 4 ); + fCurrArea = fKeepOpen && ! hb_parl( 4 ); szAlias = hb_parc( 5 ); pDelim = hb_param( 6, HB_IT_ANY ); szCpId = hb_parc( 7 ); @@ -481,7 +481,7 @@ HB_FUNC( __DBOPENSDF ) pStruct = hb_param( 2, HB_IT_ARRAY ); szDriver = hb_parc( 3 ); fKeepOpen = HB_ISLOG( 4 ); - fCurrArea = fKeepOpen && !hb_parl( 4 ); + fCurrArea = fKeepOpen && ! hb_parl( 4 ); szAlias = hb_parc( 5 ); pDelim = hb_param( 6, HB_IT_ANY ); szCpId = hb_parc( 7 ); @@ -901,7 +901,7 @@ HB_FUNC( DBUSEAREA ) { hb_retl( hb_rddOpenTable( hb_parc( 3 ), hb_parc( 2 ), hb_parl( 1 ) ? 0 : ( HB_AREANO ) hb_rddGetCurrentWorkAreaNumber(), - hb_parc( 4 ), HB_ISLOG( 5 ) ? hb_parl( 5 ) : !hb_setGetExclusive(), + hb_parc( 4 ), HB_ISLOG( 5 ) ? hb_parl( 5 ) : ! hb_setGetExclusive(), hb_parl( 6 ), hb_parc( 7 ), hb_parnl( 8 ), NULL, NULL ) == HB_SUCCESS ); } @@ -1246,7 +1246,7 @@ HB_FUNC( ORDCONDSET ) lpdbOrdCondInfo->fUseFilter ) lpdbOrdCondInfo->fAll = HB_FALSE; - lpdbOrdCondInfo->fActive = !lpdbOrdCondInfo->fAll || + lpdbOrdCondInfo->fActive = ! lpdbOrdCondInfo->fAll || lpdbOrdCondInfo->abFor || lpdbOrdCondInfo->itmCobFor || lpdbOrdCondInfo->abWhile || lpdbOrdCondInfo->itmCobWhile || lpdbOrdCondInfo->fNoOptimize || lpdbOrdCondInfo->itmCobEval || diff --git a/harbour/src/rdd/dbdelim.prg b/harbour/src/rdd/dbdelim.prg index 71a1a9eb1e..87ba968a2b 100644 --- a/harbour/src/rdd/dbdelim.prg +++ b/harbour/src/rdd/dbdelim.prg @@ -56,7 +56,7 @@ * */ -REQUEST DELIM +REQUEST Delim FUNCTION __dbDelim( lExport, cFile, cDelimArg, aFields, bFor, bWhile, nNext, nRecord, lRest, cCodePage ) diff --git a/harbour/src/rdd/dbf1.c b/harbour/src/rdd/dbf1.c index e12b01a00a..8e90b2cfab 100644 --- a/harbour/src/rdd/dbf1.c +++ b/harbour/src/rdd/dbf1.c @@ -683,7 +683,7 @@ static void hb_dbfTableCrypt( DBFAREAP pArea, PHB_ITEM pPasswd, HB_BOOL fEncrypt HB_TRACE( HB_TR_DEBUG, ( "hb_dbfTableCrypt(%p,%p,%d)", pArea, pPasswd, fEncrypt ) ); if( ! pArea->fReadonly && ! pArea->fShared && - fEncrypt ? ! pArea->fTableEncrypted && !pArea->fHasMemo : + fEncrypt ? ! pArea->fTableEncrypted && ! pArea->fHasMemo : pArea->fTableEncrypted ) { HB_ULONG ulRecords, ulRecNo; @@ -1860,7 +1860,7 @@ static HB_ERRCODE hb_dbfAppend( DBFAREAP pArea, HB_BOOL bUnLockAll ) pArea->ulRecNo = pArea->ulRecCount; pArea->fDeleted = pArea->area.fBof = pArea->area.fEof = pArea->area.fFound = HB_FALSE; - pArea->fEncrypted = pArea->pCryptKey != NULL && !pArea->fHasMemo; + pArea->fEncrypted = pArea->pCryptKey != NULL && ! pArea->fHasMemo; if( pArea->fShared ) { @@ -5146,7 +5146,7 @@ static HB_ERRCODE hb_dbfRawLock( DBFAREAP pArea, HB_USHORT uiAction, HB_ULONG ul for( ;; ) { fLck = hb_fileLock( pArea->pDataFile, nPos, 1, FL_LOCK | FLX_WAIT ); - /* TODO: call special error handler (LOCKHANDLER) if !fLck */ + /* TODO: call special error handler (LOCKHANDLER) if ! fLck */ if( fLck ) break; hb_releaseCPU(); diff --git a/harbour/src/rdd/dbfcdx/dbfcdx1.c b/harbour/src/rdd/dbfcdx/dbfcdx1.c index 0248acde3d..0d4e1c2f08 100644 --- a/harbour/src/rdd/dbfcdx/dbfcdx1.c +++ b/harbour/src/rdd/dbfcdx/dbfcdx1.c @@ -1805,10 +1805,10 @@ static void hb_cdxPageLeafEncode( LPCDXPAGE pPage, HB_BYTE * pKeyBuf, int iKeys printf( "\r\nPage=0x%lx, calc=%d, iFree=%d, req=%d, keys=%d, keyLen=%d\r\n", pPage->Page, ( int ) ( pKeyPos - pRecPos ), pPage->iFree, pPage->ReqByte, iKeys, iNum ); fflush( stdout ); - hb_cdxErrInternal( "hb_cdxPageLeafEncode: FreeSpace calculated wrong!." ); + hb_cdxErrInternal( "hb_cdxPageLeafEncode: FreeSpace calculated wrong!" ); } if( pPage->iFree < 0 ) - hb_cdxErrInternal( "hb_cdxPageLeafEncode: FreeSpace calculated wrong!!." ); + hb_cdxErrInternal( "hb_cdxPageLeafEncode: FreeSpace calculated wrong!!" ); #endif pPage->iKeys = iKeys; pPage->fChanged = HB_TRUE; @@ -2303,14 +2303,14 @@ static void hb_cdxPageStore( LPCDXPAGE pPage ) { #ifdef HB_CDX_DBGCODE if( pPage->Page == 0 || pPage->Page == CDX_DUMMYNODE ) - hb_cdxErrInternal( "hb_cdxPageStore: Page number wrong!." ); + hb_cdxErrInternal( "hb_cdxPageStore: Page number wrong!" ); if( pPage->PageType & CDX_NODE_LEAF ) { if( pPage->iFree < 0 ) - hb_cdxErrInternal( "hb_cdxPageStore: FreeSpace calculated wrong!." ); + hb_cdxErrInternal( "hb_cdxPageStore: FreeSpace calculated wrong!" ); } else if( pPage->iKeys > pPage->TagParent->MaxKeys ) - hb_cdxErrInternal( "hb_cdxPageStore: number of keys exceed!." ); + hb_cdxErrInternal( "hb_cdxPageStore: number of keys exceed!" ); #endif HB_PUT_LE_UINT16( pPage->node.intNode.attr, ( HB_U16 ) pPage->PageType ); HB_PUT_LE_UINT16( pPage->node.intNode.nKeys, pPage->iKeys ); @@ -3216,7 +3216,7 @@ static int hb_cdxPageKeyIntBalance( LPCDXPAGE pPage, int iChildRet ) ( ( iKeys + iBlncKeys - i - 1 ) / ( iBlncKeys - i ) ); #ifdef HB_CDX_DBGCODE if( iNodeKeys > pPage->TagParent->MaxKeys ) - hb_cdxErrInternal( "hb_cdxPageKeyIntBalance: iNodeKeys calculated wrong!." ); + hb_cdxErrInternal( "hb_cdxPageKeyIntBalance: iNodeKeys calculated wrong!" ); #endif /* TODO: do nothing if iNodeKeys == childs[i]->iKeys && i == iSkip */ memcpy( childs[ i ]->node.intNode.keyPool, pPtr, iNodeKeys * iLen ); @@ -5289,7 +5289,7 @@ static HB_ERRCODE hb_cdxDBOISkipUnique( CDXAREAP pArea, LPCDXTAG pTag, HB_LONG l hb_cdxTagSkipNext( pTag ); } } - retval = SELF_GOTO( ( AREAP ) pArea, ( !pArea->dbfarea.fPositioned || pTag->TagEOF ) + retval = SELF_GOTO( ( AREAP ) pArea, ( ! pArea->dbfarea.fPositioned || pTag->TagEOF ) ? 0 : pTag->CurKey->rec ); } else @@ -5753,7 +5753,7 @@ static HB_ULONG hb_cdxDBOIScopeEval( LPCDXTAG pTag, HB_EVALSCOPE_FUNC pFunc, voi static HB_LONG hb_cdxDBOIKeyCount( CDXAREAP pArea, LPCDXTAG pTag, HB_BOOL fFilters ) { HB_ULONG ulKeyCount = 0; - HB_BOOL fLogOpt = pArea->dbfarea.area.dbfi.itmCobExpr || !pArea->dbfarea.area.dbfi.fFilter; + HB_BOOL fLogOpt = pArea->dbfarea.area.dbfi.itmCobExpr || ! pArea->dbfarea.area.dbfi.fFilter; if( pTag ) { @@ -5858,7 +5858,7 @@ static HB_LONG hb_cdxDBOIKeyCount( CDXAREAP pArea, LPCDXTAG pTag, HB_BOOL fFilte static HB_LONG hb_cdxDBOIKeyNo( CDXAREAP pArea, LPCDXTAG pTag, HB_BOOL fFilters ) { HB_ULONG ulKeyNo = 0; - HB_BOOL fLogOpt = pArea->dbfarea.area.dbfi.itmCobExpr || !pArea->dbfarea.area.dbfi.fFilter; + HB_BOOL fLogOpt = pArea->dbfarea.area.dbfi.itmCobExpr || ! pArea->dbfarea.area.dbfi.fFilter; if( pArea->dbfarea.lpdbPendingRel ) SELF_FORCEREL( ( AREAP ) pArea ); @@ -5995,7 +5995,7 @@ static HB_ERRCODE hb_cdxDBOIKeyGoto( CDXAREAP pArea, LPCDXTAG pTag, HB_ULONG ulK { HB_ERRCODE retval; HB_ULONG ulKeyCnt = ulKeyNo; - HB_BOOL fLogOpt = pArea->dbfarea.area.dbfi.itmCobExpr || !pArea->dbfarea.area.dbfi.fFilter; + HB_BOOL fLogOpt = pArea->dbfarea.area.dbfi.itmCobExpr || ! pArea->dbfarea.area.dbfi.fFilter; if( ulKeyNo == 0 ) retval = SELF_GOTO( ( AREAP ) pArea, 0 ); @@ -7659,7 +7659,7 @@ static HB_ERRCODE hb_cdxOrderCreate( CDXAREAP pArea, LPDBORDERCREATEINFO pOrderI if( ! fOpenedIndex ) { PHB_FILE pFile; - HB_BOOL bRetry, fShared = pArea->dbfarea.fShared && !fTemporary && !fExclusive; + HB_BOOL bRetry, fShared = pArea->dbfarea.fShared && ! fTemporary && ! fExclusive; PHB_ITEM pError = NULL; do @@ -7823,7 +7823,7 @@ static HB_ERRCODE hb_cdxOrderDestroy( CDXAREAP pArea, LPDBORDERINFO pOrderInfo ) if( pTag ) { pIndex = pTag->pIndex; - if( /* !pIndex->fShared && */ ! pIndex->fReadonly ) + if( /* ! pIndex->fShared && */ ! pIndex->fReadonly ) { hb_cdxIndexLockWrite( pIndex ); hb_cdxIndexDelTag( pIndex, pTag->szName ); @@ -8269,7 +8269,7 @@ static HB_ERRCODE hb_cdxOrderInfo( CDXAREAP pArea, HB_USHORT uiIndex, LPDBORDERI break; case DBOI_ISDESC: - pInfo->itmResult = hb_itemPutL( pInfo->itmResult, pTag && !pTag->UsrAscend ); + pInfo->itmResult = hb_itemPutL( pInfo->itmResult, pTag && ! pTag->UsrAscend ); if( pTag && pInfo->itmNewVal && HB_IS_LOGICAL( pInfo->itmNewVal ) ) { pTag->UsrAscend = ! hb_itemGetL( pInfo->itmNewVal ); @@ -9527,7 +9527,7 @@ static void hb_cdxTagDoIndex( LPCDXTAG pTag, HB_BOOL fReindex ) } } } - fDirectRead = ! hb_setGetStrictRead() && /* !pArea->dbfarea.area.lpdbRelations && */ + fDirectRead = ! hb_setGetStrictRead() && /* ! pArea->dbfarea.area.lpdbRelations && */ ( ! pArea->dbfarea.area.lpdbOrdCondInfo || pArea->dbfarea.area.lpdbOrdCondInfo->fAll || ( pArea->uiTag == 0 && ! fUseFilter ) ); diff --git a/harbour/src/rdd/dbffpt/dbffpt1.c b/harbour/src/rdd/dbffpt/dbffpt1.c index 1c8eaa3a85..9c0bf1470c 100644 --- a/harbour/src/rdd/dbffpt/dbffpt1.c +++ b/harbour/src/rdd/dbffpt/dbffpt1.c @@ -4025,13 +4025,13 @@ static HB_ERRCODE hb_fptCreateMemFile( FPTAREAP pArea, LPDBOPENINFO pCreateInfo return HB_FAILURE; } pArea->bMemoType = ( HB_BYTE ) hb_itemGetNI( pItem ); -/* - if( !pArea->bMemoType ) +#if 0 + if( ! pArea->bMemoType ) { pArea->bMemoType = DB_MEMO_FPT; pArea->uiMemoVersion = DB_MEMOVER_FLEX; } - */ +#endif if( pArea->bMemoType != DB_MEMO_DBT && pArea->bMemoType != DB_MEMO_FPT && pArea->bMemoType != DB_MEMO_SMT ) diff --git a/harbour/src/rdd/dbfnsx/dbfnsx1.c b/harbour/src/rdd/dbfnsx/dbfnsx1.c index 3631afbbe9..0244f9bb14 100644 --- a/harbour/src/rdd/dbfnsx/dbfnsx1.c +++ b/harbour/src/rdd/dbfnsx/dbfnsx1.c @@ -1705,7 +1705,7 @@ static LPTAGINFO hb_nsxTagNew( LPNSXINDEX pIndex, const char * szTagName, pTag->pKeyItem = pKeyExpr; pTag->pForItem = pForExpr; pTag->AscendKey = fAscendKey; - pTag->fUsrDescend = !pTag->AscendKey; + pTag->fUsrDescend = ! pTag->AscendKey; pTag->UniqueKey = fUnique; pTag->Custom = fCustom; pTag->MultiKey = fCustom && DBFAREA_DATA( &pIndex->pArea->dbfarea )->fMultiKey; @@ -2554,7 +2554,7 @@ static LPPAGEINFO hb_nsxPageBottomMove( LPTAGINFO pTag, HB_ULONG ulPage ) { hb_nsxTagSetPageStack( pTag, pPage, pPage->uiKeys - ( pPage->uiKeys == 0 ? 0 : 1 ) ); - if( pPage->uiKeys == 0 && pTag->stackLevel > 1 && !pTag->pIndex->pArea->pSort ) + if( pPage->uiKeys == 0 && pTag->stackLevel > 1 && ! pTag->pIndex->pArea->pSort ) { hb_nsxPageRelease( pTag, pPage ); hb_nsxCorruptError( pTag->pIndex ); @@ -5892,7 +5892,7 @@ static HB_ERRCODE hb_nsxTagCreate( LPTAGINFO pTag, HB_BOOL fReindex ) } } - fDirectRead = ! hb_setGetStrictRead() && /* !pArea->dbfarea.area.lpdbRelations && */ + fDirectRead = ! hb_setGetStrictRead() && /* ! pArea->dbfarea.area.lpdbRelations && */ ( ! pArea->dbfarea.area.lpdbOrdCondInfo || pArea->dbfarea.area.lpdbOrdCondInfo->fAll || ( pArea->lpCurTag == NULL && ! fUseFilter ) ); @@ -6851,7 +6851,7 @@ static HB_ERRCODE hb_nsxOrderCreate( NSXAREAP pArea, LPDBORDERCREATEINFO pOrderI else { PHB_FILE pFile; - HB_BOOL bRetry, fShared = pArea->dbfarea.fShared && !fTemporary && !fExclusive; + HB_BOOL bRetry, fShared = pArea->dbfarea.fShared && ! fTemporary && ! fExclusive; HB_USHORT uiFlags = FO_READWRITE | ( fShared ? FO_DENYNONE : FO_EXCLUSIVE ); PHB_ITEM pError = NULL; @@ -6960,7 +6960,7 @@ static HB_ERRCODE hb_nsxOrderCreate( NSXAREAP pArea, LPDBORDERCREATEINFO pOrderI szFor, pForExp, fAscend, pOrderInfo->fUnique, fCustom ); pTag->Template = hb_nsxIsTemplateFunc( pTag->KeyExpr ); - pTag->Partial = ( pArea->dbfarea.area.lpdbOrdCondInfo && !pArea->dbfarea.area.lpdbOrdCondInfo->fAll ); + pTag->Partial = ( pArea->dbfarea.area.lpdbOrdCondInfo && ! pArea->dbfarea.area.lpdbOrdCondInfo->fAll ); if( fNewFile ) { diff --git a/harbour/src/rdd/dbfntx/dbfntx1.c b/harbour/src/rdd/dbfntx/dbfntx1.c index a70990f7e3..a7ec92405a 100644 --- a/harbour/src/rdd/dbfntx/dbfntx1.c +++ b/harbour/src/rdd/dbfntx/dbfntx1.c @@ -1454,7 +1454,7 @@ static LPTAGINFO hb_ntxTagNew( LPNTXINDEX pIndex, pTag->pKeyItem = pKeyExpr; pTag->pForItem = pForExpr; pTag->AscendKey = fAscendKey; - pTag->fUsrDescend = !pTag->AscendKey; + pTag->fUsrDescend = ! pTag->AscendKey; pTag->UniqueKey = fUnique; pTag->Custom = fCustom; pTag->MultiKey = fCustom && DBFAREA_DATA( &pIndex->Owner->dbfarea )->fMultiKey; @@ -5396,7 +5396,7 @@ static HB_ERRCODE hb_ntxTagCreate( LPTAGINFO pTag, HB_BOOL fReindex ) } } - fDirectRead = ! hb_setGetStrictRead() && /* !pArea->dbfarea.area.lpdbRelations && */ + fDirectRead = ! hb_setGetStrictRead() && /* ! pArea->dbfarea.area.lpdbRelations && */ ( ! pArea->dbfarea.area.lpdbOrdCondInfo || pArea->dbfarea.area.lpdbOrdCondInfo->fAll || ( pArea->lpCurTag == NULL && ! fUseFilter ) ); @@ -5873,7 +5873,7 @@ static HB_ERRCODE hb_ntxFlush( NTXAREAP pArea ) LPNTXINDEX pIndex = pArea->lpIndexes; while( pIndex ) { - if( pIndex->fFlush /* && !pIndex->Temporary */ ) + if( pIndex->fFlush /* && ! pIndex->Temporary */ ) { hb_fileCommit( pIndex->DiskFile ); pIndex->fFlush = HB_FALSE; @@ -5952,7 +5952,7 @@ static HB_ERRCODE hb_ntxGoCold( NTXAREAP pArea ) if( hb_ntxValCompare( pTag, pKey->key, pTag->KeyLength, pTag->HotKeyInfo->key, pTag->KeyLength, HB_TRUE ) == 0 ) { - if( pTag->HotFor ? fAdd : !fAdd ) + if( pTag->HotFor ? fAdd : ! fAdd ) fAdd = fDel = HB_FALSE; else fDel = ! fAdd; @@ -6440,7 +6440,7 @@ static HB_ERRCODE hb_ntxOrderCreate( NTXAREAP pArea, LPDBORDERCREATEINFO pOrderI else { PHB_FILE pFile; - HB_BOOL bRetry, fOld, fShared = pArea->dbfarea.fShared && !fTemporary && !fExclusive; + HB_BOOL bRetry, fOld, fShared = pArea->dbfarea.fShared && ! fTemporary && ! fExclusive; HB_USHORT uiFlags = FO_READWRITE | ( fShared ? FO_DENYNONE : FO_EXCLUSIVE ); PHB_ITEM pError = NULL; diff --git a/harbour/src/rdd/hsx/hsx.c b/harbour/src/rdd/hsx/hsx.c index 06e83cf88e..9b0068ac36 100644 --- a/harbour/src/rdd/hsx/hsx.c +++ b/harbour/src/rdd/hsx/hsx.c @@ -1286,7 +1286,7 @@ static int hb_hsxVerify( int iHandle, const char * szText, HB_SIZE nLen, else if( ! szText || ! szSub ) iResult = HSX_BADPARMS; else if( nSub > nLen || nSub == 0 ) - /* !nSub -> do not accept empty substrings as $ operator at runtime */ + /* ! nSub -> do not accept empty substrings as $ operator at runtime */ iResult = HSX_SUCCESSFALSE; else { diff --git a/harbour/src/rdd/usrrdd/rdds/arrayrdd.prg b/harbour/src/rdd/usrrdd/rdds/arrayrdd.prg index aa6f7853aa..3bbe09efb6 100644 --- a/harbour/src/rdd/usrrdd/rdds/arrayrdd.prg +++ b/harbour/src/rdd/usrrdd/rdds/arrayrdd.prg @@ -1471,7 +1471,7 @@ STATIC FUNCTION AR_LOCATE( nWA, lContinue ) ENDIF IF bWhile == NIL bLocate := {|| ! Eval( bFor ) } - IF !lContinue .AND. aScopeInfo[ UR_SI_NEXT ] == NIL .AND. aScopeInfo[ UR_SI_RECORD ] == NIL .AND. !aScopeInfo[ UR_SI_REST ] + IF ! lContinue .AND. aScopeInfo[ UR_SI_NEXT ] == NIL .AND. aScopeInfo[ UR_SI_RECORD ] == NIL .AND. ! aScopeInfo[ UR_SI_REST ] AR_GOTOP( nWA ) ENDIF ELSE diff --git a/harbour/src/rdd/workarea.c b/harbour/src/rdd/workarea.c index 53255083c0..fc69283a3c 100644 --- a/harbour/src/rdd/workarea.c +++ b/harbour/src/rdd/workarea.c @@ -1437,7 +1437,7 @@ static HB_ERRCODE hb_waRelEval( AREAP pArea, LPDBRELINFO pRelInfo ) { errCode = SELF_EOF( pArea, &fEof ); if( errCode == HB_SUCCESS ) - pArea->fFound = !fEof; + pArea->fFound = ! fEof; } } } diff --git a/harbour/src/rtl/cdpapi.c b/harbour/src/rtl/cdpapi.c index bb88bb0bd0..681a4bff23 100644 --- a/harbour/src/rtl/cdpapi.c +++ b/harbour/src/rtl/cdpapi.c @@ -2338,10 +2338,10 @@ HB_SIZE hb_cdpnDup2Upper( PHB_CODEPAGE cdp, const char * pszText, HB_SIZE nSize, { HB_SIZE nMax = HB_MIN( nSize, nBuffLen ), n; - if( !cdp ) + if( ! cdp ) for( n = 0; n < nMax; n++ ) pBuffer[ n ] = HB_TOUPPER( pszText[ n ] ); - else if( !HB_CDP_ISCUSTOM( cdp ) || !cdp->wcharUpper ) + else if( ! HB_CDP_ISCUSTOM( cdp ) || ! cdp->wcharUpper ) for( n = 0; n < nMax; n++ ) pBuffer[ n ] = ( char ) cdp->upper[ ( HB_UCHAR ) pszText[ n ] ]; else diff --git a/harbour/src/rtl/console.c b/harbour/src/rtl/console.c index 5561c98f32..eff4b55e9e 100644 --- a/harbour/src/rtl/console.c +++ b/harbour/src/rtl/console.c @@ -98,7 +98,7 @@ # define CRLF_BUFFER_LEN HB_OS_EOL_LEN + 1 #endif -#if defined( HB_OS_UNIX ) && !defined( HB_EOL_CRLF ) +#if defined( HB_OS_UNIX ) && ! defined( HB_EOL_CRLF ) static const char s_szCrLf[ CRLF_BUFFER_LEN ] = { HB_CHAR_LF, 0 }; static const int s_iCrLfLen = 1; #else diff --git a/harbour/src/rtl/diskspac.c b/harbour/src/rtl/diskspac.c index 6eafb382c8..787cb9ba42 100644 --- a/harbour/src/rtl/diskspac.c +++ b/harbour/src/rtl/diskspac.c @@ -115,7 +115,7 @@ HB_FUNC( DISKSPACE ) #elif defined( HB_OS_WIN ) { #if defined( _MSC_VER ) || defined( __LCC__ ) || \ - ( defined( __GNUC__ ) && !defined( __RSXNT__ ) ) + ( defined( __GNUC__ ) && ! defined( __RSXNT__ ) ) # define HB_GET_LARGE_UINT( v ) ( ( double ) (v).LowPart + \ ( double ) (v).HighPart * \ diff --git a/harbour/src/rtl/disksphb.c b/harbour/src/rtl/disksphb.c index 79ab304544..c6099ef6f5 100644 --- a/harbour/src/rtl/disksphb.c +++ b/harbour/src/rtl/disksphb.c @@ -116,7 +116,7 @@ HB_FUNC( HB_DISKSPACE ) UINT uiErrMode = SetErrorMode( SEM_FAILCRITICALERRORS ); HB_BOOL fResult; -#if !defined( HB_OS_WIN_CE ) && !defined( HB_OS_WIN_64 ) +#if ! defined( HB_OS_WIN_CE ) && ! defined( HB_OS_WIN_64 ) /* NOTE: We need to call this function dynamically to maintain support Win95 first edition. It was introduced in Win95B (aka OSR2) [vszakats] */ typedef BOOL ( WINAPI * P_GDFSE )( LPCTSTR, PULARGE_INTEGER, @@ -177,7 +177,7 @@ HB_FUNC( HB_DISKSPACE ) #endif { #if defined( _MSC_VER ) || defined( __LCC__ ) || \ - ( defined( __GNUC__ ) && !defined( __RSXNT__ ) ) + ( defined( __GNUC__ ) && ! defined( __RSXNT__ ) ) # define HB_GET_LARGE_UINT( v ) ( ( double ) (v).LowPart + \ ( double ) (v).HighPart * \ diff --git a/harbour/src/rtl/filebuf.c b/harbour/src/rtl/filebuf.c index d3e990a946..23e9708028 100644 --- a/harbour/src/rtl/filebuf.c +++ b/harbour/src/rtl/filebuf.c @@ -417,7 +417,7 @@ static PHB_FILE s_fileExtOpen( const char * pFilename, const char * pDefExt, pFile = hb_fileNew( hFile, fShared, fReadonly, device, inode, HB_TRUE ); if( pFile->hFile != hFile ) { - if( pFile->hFileRO == FS_ERROR && !fReadonly && pFile->readonly ) + if( pFile->hFileRO == FS_ERROR && ! fReadonly && pFile->readonly ) { pFile->hFileRO = pFile->hFile; pFile->hFile = hFile; diff --git a/harbour/src/rtl/filesys.c b/harbour/src/rtl/filesys.c index 08425e4720..3218875fbb 100644 --- a/harbour/src/rtl/filesys.c +++ b/harbour/src/rtl/filesys.c @@ -126,7 +126,7 @@ #if ( defined( __DMC__ ) || defined( __BORLANDC__ ) || \ defined( __IBMCPP__ ) || defined( _MSC_VER ) || \ defined( __MINGW32__ ) || defined( __WATCOMC__ ) ) && \ - !defined( HB_OS_UNIX ) && !defined( HB_OS_WIN_CE ) + ! defined( HB_OS_UNIX ) && ! defined( HB_OS_WIN_CE ) #include #include #include @@ -144,7 +144,7 @@ #if defined( _MSC_VER ) || defined( __MINGW32__ ) || defined( __DMC__ ) #include #define ftruncate _chsize - #if defined( __MINGW32__ ) && !defined( _LK_UNLCK ) + #if defined( __MINGW32__ ) && ! defined( _LK_UNLCK ) #define _LK_UNLCK _LK_UNLOCK #endif #else @@ -192,18 +192,18 @@ #if defined( HB_OS_WIN_CE ) #include "hbwince.h" #endif - #if !defined( INVALID_SET_FILE_POINTER ) && \ + #if ! defined( INVALID_SET_FILE_POINTER ) && \ ( defined( __DMC__ ) || defined( _MSC_VER ) || defined( __LCC__ ) ) #define INVALID_SET_FILE_POINTER ( ( DWORD ) -1 ) #endif - #if !defined( INVALID_FILE_ATTRIBUTES ) + #if ! defined( INVALID_FILE_ATTRIBUTES ) #define INVALID_FILE_ATTRIBUTES ( ( DWORD ) -1 ) #endif #if defined( HB_OS_WIN_64 ) - #if !defined( HB_WIN_IOREAD_LIMIT ) + #if ! defined( HB_WIN_IOREAD_LIMIT ) #define HB_WIN_IOREAD_LIMIT HB_U32_MAX #endif - #if !defined( HB_WIN_IOWRITE_LIMIT ) + #if ! defined( HB_WIN_IOWRITE_LIMIT ) #define HB_WIN_IOWRITE_LIMIT HB_U32_MAX #endif #endif @@ -798,10 +798,10 @@ HB_BOOL hb_fsPipeCreate( HB_FHANDLE hPipe[ 2 ] ) hPipe[ 0 ] = hPipe[ 1 ] = FS_ERROR; # endif } -#elif defined( HB_OS_UNIX ) && !defined( HB_OS_VXWORKS ) && !defined( HB_OS_SYMBIAN ) +#elif defined( HB_OS_UNIX ) && ! defined( HB_OS_VXWORKS ) && ! defined( HB_OS_SYMBIAN ) { fResult = pipe( hPipe ) == 0; - if( !fResult ) + if( ! fResult ) hPipe[ 0 ] = hPipe[ 1 ] = FS_ERROR; } #else @@ -906,7 +906,7 @@ HB_SIZE hb_fsPipeIsData( HB_FHANDLE hPipeHandle, HB_SIZE nBufferSize, end_timer > hb_dateMilliSeconds() ) ) && hb_vmRequestQuery() == 0 ); - if( !fResult ) + if( ! fResult ) nToRead = ( HB_SIZE ) -1; else if( dwAvail > 0 ) nToRead = ( ( HB_SIZE ) dwAvail < nBufferSize ) ? dwAvail : nBufferSize; @@ -936,18 +936,18 @@ HB_SIZE hb_fsPipeIsData( HB_FHANDLE hPipeHandle, HB_SIZE nBufferSize, end_timer > hb_dateMilliSeconds() ) ) && hb_vmRequestQuery() == 0 ); - if( !fResult ) + if( ! fResult ) nToRead = ( HB_SIZE ) -1; else if( avail.cbpipe > 0 ) nToRead = ( ( HB_SIZE ) avail.cbpipe < nBufferSize ) ? avail.cbpipe : nBufferSize; } -#elif defined( HB_OS_UNIX ) && !defined( HB_OS_SYMBIAN ) +#elif defined( HB_OS_UNIX ) && ! defined( HB_OS_SYMBIAN ) { struct timeval tv; fd_set rfds; int iResult; -#if !defined( HB_HAS_SELECT_TIMER ) +#if ! defined( HB_HAS_SELECT_TIMER ) HB_MAXUINT timer = nTimeOut <= 0 ? 0 : hb_dateMilliSeconds(); #else tv.tv_sec = ( long ) nTimeOut / 1000; @@ -961,7 +961,7 @@ HB_SIZE hb_fsPipeIsData( HB_FHANDLE hPipeHandle, HB_SIZE nBufferSize, tv.tv_sec = 1; tv.tv_usec = 0; } -#if !defined( HB_HAS_SELECT_TIMER ) +#if ! defined( HB_HAS_SELECT_TIMER ) else { tv.tv_sec = ( long ) nTimeOut / 1000; @@ -979,7 +979,7 @@ HB_SIZE hb_fsPipeIsData( HB_FHANDLE hPipeHandle, HB_SIZE nBufferSize, hb_fsOsError() != ( HB_ERRCODE ) EINTR || hb_vmRequestQuery() != 0 ) break; -#if !defined( HB_HAS_SELECT_TIMER ) +#if ! defined( HB_HAS_SELECT_TIMER ) else if( nTimeOut > 0 ) { HB_MAXUINT timecurr = hb_dateMilliSeconds(); @@ -997,7 +997,7 @@ HB_SIZE hb_fsPipeIsData( HB_FHANDLE hPipeHandle, HB_SIZE nBufferSize, } #else { -# if !defined( HB_OS_DOS ) +# if ! defined( HB_OS_DOS ) int iTODO; /* TODO: for given platform */ # endif HB_SYMBOL_UNUSED( hPipeHandle ); @@ -1276,7 +1276,7 @@ int hb_fsSetDevMode( HB_FHANDLE hFileHandle, int iDevMode ) return iRet; } #elif ( defined( _MSC_VER ) || defined( __MINGW32__ ) || defined( __DMC__ ) ) && \ - !defined( HB_OS_WIN_CE ) + ! defined( HB_OS_WIN_CE ) { int iRet = -1; @@ -3876,7 +3876,7 @@ HB_BOOL hb_fsEof( HB_FHANDLE hFileHandle ) fResult = HB_FALSE; } hb_fsSetIOError( fResult, 0 ); - fResult = !fResult || curPos == endPos; + fResult = ! fResult || curPos == endPos; } #else fResult = eof( hFileHandle ) != 0; diff --git a/harbour/src/rtl/fstemp.c b/harbour/src/rtl/fstemp.c index 577eb33ba6..c8888267a7 100644 --- a/harbour/src/rtl/fstemp.c +++ b/harbour/src/rtl/fstemp.c @@ -76,10 +76,10 @@ #include "hbwinuni.h" #endif -#if ( defined( HB_OS_LINUX ) && ( !defined( __WATCOMC__ ) || __WATCOMC__ >= 1280 ) ) || \ +#if ( defined( HB_OS_LINUX ) && ( ! defined( __WATCOMC__ ) || __WATCOMC__ >= 1280 ) ) || \ defined( HB_OS_BSD ) || defined( HB_OS_DARWIN ) || defined( HB_OS_SUNOS ) # define HB_HAS_MKSTEMP -# if ( defined( HB_OS_BSD ) && !defined( __NetBSD__ ) ) || defined( HB_OS_DARWIN ) +# if ( defined( HB_OS_BSD ) && ! defined( __NetBSD__ ) ) || defined( HB_OS_DARWIN ) # define HB_HAS_MKSTEMPS # elif defined( HB_OS_LINUX ) && \ ( defined( _BSD_SOURCE ) || defined( _SVID_SOURCE ) ) && \ diff --git a/harbour/src/rtl/gtsln/gtsln.h b/harbour/src/rtl/gtsln/gtsln.h index 59d0fdaa29..fa31134e93 100644 --- a/harbour/src/rtl/gtsln/gtsln.h +++ b/harbour/src/rtl/gtsln/gtsln.h @@ -118,7 +118,7 @@ #define HB_SLN_IS_CHAR( slch ) ( ( slch ).wchars[ 0 ] != 0 ) -#else /* !defined( HB_SLN_UTF8 ) */ +#else /* ! defined( HB_SLN_UTF8 ) */ #if SLANG_VERSION < 10400 typedef unsigned short SLsmg_Char_Type; diff --git a/harbour/src/rtl/gttrm/gttrm.c b/harbour/src/rtl/gttrm/gttrm.c index bce85fa05c..58235a0782 100644 --- a/harbour/src/rtl/gttrm/gttrm.c +++ b/harbour/src/rtl/gttrm/gttrm.c @@ -1700,7 +1700,7 @@ static void hb_gt_trm_XtermSetAttributes( PHB_GTTRM pTerm, int iAttr ) buff[ 0 ] = 0x1b; buff[ 1 ] = '['; - acsc = ( iAttr & HB_GTTRM_ATTR_ACSC ) && !pTerm->fUTF8 ? 1 : 0; + acsc = ( iAttr & HB_GTTRM_ATTR_ACSC ) && ! pTerm->fUTF8 ? 1 : 0; bg = s_AnsiColors[ ( iAttr >> 4 ) & 0x07 ]; fg = s_AnsiColors[ iAttr & 0x07 ]; bold = iAttr & 0x08 ? 1 : 0; diff --git a/harbour/src/rtl/gtwvt/gtwvt.c b/harbour/src/rtl/gtwvt/gtwvt.c index dd8aeceacd..81fc69c236 100644 --- a/harbour/src/rtl/gtwvt/gtwvt.c +++ b/harbour/src/rtl/gtwvt/gtwvt.c @@ -714,7 +714,7 @@ static void hb_gt_wvt_FitSize( PHB_GTWVT pWVT ) #if defined( HB_OS_WIN_CE ) pWVT->FixedFont = HB_FALSE; #else - pWVT->FixedFont = !pWVT->Win9X && pWVT->fontWidth >= 0 && + pWVT->FixedFont = ! pWVT->Win9X && pWVT->fontWidth >= 0 && ( tm.tmPitchAndFamily & TMPF_FIXED_PITCH ) == 0 && ( pWVT->PTEXTSIZE.x == tm.tmMaxCharWidth ); #endif @@ -1895,7 +1895,7 @@ static LRESULT CALLBACK hb_gt_wvt_WndProc( HWND hWnd, UINT message, WPARAM wPara pWVT->bAlreadySizing = HB_TRUE; else if( pWVT->ResizeMode == HB_GTI_RESIZEMODE_FONT ) { - if( !pWVT->bAlreadySizing ) + if( ! pWVT->bAlreadySizing ) hb_gt_wvt_FitSize( pWVT ); } else diff --git a/harbour/src/rtl/hbcom.c b/harbour/src/rtl/hbcom.c index dab201e0a3..ed28b9ecf2 100644 --- a/harbour/src/rtl/hbcom.c +++ b/harbour/src/rtl/hbcom.c @@ -62,8 +62,8 @@ #include "hbinit.h" #include "hbdate.h" -#if defined( HB_OS_UNIX ) && ( !defined( __WATCOMC__ ) || __WATCOMC__ > 1290 ) && \ - !defined( HB_OS_SYMBIAN ) /* || defined( __DJGPP__ ) */ +#if defined( HB_OS_UNIX ) && ( ! defined( __WATCOMC__ ) || __WATCOMC__ > 1290 ) && \ + ! defined( HB_OS_SYMBIAN ) /* || defined( __DJGPP__ ) */ # if defined( HB_OS_VXWORKS ) # if ! defined( HB_HAS_SIOLIB ) # define HB_HAS_SIOLIB @@ -116,7 +116,7 @@ typedef struct { #if defined( HB_HAS_TERMIOS ) HB_FHANDLE fd; -# if !defined( HB_OS_UNIX ) +# if ! defined( HB_OS_UNIX ) HB_MAXINT rdtimeout; # endif #elif defined( HB_OS_WIN ) @@ -2019,7 +2019,7 @@ int hb_comClose( int iPort ) fResult = CloseHandle( pCom->hComm ); pCom->hComm = INVALID_HANDLE_VALUE; pCom->status &= ~HB_COM_OPEN; - hb_comSetOsError( pCom, !fResult ); + hb_comSetOsError( pCom, ! fResult ); hb_vmLock(); } diff --git a/harbour/src/rtl/hbfilehi.prg b/harbour/src/rtl/hbfilehi.prg index c326dbb302..7ca8764c2a 100644 --- a/harbour/src/rtl/hbfilehi.prg +++ b/harbour/src/rtl/hbfilehi.prg @@ -252,14 +252,14 @@ FUNCTION hb_DirSepDel( cDir ) DO WHILE Len( cDir ) > 1 .AND. Right( cDir, 1 ) == hb_ps() .AND. ; !( cDir == hb_ps() + hb_ps() ) - cDir := hb_StrShrink( cDir, 1 ) + cDir := hb_StrShrink( cDir ) ENDDO ELSE DO WHILE Len( cDir ) > 1 .AND. Right( cDir, 1 ) == hb_ps() .AND. ; !( cDir == hb_ps() + hb_ps() ) .AND. ; !( Right( cDir, Len( hb_osDriveSeparator() ) + 1 ) == hb_osDriveSeparator() + hb_ps() ) - cDir := hb_StrShrink( cDir, 1 ) + cDir := hb_StrShrink( cDir ) ENDDO ENDIF diff --git a/harbour/src/rtl/hbgtcore.c b/harbour/src/rtl/hbgtcore.c index 88c9193435..f3c504a63d 100644 --- a/harbour/src/rtl/hbgtcore.c +++ b/harbour/src/rtl/hbgtcore.c @@ -853,7 +853,7 @@ static int hb_gt_def_PutTextW( PHB_GT pGT, int iRow, int iCol, int iColor, const { do { - if( !HB_GTSELF_PUTCHAR( pGT, iRow, iCol, iColor, 0, *szText++ ) ) + if( ! HB_GTSELF_PUTCHAR( pGT, iRow, iCol, iColor, 0, *szText++ ) ) break; ++iCol; } @@ -2043,7 +2043,7 @@ static int hb_gt_def_Alert( PHB_GT pGT, PHB_ITEM pMessage, PHB_ITEM pOptions, { if( ulCurrWidth <= ulDefWidth ) ulSpace1 = ulMsg; - else if( ulCurrWidth <= ulMaxWidth && !ulSpace2 ) + else if( ulCurrWidth <= ulMaxWidth && ! ulSpace2 ) ulSpace2 = ulMsg; } szMsgDsp[ ulDst++ ] = szMessageW[ ulMsg ]; diff --git a/harbour/src/rtl/hbi18n1.c b/harbour/src/rtl/hbi18n1.c index c98084d6c8..d872651ae9 100644 --- a/harbour/src/rtl/hbi18n1.c +++ b/harbour/src/rtl/hbi18n1.c @@ -505,7 +505,7 @@ static PHB_I18N_TRANS hb_i18n_deserialize( PHB_ITEM pItem ) if( pTable ) { pI18N = hb_i18n_initialize( pTable ); - if( !pI18N ) + if( ! pI18N ) hb_itemRelease( pTable ); } } diff --git a/harbour/src/rtl/hbproces.c b/harbour/src/rtl/hbproces.c index 30845d0c73..52972b0641 100644 --- a/harbour/src/rtl/hbproces.c +++ b/harbour/src/rtl/hbproces.c @@ -268,10 +268,10 @@ static int hb_fsProcessExec( const char * pszFilename, NULL, /* lpCurrentDirectory */ NULL, /* lpStartupInfo */ NULL ); /* lpProcessInformation */ - hb_fsSetIOError( !fError, 0 ); - if( !fError ) + hb_fsSetIOError( ! fError, 0 ); + if( ! fError ) { - hb_fsSetIOError( !fError, 0 ); + hb_fsSetIOError( ! fError, 0 ); iResult = 0; } hb_vmLock(); @@ -308,7 +308,7 @@ static int hb_fsProcessExec( const char * pszFilename, iStdErr = dup( 2 ); dup2( hStderr, 2 ); } -#if defined( HB_OS_UNIX ) && !defined( HB_OS_VXWORKS ) && !defined( HB_OS_SYMBIAN ) +#if defined( HB_OS_UNIX ) && ! defined( HB_OS_VXWORKS ) && ! defined( HB_OS_SYMBIAN ) { pid_t pid = fork(); if( pid == 0 ) @@ -707,11 +707,11 @@ int hb_fsProcessValue( HB_FHANDLE hProcess, HB_BOOL fWait ) dwResult = WaitForSingleObject( hProc, fWait ? INFINITE : 0 ); if( dwResult == WAIT_OBJECT_0 ) { - fError = !GetExitCodeProcess( hProc, &dwResult ); - iRetStatus = !fError ? ( int ) dwResult : -2; + fError = ! GetExitCodeProcess( hProc, &dwResult ); + iRetStatus = ! fError ? ( int ) dwResult : -2; } - hb_fsSetIOError( !fError, 0 ); - if( !fError ) + hb_fsSetIOError( ! fError, 0 ); + if( ! fError ) CloseHandle( hProc ); hb_vmLock(); } @@ -821,7 +821,7 @@ HB_BOOL hb_fsProcessClose( HB_FHANDLE hProcess, HB_BOOL fGentle ) else hb_fsSetError( ( HB_ERRCODE ) FS_ERROR ); } -#elif ( defined( HB_OS_UNIX ) && !defined( HB_OS_SYMBIAN ) ) || \ +#elif ( defined( HB_OS_UNIX ) && ! defined( HB_OS_SYMBIAN ) ) || \ ( defined( HB_OS_OS2 ) && defined( __GNUC__ ) ) { pid_t pid = ( pid_t ) hProcess; @@ -1072,7 +1072,7 @@ int hb_fsProcessRun( const char * pszFilename, CloseHandle( ( HANDLE ) hb_fsGetOsHandle( hProcess ) ); -#elif defined( HB_OS_UNIX ) && !defined( HB_OS_SYMBIAN ) +#elif defined( HB_OS_UNIX ) && ! defined( HB_OS_SYMBIAN ) fd_set rfds, wfds, *prfds, *pwfds; HB_FHANDLE fdMax; diff --git a/harbour/src/rtl/hbprocfn.c b/harbour/src/rtl/hbprocfn.c index 0a9106ac7e..f6a189031f 100644 --- a/harbour/src/rtl/hbprocfn.c +++ b/harbour/src/rtl/hbprocfn.c @@ -74,7 +74,7 @@ HB_FUNC( HB_PROCESSOPEN ) ( pStdErr || HB_ISNIL( 4 ) ) && ( HB_ISLOG( 5 ) || HB_ISNIL( 5 ) ) && ( HB_ISBYREF( 6 ) || HB_ISNIL( 6 ) ) && - ( !pStdIn || ( pStdIn != pStdOut && pStdIn != pStdErr ) ) ) + ( ! pStdIn || ( pStdIn != pStdOut && pStdIn != pStdErr ) ) ) { phStdIn = pStdIn ? &hStdIn : NULL; phStdOut = pStdOut ? &hStdOut : NULL; diff --git a/harbour/src/rtl/hbregex.c b/harbour/src/rtl/hbregex.c index 2fb0ce200e..d6c94da6c9 100644 --- a/harbour/src/rtl/hbregex.c +++ b/harbour/src/rtl/hbregex.c @@ -263,7 +263,7 @@ static HB_BOOL hb_regex( int iRequest ) return HB_FALSE; } pRegEx = hb_regexGet( hb_param( 1, HB_IT_ANY ), - ( !hb_parldef( 3, 1 ) ? HBREG_ICASE : 0 ) | + ( ! hb_parldef( 3, 1 ) ? HBREG_ICASE : 0 ) | ( hb_parl( 4 ) ? HBREG_NEWLINE : 0 ) ); if( ! pRegEx ) return HB_FALSE; diff --git a/harbour/src/rtl/hbregexc.c b/harbour/src/rtl/hbregexc.c index d41108a162..8dc3a28dcc 100644 --- a/harbour/src/rtl/hbregexc.c +++ b/harbour/src/rtl/hbregexc.c @@ -174,7 +174,7 @@ HB_BOOL hb_regexMatch( PHB_REGEX pRegEx, const char *szString, HB_SIZE nLen, HB_ HB_BOOL fMatch; fMatch = ( s_reg_exec )( pRegEx, szString, nLen, 1, aMatches ) > 0; - return fMatch && ( !fFull || + return fMatch && ( ! fFull || ( HB_REGMATCH_SO( aMatches, 0 ) == 0 && HB_REGMATCH_EO( aMatches, 0 ) == ( int ) nLen ) ); } diff --git a/harbour/src/rtl/hbsocket.c b/harbour/src/rtl/hbsocket.c index b524692d31..6a7836fd5f 100644 --- a/harbour/src/rtl/hbsocket.c +++ b/harbour/src/rtl/hbsocket.c @@ -253,17 +253,17 @@ # define socklen_t int #endif -#if !defined( INET_ADDRSTRLEN ) +#if ! defined( INET_ADDRSTRLEN ) # define INET_ADDRSTRLEN 16 #endif -#if defined( HB_OS_DOS ) && !defined( SHUT_RD ) +#if defined( HB_OS_DOS ) && ! defined( SHUT_RD ) # define SHUT_RD 0 # define SHUT_WR 1 # define SHUT_RDWR 2 #endif -#if defined( __WATCOMC__ ) && defined( HB_OS_LINUX ) && !defined( IP_ADD_MEMBERSHIP ) +#if defined( __WATCOMC__ ) && defined( HB_OS_LINUX ) && ! defined( IP_ADD_MEMBERSHIP ) /* it's missed in OpenWatcom 1.8 Linux header files :-( */ # define IP_ADD_MEMBERSHIP 35 struct ip_mreq @@ -816,7 +816,7 @@ static HB_CRITICAL_NEW( s_sockMtx ); static int s_iSessions; -#if defined( HB_HAS_INET6 ) && !defined( HB_HAS_INET6_ADDR_CONST ) && \ +#if defined( HB_HAS_INET6 ) && ! defined( HB_HAS_INET6_ADDR_CONST ) && \ defined( IN6ADDR_ANY_INIT ) static const struct in6_addr s_in6addr_any = IN6ADDR_ANY_INIT; #endif @@ -1318,7 +1318,7 @@ static void hb_socketSetOsError( int err ) case NO_DATA: #endif #if defined( NO_ADDRESS ) && \ - ( !defined( NO_DATA ) || NO_ADDRESS != NO_DATA ) + ( ! defined( NO_DATA ) || NO_ADDRESS != NO_DATA ) case NO_ADDRESS: #endif uiErr = HB_SOCKET_ERR_NODATA; @@ -1471,7 +1471,7 @@ static int hb_socketSelectRD( HB_SOCKET sd, HB_MAXINT timeout ) fd_set rfds; int iResult, iError; -#if !defined( HB_HAS_SELECT_TIMER ) +#if ! defined( HB_HAS_SELECT_TIMER ) HB_MAXUINT timer = timeout <= 0 ? 0 : hb_dateMilliSeconds(); #endif @@ -1525,7 +1525,7 @@ static int hb_socketSelectWR( HB_SOCKET sd, HB_MAXINT timeout ) fd_set wfds; int iResult, iError; -#if !defined( HB_HAS_SELECT_TIMER ) +#if ! defined( HB_HAS_SELECT_TIMER ) HB_MAXUINT timer = timeout <= 0 ? 0 : hb_dateMilliSeconds(); #endif @@ -1583,7 +1583,7 @@ static int hb_socketSelectWRE( HB_SOCKET sd, HB_MAXINT timeout ) #endif int iResult, iError; socklen_t len; -#if !defined( HB_HAS_SELECT_TIMER ) +#if ! defined( HB_HAS_SELECT_TIMER ) HB_MAXUINT timer = timeout <= 0 ? 0 : hb_dateMilliSeconds(); #endif @@ -1644,7 +1644,7 @@ static int hb_socketSelectWRE( HB_SOCKET sd, HB_MAXINT timeout ) #endif break; } -#if !defined( HB_OS_WIN ) +#if ! defined( HB_OS_WIN ) if( iResult > 0 && FD_ISSET( ( HB_SOCKET_T ) sd, &wfds ) ) { len = sizeof( iError ); @@ -1702,7 +1702,7 @@ HB_BOOL hb_socketInetAddr( void ** pSockAddr, unsigned * puiLen, memset( &sa, 0, sizeof( sa ) ); sa.sin_family = AF_INET; sa.sin_port = htons( ( HB_U16 ) iPort ); - if( !szAddr || !*szAddr ) + if( ! szAddr || ! *szAddr ) { sa.sin_addr.s_addr = htonl( INADDR_ANY ); *pSockAddr = memcpy( hb_xgrab( sizeof( sa ) + 1 ), &sa, sizeof( sa ) ); @@ -1747,7 +1747,7 @@ HB_BOOL hb_socketInet6Addr( void ** pSockAddr, unsigned * puiLen, memset( &sa, 0, sizeof( sa ) ); sa.sin6_family = AF_INET6; sa.sin6_port = htons( ( HB_U16 ) iPort ); - if( !szAddr || !*szAddr ) + if( ! szAddr || ! *szAddr ) { #if defined( HB_HAS_INET6_ADDR_CONST ) memcpy( &sa.sin6_addr, &in6addr_any, sizeof( struct in6_addr ) ); @@ -2484,7 +2484,7 @@ int hb_socketSetBlockingIO( HB_SOCKET sd, HB_BOOL fBlocking ) HB_BOOL fBlocked; long flags; fBlocked = ( ret & O_NONBLOCK ) == 0; - if( fBlocking ? !fBlocked : fBlocked ) + if( fBlocking ? ! fBlocked : fBlocked ) { if( fBlocking ) flags = ret & ~O_NONBLOCK; @@ -3546,4 +3546,4 @@ PHB_ITEM hb_socketGetIFaces( int af, HB_BOOL fNoAliases ) return pArray; } -#endif /* !HB_SOCKET_OFF */ +#endif /* ! HB_SOCKET_OFF */ diff --git a/harbour/src/rtl/hbtoken.c b/harbour/src/rtl/hbtoken.c index 172f0caf98..8fbd923608 100644 --- a/harbour/src/rtl/hbtoken.c +++ b/harbour/src/rtl/hbtoken.c @@ -77,7 +77,7 @@ static HB_SIZE hb_tokenCount( const char * szLine, HB_SIZE nLen, ( szLine[ ul ] == '\'' && ( iFlags & _HB_TOK_RESPECT_SQUOTE ) ) ) cQuote = szLine[ ul ]; else if( szLine[ ul ] == szDelim[ 0 ] && - ( nDelim == 1 || !memcmp( szLine + ul, szDelim, nDelim ) ) ) + ( nDelim == 1 || ! memcmp( szLine + ul, szDelim, nDelim ) ) ) { ++nTokens; if( ( iFlags & _HB_TOK_ISDELIM ) == 0 ) @@ -111,7 +111,7 @@ static const char * hb_tokenGet( const char * szLine, HB_SIZE nLen, ( szLine[ ul ] == '\'' && ( iFlags & _HB_TOK_RESPECT_SQUOTE ) ) ) cQuote = szLine[ ul ]; else if( szLine[ ul ] == szDelim[ 0 ] && - ( nDelim == 1 || !memcmp( szLine + ul, szDelim, nDelim ) ) ) + ( nDelim == 1 || ! memcmp( szLine + ul, szDelim, nDelim ) ) ) { if( --nToken == 0 ) { @@ -159,7 +159,7 @@ static PHB_ITEM hb_tokenArray( const char * szLine, HB_SIZE nLen, ( szLine[ ul ] == '\'' && ( iFlags & _HB_TOK_RESPECT_SQUOTE ) ) ) cQuote = szLine[ ul ]; else if( szLine[ ul ] == szDelim[ 0 ] && - ( nDelim == 1 || !memcmp( szLine + ul, szDelim, nDelim ) ) ) + ( nDelim == 1 || ! memcmp( szLine + ul, szDelim, nDelim ) ) ) { hb_arraySetCL( pArray, ++nToken, szLine + nStart, ul - nStart ); if( ( iFlags & _HB_TOK_ISDELIM ) == 0 ) diff --git a/harbour/src/rtl/itemseri.c b/harbour/src/rtl/itemseri.c index c0d3c3769a..1d42786b50 100644 --- a/harbour/src/rtl/itemseri.c +++ b/harbour/src/rtl/itemseri.c @@ -1667,7 +1667,7 @@ PHB_ITEM hb_itemDeserialize( const char ** pBufferPtr, HB_SIZE * pnSize ) const HB_UCHAR * pBuffer = ( const HB_UCHAR * ) *pBufferPtr; PHB_ITEM pItem = NULL; - if( !pnSize || hb_deserializeTest( ( const HB_UCHAR ** ) pBufferPtr, pnSize, 0, &pRef ) ) + if( ! pnSize || hb_deserializeTest( ( const HB_UCHAR ** ) pBufferPtr, pnSize, 0, &pRef ) ) { pItem = hb_itemNew( NULL ); hb_deserializeItem( pItem, NULL, NULL, pBuffer, 0, pRef ); @@ -1684,7 +1684,7 @@ PHB_ITEM hb_itemDeserializeCP( const char ** pBufferPtr, HB_SIZE * pnSize, const HB_UCHAR * pBuffer = ( const HB_UCHAR * ) *pBufferPtr; PHB_ITEM pItem = NULL; - if( !pnSize || hb_deserializeTest( ( const HB_UCHAR ** ) pBufferPtr, pnSize, 0, &pRef ) ) + if( ! pnSize || hb_deserializeTest( ( const HB_UCHAR ** ) pBufferPtr, pnSize, 0, &pRef ) ) { pItem = hb_itemNew( NULL ); hb_deserializeItem( pItem, cdpIn, cdpOut, pBuffer, 0, pRef ); diff --git a/harbour/src/rtl/net.c b/harbour/src/rtl/net.c index 837ad1760c..1e39ff1ca3 100644 --- a/harbour/src/rtl/net.c +++ b/harbour/src/rtl/net.c @@ -108,7 +108,7 @@ #endif -#if !defined( MAXGETHOSTNAME ) && ( defined( HB_OS_UNIX ) || \ +#if ! defined( MAXGETHOSTNAME ) && ( defined( HB_OS_UNIX ) || \ ( ( defined( HB_OS_OS2 ) || defined( HB_OS_DOS ) ) && \ defined( __GNUC__ ) ) ) #define MAXGETHOSTNAME 256 /* should be enough for a host name */ diff --git a/harbour/src/rtl/objfunc.prg b/harbour/src/rtl/objfunc.prg index 6f65f40a14..989513b94a 100644 --- a/harbour/src/rtl/objfunc.prg +++ b/harbour/src/rtl/objfunc.prg @@ -93,8 +93,8 @@ FUNCTION __objGetMsgList( oObject, lDataMethod, nClassType ) LOCAL aInfo LOCAL aData - LOCAL n - LOCAL nLen + LOCAL cName + LOCAL nFirst IF ! HB_ISOBJECT( oObject ) __errRT_BASE( EG_ARG, 3101, NIL, ProcName( 0 ) ) @@ -103,28 +103,22 @@ FUNCTION __objGetMsgList( oObject, lDataMethod, nClassType ) hb_default( @lDataMethod, .T. ) hb_default( @nClasstype, HB_MSGLISTALL ) - aInfo := ASort( oObject:ClassSel( nClassType ) ) + aInfo := oObject:ClassSel( nClassType ) aData := {} - n := 1 - nLen := Len( aInfo ) + nFirst := AScan( aInfo, {| n | Left( n, 1 ) == "_" } ) - DO WHILE n <= nLen .AND. !( SubStr( aInfo[ n ], 1, 1 ) == "_" ) + FOR EACH cName IN aInfo - /* If in range and no set function found yet - (set functions begin with a leading underscore). */ + /* Set functions begin with a leading underscore */ + IF !( Left( cName, 1 ) == "_" ) - // If found -> DATA - // else METHOD - - /* Find position of matching set function in array with all symbols */ - - IF ( AScan( aInfo, {| tmp | tmp == ( "_" + aInfo[ n ] ) }, n + 1 ) != 0 ) == lDataMethod - AAdd( aData, aInfo[ n ] ) + /* Find position of matching set function in array with all symbols */ + /* If found: DATA, else: METHOD */ + IF ( AScan( aInfo, {| tmp | tmp == ( "_" + cName ) }, nFirst ) != 0 ) == lDataMethod + AAdd( aData, cName ) + ENDIF ENDIF - - n++ - - ENDDO + NEXT RETURN aData diff --git a/harbour/src/rtl/tgetint.prg b/harbour/src/rtl/tgetint.prg index 4cf080b973..4232525dd7 100644 --- a/harbour/src/rtl/tgetint.prg +++ b/harbour/src/rtl/tgetint.prg @@ -50,8 +50,8 @@ * */ -REQUEST HB_PVALUE -REQUEST PCOUNT +REQUEST hb_PValue +REQUEST PCount FUNCTION __Get( bSetGet, cVarName, cPicture, bValid, bWhen ) diff --git a/harbour/src/rtl/tpersist.prg b/harbour/src/rtl/tpersist.prg index 5751a84c6a..7a5721629c 100644 --- a/harbour/src/rtl/tpersist.prg +++ b/harbour/src/rtl/tpersist.prg @@ -52,7 +52,7 @@ #include "hbclass.ch" -REQUEST ARRAY +REQUEST Array CREATE CLASS HBPersistent diff --git a/harbour/src/rtl/transfrm.c b/harbour/src/rtl/transfrm.c index 6de970371e..6a30048801 100644 --- a/harbour/src/rtl/transfrm.c +++ b/harbour/src/rtl/transfrm.c @@ -899,7 +899,7 @@ HB_FUNC( TRANSFORM ) nResultPos = 0; szResult = ( char * ) hb_xgrab( nPicLen + 2 ); - for( ; ( nPicLen || ! bDone ) && !bExit ; nResultPos++, szPic++, nPicLen-- ) + for( ; ( nPicLen || ! bDone ) && ! bExit; nResultPos++, szPic++, nPicLen-- ) { if( nPicLen ) cPic = *szPic; diff --git a/harbour/src/rtl/valtoexp.prg b/harbour/src/rtl/valtoexp.prg index 3a7b9ecb1f..4e4c1b150b 100644 --- a/harbour/src/rtl/valtoexp.prg +++ b/harbour/src/rtl/valtoexp.prg @@ -129,10 +129,10 @@ STATIC FUNCTION s_valToExp( xVal, lRaw, cInd, hRefs, cRefs, cObjs ) ENDIF ELSE cVal := "{" - IF !lRaw .AND. v == "O" + IF ! lRaw .AND. v == "O" FOR EACH tmp IN __objGetIVars( xVal ) - cVal += iif( tmp:__enumIndex() == 1, "{'", ", {'" ) + ; - tmp[ 1 ] + "', " + ; + cVal += iif( tmp:__enumIndex() == 1, '{"', ', {"' ) + ; + tmp[ 1 ] + '", ' + ; s_valToExp( tmp[ 2 ], lRaw, ; cInd + hb_ntos( tmp:__enumIndex() ) + ",2", ; hRefs, @cRefs, @cObjs ) + "}" @@ -152,7 +152,7 @@ STATIC FUNCTION s_valToExp( xVal, lRaw, cInd, hRefs, cRefs, cObjs ) ELSE cObjs += "," ENDIF - cObjs += "{'" + cClass + "'," + cObjs += '{"' + cClass + '",' IF ! cInd == "" cObjs += "{" + hb_StrShrink( cInd ) + "}" ENDIF diff --git a/harbour/src/vm/classes.c b/harbour/src/vm/classes.c index 33685dc804..9db9a4913c 100644 --- a/harbour/src/vm/classes.c +++ b/harbour/src/vm/classes.c @@ -993,7 +993,7 @@ static void hb_clsDefineSuperClass( PCLASS pClass, HB_USHORT uiSuperCls, HB_BOOL pSprCls = s_pClasses[ uiSuperCls ]; - if( !hb_clsHasParentClass( pClass, uiSuperCls ) ) + if( ! hb_clsHasParentClass( pClass, uiSuperCls ) ) { if( fNew ) { @@ -5124,7 +5124,7 @@ static PHB_ITEM hb_objGetIVars( PHB_ITEM pObject, HB_SIZE nLimit, nLen, nCount, nSize, nIndex, nOffset; HB_USHORT uiClass, uiSuperClasses; - if( !pObject || !HB_IS_OBJECT( pObject ) ) + if( ! pObject || ! HB_IS_OBJECT( pObject ) ) return NULL; uiClass = pObject->item.asArray.value->uiClass; @@ -5189,11 +5189,11 @@ static PHB_ITEM hb_objGetIVars( PHB_ITEM pObject, if( pInfo->uiStatus < uiStatus ) { pItem = hb_arrayGetItemPtr( pObject, nIndex ); - if( !pItem || ( pInfo->uiStatus == 0 && HB_IS_NIL( pItem ) ) ) + if( ! pItem || ( pInfo->uiStatus == 0 && HB_IS_NIL( pItem ) ) ) uiStatus = 3; else { - if( !pInfo->pMethod ) + if( ! pInfo->pMethod ) ++nSize; pInfo->pMethod = pMethod; pInfo->uiClass = uiClass; @@ -5266,7 +5266,7 @@ static void hb_objSetIVars( PHB_ITEM pObject, PHB_ITEM pArray ) PHB_ITEM pNewVal = hb_arrayGetItemPtr( pValue, 2 ); HB_USHORT uiSuper = uiClass; - if( !pVarSym ) + if( ! pVarSym ) { const char * pszClass = strchr( pszMethod, ':' ); if( pszClass ) @@ -5327,7 +5327,7 @@ HB_FUNC( __OBJSETIVARS ) pObject = pNewObj = hb_clsInst( hb_clsFindClass( hb_itemGetCPtr( pObject ), NULL ) ); else if( HB_IS_SYMBOL( pObject ) ) pObject = pNewObj = hb_clsInst( hb_clsFindClassByFunc( hb_itemGetSymbol( pObject ) ) ); - else if( !HB_IS_OBJECT( pObject ) ) + else if( ! HB_IS_OBJECT( pObject ) ) pObject = NULL; hb_objSetIVars( pObject, pArray ); diff --git a/harbour/src/vm/dynlibhb.c b/harbour/src/vm/dynlibhb.c index 37e3fc1bbe..2665e7a3fa 100644 --- a/harbour/src/vm/dynlibhb.c +++ b/harbour/src/vm/dynlibhb.c @@ -78,8 +78,8 @@ /* NOTE: VxWorks supports dlopen() functionality only in shared executables. [vszakats] */ -#if !defined( HB_HAS_DLFCN ) && \ - ( ( defined( HB_OS_LINUX ) && !defined( __WATCOMC__ ) ) || \ +#if ! defined( HB_HAS_DLFCN ) && \ + ( ( defined( HB_OS_LINUX ) && ! defined( __WATCOMC__ ) ) || \ defined( HB_OS_SUNOS ) || defined( HB_OS_DARWIN ) || \ defined( HB_OS_BSD ) || defined( HB_OS_BEOS ) || \ defined( HB_OS_QNX ) || defined( HB_OS_CYGWIN ) || \ diff --git a/harbour/src/vm/estack.c b/harbour/src/vm/estack.c index bfa48de9d7..39dd04d1de 100644 --- a/harbour/src/vm/estack.c +++ b/harbour/src/vm/estack.c @@ -87,13 +87,13 @@ # ifdef HB_USE_TLS /* compiler has native support for TLS */ -# if !defined( _HB_STACK_MACROS_ ) +# if ! defined( _HB_STACK_MACROS_ ) # if defined( __BORLANDC__ ) static PHB_STACK HB_TLS_ATTR hb_stack_ptr; # else static HB_TLS_ATTR PHB_STACK hb_stack_ptr; # endif -# elif !defined( _HB_STACK_LOCAL_MACROS_ ) +# elif ! defined( _HB_STACK_LOCAL_MACROS_ ) # if defined( __BORLANDC__ ) PHB_STACK HB_TLS_ATTR hb_stack_ptr = NULL; # else @@ -110,14 +110,14 @@ # else /* compiler has no native TLS support, we have to implement it ourselves */ -# if !defined( _HB_STACK_MACROS_ ) +# if ! defined( _HB_STACK_MACROS_ ) static HB_TLS_KEY hb_stack_key; # define hb_stack_ptr ( ( PHB_STACK ) hb_tls_get( hb_stack_key ) ) -# elif !defined( _HB_STACK_LOCAL_MACROS_ ) +# elif ! defined( _HB_STACK_LOCAL_MACROS_ ) HB_TLS_KEY hb_stack_key; # endif static volatile HB_BOOL s_fInited = HB_FALSE; -# define hb_stack_alloc() do { if( !s_fInited ) { \ +# define hb_stack_alloc() do { if( ! s_fInited ) { \ hb_tls_init( hb_stack_key ); \ s_fInited = HB_TRUE; } \ hb_tls_set( hb_stack_key, \ @@ -130,7 +130,7 @@ # endif /* HB_USE_TLS */ -# if !defined( HB_STACK_PRELOAD ) +# if ! defined( HB_STACK_PRELOAD ) # undef hb_stack # define hb_stack ( * hb_stack_ptr ) # endif @@ -138,9 +138,9 @@ #else /* no MT mode */ -# if !defined( _HB_STACK_MACROS_ ) +# if ! defined( _HB_STACK_MACROS_ ) static HB_STACK hb_stack; -# elif !defined( _HB_STACK_LOCAL_MACROS_ ) +# elif ! defined( _HB_STACK_LOCAL_MACROS_ ) HB_STACK hb_stack; # endif diff --git a/harbour/src/vm/eval.c b/harbour/src/vm/eval.c index ed79bca0db..42592686f0 100644 --- a/harbour/src/vm/eval.c +++ b/harbour/src/vm/eval.c @@ -428,7 +428,7 @@ HB_FUNC( HB_EXECFROMARRAY ) if( iPCount == 1 ) { - if( HB_IS_ARRAY( pParam ) && !HB_IS_OBJECT( pParam ) ) + if( HB_IS_ARRAY( pParam ) && ! HB_IS_OBJECT( pParam ) ) { pArray = pParam; pItem = hb_arrayGetItemPtr( pArray, 1 ); diff --git a/harbour/src/vm/garbage.c b/harbour/src/vm/garbage.c index fcf1e256bb..26c911919c 100644 --- a/harbour/src/vm/garbage.c +++ b/harbour/src/vm/garbage.c @@ -116,7 +116,7 @@ typedef struct HB_GARBAGE_ #define HB_GC_PTR( p ) ( ( PHB_GARBAGE ) ( ( HB_BYTE * ) ( p ) - HB_GARBAGE_SIZE ) ) -#endif /* !defined( HB_GC_PTR ) */ +#endif /* ! defined( HB_GC_PTR ) */ #define HB_BLOCK_PTR( p ) ( ( void * ) ( ( HB_BYTE * ) ( p ) + HB_GARBAGE_SIZE ) ) diff --git a/harbour/src/vm/hashfunc.c b/harbour/src/vm/hashfunc.c index 4ecbcf7df1..f296a8b8c7 100644 --- a/harbour/src/vm/hashfunc.c +++ b/harbour/src/vm/hashfunc.c @@ -533,7 +533,7 @@ HB_FUNC( HB_HSCAN ) { if( HB_IS_DATETIME( pItem ) && pItem->item.asDateTime.julian == pValue->item.asDateTime.julian && - ( !fExact || pItem->item.asDateTime.time == pValue->item.asDateTime.time ) ) + ( ! fExact || pItem->item.asDateTime.time == pValue->item.asDateTime.time ) ) { fFound = HB_TRUE; break; diff --git a/harbour/src/vm/hvm.c b/harbour/src/vm/hvm.c index abdcb7855e..e340f0e0b9 100644 --- a/harbour/src/vm/hvm.c +++ b/harbour/src/vm/hvm.c @@ -177,7 +177,7 @@ static void hb_vmPushDoubleConst( double dNumber, int iWidth, int iDec ); /* static void hb_vmPushLocal( int iLocal ); /* pushes the containts of a local onto the stack */ static void hb_vmPushLocalByRef( int iLocal ); /* pushes a local by refrence onto the stack */ static void hb_vmPushHBLong( HB_MAXINT nNumber ); /* pushes a HB_MAXINT number onto the stack */ -#if !defined( HB_LONG_LONG_OFF ) +#if ! defined( HB_LONG_LONG_OFF ) static void hb_vmPushLongLongConst( HB_LONGLONG lNumber ); /* Pushes a long long constant (pcode) */ #endif #if HB_VMINT_MAX >= INT32_MAX @@ -5830,11 +5830,12 @@ void hb_vmProc( HB_USHORT uiParams ) ulClock = ( HB_ULONG ) clock(); #endif - /* Poll the console keyboard - #if !defined( HB_GUI ) + /* Poll the console keyboard */ +#if 0 + #if ! defined( HB_GUI ) hb_inkeyPoll(); #endif - */ +#endif pSym = hb_stackNewFrame( &sStackState, uiParams )->item.asSymbol.value; HB_VM_FUNCUNREF( pSym ); @@ -5891,11 +5892,12 @@ void hb_vmDo( HB_USHORT uiParams ) ulClock = ( HB_ULONG ) clock(); #endif - /* Poll the console keyboard - #if !defined( HB_GUI ) + /* Poll the console keyboard */ +#if 0 + #if ! defined( HB_GUI ) hb_inkeyPoll(); #endif - */ +#endif pSym = hb_stackNewFrame( &sStackState, uiParams )->item.asSymbol.value; pSelf = hb_stackSelfItem(); /* NIL, OBJECT or BLOCK */ @@ -5981,11 +5983,12 @@ void hb_vmSend( HB_USHORT uiParams ) ulClock = ( HB_ULONG ) clock(); #endif - /* Poll the console keyboard - #if !defined( HB_GUI ) + /* Poll the console keyboard */ +#if 0 + #if ! defined( HB_GUI ) hb_inkeyPoll(); #endif - */ +#endif pSym = hb_stackNewFrame( &sStackState, uiParams )->item.asSymbol.value; pSelf = hb_stackSelfItem(); /* NIL, OBJECT or BLOCK */ @@ -8133,7 +8136,7 @@ static void hb_vmDoInitFunctions( HB_BOOL fClipInit ) if( scope == HB_FS_INIT && ( strcmp( ( pLastSymbols->pModuleSymbols + ui )->szName, - "CLIPINIT$" ) == 0 ? fClipInit : !fClipInit ) ) + "CLIPINIT$" ) == 0 ? fClipInit : ! fClipInit ) ) { hb_vmPushSymbol( pLastSymbols->pModuleSymbols + ui ); hb_vmPushNil(); diff --git a/harbour/src/vm/hvmall.c b/harbour/src/vm/hvmall.c index 4c749a3571..f016849b29 100644 --- a/harbour/src/vm/hvmall.c +++ b/harbour/src/vm/hvmall.c @@ -92,7 +92,7 @@ # else static HB_TLS_ATTR PHB_STACK hb_stack_ptr = NULL; # endif -# elif !defined( hb_stack_ptr_get ) +# elif ! defined( hb_stack_ptr_get ) static HB_TLS_KEY hb_stack_key; # endif # else diff --git a/harbour/src/vm/memvars.c b/harbour/src/vm/memvars.c index 40c8da4ee3..05cafcca74 100644 --- a/harbour/src/vm/memvars.c +++ b/harbour/src/vm/memvars.c @@ -1176,7 +1176,7 @@ HB_FUNC( __MVRELEASE ) const char * pszMask; pszMask = hb_memvarGetMask( 1 ); - bIncludeVar = ( pszMask[ 0 ] == '*' && !pszMask[ 1 ] ) || + bIncludeVar = ( pszMask[ 0 ] == '*' && ! pszMask[ 1 ] ) || iCount < 2 || hb_parl( 2 ); hb_memvarReleaseWithMask( pszMask, bIncludeVar ); } diff --git a/harbour/src/vm/set.c b/harbour/src/vm/set.c index 18aec6bca2..d65e7a05ad 100644 --- a/harbour/src/vm/set.c +++ b/harbour/src/vm/set.c @@ -317,7 +317,7 @@ static void open_handle( PHB_SET_STRUCT pSet, const char * file_name, if( ! szFileName ) return; - /* Open the file either in append (bAppend) or truncate mode (!bAppend), but + /* Open the file either in append (bAppend) or truncate mode (! bAppend), but always use binary mode */ /* QUESTION: What sharing mode does Clipper use ? [vszakats] */ diff --git a/harbour/src/vm/thread.c b/harbour/src/vm/thread.c index 2d9151f26d..fe731200ac 100644 --- a/harbour/src/vm/thread.c +++ b/harbour/src/vm/thread.c @@ -124,7 +124,7 @@ #endif -#if !defined( HB_MT_VM ) +#if ! defined( HB_MT_VM ) /* nothing */ #else static volatile HB_BOOL s_fThreadInit = HB_FALSE; @@ -157,11 +157,11 @@ static HB_RAWCRITICAL_T s_mutexlst_mtx; static void hb_threadCriticalInit( HB_CRITICAL_T * critical ) { - if( !s_fThreadInit ) + if( ! s_fThreadInit ) hb_threadInit(); HB_CRITICAL_LOCK( s_init_mtx ); - if( !critical->fInit ) + if( ! critical->fInit ) { HB_CRITICAL_INIT( critical->critical.value ); critical->fInit = HB_TRUE; @@ -181,14 +181,14 @@ static HB_RAWCOND_T s_thread_cond; static void hb_threadCondInit( HB_COND_T * cond ) { - if( !s_fThreadInit ) + if( ! s_fThreadInit ) hb_threadInit(); HB_CRITICAL_LOCK( s_init_mtx ); - if( !cond->fInit ) + if( ! cond->fInit ) { HB_COND_INIT( cond->cond.value ); -# if !defined( HB_COND_OS_SUPPORT ) +# if ! defined( HB_COND_OS_SUPPORT ) HB_CRITICAL_INIT( cond->critical.value ); cond->waiters = 0; # endif @@ -467,7 +467,7 @@ static HB_BOOL _hb_thread_cond_wait( HB_COND_T * cond, HB_RAWCRITICAL_T * critic { static PULONG s_pThID = NULL; - if( !s_pThID ) + if( ! s_pThID ) { DosAllocThreadLocalMemory( 1, &s_pThID ); *s_pThID = 0; diff --git a/harbour/tests/clsscope.prg b/harbour/tests/clsscope.prg index 558fff5e60..f235c6dc26 100644 --- a/harbour/tests/clsscope.prg +++ b/harbour/tests/clsscope.prg @@ -486,7 +486,7 @@ RETURN self 2006-09-16 23:20 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) ========================================================================= - 09/16/06 23:17:33 Harbour Alpha build 46.2 Intl. (Flex) Linux 2.6.15 i686 + 2006-09-16 23:17:33 Harbour Alpha build 46.2 Intl. (Flex) Linux 2.6.15 i686 Class Access: hVar:= cls1 @@ -751,7 +751,7 @@ RETURN self 2006-09-16 23:20 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) ========================================================================= - 09/16/06 23:18:59 Harbour Alpha build 46.2 Intl. (Flex) Linux 2.6.15 i686 + 2006-09-16 23:18:59 Harbour Alpha build 46.2 Intl. (Flex) Linux 2.6.15 i686 Class Access: hVar:= cls1 diff --git a/harbour/tests/codebl.prg b/harbour/tests/codebl.prg index fae302f8cb..264d53a236 100644 --- a/harbour/tests/codebl.prg +++ b/harbour/tests/codebl.prg @@ -55,7 +55,7 @@ STATIC FUNCTION myout( nExpected, nGot ) // -PROCEDURE GetArray( a ) +STATIC PROCEDURE GetArray( a ) LOCAL i @@ -70,7 +70,7 @@ PROCEDURE GetArray( a ) RETURN -PROCEDURE PrintArray( a ) +STATIC PROCEDURE PrintArray( a ) LOCAL i @@ -85,7 +85,7 @@ PROCEDURE PrintArray( a ) // -FUNCTION DetachWithRefer() +STATIC FUNCTION DetachWithRefer() LOCAL nTest LOCAL bBlock1 := MakeBlock() @@ -96,13 +96,13 @@ FUNCTION DetachWithRefer() RETURN NIL -FUNCTION MakeBlock() +STATIC FUNCTION MakeBlock() LOCAL nTest RETURN {|| DoThing( @nTest ), QOut( nTest ) } -FUNCTION DoThing( n ) +STATIC FUNCTION DoThing( n ) n := 42 @@ -110,7 +110,7 @@ FUNCTION DoThing( n ) // -FUNCTION DetachToStatic( n ) +STATIC FUNCTION DetachToStatic( n ) s_cbStatic := {| x | n + x } @@ -118,7 +118,7 @@ FUNCTION DetachToStatic( n ) // -FUNCTION ReferParam() +STATIC FUNCTION ReferParam() LOCAL bResult @@ -186,5 +186,4 @@ STATIC FUNCTION SetByRef( lVar ) RETURN NIL STATIC FUNCTION GetBlock( lVar ) - RETURN {|| lVar } diff --git a/harbour/tests/codebloc.prg b/harbour/tests/codebloc.prg index a3f09282cf..bb91b9f0b7 100644 --- a/harbour/tests/codebloc.prg +++ b/harbour/tests/codebloc.prg @@ -85,13 +85,13 @@ PROCEDURE Main() RETURN -FUNCTION MyEval( bCodeBlock ) +STATIC FUNCTION MyEval( bCodeBlock ) LOCAL D := "this is another variable" RETURN Eval( bCodeBlock, " from ", "MyEval Function" ) -PROCEDURE OtherTest( cblock ) +STATIC PROCEDURE OtherTest( cblock ) LOCAL cb @@ -101,7 +101,7 @@ PROCEDURE OtherTest( cblock ) RETURN -PROCEDURE AnotherTest( cb, a ) +STATIC PROCEDURE AnotherTest( cb, a ) OutStd( Eval( cb, a ) ) OutStd( hb_eol() ) @@ -110,7 +110,7 @@ PROCEDURE AnotherTest( cb, a ) RETURN -FUNCTION DetachLocal( x, y ) +STATIC FUNCTION DetachLocal( x, y ) // NOTE! this should work LOCAL z := x + y @@ -118,7 +118,7 @@ FUNCTION DetachLocal( x, y ) RETURN cb -PROCEDURE BugToFix() +STATIC PROCEDURE BugToFix() LOCAL b, a := {|| a + b } @@ -127,6 +127,5 @@ PROCEDURE BugToFix() RETURN -FUNCTION RetBlock() - +STATIC FUNCTION RetBlock() RETURN {| x | x * x } diff --git a/harbour/tests/dates3.prg b/harbour/tests/dates3.prg index c0c72bdf90..3498981d4b 100644 --- a/harbour/tests/dates3.prg +++ b/harbour/tests/dates3.prg @@ -46,6 +46,5 @@ PROCEDURE Main() // Like NG's sample -FUNCTION LastMonday( dDate ) - +STATIC FUNCTION LastMonday( dDate ) RETURN dDate - DoW( dDate ) + 2 diff --git a/harbour/tests/debug.prg b/harbour/tests/debug.prg index 5a5d4a4880..02659ea82f 100644 --- a/harbour/tests/debug.prg +++ b/harbour/tests/debug.prg @@ -40,7 +40,7 @@ PROCEDURE Main() oForm:Transfer( { "nLeft", 50 }, { "nRight", 100 } ) ? hb_ValToExp( oForm:Transfer() ) - Pause() + Inkey( 0 ) ? "-DEBUG Functions-" ? "-Statics-" @@ -55,17 +55,13 @@ PROCEDURE Main() ? "-Parameters-" ? hb_ValToExp( __dbgVMParLList() ) - Pause() + Inkey( 0 ) FuncSecond( 241, "Hello" ) RETURN -FUNCTION Pause() - - RETURN __Accept( "" ) - -FUNCTION FuncSecond( nParam, cParam, uParam ) +STATIC FUNCTION FuncSecond( nParam, cParam, uParam ) LOCAL cWhat := "Something" LOCAL nNumber := 2 @@ -101,14 +97,13 @@ FUNCTION FuncSecond( nParam, cParam, uParam ) ? ":-)" ENDIF - Pause() + Inkey( 0 ) RETURN NIL - /* TForm() -> */ -FUNCTION TForm() +STATIC FUNCTION TForm() STATIC s_oClass diff --git a/harbour/tests/dynobj.prg b/harbour/tests/dynobj.prg index f63c039eb4..5986ea663f 100644 --- a/harbour/tests/dynobj.prg +++ b/harbour/tests/dynobj.prg @@ -159,6 +159,6 @@ STATIC FUNCTION BigSmile() FUNCTION Pause() - __Accept( "Pause :" ) + WAIT "Pause:" RETURN NIL diff --git a/harbour/tests/extend1.hbp b/harbour/tests/extend1.hbp new file mode 100644 index 0000000000..9cb5e5bb1e --- /dev/null +++ b/harbour/tests/extend1.hbp @@ -0,0 +1,8 @@ +# +# $Id$ +# + +-warn + +extend1.prg +extend2.c diff --git a/harbour/tests/extend1.prg b/harbour/tests/extend1.prg index 0bd70097c7..2964c06e3e 100644 --- a/harbour/tests/extend1.prg +++ b/harbour/tests/extend1.prg @@ -2,9 +2,12 @@ * $Id$ */ -// Testing Harbour Extended system. -// -// NOTE: compile extend1.prg and extend2.c and link both files +/* + * Testing Clipper Extended system. + * + * NOTE: build together with extend2.c + * In Harbour use command 'hbmk2 extend1.hbp' + */ PROCEDURE Main() @@ -37,7 +40,7 @@ PROCEDURE Main() ? ? - __Accept( "Press return to continue..." ) + WAIT "Press any key to continue..." ? "Strings:" ? "========" @@ -70,7 +73,7 @@ PROCEDURE Main() ? ? - __Accept( "Press return to continue..." ) + WAIT "Press any key to continue..." ? "Logicals:" ? "=========" @@ -101,21 +104,21 @@ PROCEDURE Main() ? ? - __Accept( "Press return to continue..." ) + WAIT "Press any key to continue..." ? "Dates: (SET CENTURY ON)" ? "=======================" ? - ? ' _pards() and _retds() with Date1( CToD( "01/01/2000" ) ) =>', Date1( CToD( "01/01/2000" ) ) - ? ' _pards() and retds() with Date2( { CToD( "01/01/2000" ) } ) =>', Date2( { CToD( "01/01/2000" ) } ) - uVar := CToD( "01/01/2000" ) - ? ' uVar := CToD( "01/01/2000" )' - Date3( @uVar, CToD( "12/31/1999" ) ) - ? ' _stords() with Date3( @uVar, CToD( "12/31/1999" ) ) => ', uVar - uVar := { CToD( "01/01/2000" ) } - ? ' uVar := { CToD( "01/01/2000" ) }' - Date4( uVar, CToD( "12/31/1999" ) ) - ? ' _stords() with Date4( uVar, CToD( "12/31/1999" ) ) => ', uVar[ 1 ] + ? ' _pards() and _retds() with Date1( CToD( "2000-01-01" ) ) =>', Date1( CToD( "2000-01-01" ) ) + ? ' _pards() and retds() with Date2( { CToD( "2000-01-01" ) } ) =>', Date2( { CToD( "2000-01-01" ) } ) + uVar := CToD( "2000-01-01" ) + ? ' uVar := CToD( "2000-01-01" )' + Date3( @uVar, CToD( "1999-12-31" ) ) + ? ' _stords() with Date3( @uVar, CToD( "1999-12-31" ) ) => ', uVar + uVar := { CToD( "2000-01-01" ) } + ? ' uVar := { CToD( "2000-01-01" ) }' + Date4( uVar, CToD( "1999-12-31" ) ) + ? ' _stords() with Date4( uVar, CToD( "1999-12-31" ) ) => ', uVar[ 1 ] ? ? ? @@ -132,7 +135,7 @@ PROCEDURE Main() ? ? - __Accept( "Press return to continue..." ) + WAIT "Press any key to continue..." ? "Numbers:" ? "========" @@ -171,7 +174,7 @@ PROCEDURE Main() ? ? - __Accept( "Press return to continue..." ) + WAIT "Press any key to continue..." ? "Nil:" ? "====" @@ -198,7 +201,7 @@ PROCEDURE Main() ? ? - __Accept( "Press return to continue..." ) + WAIT "Press any key to continue..." ? "Arrays:" ? "=======" @@ -225,7 +228,7 @@ PROCEDURE Main() ? ? - __Accept( "Press return to continue..." ) + WAIT "Press any key to continue..." ? "Parameters info:" ? "================" @@ -252,7 +255,7 @@ PROCEDURE Main() ? ? - __Accept( "Press return to continue..." ) + WAIT "Press any key to continue..." ? "Undocumented features:" ? "======================" diff --git a/harbour/tests/extend2.c b/harbour/tests/extend2.c index 802f64c284..9a57994e1f 100644 --- a/harbour/tests/extend2.c +++ b/harbour/tests/extend2.c @@ -3,184 +3,191 @@ */ /* - * Testing CLIPPER Extended system. + * Testing Clipper Extended system. * - * NOTE: compile extend1.prg and extend2.c and link both files + * NOTE: build together with extend1.prg + * In Harbour use command 'hbmk2 extend1.hbp' */ #include #include "extend.api" -#ifdef __HARBOUR__ +#if defined(__HARBOUR__) + #include "hbapi.h" #include "hbundoc.api" + #define CLIPFUN( funcname ) HB_FUNC( funcname ) + #define CLIPFUNL( funcname, funcshort ) HB_FUNC( funcname ) +#elif defined(__CLIPPER__) + #define CLIPFUN( funcname ) CLIPPER funcname ( void ) + #define CLIPFUNL( funcname, funcshort ) CLIPPER funcshort ( void ) #endif -CLIPPER HB_STRINGS1() +CLIPFUN( STRINGS1 ) { _retc( _parc( 1 ) ); } -CLIPPER HB_STRINGS2() +CLIPFUN( STRINGS2 ) { _retc( _parc( 1, 1 ) ); } -CLIPPER HB_STRINGS3() +CLIPFUN( STRINGS3 ) { _retclen( _parc( 1 ), _parnl( 2 ) ); } -CLIPPER HB_STRINGS4() +CLIPFUN( STRINGS4 ) { _retni( _parclen( 1 ) ); } -CLIPPER HB_STRINGS5() +CLIPFUN( STRINGS5 ) { _storc( _parc( 2 ), 1 ); } -CLIPPER HB_STRINGS6() +CLIPFUN( STRINGS6 ) { _storclen( _parc( 2 ), _parnl( 3 ), 1 ); } -CLIPPER HB_STRINGS7() +CLIPFUN( STRINGS7 ) { _storc( _parc( 2 ), 1, 1 ); } -CLIPPER HB_STRINGS8() +CLIPFUN( STRINGS8 ) { _storclen( _parc( 2 ), _parnl( 3 ), 1, 1 ); } -CLIPPER HB_LOGICAL1() +CLIPFUN( LOGICAL1 ) { _retl( _parl( 1 ) ); } -CLIPPER HB_LOGICAL2() +CLIPFUN( LOGICAL2 ) { _retl( _parl( 1, 1 ) ); } -CLIPPER HB_LOGICAL3() +CLIPFUN( LOGICAL3 ) { _storl( _parl( 2 ), 1 ); } -CLIPPER HB_LOGICAL4() +CLIPFUN( LOGICAL4 ) { _storl( _parl( 2 ), 1, 1 ); } -CLIPPER HB_DATE1() +CLIPFUN( DATE1 ) { _retds( _pards( 1 ) ); } -CLIPPER HB_DATE2() +CLIPFUN( DATE2 ) { _retds( _pards( 1, 1 ) ); } -CLIPPER HB_DATE3() +CLIPFUN( DATE3 ) { _stords( _pards( 2 ), 1 ); } -CLIPPER HB_DATE4() +CLIPFUN( DATE4 ) { _stords( _pards( 2 ), 1, 1 ); } -CLIPPER HB_INT1() +CLIPFUN( INT1 ) { _retni( _parni( 1 ) ); } -CLIPPER HB_INT2() +CLIPFUN( INT2 ) { _retni( _parni( 1, 1 ) ); } -CLIPPER HB_INT3() +CLIPFUN( INT3 ) { _storni( _parni( 2 ), 1 ); } -CLIPPER HB_INT4() +CLIPFUN( INT4 ) { _storni( _parni( 2 ), 1, 1 ); } -CLIPPER HB_LONG1() +CLIPFUN( LONG1 ) { _retnl( _parnl( 1 ) ); } -CLIPPER HB_LONG2() +CLIPFUN( LONG2 ) { _retnl( _parnl( 1, 1 ) ); } -CLIPPER HB_LONG3() +CLIPFUN( LONG3 ) { _stornl( _parnl( 2 ), 1 ); } -CLIPPER HB_LONG4() +CLIPFUN( LONG4 ) { _stornl( _parnl( 2 ), 1, 1 ); } -CLIPPER HB_DOUBLE1() +CLIPFUN( DOUBLE1 ) { _retnd( _parnd( 1 ) ); } -CLIPPER HB_DOUBLE2() +CLIPFUN( DOUBLE2 ) { _retnd( _parnd( 1, 1 ) ); } -CLIPPER HB_DOUBLE3() +CLIPFUN( DOUBLE3 ) { _stornd( _parnd( 2 ), 1 ); } -CLIPPER HB_DOUBLE4() +CLIPFUN( DOUBLE4 ) { _stornd( _parnd( 2 ), 1, 1 ); } -CLIPPER HB_NIL1() +CLIPFUN( NIL1 ) { _ret(); } -CLIPPER HB_ARRAYS1() +CLIPFUN( ARRAYS1 ) { _reta( _parnl( 1 ) ); } -CLIPPER HB_ARRAYS2() +CLIPFUN( ARRAYS2 ) { _retnl( _parinfa( 1, _parni( 2 ) ) ); } -CLIPPER HB_PARAMS1() +CLIPFUN( PARAMS1 ) { _retni( _pcount() ); } -CLIPPER HB_PARAMS2() +CLIPFUN( PARAMS2 ) { _retni( _parinfo( _parni( 4 ) ) ); } -CLIPPER HB_UNDOC2() +CLIPFUN( UNDOC2 ) { char szText[ 25 ]; @@ -190,13 +197,13 @@ CLIPPER HB_UNDOC2() _retc( szText ); } -CLIPPER HB_UNDOC3() +CLIPFUN( UNDOC3 ) { _retc( "Hello word" ); _retnl( _parclen( -1 ) ); } -CLIPPER HB_UNDOC4() +CLIPFUN( UNDOC4 ) { char szText[ 25 ]; @@ -206,79 +213,79 @@ CLIPPER HB_UNDOC4() _retds( szText ); } -CLIPPER HB_UNDOC5() +CLIPFUN( UNDOC5 ) { _retl( _parl( 1 ) ); _retl( _parl( -1 ) - 1 ); } -CLIPPER HB_UNDOC6() +CLIPFUN( UNDOC6 ) { _retnd( _parnd( 1 ) ); _retnd( _parnd( -1 ) - 1234567 ); } -CLIPPER HB_UNDOC7() +CLIPFUN( UNDOC7 ) { _retni( _parni( 1 ) ); _retni( _parni( -1 ) / 10 ); } -CLIPPER HB_UNDOC8() +CLIPFUN( UNDOC8 ) { _retnl( _parnl( 1 ) ); _retnl( _parnl( -1 ) * 10 ); } -CLIPPER HB_UNDOC9() +CLIPFUN( UNDOC9 ) { _reta( _parni( 1 ) ); _retnl( _parinfa( -1, 0 ) ); } -CLIPPER HB_UNDOC10() +CLIPFUN( UNDOC10 ) { - _retc( "CLIPPER power!!!" ); + _retc( "Clipper power!!!" ); _retni( _parinfo( -1 ) ); } -CLIPPER HB_UNDOC11() +CLIPFUN( UNDOC11 ) { _retc( _parc( 1 ) ); - _storc( "CLIPPER power!!!", -1 ); + _storc( "Clipper power!!!", -1 ); } -CLIPPER HB_UNDOC12() +CLIPFUN( UNDOC12 ) { _retc( _parc( 1 ) ); - _storclen( "CLIPPER power!!!", _parni( 2 ), -1 ); + _storclen( "Clipper power!!!", _parni( 2 ), -1 ); } -CLIPPER HB_UNDOC13() +CLIPFUN( UNDOC13 ) { _retds( _pards( 1 ) ); _stords( "20010101", -1 ); } -CLIPPER HB_UNDOC14() +CLIPFUN( UNDOC14 ) { _retl( _parl( 1 ) ); _storl( 0, -1 ); } -CLIPPER HB_UNDOC15() +CLIPFUN( UNDOC15 ) { _retni( _parni( 1 ) ); _storni( 4321, -1 ); } -CLIPPER HB_UNDOC16() +CLIPFUN( UNDOC16 ) { _retnl( _parnl( 1 ) ); _stornl( 987654321, -1 ); } -CLIPPER HB_UNDOC17() +CLIPFUN( UNDOC17 ) { _retnd( _parnd( 1 ) ); _stornd( 9876543.21, -1 ); diff --git a/harbour/tests/fixcase.hb b/harbour/tests/fixcase.hb index 8d9e0327f1..770f715ee1 100644 --- a/harbour/tests/fixcase.hb +++ b/harbour/tests/fixcase.hb @@ -155,7 +155,7 @@ STATIC PROCEDURE ProcFile( hAll, cFileName, lPartial ) FOR EACH a IN hb_regexAll( "([A-Za-z] |[^A-Za-z_:]|^)([A-Za-z_][A-Za-z0-9_]+\()", cLog,,,,, .T. ) IF Len( a[ 2 ] ) != 2 .OR. !( Left( a[ 2 ], 1 ) $ "D" /* "METHOD" */ ) - cProper := ProperCase( hAll, hb_StrShrink( a[ 3 ], 1 ) ) + "(" + cProper := ProperCase( hAll, hb_StrShrink( a[ 3 ] ) ) + "(" IF !( cProper == a[ 3 ] ) .AND. ; !( Upper( cProper ) == "FILE(" ) .AND. ; /* interacts with "file(s)" text */ !( Upper( cProper ) == "INT(" ) /* interacts with SQL statements */ @@ -166,6 +166,17 @@ STATIC PROCEDURE ProcFile( hAll, cFileName, lPartial ) ENDIF NEXT + IF !( "hbclass.ch" $ cFileName ) + FOR EACH a IN hb_regexAll( "(?:REQUEST|EXTERNAL|EXTERNA|EXTERN)[ \t]+([A-Za-z_][A-Za-z0-9_]+)", cLog,,,,, .T. ) + cProper := ProperCase( hAll, a[ 2 ] ) + IF !( cProper == a[ 2 ] ) + cLog := StrTran( cLog, a[ 1 ], StrTran( a[ 1 ], a[ 2 ], cProper ) ) + ? cFileName, a[ 2 ], cProper, "|" + a[ 1 ] + "|" + nChanged++ + ENDIF + NEXT + ENDIF + IF nChanged > 0 ? cFileName, "changed: ", nChanged hb_MemoWrit( cFileName, cLog + cRest ) diff --git a/harbour/tests/for2.prg b/harbour/tests/for2.prg index 31a6b10d7e..1db1852afc 100644 --- a/harbour/tests/for2.prg +++ b/harbour/tests/for2.prg @@ -11,11 +11,11 @@ PROCEDURE Main() ? i IF i == 4 .AND. .T. - __Accept( "" ) + Inkey( 0 ) ? i i := 9 ? i - __Accept( "" ) + Inkey( 0 ) ENDIF NEXT diff --git a/harbour/tests/foreach.prg b/harbour/tests/foreach.prg index c729a3a37c..138abf599c 100644 --- a/harbour/tests/foreach.prg +++ b/harbour/tests/foreach.prg @@ -35,7 +35,6 @@ PROCEDURE Main() ? Inkey( 0 ) - ? "========================================================" ? "Testing passing by reference" ? "before loop: ENUM=", enum @@ -124,7 +123,7 @@ PROCEDURE Main() RETURN -PROCEDURE TESTbreak( v ) +STATIC PROCEDURE TESTbreak( v ) IF LEFTEQUAL( v, "2" ) .OR. LEFTEQUAL( v, "d" ) ? "issuing break" @@ -133,7 +132,7 @@ PROCEDURE TESTbreak( v ) RETURN -PROCEDURE TESTBYREF( enum ) +STATIC PROCEDURE TESTBYREF( enum ) ? "start of testBYREF ENUM=", enum FOR EACH enum IN { 1, 2, 3 } diff --git a/harbour/tests/hrb.prg b/harbour/tests/hrb.prg index 7054c86958..65bcbb677f 100644 --- a/harbour/tests/hrb.prg +++ b/harbour/tests/hrb.prg @@ -6,11 +6,16 @@ #include "hbhrb.ch" -PROCEDURE Main( x ) +PROCEDURE Main( n ) - LOCAL pHrb, cExe := "Msg2()" + LOCAL pHrb + LOCAL cExe := "Msg2()" - LOCAL n := iif( x == NIL, 0, Val( x ) ) + n := iif( n == NIL, 0, Val( n ) ) + + IF ! hb_FileExists( "hrbext.hrb" ) + hb_run( "harbour hrbext.prg -gh" ) + ENDIF ? "calling Msg ... From exe here !" Msg() @@ -27,22 +32,22 @@ PROCEDURE Main( x ) pHrb := hb_hrbLoad( HB_HRB_BIND_LOCAL, "hrbext.hrb" ) #endif - ? "Loading(" + iif( n == 0, "HB_HRB_BIND_DEFAULT", iif( n == 1, "HB_HRB_BIND_LOCAL", "HB_HRB_BIND_OVERLOAD" ) ) + ", 'hrbext.hrb' )" + ? "Loading( " + iif( n == 0, "HB_HRB_BIND_DEFAULT", iif( n == 1, "HB_HRB_BIND_LOCAL", "HB_HRB_BIND_OVERLOAD" ) ) + ", 'hrbext.hrb' )" pHrb := hb_hrbLoad( n, "hrbext.hrb" ) ? "=========================" - ? "calling Msg ... DEFAULT=From exe, LOCAL=From exe, OVERLOAD=From HRB" + ? "calling Msg ... DEFAULT=From exe, LOCAL=From exe, OVERLOAD=From hrb" Msg() ? "=========================" - ? "calling Msg ... DEFAULT=From exe, LOCAL=From HRB, OVERLOAD=From HRB" + ? "calling Msg ... DEFAULT=From exe, LOCAL=From hrb, OVERLOAD=From hrb" &cExe // ? "=========================" hb_hrbUnload( pHrb ) // should do nothing in case of OVERLOAD - ? "calling Msg ... DEFAULT=From exe, LOCAL=From exe, OVERLOAD=From HRB" + ? "calling Msg ... DEFAULT=From exe, LOCAL=From exe, OVERLOAD=From hrb" Msg() // test unload protection when using OVERLOAD ... then .hrb not anymore unloadable ? "=========================" @@ -52,6 +57,6 @@ PROCEDURE Main( x ) FUNCTION Msg() - ? "Function called from Exe" + ? "Function called from .exe" RETURN .T. diff --git a/harbour/tests/hrbext.prg b/harbour/tests/hrbext.prg index 2a04f2712f..89998baaff 100644 --- a/harbour/tests/hrbext.prg +++ b/harbour/tests/hrbext.prg @@ -6,9 +6,15 @@ FUNCTION Msg() - ? "Function called from HRB file" + ? "Function called from .hrb" RETURN .T. -FUNCTION msg2() +FUNCTION Msg2() RETURN Msg() + +INIT PROCEDURE MsgInit() + + ? "INIT PROCEDURE in .hrb" + + RETURN diff --git a/harbour/tests/macro.prg b/harbour/tests/macro.prg index e50522e4c4..4cbfe74f1e 100644 --- a/harbour/tests/macro.prg +++ b/harbour/tests/macro.prg @@ -55,7 +55,7 @@ PROCEDURE Main() RETURN -FUNCTION TValue +FUNCTION TValue() STATIC s_oClass @@ -126,10 +126,10 @@ STATIC PROCEDURE TEST_Type() v2 := "UDF_STATIC" ? "Test for Type('UDF_STATIC') - should be 'U': ", Type( v2 ) - v1a := "UDF:=1" - ? "Test for Type('UDF:=1') - should be 'N': ", Type( v1a ) - v2a := "UDF_STATIC:=1" - ? "Test for Type('UDF_STATIC:=1') - should be 'N': ", Type( v2a ) + v1a := "UDF := 1" + ? "Test for Type('UDF := 1') - should be 'N': ", Type( v1a ) + v2a := "UDF_STATIC := 1" + ? "Test for Type('UDF_STATIC := 1') - should be 'N': ", Type( v2a ) ? "=== after the assignment ===" v1 := "UDF" diff --git a/harbour/tests/memvar.prg b/harbour/tests/memvar.prg index 4749ed405e..4c42612479 100644 --- a/harbour/tests/memvar.prg +++ b/harbour/tests/memvar.prg @@ -8,7 +8,7 @@ #include "clipper.ch" #endif -MEMVAR MEMVAR +MEMVAR memvar MEMVAR memvar1 MEMVAR memvar2 MEMVAR memvar3 @@ -40,21 +40,21 @@ PROCEDURE Main() HB_SYMBOL_UNUSED( main ) Test1() - __Accept( "press Enter..." ) + WAIT "press any key..." Test2() - __Accept( "press Enter..." ) + WAIT "press any key..." Test3() - __Accept( "press Enter..." ) + WAIT "press any key..." Test4() - __Accept( "press Enter..." ) + WAIT "press any key..." Test5() - __Accept( "press Enter..." ) + WAIT "press any key..." Test6() - __Accept( "press Enter..." ) + WAIT "press any key..." Test7( "value1", 2, .T. ) - __Accept( "press Enter..." ) + WAIT "press any key..." Test8() - __Accept( "press Enter..." ) + WAIT "press any key..." Test9() RETURN @@ -307,7 +307,7 @@ PROCEDURE Test8() ? "In Test8 after UsePriv" ? "Private1 : ", private1 - __Accept( "press Enter..." ) + WAIT "press any key..." ? "In Test8 before UsePriv with reference" ? "Private1 : ", private1 diff --git a/harbour/tests/mouse.prg b/harbour/tests/mouse.prg index 8446abbb2c..6bfb45e3fd 100644 --- a/harbour/tests/mouse.prg +++ b/harbour/tests/mouse.prg @@ -50,14 +50,14 @@ PROCEDURE Main() RETURN -FUNCTION MUPDATE() +STATIC FUNCTION MUPDATE() @ MaxRow() - 1, 4 SAY MRow() PICTURE "9999" @ MaxRow() - 1, 12 SAY MCol() PICTURE "9999" RETURN 0 -FUNCTION MINRECT( nTop, nLeft, nBott, nRight ) +STATIC FUNCTION MINRECT( nTop, nLeft, nBott, nRight ) LOCAL lInside := .F. @@ -71,7 +71,7 @@ FUNCTION MINRECT( nTop, nLeft, nBott, nRight ) // First test: Check the boundaries of the main window -PROCEDURE TEST1() +STATIC PROCEDURE TEST1() LOCAL nKey @@ -131,7 +131,7 @@ PROCEDURE TEST1() // Second test: check the button pressing -PROCEDURE TEST2( nR, nC ) +STATIC PROCEDURE TEST2( nR, nC ) LOCAL cSkip := "", nKey, nPress := 0 @@ -244,7 +244,7 @@ PROCEDURE TEST2( nR, nC ) RETURN -PROCEDURE CHECKEXIT() +STATIC PROCEDURE CHECKEXIT() IF ! MINRECT( MaxRow() - 2, MaxCol() - 11, MaxRow(), MaxCol() ) RETURN diff --git a/harbour/tests/onidle.prg b/harbour/tests/onidle.prg index 0f5e8d9da3..efb0b1829d 100644 --- a/harbour/tests/onidle.prg +++ b/harbour/tests/onidle.prg @@ -53,7 +53,7 @@ PROCEDURE Main() RETURN -PROCEDURE TEST() +STATIC PROCEDURE TEST() LOCAL a, b, c LOCAL cb diff --git a/harbour/tests/ppapi.prg b/harbour/tests/ppapi.prg index c698e80363..bcae3fadca 100644 --- a/harbour/tests/ppapi.prg +++ b/harbour/tests/ppapi.prg @@ -2,17 +2,17 @@ * $Id$ */ -REQUEST __PP_STDRULES +REQUEST __pp_StdRules PROCEDURE Main() LOCAL cString, l_pp LOCAL i, j, aScript - CLS - l_pp := __pp_Init() + CLS + ? "Testing Harbour run-time preprocessing" ? "======================================" ? @@ -50,33 +50,30 @@ PROCEDURE Main() ? __pp_Process( l_pp, cString ) ? - ? "Press ..." - __Accept( "" ) + WAIT "Press any key..." CLS - aScript := { 'cMyDatabase := "dontknow.dbf"', ; - 'USE (cMyDatabase)', ; - 'GO TOP', ; - '', ; - '? MYFIELD, YOURFIELD', ; - '', ; - 'WAIT "Press key..."', ; - '', ; - 'CLOSE ALL' } + aScript := { ; + 'cMyDatabase := "dontknow.dbf"', ; + 'USE ( cMyDatabase )', ; + 'GO TOP', ; + '', ; + '? MYFIELD, YOURFIELD', ; + '', ; + 'WAIT "Press any key..."', ; + '', ; + 'CLOSE ALL' } FOR j := 1 TO 2 ? iif( j == 1, "Before", "After" ) + " __pp_Process()" ? "===================" ? FOR i := 1 TO Len( aScript ) - ? iif( j == 1, aScript[ i ], __pp_Process( l_pp, aScript[ i ] ) ) - NEXT ? - ? "Press key..." - __Accept( "" ) + WAIT "Press any key..." CLS NEXT diff --git a/harbour/tests/scroll.prg b/harbour/tests/scroll.prg index 7895bd44cc..2c6e361390 100644 --- a/harbour/tests/scroll.prg +++ b/harbour/tests/scroll.prg @@ -68,6 +68,6 @@ PROCEDURE Main() FUNCTION pause() SetPos( MaxRow() - 2, 0 ) - __Accept( "pause: " ) + WAIT "pause:" RETURN NIL diff --git a/harbour/tests/set.prg b/harbour/tests/set.prg index 3f19b31d00..a5f9dd210a 100644 --- a/harbour/tests/set.prg +++ b/harbour/tests/set.prg @@ -4,7 +4,7 @@ // Testing SET -REQUEST dbfntx +REQUEST DBFNTX PROCEDURE Main() diff --git a/harbour/tests/str.prg b/harbour/tests/str.prg index 7bf74b5d9c..f7a610eac1 100644 --- a/harbour/tests/str.prg +++ b/harbour/tests/str.prg @@ -7,7 +7,7 @@ PROCEDURE Main() ? "Running with SET FIXED OFF (the default setting):" ? test() - __Accept( "Pause before running again with SET FIXED ON: " ) + WAIT "Pause before running again with SET FIXED ON:" ? "Running with SET FIXED ON:" ? Set( _SET_FIXED, .T. ) diff --git a/harbour/tests/tbrowse.prg b/harbour/tests/tbrowse.prg index e3892025b7..3e24468e05 100644 --- a/harbour/tests/tbrowse.prg +++ b/harbour/tests/tbrowse.prg @@ -137,7 +137,7 @@ PROCEDURE Main() #ifdef HB_COMPAT_C53 -FUNCTION DefProc( oBrowse, nKey ) +STATIC FUNCTION DefProc( oBrowse, nKey ) IF nKey == K_TAB hb_DispOutAt( 0, 0, Time() ) diff --git a/harbour/tests/vmasort.prg b/harbour/tests/vmasort.prg index 6f6281bee4..6d197c5699 100644 --- a/harbour/tests/vmasort.prg +++ b/harbour/tests/vmasort.prg @@ -51,7 +51,7 @@ STATIC FUNCTION aMkArray( nPass ) RETURN aData -FUNCTION aDump( a ) +STATIC FUNCTION aDump( a ) LOCAL cStr := "" LOCAL n := Len( a ) @@ -63,7 +63,7 @@ FUNCTION aDump( a ) RETURN cStr -FUNCTION xToStr( xValue ) +STATIC FUNCTION xToStr( xValue ) LOCAL cType := ValType( xValue ) diff --git a/harbour/tests/wvtext.prg b/harbour/tests/wvtext.prg index 9e1e9f4f0e..6c446ccf44 100644 --- a/harbour/tests/wvtext.prg +++ b/harbour/tests/wvtext.prg @@ -351,7 +351,7 @@ PROCEDURE hb_GTSYS() // -FUNCTION SetPalette( nMode ) +STATIC FUNCTION SetPalette( nMode ) LOCAL aPalette := hb_gtInfo( HB_GTI_PALETTE ) @@ -374,7 +374,7 @@ FUNCTION SetPalette( nMode ) // -FUNCTION SetPaletteIndex() +STATIC FUNCTION SetPaletteIndex() hb_gtInfo( HB_GTI_PALETTE, 8, RGB( 120, 200, 240 ) ) DispScreen() @@ -383,7 +383,7 @@ FUNCTION SetPaletteIndex() // -PROCEDURE thFunc() +STATIC PROCEDURE thFunc() STATIC s_nBrowser := 0 STATIC s_nZx := 0 @@ -572,7 +572,7 @@ STATIC FUNCTION BrwHandleKey( oBrowse, nKey, lEnd ) // -FUNCTION ChgPalette( lFocus ) +STATIC FUNCTION ChgPalette( lFocus ) LOCAL aPalette := hb_gtInfo( HB_GTI_PALETTE ) LOCAL cSaveScreen := SaveScreen( 0, 0, MaxRow(), MaxCol() ) diff --git a/harbour/utils/hbmk2/hbmk2.prg b/harbour/utils/hbmk2/hbmk2.prg index 576318078e..595d92376f 100644 --- a/harbour/utils/hbmk2/hbmk2.prg +++ b/harbour/utils/hbmk2/hbmk2.prg @@ -529,8 +529,9 @@ EXTERNAL hbmk_KEYW #define _HBMK_lSysLoc 154 #define _HBMK_lDumpInfo 155 #define _HBMK_lMarkdown 156 +#define _HBMK_lShellMode 157 -#define _HBMK_MAX_ 156 +#define _HBMK_MAX_ 157 #define _HBMK_DEP_CTRL_MARKER ".control." /* must be an invalid path */ @@ -913,10 +914,12 @@ STATIC PROCEDURE hbmk_COMP_Setup( cARCH, cCOMP, cBasePath ) #endif -STATIC FUNCTION hbmk_new() +STATIC FUNCTION hbmk_new( lShellMode ) LOCAL hbmk[ _HBMK_MAX_ ] + hbmk[ _HBMK_lShellMode ] := lShellMode + hbmk[ _HBMK_cBUILD ] := "" hbmk[ _HBMK_lStopAfterInit ] := .F. @@ -1437,7 +1440,7 @@ STATIC FUNCTION __hbmk( aArgs, nArgTarget, nLevel, /* @ */ lPause, /* @ */ lExit LOCAL cStdOutErr - hbmk := hbmk_new() + hbmk := hbmk_new( .F. ) hbmk[ _HBMK_aArgs ] := aArgs hbmk[ _HBMK_nArgTarget ] := nArgTarget @@ -1548,16 +1551,14 @@ STATIC FUNCTION __hbmk( aArgs, nArgTarget, nLevel, /* @ */ lPause, /* @ */ lExit ProcEnvOption( SubStr( cParam, 6 ) ) CASE cParamL == "-help" .OR. cParamL == "--help" .OR. ; - cParamL == "-h" .OR. ; - cParamL == "-?" + cParamL == "-h" .OR. cParamL == "-?" ShowHeader( hbmk ) ShowHelp( hbmk, .T. ) RETURN _EXIT_HELP CASE cParamL == "-longhelp" .OR. cParamL == "--longhelp" .OR. ; - cParamL == "-hh" .OR. ; - cParamL == "-??" + cParamL == "-hh" .OR. cParamL == "-??" ShowHeader( hbmk ) ShowHelp( hbmk, .T., .T. ) @@ -13634,6 +13635,7 @@ STATIC PROCEDURE __hbshell( cFile, ... ) LOCAL aOPTPRG LOCAL hHRB LOCAL cVersion + LOCAL cParamL /* get this before doing anything else */ LOCAL lDebug := ; @@ -13655,9 +13657,47 @@ STATIC PROCEDURE __hbshell( cFile, ... ) hbsh[ _HBSH_cDirBase ] := hb_DirBase() hbsh[ _HBSH_cProgName ] := hb_ProgName() + /* Init */ + + hbmk := hbsh[ _HBSH_hbmk ] := hbmk_new( .T. ) + + /* Help */ + + IF HB_ISSTRING( cFile ) + + cParamL := Lower( cFile ) + + DO CASE + CASE cParamL == "-help" .OR. cParamL == "--help" .OR. ; + cParamL == "-h" .OR. cParamL == "-?" + + SetUILang( hbmk[ _HBMK_cUILNG ] := GetUILang() ) + ShowHeader( hbmk ) + ShowHelp( hbmk, .T. ) + RETURN + + CASE cParamL == "-longhelp" .OR. cParamL == "--longhelp" .OR. ; + cParamL == "-hh" .OR. cParamL == "-??" + + SetUILang( hbmk[ _HBMK_cUILNG ] := GetUILang() ) + ShowHeader( hbmk ) + ShowHelp( hbmk, .T., .T. ) + RETURN + + CASE cParamL == "-longhelpmd" .OR. cParamL == "--longhelpmd" + + hbmk[ _HBMK_lMarkdown ] := .T. + + SetUILang( hbmk[ _HBMK_cUILNG ] := GetUILang() ) + ShowHeader( hbmk ) + ShowHelp( hbmk, .T., .T. ) + RETURN + + ENDCASE + ENDIF + /* Detect Harbour dir layout */ - hbmk := hbsh[ _HBSH_hbmk ] := hbmk_new() hbmk_init_stage2( hbmk ) IF ! hbmk_harbour_dirlayout_detect( hbmk, .T. ) IF __hbshell_CanLoadDyn() @@ -14712,7 +14752,9 @@ STATIC FUNCTION __hbshell_detect_CUI_extern_positive() "SETCURSOR" => NIL, ; "SETMODE" => NIL, ; "SETPOS" => NIL, ; - "SETPOSBS" => NIL } + "SETPOSBS" => NIL, ; + "__ACCEPT" => NIL, ; + "__WAIT" => NIL } STATIC FUNCTION __hbshell_detect_CUI_extern_negative() RETURN { ; @@ -15411,9 +15453,16 @@ STATIC PROCEDURE ShowHeader( hbmk ) LOCAL cTrsText LOCAL cTrsTextI - cText := ; - "Harbour Make (" + _SELF_NAME_ + ") " + HBRawVersion() + e"\n" + ; - "Copyright (c) 1999-2013, Viktor Szakáts" + e"\n" + IF hbmk[ _HBMK_lShellMode ] + cText := ; + "Harbour Shell / Script Runner " + HBRawVersion() + e"\n" + ; + "Copyright (c) 2007-2013, Viktor Szakáts" + e"\n" + ; + "Copyright (c) 2003-2007, Przemysław Czerpak" + e"\n" + ELSE + cText := ; + "Harbour Make (" + _SELF_NAME_ + ") " + HBRawVersion() + e"\n" + ; + "Copyright (c) 1999-2013, Viktor Szakáts" + e"\n" + ENDIF IF hbmk[ _HBMK_lMarkdown ] hb_SetTermCP( "UTF8EX" ) /* UTF-8 output for Markdown */ @@ -15482,6 +15531,11 @@ STATIC PROCEDURE ShowHelp( hbmk, lMore, lLong ) "", ; hb_StrFormat( I_( " %1$s [options] [] " ), _SELF_NAME_ ) } + LOCAL aHdr_Syntax_Shell := { ; + I_( "Syntax:" ), ; + "", ; + hb_StrFormat( I_( " %1$s |