From 2f5082bdc8a1382618ee9b0f2badda7776f6ca13 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 17 Mar 2000 09:53:55 +0000 Subject: [PATCH] 20000317-10:53 GMT+1 Victor Szakats --- harbour/ChangeLog | 9 +++++++++ harbour/include/hbclass.ch | 1 + harbour/include/hbpp.h | 1 + harbour/source/compiler/hbgenerr.c | 6 ++---- harbour/source/pp/ppcomp.c | 26 ++++++++++++-------------- harbour/source/pp/ppcore.c | 2 +- harbour/source/pp/pplib.c | 1 - harbour/source/pp/stdalone/hbpp.c | 27 +++++++++++++-------------- harbour/utils/hbdoc/genhpc.prg | 2 ++ 9 files changed, 41 insertions(+), 34 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index cdccd9079f..87c6384b4a 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,12 @@ +20000317-10:53 GMT+1 Victor Szakats + * include/hbclass.ch + ! To avoid warning _CLASS_NAME_ is #undef-ed before #define-ed. + * include/hbpp.h + source/compiler/hbgenerr.c + source/pp/* + ! nEmptyString global variable prefixed with "hb_" + ! nEmptyString declaration moved to the header file. + 20000317-09:56 GMT+3 Alexander Kresin * source/pp/stdalone/hbpp.c * source/pp/ppcomp.c diff --git a/harbour/include/hbclass.ch b/harbour/include/hbclass.ch index 313d930b13..f19a5876b2 100644 --- a/harbour/include/hbclass.ch +++ b/harbour/include/hbclass.ch @@ -52,6 +52,7 @@ static oClass ;; if oClass == nil ;; oClass = TClass():New( <(ClassName)> [,<(SuperClass)>] ) ;; + #undef _CLASS_NAME_ ;; #define _CLASS_NAME_ ;; #translate CLSMETH () => @_() ; [ ; #translate Super : => ::: ] ; diff --git a/harbour/include/hbpp.h b/harbour/include/hbpp.h index 962a1441fe..67b6f3d876 100644 --- a/harbour/include/hbpp.h +++ b/harbour/include/hbpp.h @@ -95,6 +95,7 @@ extern int * hb_pp_aCondCompile; extern int hb_pp_nCondCompile; extern char * hb_pp_szErrors[]; extern char * hb_pp_szWarnings[]; +extern int hb_pp_nEmptyStrings; /* TABLE.C exported variables */ diff --git a/harbour/source/compiler/hbgenerr.c b/harbour/source/compiler/hbgenerr.c index c7f8718773..47c2297eb6 100644 --- a/harbour/source/compiler/hbgenerr.c +++ b/harbour/source/compiler/hbgenerr.c @@ -35,8 +35,6 @@ #include "hbcomp.h" -extern int nEmptyStrings; - /* Table with parse errors */ char * hb_comp_szErrors[] = { @@ -115,7 +113,7 @@ char * hb_comp_szWarnings[] = void hb_compGenError( char * szErrors[], char cPrefix, int iError, char * szError1, char * szError2 ) { if( hb_comp_files.pLast != NULL && hb_comp_files.pLast->szFileName != NULL ) - printf( "\r%s(%i) ", hb_comp_files.pLast->szFileName, hb_comp_iLine + nEmptyStrings ); + printf( "\r%s(%i) ", hb_comp_files.pLast->szFileName, hb_comp_iLine + hb_pp_nEmptyStrings ); printf( "Error %c%04i ", cPrefix, iError ); printf( szErrors[ iError - 1 ], szError1, szError2 ); @@ -135,7 +133,7 @@ void hb_compGenWarning( char * szWarnings[], char cPrefix, int iWarning, char * if( ( szText[ 0 ] - '0' ) <= hb_comp_iWarnings ) { if( hb_comp_files.pLast != NULL && hb_comp_files.pLast->szFileName != NULL ) - printf( "\r%s(%i) ", hb_comp_files.pLast->szFileName, hb_comp_iLine + nEmptyStrings ); + printf( "\r%s(%i) ", hb_comp_files.pLast->szFileName, hb_comp_iLine + hb_pp_nEmptyStrings ); printf( "Warning %c%04i ", cPrefix, iWarning ); printf( szText + 1, szWarning1, szWarning2 ); printf( "\n" ); diff --git a/harbour/source/pp/ppcomp.c b/harbour/source/pp/ppcomp.c index 085da6352c..58a8ebb0bf 100644 --- a/harbour/source/pp/ppcomp.c +++ b/harbour/source/pp/ppcomp.c @@ -49,8 +49,6 @@ #include "hbpp.h" #include "hbcomp.h" -extern int nEmptyStrings; - static char s_szLine[ HB_PP_STR_SIZE ]; static char s_szOutLine[ HB_PP_STR_SIZE ]; @@ -64,7 +62,7 @@ int hb_pp_Internal( FILE * handl_o, char * sOut ) HB_TRACE(HB_TR_DEBUG, ("PreProcess(%p, %p, %s)", handl_o, sOut)); - nEmptyStrings = 0; + hb_pp_nEmptyStrings = 0; while( TRUE ) { pFile = hb_comp_files.pLast; @@ -85,7 +83,7 @@ int hb_pp_Internal( FILE * handl_o, char * sOut ) s_szLine[ ++lens ] = ' '; s_szLine[ ++lens ] = '\0'; - nEmptyStrings++; + hb_pp_nEmptyStrings++; } else { @@ -107,19 +105,19 @@ int hb_pp_Internal( FILE * handl_o, char * sOut ) pFile = ( PFILE ) ( ( PFILE ) hb_comp_files.pLast )->pPrev; if( lLine ) sprintf( s_szLine, "#line %d \"%s\"\n", - pFile->iLine+nEmptyStrings, pFile->szFileName ); + pFile->iLine+hb_pp_nEmptyStrings, pFile->szFileName ); else *s_szLine = '\0'; lLine = 0; - pFile->iLine += 1+nEmptyStrings; + pFile->iLine += 1+hb_pp_nEmptyStrings; sprintf( s_szLine+strlen(s_szLine), "#line 1 \"%s\"", hb_comp_files.pLast->szFileName ); - nEmptyStrings = 0; + hb_pp_nEmptyStrings = 0; } else { *s_szLine = '\0'; - nEmptyStrings++; + hb_pp_nEmptyStrings++; } } else @@ -131,12 +129,12 @@ int hb_pp_Internal( FILE * handl_o, char * sOut ) else { *s_szLine = '\0'; - nEmptyStrings++; + hb_pp_nEmptyStrings++; } } } else - nEmptyStrings++; + hb_pp_nEmptyStrings++; break; } } @@ -155,20 +153,20 @@ int hb_pp_Internal( FILE * handl_o, char * sOut ) hb_comp_iLine = hb_comp_files.pLast->iLine; hb_comp_files.iFiles--; lLine = 1; - nEmptyStrings = 0; + hb_pp_nEmptyStrings = 0; } } if( *s_szLine ) break; } if( lLine ) { - sprintf( ptrOut, "#line %d \"%s\"\n",hb_comp_iLine+nEmptyStrings,hb_comp_files.pLast->szFileName ); + sprintf( ptrOut, "#line %d \"%s\"\n",hb_comp_iLine+hb_pp_nEmptyStrings,hb_comp_files.pLast->szFileName ); while( *ptrOut ) ptrOut++; } else { - if( nEmptyStrings ) - for( i=0;ipPrev; if( lLine ) sprintf( s_szLine, "#line %d \"%s\"\n", - pFile->iLine+nEmptyStrings, pFile->szFileName ); + pFile->iLine+hb_pp_nEmptyStrings, pFile->szFileName ); else *s_szLine = '\0'; lLine = 0; - pFile->iLine += 1+nEmptyStrings; + pFile->iLine += 1+hb_pp_nEmptyStrings; sprintf( s_szLine+strlen(s_szLine), "#line 1 \"%s\"", hb_comp_files.pLast->szFileName ); - nEmptyStrings = 0; + hb_pp_nEmptyStrings = 0; hb_comp_iLine = 0; } else { *s_szLine = '\0'; - nEmptyStrings++; + hb_pp_nEmptyStrings++; } } else @@ -307,12 +306,12 @@ int hb_pp_Parse( FILE * handl_o ) else { *s_szLine = '\0'; - nEmptyStrings++; + hb_pp_nEmptyStrings++; } } } else - nEmptyStrings++; + hb_pp_nEmptyStrings++; break; } } @@ -331,22 +330,22 @@ int hb_pp_Parse( FILE * handl_o ) hb_comp_iLine = hb_comp_files.pLast->iLine; hb_comp_files.iFiles--; lLine = 1; - nEmptyStrings = 0; + hb_pp_nEmptyStrings = 0; } } if( *s_szLine ) break; } if( lLine ) - fprintf( handl_o, "#line %d \"%s\"\n",hb_comp_iLine+nEmptyStrings,hb_comp_files.pLast->szFileName ); + fprintf( handl_o, "#line %d \"%s\"\n",hb_comp_iLine+hb_pp_nEmptyStrings,hb_comp_files.pLast->szFileName ); else { - if( nEmptyStrings ) - for( i=0;i