2008-11-24 12:34 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)

* harbour/include/hberrors.h
  * harbour/source/compiler/hbgenerr.c
    + added new compile time error (file write error)

  * harbour/source/pp/ppcore.c
  * harbour/source/rtl/errorint.c
  * harbour/source/compiler/genhrb.c
  * harbour/source/compiler/genc.c
  * harbour/source/rtl/run.c
  * harbour/source/vm/estack.c
    * pacified warnings - Lorenzo please verify it compiling with C header
      files from Ubuntu.

  * harbour/contrib/xhb/filestat.c
    ! fixed UNICODE compilation

  * harbour/contrib/gtwvg/wvgsink.c
    ! added #define NONAMELESSUNION to fix MinGW compilation
This commit is contained in:
Przemyslaw Czerpak
2008-11-24 11:33:13 +00:00
parent 39b634fbb7
commit 2e6b5eee7d
11 changed files with 61 additions and 38 deletions

View File

@@ -8,6 +8,26 @@
2008-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org)
*/
2008-11-24 12:34 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hberrors.h
* harbour/source/compiler/hbgenerr.c
+ added new compile time error (file write error)
* harbour/source/pp/ppcore.c
* harbour/source/rtl/errorint.c
* harbour/source/compiler/genhrb.c
* harbour/source/compiler/genc.c
* harbour/source/rtl/run.c
* harbour/source/vm/estack.c
* pacified warnings - Lorenzo please verify it compiling with C header
files from Ubuntu.
* harbour/contrib/xhb/filestat.c
! fixed UNICODE compilation
* harbour/contrib/gtwvg/wvgsink.c
! added #define NONAMELESSUNION to fix MinGW compilation
2008-11-23 17:28 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com)
* harbour/contrib/gtwvg/Makefile
* harbour/contrib/gtwvg/common.mak

View File

@@ -80,6 +80,8 @@
*/
//----------------------------------------------------------------------//
#define NONAMELESSUNION
#ifdef __XHARBOUR__
#include "hbvmopt.h"
#else

View File

@@ -186,26 +186,26 @@ static BOOL hb_fsFileStats(
HANDLE hFind;
FILETIME filetime;
SYSTEMTIME time;
/* Get attributes... */
dwAttribs = GetFileAttributes( (char*) pszFileName );
dwAttribs = GetFileAttributesA( ( char * ) pszFileName );
if ( dwAttribs == INVALID_FILE_ATTRIBUTES )
{
/* return */
return FALSE;
}
hb_fsAttrDecode( hb_fsAttrFromRaw( dwAttribs ), (char*) pszAttr );
hb_fsAttrDecode( hb_fsAttrFromRaw( dwAttribs ), ( char * ) pszAttr );
/* If file existed, do a findfirst */
hFind = FindFirstFile( (char*) pszFileName, &ffind );
hFind = FindFirstFileA( ( char * ) pszFileName, &ffind );
if ( hFind != INVALID_HANDLE_VALUE )
{
CloseHandle( hFind );
/* get file times and work them out */
*llSize = ( HB_FOFFSET ) ffind.nFileSizeLow + ( ( HB_FOFFSET ) ffind.nFileSizeHigh << 32 );
if ( FileTimeToLocalFileTime( &ffind.ftCreationTime, &filetime ) &&
FileTimeToSystemTime( &filetime, &time ) )
{
@@ -217,7 +217,7 @@ static BOOL hb_fsFileStats(
*lcDate = hb_dateEncode( 0, 0, 0 );
*lcTime = 0;
}
if ( FileTimeToLocalFileTime( &ffind.ftLastAccessTime, &filetime ) &&
FileTimeToSystemTime( &filetime, &time ) )
{
@@ -237,11 +237,11 @@ static BOOL hb_fsFileStats(
/* Generic algorithm based on findfirst */
{
PHB_FFIND findinfo = hb_fsFindFirst( (char*) pszFileName, HB_FA_ALL );
PHB_FFIND findinfo = hb_fsFindFirst( ( char * ) pszFileName, HB_FA_ALL );
if( findinfo )
{
hb_fsAttrDecode( findinfo->attr, (char*) pszAttr );
hb_fsAttrDecode( findinfo->attr, ( char * ) pszAttr );
*llSize = ( HB_FOFFSET ) findinfo->size;
*lcDate = findinfo->lDate;
*lcTime = (findinfo->szTime[0] - '0') * 36000 +

View File

@@ -127,10 +127,11 @@ HB_EXTERN_BEGIN
#define HB_COMP_ERR_NOT_VPARAMS 65
#define HB_COMP_ERR_OPEN_CFG 66
#define HB_COMP_ERR_ALWAYS_AFTER_EXIT 67
#define HB_COMP_ERR_HISTORICAL_1 68
#define HB_COMP_ERR_HISTORICAL_2 69
#define HB_COMP_ERR_HISTORICAL_3 70
#define HB_COMP_ERR_HISTORICAL_4 71
#define HB_COMP_ERR_FILE_WRITE 68
#define HB_COMP_ERR_HISTORICAL_1 69
#define HB_COMP_ERR_HISTORICAL_2 70
#define HB_COMP_ERR_HISTORICAL_3 71
#define HB_COMP_ERR_HISTORICAL_4 72
#define HB_COMP_WARN_AMBIGUOUS_VAR 1
#define HB_COMP_WARN_MEMVAR_ASSUMED 2

View File

@@ -410,16 +410,16 @@ static void hb_compGenCFunc( FILE * yyc, const char *cDecor, const char *szName,
if( cDecor[i] == '%' && cDecor[i+1] == 's' )
{
int j=0;
while( szName[j+iStrip] )
while( szName[ j + iStrip ] )
{
fwrite( (void*)(szName+j), 1, 1, yyc );
fputc( ( UCHAR ) szName[ j ], yyc );
j++;
}
i +=2;
}
else
{
fwrite( (void*)(cDecor+i), 1, 1, yyc );
fputc( ( UCHAR ) cDecor[ i ], yyc );
i++;
}
}
@@ -437,12 +437,8 @@ static void hb_compGenCByteStr( FILE * yyc, BYTE * pText, ULONG ulLen )
*
* TODO: add switch to use hexadecimal format "%#04x"
*/
if( ( uchr < ( BYTE ) ' ' ) || ( uchr >= 127 ) )
fprintf( yyc, "%i, ", uchr );
else if( strchr( "\'\\\"", uchr ) )
fprintf( yyc, "%i, ", uchr );
else
fprintf( yyc, "\'%c\', ", uchr );
fprintf( yyc, ( uchr < ( BYTE ) ' ' || uchr >= 127 || uchr == '\\' ||
uchr == '\'' ) ? "%i, " : "\'%c\', ", uchr );
}
}

View File

@@ -167,7 +167,10 @@ void hb_compGenPortObj( HB_COMP_DECL, PHB_FNAME pFileName )
}
hb_compGenBufPortObj( HB_COMP_PARAM, &pHrbBody, &ulSize );
fwrite( pHrbBody, ulSize, 1, yyc );
if( fwrite( pHrbBody, ulSize, 1, yyc ) != 1 )
hb_compGenError( HB_COMP_PARAM, hb_comp_szErrors, 'E', HB_COMP_ERR_FILE_WRITE, szFileName, NULL );
hb_xfree( pHrbBody );
fclose( yyc );

View File

@@ -98,6 +98,7 @@ const char * hb_comp_szErrors[] =
"%s not declared with variable number of parameters",
"Can't find %s file",
"Invalid ALWAYS after %s in RECOVER code",
"File write error",
/* Some historical, funny sounding error messages from original CA-Cl*pper.
They serve no purpose whatsoever. [vszakats] */
"END wreaks terrible vengeance on control stack",

View File

@@ -837,7 +837,7 @@ static void hb_pp_dumpEnd( PHB_PP_STATE pState )
pBuffer = hb_membufPtr( pState->pDumpBuffer );
ulLen = hb_membufLen( pState->pDumpBuffer );
fputs( "#pragma BEGINDUMP\n", pState->file_out );
fwrite( pBuffer, sizeof( char ), ulLen, pState->file_out );
( void ) fwrite( pBuffer, sizeof( char ), ulLen, pState->file_out );
fputs( "#pragma ENDDUMP\n", pState->file_out );
while( ulLen-- )
@@ -2516,8 +2516,8 @@ static void hb_pp_pragmaNew( PHB_PP_STATE pState, PHB_PP_TOKEN pToken )
hb_membufAddCh( pState->pBuffer, '\n' );
if( pState->fWriteTrace )
{
fwrite( hb_membufPtr( pState->pBuffer ), sizeof( char ),
hb_membufLen( pState->pBuffer ), pState->file_trace );
( void ) fwrite( hb_membufPtr( pState->pBuffer ), sizeof( char ),
hb_membufLen( pState->pBuffer ), pState->file_trace );
}
if( pState->fTracePragmas )
{
@@ -5124,8 +5124,8 @@ PHB_PP_TOKEN hb_pp_tokenGet( PHB_PP_STATE pState )
pState->usLastType );
#endif
pState->usLastType = HB_PP_TOKEN_TYPE( pState->pTokenOut->type );
fwrite( hb_membufPtr( pState->pBuffer ), sizeof( char ),
hb_membufLen( pState->pBuffer ), pState->file_out );
( void ) fwrite( hb_membufPtr( pState->pBuffer ), sizeof( char ),
hb_membufLen( pState->pBuffer ), pState->file_out );
}
return pState->pTokenOut;
@@ -5873,8 +5873,8 @@ void hb_pp_tokenToString( PHB_PP_STATE pState, PHB_PP_TOKEN pToken )
{
if( !fError )
hb_membufAddCh( pState->pBuffer, ']' );
fwrite( hb_membufPtr( pState->pBuffer ), sizeof( char ),
hb_membufLen( pState->pBuffer ), pState->file_out );
( void ) fwrite( hb_membufPtr( pState->pBuffer ), sizeof( char ),
hb_membufLen( pState->pBuffer ), pState->file_out );
}
}

View File

@@ -107,7 +107,7 @@ void hb_errInternalRaw( ULONG ulIntCode, const char * szText, const char * szPar
hb_conOutErr( buffer, 0 );
if( hLog )
fwrite( buffer, sizeof( buffer[ 0 ] ), strlen( buffer ), hLog );
( void ) fwrite( buffer, sizeof( buffer[ 0 ] ), strlen( buffer ), hLog );
if( szText )
hb_snprintf( buffer, sizeof( buffer ), szText, szPar1, szPar2 );
@@ -130,7 +130,7 @@ void hb_errInternalRaw( ULONG ulIntCode, const char * szText, const char * szPar
hb_conOutErr( msg, 0 );
if( hLog )
fwrite( msg, sizeof( msg[ 0 ] ), strlen( msg ), hLog );
( void ) fwrite( msg, sizeof( msg[ 0 ] ), strlen( msg ), hLog );
}
if( hLog )

View File

@@ -61,7 +61,7 @@ HB_FUNC( __RUN )
{
if( ISCHAR( 1 ) && hb_gtSuspend() == 0 )
{
system( hb_parc( 1 ) );
( void ) system( hb_parc( 1 ) );
if( hb_gtResume() != 0 )
{

View File

@@ -1037,16 +1037,16 @@ void hb_stackDispLocal( void )
HB_TRACE(HB_TR_DEBUG, ("hb_stackDispLocal()"));
printf( hb_conNewLine() );
printf( "%s", hb_conNewLine() );
printf( HB_I_("Virtual Machine Stack Dump at %s(%i):"),
( *hb_stack.pBase )->item.asSymbol.value->szName,
( *hb_stack.pBase )->item.asSymbol.stackstate->uiLineNo );
printf( hb_conNewLine() );
printf( "%s", hb_conNewLine() );
printf( "--------------------------" );
for( pBase = hb_stack.pBase; pBase <= hb_stack.pPos; pBase++ )
{
printf( hb_conNewLine() );
printf( "%s", hb_conNewLine() );
switch( hb_itemType( *pBase ) )
{