From 23172a52cead65f18ff7b62c943ebeb2a4367fa9 Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Wed, 12 Oct 2005 00:30:49 +0000 Subject: [PATCH] 2005-10-12 02:24 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/config/global.cf + added HB_DB_DRVEXT envvar support for additional RDDs * harbour/config/linux/gcc.cf + harbour/config/linux/gpp.cf + added GNU C++ support * harbour/config/linux/owatcom.cf * harbour/contrib/btree/hb_btree.c * harbour/contrib/libct/ct.h * harbour/contrib/libct/ctc.c * harbour/contrib/odbc/odbc.c * harbour/contrib/rdd_ads/adsfunc.c * harbour/include/hbapi.h * harbour/include/hbapierr.h * harbour/include/hbapigt.h * harbour/include/hbapilng.h * harbour/source/compiler/harbour.c * harbour/source/rtl/console.c * harbour/source/rtl/datec.c * harbour/source/rtl/diskspac.c * harbour/source/rtl/errorapi.c * harbour/source/rtl/errorint.c * harbour/source/rtl/filesys.c * harbour/source/rtl/fssize.c * harbour/source/rtl/fstemp.c * harbour/source/rtl/gtapi.c * harbour/source/rtl/isprint.c * harbour/source/rtl/natmsg.c * harbour/source/rtl/philes.c * harbour/source/rtl/setcolor.c * harbour/source/rtl/spfiles.c * harbour/source/rtl/gtcrs/gtcrs.c * harbour/source/rtl/gtsln/gtsln.c * harbour/source/rtl/gtsln/kbsln.c * harbour/source/vm/itemapi.c * harbour/source/vm/memvars.c * harbour/source/vm/runner.c * fixed for popper compilation with GNU C++ and OpenWatcom on Linux --- harbour/ChangeLog | 41 +++++++++++++++++++++++++ harbour/config/global.cf | 4 +++ harbour/config/linux/gcc.cf | 10 +++++-- harbour/config/linux/gpp.cf | 5 ++++ harbour/config/linux/owatcom.cf | 2 +- harbour/contrib/btree/hb_btree.c | 44 +++++++++++++-------------- harbour/contrib/libct/ct.h | 8 ++--- harbour/contrib/libct/ctc.c | 8 ++--- harbour/contrib/odbc/odbc.c | 8 ++++- harbour/contrib/rdd_ads/adsfunc.c | 2 +- harbour/include/hbapi.h | 6 ++-- harbour/include/hbapierr.h | 38 +++++++++++------------ harbour/include/hbapigt.h | 4 +-- harbour/include/hbapilng.h | 2 +- harbour/source/compiler/harbour.c | 2 +- harbour/source/rtl/console.c | 10 +++---- harbour/source/rtl/datec.c | 4 +-- harbour/source/rtl/diskspac.c | 2 +- harbour/source/rtl/errorapi.c | 50 +++++++++++++++---------------- harbour/source/rtl/errorint.c | 2 +- harbour/source/rtl/filesys.c | 16 +++++----- harbour/source/rtl/fssize.c | 2 +- harbour/source/rtl/fstemp.c | 2 +- harbour/source/rtl/gtapi.c | 8 ++--- harbour/source/rtl/gtcrs/gtcrs.c | 4 +-- harbour/source/rtl/gtsln/gtsln.c | 6 ++-- harbour/source/rtl/gtsln/kbsln.c | 2 +- harbour/source/rtl/isprint.c | 4 +-- harbour/source/rtl/natmsg.c | 2 +- harbour/source/rtl/philes.c | 2 +- harbour/source/rtl/setcolor.c | 2 +- harbour/source/rtl/spfiles.c | 2 +- harbour/source/vm/itemapi.c | 4 +-- harbour/source/vm/memvars.c | 2 +- harbour/source/vm/runner.c | 2 +- 35 files changed, 187 insertions(+), 125 deletions(-) create mode 100644 harbour/config/linux/gpp.cf diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 3611bec7d2..fdf8d7eb18 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,47 @@ 2002-12-01 23:12 UTC+0100 Foo Bar */ +2005-10-12 02:24 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/config/global.cf + + added HB_DB_DRVEXT envvar support for additional RDDs + - harbour/source/codepage/cdpruwin.c + * harbour/config/linux/gcc.cf + + harbour/config/linux/gpp.cf + + added GNU C++ support + - harbour/source/codepage/cdpslwin.c + * harbour/config/linux/owatcom.cf + * harbour/contrib/btree/hb_btree.c + * harbour/contrib/libct/ct.h + * harbour/contrib/libct/ctc.c + * harbour/contrib/odbc/odbc.c + * harbour/contrib/rdd_ads/adsfunc.c + * harbour/include/hbapi.h + * harbour/include/hbapierr.h + * harbour/include/hbapigt.h + * harbour/include/hbapilng.h + * harbour/source/compiler/harbour.c + * harbour/source/rtl/console.c + * harbour/source/rtl/datec.c + * harbour/source/rtl/diskspac.c + * harbour/source/rtl/errorapi.c + * harbour/source/rtl/errorint.c + * harbour/source/rtl/filesys.c + * harbour/source/rtl/fssize.c + * harbour/source/rtl/fstemp.c + * harbour/source/rtl/gtapi.c + * harbour/source/rtl/isprint.c + * harbour/source/rtl/natmsg.c + * harbour/source/rtl/philes.c + * harbour/source/rtl/setcolor.c + * harbour/source/rtl/spfiles.c + * harbour/source/rtl/gtcrs/gtcrs.c + * harbour/source/rtl/gtsln/gtsln.c + * harbour/source/rtl/gtsln/kbsln.c + * harbour/source/vm/itemapi.c + * harbour/source/vm/memvars.c + * harbour/source/vm/runner.c + * fixed for popper compilation with GNU C++ and OpenWatcom on Linux + 2005-10-05 15:05 UTC+0100 Ryszard Glab * source/common/expropt2.c * fixed bug in ASC() optimization (when character code > 127) diff --git a/harbour/config/global.cf b/harbour/config/global.cf index 51b5d4a38f..0b910b5a29 100644 --- a/harbour/config/global.cf +++ b/harbour/config/global.cf @@ -13,6 +13,10 @@ HB_DB_DRIVERS=\ hbsix \ hsx \ +ifneq ($(HB_DB_DRVEXT),) +HB_DB_DRIVERS += $(HB_DB_DRVEXT) +endif + ifeq ($(HB_BIN_COMPILE),) HB_BIN_COMPILE := $(TOP)$(ROOT)source/compiler/$(HB_ARCH) endif diff --git a/harbour/config/linux/gcc.cf b/harbour/config/linux/gcc.cf index 1539c241e6..c0d4bfd344 100644 --- a/harbour/config/linux/gcc.cf +++ b/harbour/config/linux/gcc.cf @@ -4,12 +4,18 @@ include $(TOP)$(ROOT)config/$(HB_ARCHITECTURE)/global.cf +ifeq ($(HB_COMPILER),gpp) + HB_CMP = g++ +else + HB_CMP = $(HB_COMPILER) +endif + OBJ_EXT = .o EXE_EXT = LIB_PREF = lib LIB_EXT = .a -CC = $(HB_CCACHE) gcc +CC = $(HB_CCACHE) $(HB_CMP) CC_IN = -c CC_OUT = -o CPPFLAGS = -I. -I$(HB_INC_COMPILE) @@ -26,7 +32,7 @@ CFLAGS += -DSIMPLEX endif -LD = $(HB_CCACHE) gcc +LD = $(HB_CCACHE) $(HB_CMP) LD_OUT = -o # Add all libraries specified in CONTRIBS and LIBS. diff --git a/harbour/config/linux/gpp.cf b/harbour/config/linux/gpp.cf new file mode 100644 index 0000000000..85eb098523 --- /dev/null +++ b/harbour/config/linux/gpp.cf @@ -0,0 +1,5 @@ +# +# $Id$ +# + +include $(TOP)$(ROOT)config/$(HB_ARCHITECTURE)/gcc.cf diff --git a/harbour/config/linux/owatcom.cf b/harbour/config/linux/owatcom.cf index 7d901dd5f6..d6e596f8ed 100644 --- a/harbour/config/linux/owatcom.cf +++ b/harbour/config/linux/owatcom.cf @@ -28,7 +28,7 @@ CPPFLAGS += -onaehtzr -oi+ -ei -zp8 -s -zt0 CPPFLAGS += -i. -i$(TOP)include -i$(TOP)$(ROOT)include -iinclude ifneq ($(HB_LIB_COMPILE),) - CPPFLAGS += -i$(HB_INC_COMPILE) + CPPFLAGS += -i$(HB_INC_COMPILE) endif ifeq ($(HB_LEX),SIMPLEX) diff --git a/harbour/contrib/btree/hb_btree.c b/harbour/contrib/btree/hb_btree.c index 8cde17c4ca..6b902a2060 100644 --- a/harbour/contrib/btree/hb_btree.c +++ b/harbour/contrib/btree/hb_btree.c @@ -267,28 +267,28 @@ typedef struct ioBuffer_tag BYTE Buffer[ 1 ]; } ioBuffer_T; -typedef enum BTreeFlags_enum { +typedef int hb_BTreeFlags_T; - IsNormal = 0, - /* btree file access flags */ - IsReadOnly = HB_BTREE_READONLY, - IsExclusive = HB_BTREE_EXCLUSIVE, - IsShared = HB_BTREE_SHARED, +#define IsNormal 0 - /* btree control flags */ - IsUnique = HB_BTREE_UNIQUE, - IsCaseLess = HB_BTREE_CASELESS, - IsInMemory = HB_BTREE_INMEMORY, +/* btree file access flags */ +#define IsReadOnly HB_BTREE_READONLY +#define IsExclusive HB_BTREE_EXCLUSIVE +#define IsShared HB_BTREE_SHARED - /* internal flags */ - IsRecordFound = 1 << 16, - IsDuplicateKey = 1 << 17, - IsMultiBuffers = 1 << 18, - IsOptimized = 1 << 19, -} hb_BTreeFlags_T; +/* btree control flags */ +#define IsUnique HB_BTREE_UNIQUE +#define IsCaseLess HB_BTREE_CASELESS +#define IsInMemory HB_BTREE_INMEMORY -#define GETFLAG( pBTree, flag ) ( BOOL )( ( ( pBTree )->ulFlags & ( flag ) ) == ( flag ) ) +/* internal flags */ +#define IsRecordFound ( 1 << 16 ) +#define IsDuplicateKey ( 1 << 17 ) +#define IsMultiBuffers ( 1 << 18 ) +#define IsOptimized ( 1 << 19 ) + +#define GETFLAG( pBTree, flag ) ( BOOL )( ( ( int ) ( pBTree )->ulFlags & ( flag ) ) == ( flag ) ) #define SETFLAG( pBTree, flag ) ( ( pBTree )->ulFlags |= ( flag ) ) #define RESETFLAG( pBTree, flag ) ( ( pBTree )->ulFlags &= ~( flag ) ) @@ -932,7 +932,7 @@ static void KeySet( struct hb_BTree * pBTree, ULONG ulNode, int iPosition, hb_Ke static LONG KeyCompare( struct hb_BTree * pBTree, hb_KeyData_T *left, hb_KeyData_T *right ) { /* LONG lResults = strnicmp( left->szKey, right->szKey, pBTree->usKeySize );*/ - LONG lResults = ( pBTree->pStrCompare )( left->szKey, right->szKey, pBTree->usKeySize ); + LONG lResults = ( pBTree->pStrCompare )( ( char * ) left->szKey, ( char * ) right->szKey, pBTree->usKeySize ); if ( lResults == 0 && GETFLAG( pBTree, IsUnique ) ) { @@ -1617,7 +1617,7 @@ struct hb_BTree * hb_BTreeNew( BYTE * FileName, USHORT usPageSize, USHORT usKeyS } } - pBTree->szFileName = hb_strdup( ( char * ) FileName ); + pBTree->szFileName = ( BYTE * ) hb_strdup( ( char * ) FileName ); } pBTree->ulFreePage = NULLPAGE; @@ -1663,7 +1663,7 @@ struct hb_BTree * hb_BTreeNew( BYTE * FileName, USHORT usPageSize, USHORT usKeyS } else /* IsInMemory == TRUE */ { - pBTree->ulFlags &= ~HB_BTREE_UNIQUE; /* clear this flag */ + RESETFLAG( pBTree, HB_BTREE_UNIQUE ); /* clear this flag */ } return pBTree; @@ -1678,7 +1678,7 @@ struct hb_BTree *hb_BTreeOpen( BYTE *FileName, ULONG ulFlags, USHORT usBuffers ) HB_TRACE( HB_TR_DEBUG, ( SRCLINENO ) ); - pBTree->szFileName = hb_strdup( ( char * ) FileName ); + pBTree->szFileName = ( BYTE * ) hb_strdup( ( char * ) FileName ); pBTree->hFile = hb_fsOpen( pBTree->szFileName, FO_READWRITE ); if ( pBTree->hFile == -1 ) { @@ -1717,7 +1717,7 @@ struct hb_BTree *hb_BTreeOpen( BYTE *FileName, ULONG ulFlags, USHORT usBuffers ) HB_SYMBOL_UNUSED( ulFlags ); ioBufferAlloc( pBTree, usBuffers ); - pBTree->ulFlags &= ~HB_BTREE_INMEMORY; /* clear this flag */ + RESETFLAG( pBTree, HB_BTREE_INMEMORY ); /* clear this flag */ pBTree->IsDirtyFlagAssignment = TRUE; /* replaces const value for assignment */ if ( GETFLAG( pBTree, IsCaseLess ) ) diff --git a/harbour/contrib/libct/ct.h b/harbour/contrib/libct/ct.h index 7f0010618e..a478c55f6d 100644 --- a/harbour/contrib/libct/ct.h +++ b/harbour/contrib/libct/ct.h @@ -75,12 +75,12 @@ /* CT subsystem error throwing functions */ extern USHORT ct_error (USHORT uiSeverity, ULONG ulGenCode, ULONG ulSubCode, - char * szDescription, char * szOperation, USHORT uiOsCode, - USHORT uiFlags, ULONG uiArgCount, ...); + const char * szDescription, const char * szOperation, + USHORT uiOsCode, USHORT uiFlags, ULONG uiArgCount, ...); extern PHB_ITEM ct_error_subst (USHORT uiSeverity, ULONG ulGenCode, ULONG ulSubCode, - char * szDescription, char * szOperation, USHORT uiOsCode, - USHORT uiFlags, ULONG uiArgCount, ...); + const char * szDescription, const char * szOperation, + USHORT uiOsCode, USHORT uiFlags, ULONG uiArgCount, ...); /* set argument error behaviour */ extern void ct_setargerrormode (int iMode); diff --git a/harbour/contrib/libct/ctc.c b/harbour/contrib/libct/ctc.c index 73432ab302..a62937723e 100644 --- a/harbour/contrib/libct/ctc.c +++ b/harbour/contrib/libct/ctc.c @@ -60,8 +60,8 @@ /* throwing a CT-subsystem error without value substitution - function adapted from errorapi.c */ USHORT ct_error (USHORT uiSeverity, ULONG ulGenCode, ULONG ulSubCode, - char * szDescription, char * szOperation, USHORT uiOsCode, - USHORT uiFlags, ULONG uiArgCount, ...) + const char * szDescription, const char * szOperation, + USHORT uiOsCode, USHORT uiFlags, ULONG uiArgCount, ...) { USHORT uiAction; PHB_ITEM pError; @@ -117,8 +117,8 @@ USHORT ct_error (USHORT uiSeverity, ULONG ulGenCode, ULONG ulSubCode, /* throwing a CT-subsystem error with value substitution - function adapted from errorapi.c */ PHB_ITEM ct_error_subst (USHORT uiSeverity, ULONG ulGenCode, ULONG ulSubCode, - char * szDescription, char * szOperation, USHORT uiOsCode, - USHORT uiFlags, ULONG uiArgCount, ...) + const char * szDescription, const char * szOperation, + USHORT uiOsCode, USHORT uiFlags, ULONG uiArgCount, ...) { PHB_ITEM pRetVal; PHB_ITEM pError; diff --git a/harbour/contrib/odbc/odbc.c b/harbour/contrib/odbc/odbc.c index 2848bdcba6..05b98bccba 100644 --- a/harbour/contrib/odbc/odbc.c +++ b/harbour/contrib/odbc/odbc.c @@ -77,9 +77,15 @@ #include #include #include +#if defined(HB_OS_LINUX) && defined(__WATCOMC__) +#include "/usr/include/sql.h" +#include "/usr/include/sqlext.h" +#include "/usr/include/sqltypes.h" +#else #include #include #include +#endif HB_FUNC( SQLALLOCEN ) /* HB_SQLALLOCENV( @hEnv ) --> nRetCode */ { @@ -111,7 +117,7 @@ HB_FUNC( SQLDRIVERC ) /* HB_SQLDRIVERCONNECT( hDbc, @ cConnectString, lPrompt ) #elif defined(HB_OS_UNIX) RETCODE ret = SQLDriverConnect( ( HDBC ) hb_parnl( 1 ), 0, - hb_parc( 2 ), strlen(hb_parc(2)), + ( SQLCHAR * ) hb_parc( 2 ), strlen(hb_parc(2)), bBuffer1, 1024, &wLen, SQL_DRIVER_COMPLETE ) ; #endif diff --git a/harbour/contrib/rdd_ads/adsfunc.c b/harbour/contrib/rdd_ads/adsfunc.c index baa1168673..7964754ddd 100644 --- a/harbour/contrib/rdd_ads/adsfunc.c +++ b/harbour/contrib/rdd_ads/adsfunc.c @@ -1569,7 +1569,7 @@ HB_FUNC( ADSREINDEX ) if( pArea ) ulRetVal = AdsReindex( pArea->hTable); else - ulRetVal = AdsReindex( -1 ); // should return error! + ulRetVal = AdsReindex( ( ADSHANDLE ) -1 ); // should return error! if( ulRetVal == AE_SUCCESS ) hb_retl( 1 ); diff --git a/harbour/include/hbapi.h b/harbour/include/hbapi.h index 303e21135f..6b039f24b9 100644 --- a/harbour/include/hbapi.h +++ b/harbour/include/hbapi.h @@ -588,10 +588,10 @@ extern HB_ITEM_PTR hb_memvarDetachLocal( HB_ITEM_PTR pLocal ); /* Detach a local extern void hb_conInit( void ); /* initialize the console API system */ extern void hb_conRelease( void ); /* release the console API system */ extern char * hb_conNewLine( void ); /* retrieve a pointer to a static buffer containing new-line characters */ -extern void hb_conOutStd( char * pStr, ULONG ulLen ); /* output an string to STDOUT */ -extern void hb_conOutErr( char * pStr, ULONG ulLen ); /* output an string to STDERR */ +extern void hb_conOutStd( const char * pStr, ULONG ulLen ); /* output an string to STDOUT */ +extern void hb_conOutErr( const char * pStr, ULONG ulLen ); /* output an string to STDERR */ extern USHORT hb_conSetCursor( BOOL bSetCursor, USHORT usNewCursor ); /* retrieve and optionally set cursor shape */ -extern char * hb_conSetColor( char * szColor ); /* retrieve and optionally set console color */ +extern char * hb_conSetColor( const char * szColor ); /* retrieve and optionally set console color */ extern void hb_conXSaveRestRelease( void ); /* release the save/restore API */ /* compiler and macro compiler */ diff --git a/harbour/include/hbapierr.h b/harbour/include/hbapierr.h index 1a74366b7a..cedcddca5b 100644 --- a/harbour/include/hbapierr.h +++ b/harbour/include/hbapierr.h @@ -108,15 +108,15 @@ extern USHORT hb_errGetTries ( PHB_ITEM pError ); extern USHORT hb_errLaunch ( PHB_ITEM pError ); extern PHB_ITEM hb_errNew ( void ); extern PHB_ITEM hb_errPutArgs ( PHB_ITEM pError, ULONG ulArgCount, ... ); -extern PHB_ITEM hb_errPutDescription ( PHB_ITEM pError, char * szDescription ); -extern PHB_ITEM hb_errPutFileName ( PHB_ITEM pError, char * szFileName ); +extern PHB_ITEM hb_errPutDescription ( PHB_ITEM pError, const char * szDescription ); +extern PHB_ITEM hb_errPutFileName ( PHB_ITEM pError, const char * szFileName ); extern PHB_ITEM hb_errPutFlags ( PHB_ITEM pError, USHORT uiFlags ); extern PHB_ITEM hb_errPutGenCode ( PHB_ITEM pError, USHORT uiGenCode ); -extern PHB_ITEM hb_errPutOperation ( PHB_ITEM pError, char * szOperation ); +extern PHB_ITEM hb_errPutOperation ( PHB_ITEM pError, const char * szOperation ); extern PHB_ITEM hb_errPutOsCode ( PHB_ITEM pError, USHORT uiOsCode ); extern PHB_ITEM hb_errPutSeverity ( PHB_ITEM pError, USHORT uiSeverity ); extern PHB_ITEM hb_errPutSubCode ( PHB_ITEM pError, USHORT uiSubCode ); -extern PHB_ITEM hb_errPutSubSystem ( PHB_ITEM pError, char * szSubSystem ); +extern PHB_ITEM hb_errPutSubSystem ( PHB_ITEM pError, const char * szSubSystem ); extern PHB_ITEM hb_errPutTries ( PHB_ITEM pError, USHORT uiTries ); extern void hb_errRelease ( PHB_ITEM pError ); @@ -127,34 +127,34 @@ extern void hb_errExit ( void ); extern PHB_ITEM hb_errLaunchSubst ( PHB_ITEM pError ); -extern PHB_ITEM hb_errRT_New( USHORT uiSeverity, char * szSubSystem, +extern PHB_ITEM hb_errRT_New( USHORT uiSeverity, const char * szSubSystem, ULONG ulGenCode, ULONG ulSubCode, - char * szDescription, - char * szOperation, + const char * szDescription, + const char * szOperation, USHORT uiOsCode, USHORT uiFlags ); -extern PHB_ITEM hb_errRT_New_Subst( USHORT uiSeverity, char * szSubSystem, +extern PHB_ITEM hb_errRT_New_Subst( USHORT uiSeverity, const char * szSubSystem, ULONG ulGenCode, ULONG ulSubCode, - char * szDescription, - char * szOperation, + const char * szDescription, + const char * szOperation, USHORT uiOsCode, USHORT uiFlags ); -extern PHB_ITEM hb_errRT_SubstParams( char *szSubSystem, ULONG ulGenCode, ULONG ulSubCode, char * szDescription, char * szOperation ); +extern PHB_ITEM hb_errRT_SubstParams( const char *szSubSystem, ULONG ulGenCode, ULONG ulSubCode, const char * szDescription, const char * szOperation ); -extern USHORT hb_errRT_BASE ( ULONG ulGenCode, ULONG ulSubCode, char * szDescription, char * szOperation, ULONG ulArgCount, ... ); -extern USHORT hb_errRT_BASE_Ext1 ( ULONG ulGenCode, ULONG ulSubCode, char * szDescription, char * szOperation, USHORT uiOsCode, USHORT uiFlags, ULONG ulArgCount, ... ); -extern PHB_ITEM hb_errRT_BASE_Subst ( ULONG ulGenCode, ULONG ulSubCode, char * szDescription, char * szOperation, ULONG ulArgCount, ... ); -extern void hb_errRT_BASE_SubstR ( ULONG ulGenCode, ULONG ulSubCode, char * szDescription, char * szOperation, ULONG ulArgCount, ... ); -extern USHORT hb_errRT_TERM ( ULONG ulGenCode, ULONG ulSubCode, char * szDescription, char * szOperation, USHORT uiOSCode, USHORT uiFlags ); -extern USHORT hb_errRT_DBCMD ( ULONG ulGenCode, ULONG ulSubCode, char * szDescription, char * szOperation ); +extern USHORT hb_errRT_BASE ( ULONG ulGenCode, ULONG ulSubCode, const char * szDescription, const char * szOperation, ULONG ulArgCount, ... ); +extern USHORT hb_errRT_BASE_Ext1 ( ULONG ulGenCode, ULONG ulSubCode, const char * szDescription, const char * szOperation, USHORT uiOsCode, USHORT uiFlags, ULONG ulArgCount, ... ); +extern PHB_ITEM hb_errRT_BASE_Subst ( ULONG ulGenCode, ULONG ulSubCode, const char * szDescription, const char * szOperation, ULONG ulArgCount, ... ); +extern void hb_errRT_BASE_SubstR ( ULONG ulGenCode, ULONG ulSubCode, const char * szDescription, const char * szOperation, ULONG ulArgCount, ... ); +extern USHORT hb_errRT_TERM ( ULONG ulGenCode, ULONG ulSubCode, const char * szDescription, const char * szOperation, USHORT uiOSCode, USHORT uiFlags ); +extern USHORT hb_errRT_DBCMD ( ULONG ulGenCode, ULONG ulSubCode, const char * szDescription, const char * szOperation ); extern USHORT hb_errRT_DBCMD_Ext ( ULONG ulGenCode, ULONG ulSubCode, const char * szDescription, const char * szOperation, USHORT uiFlags ); -extern USHORT hb_errRT_TOOLS ( ULONG ulGenCode, ULONG ulSubCode, char * szDescription, char * szOperation ); +extern USHORT hb_errRT_TOOLS ( ULONG ulGenCode, ULONG ulSubCode, const char * szDescription, const char * szOperation ); -extern void hb_errInternal ( ULONG ulIntCode, char * szText, char * szPar1, char * szPar2 ); +extern void hb_errInternal ( ULONG ulIntCode, const char * szText, const char * szPar1, const char * szPar2 ); /* Low-level error handling */ struct HB_ERROR_INFO_; /* forward declaration */ diff --git a/harbour/include/hbapigt.h b/harbour/include/hbapigt.h index cba753b093..df9d12b4cf 100644 --- a/harbour/include/hbapigt.h +++ b/harbour/include/hbapigt.h @@ -149,7 +149,7 @@ typedef enum extern void hb_gtInit( int iFilenoStdin, int iFilenoStdout, int iFilenoStderr ); extern void hb_gtExit( void ); -extern void hb_gtAdjustPos( int iHandle, char * pStr, ULONG ulLen ); +extern void hb_gtAdjustPos( int iHandle, const char * pStr, ULONG ulLen ); extern USHORT hb_gtBox( SHORT uiTop, SHORT uiLeft, SHORT uiBottom, SHORT uiRight, BYTE * pbyFrame ); extern USHORT hb_gtBoxD( SHORT uiTop, SHORT uiLeft, SHORT uiBottom, SHORT uiRight ); extern USHORT hb_gtBoxS( SHORT uiTop, SHORT uiLeft, SHORT uiBottom, SHORT uiRight ); @@ -179,7 +179,7 @@ extern USHORT hb_gtSave( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT ui extern USHORT hb_gtScrDim( USHORT * puiHeight, USHORT * puiWidth ); extern USHORT hb_gtScroll( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight, SHORT iRows, SHORT iCols ); extern USHORT hb_gtSetBlink( BOOL bBlink ); -extern USHORT hb_gtSetColorStr( char * pszColorString ); +extern USHORT hb_gtSetColorStr( const char * pszColorString ); extern USHORT hb_gtSetCursor( USHORT uiCursorShape ); extern USHORT hb_gtSetMode( USHORT uiRows, USHORT uiCols ); extern USHORT hb_gtSetPos( SHORT iRow, SHORT iCol ); diff --git a/harbour/include/hbapilng.h b/harbour/include/hbapilng.h index 4e4273864f..6078b2b109 100644 --- a/harbour/include/hbapilng.h +++ b/harbour/include/hbapilng.h @@ -74,7 +74,7 @@ HB_EXTERN_BEGIN typedef struct _HB_LANG { - void * pItemList[ HB_LANG_ITEM_MAX_ ]; + const void * pItemList[ HB_LANG_ITEM_MAX_ ]; } HB_LANG, * PHB_LANG, * HB_LANG_PTR; /* Supported language list management */ diff --git a/harbour/source/compiler/harbour.c b/harbour/source/compiler/harbour.c index 8e092b4b45..8fcefebc91 100644 --- a/harbour/source/compiler/harbour.c +++ b/harbour/source/compiler/harbour.c @@ -326,7 +326,7 @@ ULONG hb_xquery( USHORT uiMode ) return 0; } -void hb_conOutErr( char * pStr, ULONG ulLen ) +void hb_conOutErr( const char * pStr, ULONG ulLen ) { HB_SYMBOL_UNUSED( ulLen ); diff --git a/harbour/source/rtl/console.c b/harbour/source/rtl/console.c index 4d2b9caaec..c6e1118c51 100644 --- a/harbour/source/rtl/console.c +++ b/harbour/source/rtl/console.c @@ -201,7 +201,7 @@ HB_FUNC( HB_OSNEWLINE ) hb_retc( s_szCrLf ); } -typedef void hb_out_func_typedef( char *, ULONG ); +typedef void hb_out_func_typedef( const char *, ULONG ); /* Format items for output, then call specified output function */ static void hb_conOut( USHORT uiParam, hb_out_func_typedef * pOutFunc ) @@ -222,7 +222,7 @@ static void hb_conOut( USHORT uiParam, hb_out_func_typedef * pOutFunc ) } /* Output an item to STDOUT */ -void hb_conOutStd( char * pStr, ULONG ulLen ) +void hb_conOutStd( const char * pStr, ULONG ulLen ) { USHORT uiErrorOld; @@ -246,7 +246,7 @@ void hb_conOutStd( char * pStr, ULONG ulLen ) } /* Output an item to STDERR */ -void hb_conOutErr( char * pStr, ULONG ulLen ) +void hb_conOutErr( const char * pStr, ULONG ulLen ) { USHORT uiErrorOld; @@ -270,7 +270,7 @@ void hb_conOutErr( char * pStr, ULONG ulLen ) } /* Output an item to the screen and/or printer and/or alternate */ -static void hb_conOutAlt( char * pStr, ULONG ulLen ) +static void hb_conOutAlt( const char * pStr, ULONG ulLen ) { HB_TRACE(HB_TR_DEBUG, ("hb_conOutAlt(%s, %lu)", pStr, ulLen)); @@ -304,7 +304,7 @@ static void hb_conOutAlt( char * pStr, ULONG ulLen ) } /* Output an item to the screen and/or printer */ -static void hb_conOutDev( char * pStr, ULONG ulLen ) +static void hb_conOutDev( const char * pStr, ULONG ulLen ) { HB_TRACE(HB_TR_DEBUG, ("hb_conOutDev(%s, %lu)", pStr, ulLen)); diff --git a/harbour/source/rtl/datec.c b/harbour/source/rtl/datec.c index 3583f389fc..ee66cbda95 100644 --- a/harbour/source/rtl/datec.c +++ b/harbour/source/rtl/datec.c @@ -60,14 +60,14 @@ char * hb_dateCMonth( int iMonth ) { HB_TRACE(HB_TR_DEBUG, ("hb_dateCMonth(%d)", iMonth)); - return ( iMonth >= 1 && iMonth <= 12 ) ? ( char * ) hb_langDGetItem( HB_LANG_ITEM_BASE_MONTH + iMonth - 1 ) : ""; + return ( iMonth >= 1 && iMonth <= 12 ) ? ( char * ) hb_langDGetItem( HB_LANG_ITEM_BASE_MONTH + iMonth - 1 ) : ( char * ) ""; } char * hb_dateCDOW( int iDay ) { HB_TRACE(HB_TR_DEBUG, ("hb_dateCDOW(%d)", iDay)); - return ( iDay >= 1 && iDay <= 7 ) ? ( char * ) hb_langDGetItem( HB_LANG_ITEM_BASE_DAY + iDay - 1 ) : ""; + return ( iDay >= 1 && iDay <= 7 ) ? ( char * ) hb_langDGetItem( HB_LANG_ITEM_BASE_DAY + iDay - 1 ) : ( char * ) ""; } HB_FUNC( CMONTH ) diff --git a/harbour/source/rtl/diskspac.c b/harbour/source/rtl/diskspac.c index e77456532e..877fcb7573 100644 --- a/harbour/source/rtl/diskspac.c +++ b/harbour/source/rtl/diskspac.c @@ -206,7 +206,7 @@ HB_FUNC( DISKSPACE ) #elif defined(HB_OS_UNIX) && !defined(__WATCOMC__) { - char *szName = ISCHAR( 1 ) ? hb_parc( 1 ) : "/"; + char *szName = ISCHAR( 1 ) ? hb_parc( 1 ) : ( char * ) "/"; #if defined(HB_OS_SUNOS) struct statvfs st; if ( statvfs( szName, &st) == 0 ) diff --git a/harbour/source/rtl/errorapi.c b/harbour/source/rtl/errorapi.c index e6ec222e6f..3dc8d30648 100644 --- a/harbour/source/rtl/errorapi.c +++ b/harbour/source/rtl/errorapi.c @@ -384,13 +384,13 @@ char * hb_errGetDescription( PHB_ITEM pError ) return hb_itemGetCPtr( &hb_stack.Return ); } -PHB_ITEM hb_errPutDescription( PHB_ITEM pError, char * szDescription ) +PHB_ITEM hb_errPutDescription( PHB_ITEM pError, const char * szDescription ) { HB_TRACE(HB_TR_DEBUG, ("hb_errPutDescription(%p, %s)", pError, szDescription)); hb_vmPushSymbol( hb_dynsymGet( "_DESCRIPTION" )->pSymbol ); hb_vmPush( pError ); - hb_vmPushString( szDescription, strlen( szDescription ) ); + hb_vmPushString( ( char * ) szDescription, strlen( szDescription ) ); hb_vmDo( 1 ); return pError; @@ -407,13 +407,13 @@ char * hb_errGetFileName( PHB_ITEM pError ) return hb_itemGetCPtr( &hb_stack.Return ); } -PHB_ITEM hb_errPutFileName( PHB_ITEM pError, char * szFileName ) +PHB_ITEM hb_errPutFileName( PHB_ITEM pError, const char * szFileName ) { HB_TRACE(HB_TR_DEBUG, ("hb_errPutFileName(%p, %s)", pError, szFileName)); hb_vmPushSymbol( hb_dynsymGet( "_FILENAME" )->pSymbol ); hb_vmPush( pError ); - hb_vmPushString( szFileName, strlen( szFileName ) ); + hb_vmPushString( ( char * ) szFileName, strlen( szFileName ) ); hb_vmDo( 1 ); return pError; @@ -453,13 +453,13 @@ char * hb_errGetOperation( PHB_ITEM pError ) return hb_itemGetCPtr( &hb_stack.Return ); } -PHB_ITEM hb_errPutOperation( PHB_ITEM pError, char * szOperation ) +PHB_ITEM hb_errPutOperation( PHB_ITEM pError, const char * szOperation ) { HB_TRACE(HB_TR_DEBUG, ("hb_errPutOperation(%p, %s)", pError, szOperation)); hb_vmPushSymbol( hb_dynsymGet( "_OPERATION" )->pSymbol ); hb_vmPush( pError ); - hb_vmPushString( szOperation, strlen( szOperation ) ); + hb_vmPushString( ( char * ) szOperation, strlen( szOperation ) ); hb_vmDo( 1 ); return pError; @@ -545,13 +545,13 @@ char * hb_errGetSubSystem( PHB_ITEM pError ) return hb_itemGetCPtr( &hb_stack.Return ); } -PHB_ITEM hb_errPutSubSystem( PHB_ITEM pError, char * szSubSystem ) +PHB_ITEM hb_errPutSubSystem( PHB_ITEM pError, const char * szSubSystem ) { HB_TRACE(HB_TR_DEBUG, ("hb_errPutSubSytem(%p, %s)", pError, szSubSystem)); hb_vmPushSymbol( hb_dynsymGet( "_SUBSYSTEM" )->pSymbol ); hb_vmPush( pError ); - hb_vmPushString( szSubSystem, strlen( szSubSystem ) ); + hb_vmPushString( ( char * ) szSubSystem, strlen( szSubSystem ) ); hb_vmDo( 1 ); return pError; @@ -679,11 +679,11 @@ PHB_ITEM hb_errPutArgs( PHB_ITEM pError, ULONG ulArgCount, ... ) PHB_ITEM hb_errRT_New( USHORT uiSeverity, - char * szSubSystem, + const char * szSubSystem, ULONG ulGenCode, ULONG ulSubCode, - char * szDescription, - char * szOperation, + const char * szDescription, + const char * szOperation, USHORT uiOsCode, USHORT uiFlags ) { @@ -693,7 +693,7 @@ PHB_ITEM hb_errRT_New( hb_errPutSubSystem( pError, szSubSystem ? szSubSystem : HB_ERR_SS_BASE ); hb_errPutGenCode( pError, ( USHORT ) ulGenCode ); hb_errPutSubCode( pError, ( USHORT ) ulSubCode ); - hb_errPutDescription( pError, szDescription ? szDescription : ( char * ) hb_langDGetItem( HB_LANG_ITEM_BASE_ERRDESC + ulGenCode ) ); + hb_errPutDescription( pError, szDescription ? szDescription : ( const char * ) hb_langDGetItem( HB_LANG_ITEM_BASE_ERRDESC + ulGenCode ) ); hb_errPutOperation( pError, szOperation ? szOperation : "" ); hb_errPutOsCode( pError, uiOsCode ); hb_errPutFlags( pError, uiFlags ); @@ -703,11 +703,11 @@ PHB_ITEM hb_errRT_New( PHB_ITEM hb_errRT_New_Subst( USHORT uiSeverity, - char * szSubSystem, + const char * szSubSystem, ULONG ulGenCode, ULONG ulSubCode, - char * szDescription, - char * szOperation, + const char * szDescription, + const char * szOperation, USHORT uiOsCode, USHORT uiFlags ) { @@ -717,7 +717,7 @@ PHB_ITEM hb_errRT_New_Subst( hb_errPutSubSystem( pError, szSubSystem ? szSubSystem : HB_ERR_SS_BASE ); hb_errPutGenCode( pError, ( USHORT ) ulGenCode ); hb_errPutSubCode( pError, ( USHORT ) ulSubCode ); - hb_errPutDescription( pError, szDescription ? szDescription : ( char * ) hb_langDGetItem( HB_LANG_ITEM_BASE_ERRDESC + ulGenCode ) ); + hb_errPutDescription( pError, szDescription ? szDescription : ( const char * ) hb_langDGetItem( HB_LANG_ITEM_BASE_ERRDESC + ulGenCode ) ); hb_errPutOperation( pError, szOperation ? szOperation : "" ); hb_errPutOsCode( pError, uiOsCode ); hb_errPutFlags( pError, uiFlags | EF_CANSUBSTITUTE ); @@ -725,7 +725,7 @@ PHB_ITEM hb_errRT_New_Subst( return pError; } -PHB_ITEM hb_errRT_SubstParams( char *szSubSystem, ULONG ulGenCode, ULONG ulSubCode, char * szDescription, char * szOperation ) +PHB_ITEM hb_errRT_SubstParams( const char *szSubSystem, ULONG ulGenCode, ULONG ulSubCode, const char * szDescription, const char * szOperation ) { PHB_ITEM pRetVal; PHB_ITEM pError; @@ -775,7 +775,7 @@ HB_FUNC( __ERRRT_SBASE ) hb_param( 6, HB_IT_ANY ) ); } -USHORT hb_errRT_BASE( ULONG ulGenCode, ULONG ulSubCode, char * szDescription, char * szOperation, ULONG ulArgCount, ... ) +USHORT hb_errRT_BASE( ULONG ulGenCode, ULONG ulSubCode, const char * szDescription, const char * szOperation, ULONG ulArgCount, ... ) { USHORT uiAction; PHB_ITEM pError; @@ -846,7 +846,7 @@ USHORT hb_errRT_BASE( ULONG ulGenCode, ULONG ulSubCode, char * szDescription, ch return uiAction; } -USHORT hb_errRT_BASE_Ext1( ULONG ulGenCode, ULONG ulSubCode, char * szDescription, char * szOperation, USHORT uiOsCode, USHORT uiFlags, ULONG ulArgCount, ... ) +USHORT hb_errRT_BASE_Ext1( ULONG ulGenCode, ULONG ulSubCode, const char * szDescription, const char * szOperation, USHORT uiOsCode, USHORT uiFlags, ULONG ulArgCount, ... ) { USHORT uiAction; PHB_ITEM pError; @@ -885,7 +885,7 @@ USHORT hb_errRT_BASE_Ext1( ULONG ulGenCode, ULONG ulSubCode, char * szDescriptio return uiAction; } -PHB_ITEM hb_errRT_BASE_Subst( ULONG ulGenCode, ULONG ulSubCode, char * szDescription, char * szOperation, ULONG ulArgCount, ... ) +PHB_ITEM hb_errRT_BASE_Subst( ULONG ulGenCode, ULONG ulSubCode, const char * szDescription, const char * szOperation, ULONG ulArgCount, ... ) { PHB_ITEM pRetVal; PHB_ITEM pError; @@ -924,7 +924,7 @@ PHB_ITEM hb_errRT_BASE_Subst( ULONG ulGenCode, ULONG ulSubCode, char * szDescrip return pRetVal; } -void hb_errRT_BASE_SubstR( ULONG ulGenCode, ULONG ulSubCode, char * szDescription, char * szOperation, ULONG ulArgCount, ... ) +void hb_errRT_BASE_SubstR( ULONG ulGenCode, ULONG ulSubCode, const char * szDescription, const char * szOperation, ULONG ulArgCount, ... ) { PHB_ITEM pError; @@ -987,7 +987,7 @@ void hb_errRT_BASE_SubstR( ULONG ulGenCode, ULONG ulSubCode, char * szDescriptio hb_errRelease( pError ); } -USHORT hb_errRT_TERM( ULONG ulGenCode, ULONG ulSubCode, char * szDescription, char * szOperation, USHORT uiOSCode, USHORT uiFlags ) +USHORT hb_errRT_TERM( ULONG ulGenCode, ULONG ulSubCode, const char * szDescription, const char * szOperation, USHORT uiOSCode, USHORT uiFlags ) { USHORT uiAction; PHB_ITEM pError = @@ -1000,7 +1000,7 @@ USHORT hb_errRT_TERM( ULONG ulGenCode, ULONG ulSubCode, char * szDescription, ch return uiAction; } -USHORT hb_errRT_DBCMD( ULONG ulGenCode, ULONG ulSubCode, char * szDescription, char * szOperation ) +USHORT hb_errRT_DBCMD( ULONG ulGenCode, ULONG ulSubCode, const char * szDescription, const char * szOperation ) { USHORT uiAction; PHB_ITEM pError = @@ -1018,7 +1018,7 @@ USHORT hb_errRT_DBCMD_Ext( ULONG ulGenCode, ULONG ulSubCode, const char * szDesc USHORT uiAction; PHB_ITEM pError; - pError = hb_errRT_New( ES_ERROR, HB_ERR_SS_DBCMD, ulGenCode, ulSubCode, (char *)szDescription, (char *)szOperation, 0, uiFlags ); + pError = hb_errRT_New( ES_ERROR, HB_ERR_SS_DBCMD, ulGenCode, ulSubCode, (const char *)szDescription, (const char *)szOperation, 0, uiFlags ); uiAction = hb_errLaunch( pError ); @@ -1027,7 +1027,7 @@ USHORT hb_errRT_DBCMD_Ext( ULONG ulGenCode, ULONG ulSubCode, const char * szDesc return uiAction; } -USHORT hb_errRT_TOOLS( ULONG ulGenCode, ULONG ulSubCode, char * szDescription, char * szOperation ) +USHORT hb_errRT_TOOLS( ULONG ulGenCode, ULONG ulSubCode, const char * szDescription, const char * szOperation ) { USHORT uiAction; PHB_ITEM pError = diff --git a/harbour/source/rtl/errorint.c b/harbour/source/rtl/errorint.c index f00e7c3569..71f21a1964 100644 --- a/harbour/source/rtl/errorint.c +++ b/harbour/source/rtl/errorint.c @@ -58,7 +58,7 @@ /* NOTE: Use as minimal calls from here, as possible. Don't allocate memory from this function. [vszakats] */ -void hb_errInternal( ULONG ulIntCode, char * szText, char * szPar1, char * szPar2 ) +void hb_errInternal( ULONG ulIntCode, const char * szText, const char * szPar1, const char * szPar2 ) { char buffer[ 128 ]; diff --git a/harbour/source/rtl/filesys.c b/harbour/source/rtl/filesys.c index 808a1d8abc..43ee23d47c 100644 --- a/harbour/source/rtl/filesys.c +++ b/harbour/source/rtl/filesys.c @@ -568,7 +568,7 @@ FHANDLE hb_fsPOpen( BYTE * pFilename, BYTE * pMode ) } if( pFilename[ ulLen - 1 ] == '|' ) { - pbyTmp = hb_strdup( ( char * ) pFilename ); + pbyTmp = ( BYTE * ) hb_strdup( ( char * ) pFilename ); pbyTmp[--ulLen] = 0; pFilename = pbyTmp; } else @@ -936,7 +936,7 @@ BOOL hb_fsSetDevMode( FHANDLE hFileHandle, USHORT uiDevMode ) HB_SYMBOL_UNUSED( uiDevMode ); bResult = FALSE; - s_uiErrorLast = FS_ERROR; + s_uiErrorLast = ( USHORT ) FS_ERROR; #endif @@ -1974,8 +1974,8 @@ USHORT HB_EXPORT hb_fsChDrv( BYTE nDrive ) HB_SYMBOL_UNUSED( nDrive ); - uiResult = FS_ERROR; - s_uiErrorLast = FS_ERROR; + uiResult = ( USHORT ) FS_ERROR; + s_uiErrorLast = ( USHORT ) FS_ERROR; #endif @@ -2045,8 +2045,8 @@ USHORT HB_EXPORT hb_fsIsDrv( BYTE nDrive ) HB_SYMBOL_UNUSED( nDrive ); - uiResult = FS_ERROR; - s_uiErrorLast = FS_ERROR; + uiResult = ( USHORT ) FS_ERROR; + s_uiErrorLast = ( USHORT ) FS_ERROR; #endif @@ -2124,7 +2124,7 @@ BYTE HB_EXPORT hb_fsCurDrv( void ) #else uiResult = 0; - s_uiErrorLast = FS_ERROR; + s_uiErrorLast = ( USHORT ) FS_ERROR; #endif @@ -2309,7 +2309,7 @@ BOOL hb_fsEof( FHANDLE hFileHandle ) } else if( newPos != curPos ) { - hb_fsSetError( FS_ERROR ); + hb_fsSetError( ( USHORT ) FS_ERROR ); } return curPos >= endPos; #else diff --git a/harbour/source/rtl/fssize.c b/harbour/source/rtl/fssize.c index eaa9c147cd..61d80e4b66 100644 --- a/harbour/source/rtl/fssize.c +++ b/harbour/source/rtl/fssize.c @@ -90,7 +90,7 @@ ULONG hb_fsFSize( BYTE * pszFileName, BOOL bUseDirEntry ) } } - hb_fsSetError( FS_ERROR ); + hb_fsSetError( ( USHORT ) FS_ERROR ); return 0; } diff --git a/harbour/source/rtl/fstemp.c b/harbour/source/rtl/fstemp.c index ecc0a73cd1..5fcaeec721 100644 --- a/harbour/source/rtl/fstemp.c +++ b/harbour/source/rtl/fstemp.c @@ -151,7 +151,7 @@ FHANDLE hb_fsCreateTemp( const BYTE * pszDir, const BYTE * pszPrefix, USHORT uiA } #endif - hb_fsSetError( FS_ERROR ); + hb_fsSetError( ( USHORT ) FS_ERROR ); return FS_ERROR; } diff --git a/harbour/source/rtl/gtapi.c b/harbour/source/rtl/gtapi.c index 670192c807..bced44caed 100644 --- a/harbour/source/rtl/gtapi.c +++ b/harbour/source/rtl/gtapi.c @@ -154,7 +154,7 @@ int hb_gtReadKey( HB_inkey_enum eventmask ) return hb_gt_ReadKey( eventmask ); } -void hb_gtAdjustPos( int iHandle, char * pStr, ULONG ulLen ) +void hb_gtAdjustPos( int iHandle, const char * pStr, ULONG ulLen ) { HB_TRACE(HB_TR_DEBUG, ("hb_gtAdjustPos()")); @@ -488,7 +488,7 @@ USHORT hb_gtColorToN( char * szColorString ) return nColor; } -USHORT hb_gtSetColorStr( char * szColorString ) +USHORT hb_gtSetColorStr( const char * szColorString ) { char c; char buff[ 6 ]; @@ -1116,7 +1116,7 @@ USHORT hb_gtSuspend( void ) * to prepare screen for outside output */ if( !hb_gt_Suspend() ) - return( -1 ); + return( ( USHORT ) -1 ); return( 0 ); } @@ -1132,7 +1132,7 @@ USHORT hb_gtResume( void ) hb_gt_DispBegin(); } else - return( -1 ); + return( ( USHORT ) -1 ); return( 0 ); } diff --git a/harbour/source/rtl/gtcrs/gtcrs.c b/harbour/source/rtl/gtcrs/gtcrs.c index ad257298e4..906e6a64c2 100644 --- a/harbour/source/rtl/gtcrs/gtcrs.c +++ b/harbour/source/rtl/gtcrs/gtcrs.c @@ -819,7 +819,7 @@ USHORT hb_gt_BoxD( SHORT Top, SHORT Left, SHORT Bottom, SHORT Right, BYTE * pbyF if( s_under_xterm ) { /* Under xterm use hard-coded box drawing characters */ - pbyFrame = s_xTermBox; + pbyFrame = ( BYTE * ) s_xTermBox; } s_alternate_char_set = A_ALTCHARSET; @@ -837,7 +837,7 @@ USHORT hb_gt_BoxS( SHORT Top, SHORT Left, SHORT Bottom, SHORT Right, BYTE * pbyF if( s_under_xterm ) { /* Under xterm use hard-coded box drawing characters */ - pbyFrame = s_xTermBox; + pbyFrame = ( BYTE * ) s_xTermBox; } s_alternate_char_set = A_ALTCHARSET; diff --git a/harbour/source/rtl/gtsln/gtsln.c b/harbour/source/rtl/gtsln/gtsln.c index dfb88f3bd5..769e960120 100644 --- a/harbour/source/rtl/gtsln/gtsln.c +++ b/harbour/source/rtl/gtsln/gtsln.c @@ -262,7 +262,7 @@ void hb_gt_Init( int iFilenoStdin, int iFilenoStdout, int iFilenoStderr ) if( ! gt_Inited ) { - char *errmsg = '\r'+'\n'+"Internal error : screen driver initialization failure"+'\r'+'\n'+( char )0; + const char *errmsg = '\r'+'\n'+"Internal error : screen driver initialization failure"+'\r'+'\n'+( char )0; /* something went wrong - restore default settings */ SLang_reset_tty(); @@ -1247,7 +1247,7 @@ static void hb_gt_build_conv_tabs() s_convHighChars[ i ] = ( ( SLsmg_Char_Type ) i ) | 0x8000; /* init an alternate chars table */ - if( ( p = SLtt_Graphics_Char_Pairs ) ) + if( ( p = ( unsigned char * ) SLtt_Graphics_Char_Pairs ) ) { len = strlen( ( char * ) p ); @@ -1365,7 +1365,7 @@ static void hb_gt_build_conv_tabs() /* init national chars */ - env = hb_getenv( hb_NationCharsEnvName ); + env = ( unsigned char * ) hb_getenv( hb_NationCharsEnvName ); p = env; if( p && p[ 0 ] != '\0' ) diff --git a/harbour/source/rtl/gtsln/kbsln.c b/harbour/source/rtl/gtsln/kbsln.c index 48cb7937e9..8ceeb5f1bb 100644 --- a/harbour/source/rtl/gtsln/kbsln.c +++ b/harbour/source/rtl/gtsln/kbsln.c @@ -235,7 +235,7 @@ int hb_gt_Init_Terminal( int phase ) /* get Dead key definition */ - p = hb_getenv( hb_DeadKeyEnvName ); + p = ( unsigned char * ) hb_getenv( hb_DeadKeyEnvName ); if( p && p[ 0 ] != '\0' ) { diff --git a/harbour/source/rtl/isprint.c b/harbour/source/rtl/isprint.c index 5728445663..6db4f5be4e 100644 --- a/harbour/source/rtl/isprint.c +++ b/harbour/source/rtl/isprint.c @@ -159,10 +159,10 @@ HB_FUNC( ISPRINTER ) char DefaultPrinter[ 80 ]; DWORD pdwBufferSize = 80; DPGetDefaultPrinter( ( LPTSTR ) &DefaultPrinter, &pdwBufferSize); - hb_retl( hb_printerIsReady( ISCHAR( 1 ) ? hb_parc( 1 ) : (char*)DefaultPrinter ) ); + hb_retl( hb_printerIsReady( ISCHAR( 1 ) ? hb_parc( 1 ) : ( char * ) DefaultPrinter ) ); } #else - hb_retl( hb_printerIsReady( ISCHAR( 1 ) ? hb_parc( 1 ) : "LPT1" ) ); + hb_retl( hb_printerIsReady( ISCHAR( 1 ) ? hb_parc( 1 ) : ( char * ) "LPT1" ) ); #endif } diff --git a/harbour/source/rtl/natmsg.c b/harbour/source/rtl/natmsg.c index 28fa675047..b91fa17d92 100644 --- a/harbour/source/rtl/natmsg.c +++ b/harbour/source/rtl/natmsg.c @@ -90,7 +90,7 @@ char * hb_nationGetMsg( USHORT uiMsg ) { HB_TRACE(HB_TR_DEBUG, ("hb_nationGetMsg(%hu)", uiMsg)); - return ( uiMsg >= 1 && uiMsg <= 13 ) ? ( char * ) hb_langDGetItem( HB_LANG_ITEM_BASE_NATMSG + uiMsg - 1 ) : ""; + return ( uiMsg >= 1 && uiMsg <= 13 ) ? ( char * ) hb_langDGetItem( HB_LANG_ITEM_BASE_NATMSG + uiMsg - 1 ) : ( char * ) ""; } #ifdef HB_C52_UNDOC diff --git a/harbour/source/rtl/philes.c b/harbour/source/rtl/philes.c index f7998497ec..a7e1121b14 100644 --- a/harbour/source/rtl/philes.c +++ b/harbour/source/rtl/philes.c @@ -234,7 +234,7 @@ HB_FUNC( HB_F_EOF ) } else { - hb_fsSetError( FS_ERROR ); + hb_fsSetError( ( USHORT ) FS_ERROR ); hb_retl( TRUE ); } } diff --git a/harbour/source/rtl/setcolor.c b/harbour/source/rtl/setcolor.c index 7b859e03b0..791973325c 100644 --- a/harbour/source/rtl/setcolor.c +++ b/harbour/source/rtl/setcolor.c @@ -54,7 +54,7 @@ #include "hbapigt.h" #include "hbset.h" -char * hb_conSetColor( char * szColor ) +char * hb_conSetColor( const char * szColor ) { HB_TRACE(HB_TR_DEBUG, ("hb_conSetColor(%s)", szColor)); diff --git a/harbour/source/rtl/spfiles.c b/harbour/source/rtl/spfiles.c index 5caf93a1cf..85dd0b3aed 100644 --- a/harbour/source/rtl/spfiles.c +++ b/harbour/source/rtl/spfiles.c @@ -107,7 +107,7 @@ BOOL hb_spFile( BYTE * pFilename, BYTE * pRetPath ) */ if( ! bIsFile ) { - pFilepath->szPath = hb_set.HB_SET_DEFAULT ? hb_set.HB_SET_DEFAULT : "."; + pFilepath->szPath = hb_set.HB_SET_DEFAULT ? hb_set.HB_SET_DEFAULT : ( char * ) "."; hb_fsFNameMerge( (char*) Path, pFilepath ); } } diff --git a/harbour/source/vm/itemapi.c b/harbour/source/vm/itemapi.c index cfe99a6ce9..7da7c20ac3 100644 --- a/harbour/source/vm/itemapi.c +++ b/harbour/source/vm/itemapi.c @@ -1054,7 +1054,7 @@ char * HB_EXPORT hb_itemTypeStr( PHB_ITEM pItem ) switch( pItem->type & ~HB_IT_BYREF ) { case HB_IT_ARRAY: - return ( hb_arrayIsObject( pItem ) ? "O" : "A" ); + return ( char * ) ( hb_arrayIsObject( pItem ) ? "O" : "A" ); case HB_IT_BLOCK: return "B"; @@ -1777,7 +1777,7 @@ char * HB_EXPORT hb_itemString( PHB_ITEM pItem, ULONG * ulLen, BOOL * bFreeReq ) break; case HB_IT_LOGICAL: - buffer = ( hb_itemGetL( pItem ) ? ".T." : ".F." ); + buffer = ( char * ) ( hb_itemGetL( pItem ) ? ".T." : ".F." ); * ulLen = 3; * bFreeReq = FALSE; break; diff --git a/harbour/source/vm/memvars.c b/harbour/source/vm/memvars.c index 0a0444c04c..7af6902ed0 100644 --- a/harbour/source/vm/memvars.c +++ b/harbour/source/vm/memvars.c @@ -1528,7 +1528,7 @@ HB_FUNC( __MVRESTORE ) if( fhnd != FS_ERROR ) { - char * pszMask = ISCHAR( 3 ) ? hb_parc( 3 ) : "*"; + char * pszMask = ISCHAR( 3 ) ? hb_parc( 3 ) : ( char * ) "*"; BOOL bIncludeMask = ISCHAR( 4 ) ? hb_parl( 4 ) : TRUE; BYTE buffer[ HB_MEM_REC_LEN ]; diff --git a/harbour/source/vm/runner.c b/harbour/source/vm/runner.c index c2949579bb..dd4dc7b9bc 100644 --- a/harbour/source/vm/runner.c +++ b/harbour/source/vm/runner.c @@ -660,7 +660,7 @@ static PASM_CALL hb_hrbAsmCreateFun( PHB_SYMB pSymbols, BYTE * pCode ) hb_hrbAsmPatch( asmRet->pAsmData, 1, pSymbols ); /* Insert pointer to testsym */ hb_hrbAsmPatch( asmRet->pAsmData, 6, pCode ); /* Insert pointer to testcode */ - hb_hrbAsmPatchRelative( asmRet->pAsmData, 11, hb_vmExecute, 15 ); + hb_hrbAsmPatchRelative( asmRet->pAsmData, 11, ( void * ) hb_vmExecute, 15 ); /* Insert pointer to hb_vmExecute() */ /* #elseif INTEL16 */