From 7a1f91f3f55001346b0b707642305509fa7fc74c Mon Sep 17 00:00:00 2001 From: Ryszard Glab Date: Mon, 20 Mar 2000 11:52:15 +0000 Subject: [PATCH] ChangeLog 20000320-13:10 GMT+1 --- harbour/ChangeLog | 18 +++++ harbour/include/hbexpra.c | 1 + harbour/include/hbexprb.c | 2 +- harbour/source/compiler/harbour.y | 2 + harbour/source/macro/macro.c | 11 +-- harbour/source/rtl/gt/gtcrs.c | 2 + harbour/source/rtl/gt/gtstd.c | 122 +++--------------------------- 7 files changed, 39 insertions(+), 119 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index fd9f3f316e..9e79efbf84 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,21 @@ +20000320-13:10 GMT+1 Ryszard Glab + + *source/compiler/harbour.y + * fixed compilation of empty files + + *include/hbexpra.c + *include/hbexprb.c + *source/macro/macro.c + *fixed passing of the second parameter in hb_compGenPushSymbol + + *source/rtl/gt/gtstd.c + *fixed to get a clean compile on Linux + + *source/rtl/gt/gtcrs.c + *matching #endif added + *inkey.ch added again - we need these definitions to define the + keys translation table - TOFIX + 20000319-01:35 EST Paul Tucker * source/pp/ppcore.c from 20000319-01:30 that didn't get posted. diff --git a/harbour/include/hbexpra.c b/harbour/include/hbexpra.c index 992aa7c5bd..0a67bb8f0e 100644 --- a/harbour/include/hbexpra.c +++ b/harbour/include/hbexpra.c @@ -144,6 +144,7 @@ void hb_compExprErrorType( HB_EXPR_PTR pExpr, HB_MACRO_DECL ) { HB_TRACE(HB_TR_DEBUG, ("hb_compExprErrorType()")); hb_compErrorType( pExpr ); + HB_SYMBOL_UNUSED( pExpr ); HB_SYMBOL_UNUSED( HB_MACRO_VARNAME ); } diff --git a/harbour/include/hbexprb.c b/harbour/include/hbexprb.c index 297d9de20e..6beaaa05b9 100644 --- a/harbour/include/hbexprb.c +++ b/harbour/include/hbexprb.c @@ -1355,7 +1355,7 @@ static HB_EXPR_FUNC( hb_compExprUseAlias ) case HB_EA_LVALUE: break; case HB_EA_PUSH_PCODE: - HB_EXPR_PCODE2( hb_compGenPushSymbol, pSelf->value.asSymbol, FALSE ); + HB_EXPR_PCODE2( hb_compGenPushSymbol, pSelf->value.asSymbol, 0 ); break; case HB_EA_POP_PCODE: case HB_EA_PUSH_POP: diff --git a/harbour/source/compiler/harbour.y b/harbour/source/compiler/harbour.y index 06a87dd365..a429f682ba 100644 --- a/harbour/source/compiler/harbour.y +++ b/harbour/source/compiler/harbour.y @@ -241,6 +241,8 @@ char * hb_comp_szAnnounce = NULL; /* ANNOUNCEd procedure */ %% Main : { hb_compLinePush(); } Source { } + | /* empty file */ + ; Source : Crlf | VarDefs diff --git a/harbour/source/macro/macro.c b/harbour/source/macro/macro.c index 0a1205c8f6..16cb4931d9 100644 --- a/harbour/source/macro/macro.c +++ b/harbour/source/macro/macro.c @@ -836,10 +836,11 @@ void hb_compMemvarGenPCode( BYTE bPCode, char * szVarName, HB_MACRO_DECL ) } /* generates the pcode to push a symbol on the virtual machine stack */ -void hb_compGenPushSymbol( char * szSymbolName, HB_MACRO_DECL ) +void hb_compGenPushSymbol( char * szSymbolName, int isFunction, HB_MACRO_DECL ) { HB_DYNS_PTR pSym; + HB_SYMBOL_UNUSED( isFunction ); if( HB_MACRO_DATA->Flags & HB_MACRO_GEN_TYPE ) { /* we are determining the type of expression (called from TYPE() function) @@ -963,7 +964,7 @@ void hb_compGenPopAliasedVar( char * szVarName, } else { /* database alias */ - hb_compGenPushSymbol( szAlias, HB_MACRO_PARAM ); + hb_compGenPushSymbol( szAlias, 0, HB_MACRO_PARAM ); hb_compMemvarGenPCode( HB_P_MPOPALIASEDFIELD, szVarName, HB_MACRO_PARAM ); } } @@ -1062,7 +1063,7 @@ void hb_compGenPushAliasedVar( char * szVarName, } else { /* database alias */ - hb_compGenPushSymbol( szAlias, HB_MACRO_PARAM ); + hb_compGenPushSymbol( szAlias, 0, HB_MACRO_PARAM ); hb_compMemvarGenPCode( HB_P_MPUSHALIASEDFIELD, szVarName, HB_MACRO_PARAM ); } } @@ -1108,12 +1109,12 @@ void hb_compGenPushFunCall( char * szFunName, HB_MACRO_DECL ) { /* Abbreviated function name was used - change it for whole name */ - hb_compGenPushSymbol( szFunction, HB_MACRO_PARAM ); + hb_compGenPushSymbol( szFunction, 0, HB_MACRO_PARAM ); } else { HB_MACRO_DATA->status |= HB_MACRO_UDF; /* this is used in hb_macroGetType */ - hb_compGenPushSymbol( szFunName, HB_MACRO_PARAM ); + hb_compGenPushSymbol( szFunName, 0, HB_MACRO_PARAM ); } } diff --git a/harbour/source/rtl/gt/gtcrs.c b/harbour/source/rtl/gt/gtcrs.c index de476f7bd4..7202c84f9c 100644 --- a/harbour/source/rtl/gt/gtcrs.c +++ b/harbour/source/rtl/gt/gtcrs.c @@ -37,6 +37,7 @@ #include "hbapigt.h" #include "hbinit.h" +#include "inkey.ch" /* TOFIX: define K_xxx constants somewhere in H file */ static void gt_GetMaxRC(int* r, int* c); static void gt_GetRC(int* r, int* c); @@ -84,6 +85,7 @@ static int iKeyTable[] = #if defined(OS_UNIX_COMPATIBLE) #include #include +#endif static void restore_input_mode( void ) { diff --git a/harbour/source/rtl/gt/gtstd.c b/harbour/source/rtl/gt/gtstd.c index 8348d2b599..eef9bd158e 100644 --- a/harbour/source/rtl/gt/gtstd.c +++ b/harbour/source/rtl/gt/gtstd.c @@ -40,6 +40,10 @@ #include "hbapifs.h" #include "hbapigt.h" +#if defined( OS_UNIX_COMPATIBLE ) + #include /* read() function requires it */ +#endif + static SHORT s_iRow; static SHORT s_iCol; static USHORT s_uiMaxRow; @@ -73,6 +77,8 @@ void hb_gt_Done( void ) int hb_gt_ReadKey( HB_inkey_enum eventmask ) { + int ch; + HB_TRACE(HB_TR_DEBUG, ("hb_gt_ReadKey(%d)", (int) event_mask)); HB_SYMBOL_UNUSED( eventmask ); @@ -80,11 +86,13 @@ int hb_gt_ReadKey( HB_inkey_enum eventmask ) #if defined(OS_UNIX_COMPATIBLE) if( ! read( STDIN_FILENO, &ch, 1 ) ) ch = 0; +#else + ch = 0; #endif /* TODO: */ - return 0; + return ch; } BOOL hb_gt_AdjustPos( BYTE * pStr, ULONG ulLen ) @@ -345,115 +353,3 @@ void hb_gt_Tone( double dFrequency, double dDuration ) HB_SYMBOL_UNUSED( dDuration ); } -/* - BYTE pszBox[ 10 ]; - - USHORT uiRow; - USHORT uiCol; - USHORT width, height, tmp; - - USHORT top, left, bottom, right, size = strlen( _B_SINGLE ); - - /* TODO: Would be better to support these cases, Clipper implementation */ - /* was quite messy for these cases, which can be considered as */ - /* a bug there. */ - - if( uiTop > uiMaxRow || uiBottom > uiMaxRow || - uiLeft > uiMaxCol || uiRight > uiMaxCol ) - { - return 1; - } - - /* Force the box to be drawn from top left to bottom right */ - if( top > bottom ) - { - tmp = top; - top = bottom; - bottom = tmp; - } - if( left > right ) - { - tmp = right; - right = left; - left = tmp; - } - width = right - left + 1; - height = bottom - top + 1; - - /* Determine the box style */ - if( ISCHAR( 5 ) ) - { - pbyFrame = hb_parc( 5 ); - size = hb_parclen( 5 ); - } - else if( ISNUM( 5 ) ) - { - switch( hb_parni( 5 ) ) - { - case 2: - pbyFrame = _B_DOUBLE; - break; - case 3: - pbyFrame = _B_SINGLE_DOUBLE; - break; - case 4: - pbyFrame = _B_DOUBLE_SINGLE; - break; - default: - pbyFrame = _B_SINGLE; - } - size = strlen( pbyFrame ); - } - /* We only need 9 characters from the source string */ - if( size > 9 ) size = 9; - /* If we have at least one character... */ - if( size ) - /* ...copy the source string */ - memcpy( pszBox, pbyFrame, size ); - else - /* If not, set the first character to a space */ - pszBox[ size++ ] = ' '; - /* If there were less than 8 characters in the source... */ - for( ; size < 8; size++ ) - { - /* ...copy the last character into the remaining 8 border positions */ - pszBox[ size ] = pszBox[ size - 1 ]; - } - /* If there were less than 9 characters in the source... */ - if( size < 9 ) - /* ...set the fill character to space */ - pszBox[ 8 ] = ' '; - - /* Draw the box */ - hb_gtSetPos( top, left ); - if( height > 1 && width > 1 ) - fputc( pszBox[ 0 ], stdout ); /* Upper left corner */ - for( uiCol = ( height > 1 ? left + 1 : left ); uiCol < ( height > 1 ? right : right + 1 ); uiCol++ ) - fputc( pszBox[ 1 ], stdout ); /* Top line */ - if( height > 1 && width > 1 ) - fputc( pszBox[ 2 ], stdout ); /* Upper right corner */ - for( uiRow = ( height > 1 ? top + 1 : top ); uiRow < ( width > 1 ? bottom : bottom + 1 ); uiRow++ ) - { - hb_gtSetPos( uiRow, left ); - if( height > 1 ) - fputc( pszBox[ 3 ], stdout ); /* Left side */ - if( height > 1 && width > 1 ) for( uiCol = left + 1; uiCol < right; uiCol++ ) - fputc( pszBox[ 8 ], stdout ); /* Fill */ - if( height > 1 && width > 1 ) - fputc( pszBox[ 7 ], stdout ); /* Right side */ - } - if( height > 1 && width > 1 ) - { - hb_gtSetPos( bottom, left ); - uiCol = left; - fputc( pszBox[ 6 ], stdout ); /* Bottom left corner */ - for( uiCol = left + 1; uiCol < right; uiCol++ ) - fputc( pszBox[ 5 ], stdout ); /* Bottom line */ - fputc( pszBox[ 4 ], stdout ); /* Bottom right corner */ - } - fflush( stdout ); - hb_gtSetPos( bottom + 1, right + 1 ); - -*/ - -