From ebd86942df6d0f7f789f56b4fe4bd1e011254190 Mon Sep 17 00:00:00 2001 From: "Alexander S.Kresin" Date: Fri, 18 Feb 2000 12:24:01 +0000 Subject: [PATCH] Updating pp files --- harbour/ChangeLog | 91 +++++++++++++++++++------------------ harbour/source/pp/hbpp.c | 5 +- harbour/source/pp/hbppint.c | 19 ++++---- 3 files changed, 59 insertions(+), 56 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index e39fff2a6a..86ff2c0cf6 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,8 @@ +20000218-15:23 GMT+3 Alexander Kresin + * source/pp/hbpp.c + * source/pp/hbppint.c + * Bug fixed, reported by Brian Hays + 20000218-10:02 GMT-3 Luiz Rafael Culik *doc/compiler.txt doc/readme.txt @@ -149,7 +154,7 @@ ! Fixed adsOrderListAdd() for setting up the default index. ! Fixed table, index and memo file extensions. * contrib/rdd_ads/adsfunc.c - ! Modified HB_ADSSETDELETED() for making similar to clipper + ! Modified HB_ADSSETDELETED() for making similar to clipper set deleted command. 20000214-19:35 GMT+1 Ryszard Glab @@ -157,11 +162,11 @@ *source/compiler/expropt.c *source/macro/macro.c *include/hbexpr.c - * fixed generation of incorrect HB_P_MACROSYMBOL pcode when - &( expression ) syntax was used - + * fixed generation of incorrect HB_P_MACROSYMBOL pcode when + &( expression ) syntax was used + *tests/tstmacro.prg - * cleared to allow Clipper compatible syntax only + * cleared to allow Clipper compatible syntax only 20000214-17:10 GMT+1 Victor Szakats * config/w32/bcc32.cf @@ -210,8 +215,8 @@ ! Fixed hb_mouse_GetBounds(). (Have this function been ever tested/compiled ??) - ; COMMENT: Borland 16 bit support is still broken. Large symbol tables and - strings makes the final .EXE exit without any messages. HBDOC works, + ; COMMENT: Borland 16 bit support is still broken. Large symbol tables and + strings makes the final .EXE exit without any messages. HBDOC works, HBRUN not, RT_MAIN not (but it can work if larger parts are removed). xmemset() and xmemcpy() crashes for larger values (like 100000), and the symbol processing used to fail right on startup. @@ -297,38 +302,38 @@ 20000213-16:15 GMT+1 Ryszard Glab *source/compiler/harbour.y - * line number opcodes are correctly generated inside IF/ENDIF, - WHILE/END - + * line number opcodes are correctly generated inside IF/ENDIF, + WHILE/END + *source/macro/macro.c - * fixed unreleased memory when database alias was used + * fixed unreleased memory when database alias was used *source/macro/macro.y - * fixed unreleased memory when invalid syntax was found during - macro string parsing + * fixed unreleased memory when invalid syntax was found during + macro string parsing *include/hbexpr.c - * added more tracing information - + * added more tracing information + *source/common/hbstr.c - * hb_strdup() reports the length of a string in tracing info + * hb_strdup() reports the length of a string in tracing info *source/rtl/gt/gtdos.c - * fixed unreleased memory block - + * fixed unreleased memory block + *include/hbtrace.h *source/common/hbtrace.c - * added HB_TRACE_STEALTH definition to print tracing information - without changing filename/linenum information - * hb_tr_trace() doesn't clear filename/linenum info on exit - this - info is used in fm.c to store the location of code that requested - memory allocation + * added HB_TRACE_STEALTH definition to print tracing information + without changing filename/linenum information + * hb_tr_trace() doesn't clear filename/linenum info on exit - this + info is used in fm.c to store the location of code that requested + memory allocation *source/rtl/fm.c - * when HB_TR_LEVEL is set to HB_TR_DEBUG then allocated memory blocks - store C function name and line number instead of PRG filename/linenum - This allows to easy locate the source of unrealeased memory blocks - + * when HB_TR_LEVEL is set to HB_TR_DEBUG then allocated memory blocks + store C function name and line number instead of PRG filename/linenum + This allows to easy locate the source of unrealeased memory blocks + 20000213-13:27 GMT+1 Victor Szakats ! makefile.bc ! Some bugs fixed related to the previous change. @@ -340,8 +345,8 @@ make_b*.bat + Merged to functionality of makefile.b16 into makefile.b32 resulting in a generic makefile.bc for all Borland compilers. - Note that MAINDLL.C, MAINWIN.C, SYMBOLS.ASM should be fixed to be - multiplatform, and currently the 16bits Borland choks on DEBUGGER.PRG. + Note that MAINDLL.C, MAINWIN.C, SYMBOLS.ASM should be fixed to be + multiplatform, and currently the 16bits Borland choks on DEBUGGER.PRG. But it mostly works. The old makefile.b16 was completely outdated. + Added HARBOUR_OPT support. * doc/* @@ -390,12 +395,12 @@ *source/macro/macro.l *source/macro/macro.y - * fixed recognition of FIELD-> syntax + * fixed recognition of FIELD-> syntax 20000212-12:22 GMT+1 Philip Joseph * contrib/rdd_ads/ads1.c - + Added adsCreate function for creating ads tables. It also supports - adt tables with short names. + + Added adsCreate function for creating ads tables. It also supports + adt tables with short names. 20000212-02:30 GMT+1 Victor Szakats * include/gtapi.h @@ -442,14 +447,14 @@ 20000211-19:11 GMT+1 Victor Szakats * source/rtl/Makefile - readvar.prg removed. - * doc/harbext.txt + * doc/harbext.txt + CVS ID added !! Please remember to add this to every file CVS-d !! - * tests/bld_b16.bat - tests/bld_b32.bat + * tests/bld_b16.bat + tests/bld_b32.bat tests/bld_b32o.bat tests/bld_b32w.bat - tests/bld_vc.bat + tests/bld_vc.bat * Files moved to the bin\ directory. - tests/test_all.lnk - Blinker specific, probably obsolete file removed. @@ -520,17 +525,17 @@ 20000210-13:20 GMT+1 Ryszard Glab *source/compiler/harbour.l - * fixed syntax for RETURN statement + * fixed syntax for RETURN statement *source/compiler/hbgenerr.c - * changed warning level for 'unreachable code' - it will be generated - if /w2 option is used + * changed warning level for 'unreachable code' - it will be generated + if /w2 option is used *source/genc.c - * fixed 'unused "wSym" variable' warning + * fixed 'unused "wSym" variable' warning *tests/keywords.prg - * added some more code related to RETURN statement + * added some more code related to RETURN statement 20000209-22:37 EST Paul Tucker * source/rtl/tone.c @@ -691,11 +696,11 @@ * added some more test code *source/rtl/wait.prg - * fixed code to stop generation of error 'unreachable code' + * fixed code to stop generation of error 'unreachable code' *source/rtl/gt/gtstd.c * added dummy function hb_gt_ReadKey() if compiled for U*ix - (I don't know why it worked previously without this function) + (I don't know why it worked previously without this function) 20000208-12:00 GMT+1 Antonio Linares * tests/bld_b32.bat diff --git a/harbour/source/pp/hbpp.c b/harbour/source/pp/hbpp.c index d047c7ad3e..5e3b7ac74c 100644 --- a/harbour/source/pp/hbpp.c +++ b/harbour/source/pp/hbpp.c @@ -1869,7 +1869,7 @@ int hb_pp_RdStr( FILE * handl_i, char * buffer, int maxlen, BOOL lDropSpaces, ch if( cha == '\n' ) { if( s_ParseState == STATE_COMMENT && symbLast == ';' ) - buffer[readed++] = ';'; + buffer[readed++] = ';'; break; } if( maxlen > 0 ) @@ -2312,7 +2312,8 @@ static BOOL OpenInclude( char * szFileName, PATHNAMES * pSearch, PHB_FNAME pMain pFile->handle = fptr; pFile->pBuffer = hb_xgrab( HB_PP_BUFF_SIZE ); pFile->iBuffer = pFile->lenBuffer = 10; - pFile->szFileName = szFileName; + pFile->szFileName = (char*) hb_xgrab( strlen( szFileName ) + 1 ); + hb_pp_strocpy( pFile->szFileName, szFileName ); hb_comp_files.pLast->iLine = hb_comp_iLine; hb_comp_iLine = 1; pFile->pPrev = hb_comp_files.pLast; diff --git a/harbour/source/pp/hbppint.c b/harbour/source/pp/hbppint.c index 413eeb5cae..0a31cc7ced 100644 --- a/harbour/source/pp/hbppint.c +++ b/harbour/source/pp/hbppint.c @@ -6,7 +6,7 @@ * Harbour Project source code: * Preprocessor & Compiler integration module * - * Copyright 1999 Alexander S.Kresin + * Copyright 1999 Alexander S.Kresin * www - http://www.harbour-project.org * * This program is free software; you can redistribute it and/or modify @@ -64,19 +64,15 @@ void hb_pp_Init( void ) int hb_pp_Internal( FILE * handl_o, char * sOut ) { - char *sBuffer; /* File read buffer */ - char * ptr, * ptrOut; - int lContinue; - int lens, rdlen; - FILE * handl_i; + char *sBuffer = (char*) hb_comp_files.pLast->pBuffer; /* File read buffer */ + char * ptr, * ptrOut = sOut; + int lContinue = 0; + int lens = 0, rdlen; + FILE * handl_i = hb_comp_files.pLast->handle; HB_TRACE(HB_TR_DEBUG, ("PreProcess(%p, %p, %s)", handl_i, handl_o, sOut)); - handl_i = hb_comp_files.pLast->handle; - sBuffer = (char *)hb_comp_files.pLast->pBuffer; - lContinue = lens = 0; - ptrOut = sOut; - while( ( rdlen = hb_pp_RdStr( handl_i, s_szLine + lens, HB_PP_STR_SIZE - + while( ( rdlen = hb_pp_RdStr( handl_i, s_szLine + lens, HB_PP_STR_SIZE - lens, lContinue, sBuffer, &(hb_comp_files.pLast->lenBuffer), &(hb_comp_files.pLast->iBuffer) ) ) >= 0 ) { @@ -134,6 +130,7 @@ int hb_pp_Internal( FILE * handl_o, char * sOut ) PFILE pFile; fclose( hb_comp_files.pLast->handle ); hb_xfree( hb_comp_files.pLast->pBuffer ); + hb_xfree( hb_comp_files.pLast->szFileName ); pFile = ( PFILE ) ( ( PFILE ) hb_comp_files.pLast )->pPrev; hb_xfree( hb_comp_files.pLast ); hb_comp_files.pLast = pFile;