diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2003-03-18 15:28:40 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2003-03-18 15:28:40 +0000 |
commit | 9778aa12dbc0202478fbb5ce28d7e7c5bde9c793 (patch) | |
tree | 81b84e9dcb66142d93ef3ec3ad019d578f373e6f /basic/source/comp | |
parent | 16a013ff8c8f4b4935552ac5ebdb27153582eb0e (diff) |
MWS_SRX644: migrate branch mws_srx644 -> HEAD
Diffstat (limited to 'basic/source/comp')
-rw-r--r-- | basic/source/comp/buffer.cxx | 10 | ||||
-rw-r--r-- | basic/source/comp/dim.cxx | 26 | ||||
-rw-r--r-- | basic/source/comp/exprnode.cxx | 10 | ||||
-rw-r--r-- | basic/source/comp/sbcomp.cxx | 18 | ||||
-rw-r--r-- | basic/source/comp/scanner.cxx | 18 | ||||
-rw-r--r-- | basic/source/comp/symtbl.cxx | 12 |
6 files changed, 61 insertions, 33 deletions
diff --git a/basic/source/comp/buffer.cxx b/basic/source/comp/buffer.cxx index 9c9a8b553d02..286867e597bd 100644 --- a/basic/source/comp/buffer.cxx +++ b/basic/source/comp/buffer.cxx @@ -2,9 +2,9 @@ * * $RCSfile: buffer.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: mh $ $Date: 2001-10-17 18:53:05 $ + * last change: $Author: hr $ $Date: 2003-03-18 16:28:34 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -82,7 +82,7 @@ SbiBuffer::SbiBuffer( SbiParser* p, short n ) SbiBuffer::~SbiBuffer() { - delete pBuf; + delete[] pBuf; } // Rausreichen des Puffers @@ -113,13 +113,13 @@ BOOL SbiBuffer::Check( USHORT n ) { pParser->Error( SbERR_PROG_TOO_LARGE ); nInc = 0; - delete pBuf; pBuf = NULL; + delete[] pBuf; pBuf = NULL; return FALSE; } else { if( nSize ) memcpy( p, pBuf, nSize ); - delete pBuf; + delete[] pBuf; pBuf = p; pCur = pBuf + nOff; nSize += nn; diff --git a/basic/source/comp/dim.cxx b/basic/source/comp/dim.cxx index f28699c5b72b..8160365ba551 100644 --- a/basic/source/comp/dim.cxx +++ b/basic/source/comp/dim.cxx @@ -2,9 +2,9 @@ * * $RCSfile: dim.cxx,v $ * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * - * last change: $Author: ab $ $Date: 2002-08-12 12:04:52 $ + * last change: $Author: hr $ $Date: 2003-03-18 16:28:34 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -329,10 +329,24 @@ void SbiParser::DefVar( SbiOpcode eOp, BOOL bStatic ) if( pDim ) { - pDef->SetDims( pDim->GetDims() ); - SbiExpression aExpr( this, *pDef, pDim ); - aExpr.Gen(); - aGen.Gen( _DCREATE, pDef->GetId(), pDef->GetTypeId() ); + if( eOp == _REDIMP ) + { + SbiExpression aExpr( this, *pDef, NULL ); + aExpr.Gen(); + aGen.Gen( _REDIMP_ERASE ); + + pDef->SetDims( pDim->GetDims() ); + SbiExpression aExpr2( this, *pDef, pDim ); + aExpr2.Gen(); + aGen.Gen( _DCREATE_REDIMP, pDef->GetId(), pDef->GetTypeId() ); + } + else + { + pDef->SetDims( pDim->GetDims() ); + SbiExpression aExpr( this, *pDef, pDim ); + aExpr.Gen(); + aGen.Gen( _DCREATE, pDef->GetId(), pDef->GetTypeId() ); + } } else { diff --git a/basic/source/comp/exprnode.cxx b/basic/source/comp/exprnode.cxx index 6f4c41c41688..6df66b4cad5b 100644 --- a/basic/source/comp/exprnode.cxx +++ b/basic/source/comp/exprnode.cxx @@ -2,9 +2,9 @@ * * $RCSfile: exprnode.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: mh $ $Date: 2001-10-17 18:53:05 $ + * last change: $Author: hr $ $Date: 2003-03-18 16:28:34 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -63,9 +63,7 @@ #define HUGE_VAL HUGE #include <math.h> -#ifndef _TOOLS_SOLMATH_HXX //autogen wg. SolarMath -#include <tools/solmath.hxx> -#endif +#include <rtl/math.hxx> #include "sbcomp.hxx" #pragma hdrstop #include "expr.hxx" @@ -441,7 +439,7 @@ void SbiExprNode::FoldConstants() nVal = (double) ( ~ll | lr ); eType = SbxLONG; break; } - if( SolarMath::IsINF( nVal ) || SolarMath::IsNAN( nVal ) ) + if( !::rtl::math::isFinite( nVal ) ) pGen->GetParser()->Error( SbERR_MATH_OVERFLOW ); // Den Datentyp wiederherstellen, um Rundungsfehler diff --git a/basic/source/comp/sbcomp.cxx b/basic/source/comp/sbcomp.cxx index 8f7ef9275a03..6f44384fb47a 100644 --- a/basic/source/comp/sbcomp.cxx +++ b/basic/source/comp/sbcomp.cxx @@ -2,9 +2,9 @@ * * $RCSfile: sbcomp.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: mh $ $Date: 2001-10-17 18:53:05 $ + * last change: $Author: hr $ $Date: 2003-03-18 16:28:34 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -67,6 +67,12 @@ #include "sbcomp.hxx" #include "image.hxx" + +#ifndef PRODUCT +// For debugging only +void dbg_SaveDisassembly( SbModule* pModule ); +#endif + // Diese Routine ist hier definiert, damit der Compiler als eigenes Segment // geladen werden kann. @@ -118,6 +124,14 @@ BOOL SbModule::Compile() if( pBasic ) pBasic->ClearAllModuleVars(); } + +#ifndef PRODUCT + // Disassembly functionality for debugging + bool bDisassemble = false; + if( bDisassemble ) + dbg_SaveDisassembly( this ); +#endif + return bRet; } diff --git a/basic/source/comp/scanner.cxx b/basic/source/comp/scanner.cxx index 6bee3325636d..61cd7b21cab7 100644 --- a/basic/source/comp/scanner.cxx +++ b/basic/source/comp/scanner.cxx @@ -2,9 +2,9 @@ * * $RCSfile: scanner.cxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: mh $ $Date: 2001-10-17 18:53:05 $ + * last change: $Author: hr $ $Date: 2003-03-18 16:28:35 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -61,7 +61,7 @@ #include "sbcomp.hxx" #pragma hdrstop -#include <stdio.h> // sprintf() +#include <stdio.h> #include <string.h> #include <ctype.h> #if defined (ICC) || defined (WTC) || defined(__powerc) || defined ( MAC ) || defined UNX @@ -69,9 +69,7 @@ #else #include <math.h> // atof() #endif -#ifndef _SOLMATH_HXX //autogen wg. SolarMath -#include <tools/solmath.hxx> -#endif +#include <rtl/math.hxx> #ifndef _TOOLS_INTN_HXX #include <tools/intn.hxx> #endif @@ -119,6 +117,11 @@ void SbiScanner::UnlockColumn() void SbiScanner::GenError( SbError code ) { + if( GetSbData()->bBlockCompilerError ) + { + bAbort = TRUE; + return; + } if( !bError && bErrors ) { BOOL bRes = TRUE; @@ -316,8 +319,7 @@ BOOL SbiScanner::NextSym() GenError( SbERR_BAD_CHAR_IN_NUMBER ); } // #57844 Lokalisierte Funktion benutzen - int nErrno; - nVal = SolarMath::StringToDouble( buf, ',', '.', nErrno ); + nVal = rtl_math_uStringToDouble( buf, buf+(p-buf), '.', ',', NULL, NULL ); // ALT: nVal = atof( buf ); ndig -= comma; diff --git a/basic/source/comp/symtbl.cxx b/basic/source/comp/symtbl.cxx index 7535fd9d817d..0b9373f7d9bc 100644 --- a/basic/source/comp/symtbl.cxx +++ b/basic/source/comp/symtbl.cxx @@ -2,9 +2,9 @@ * * $RCSfile: symtbl.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: ab $ $Date: 2002-08-12 11:57:34 $ + * last change: $Author: hr $ $Date: 2003-03-18 16:28:35 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -121,10 +121,10 @@ short SbiStringPool::Add( double n, SbxDataType t ) char buf[ 40 ]; switch( t ) { - case SbxINTEGER: sprintf( buf, "%d", (short) n ); break; - case SbxLONG: sprintf( buf, "%ld", (long) n ); break; - case SbxSINGLE: sprintf( buf, "%.6g", (float) n ); break; - case SbxDOUBLE: sprintf( buf, "%.16g", n ); break; + case SbxINTEGER: snprintf( buf, sizeof(buf), "%d", (short) n ); break; + case SbxLONG: snprintf( buf, sizeof(buf), "%ld", (long) n ); break; + case SbxSINGLE: snprintf( buf, sizeof(buf), "%.6g", (float) n ); break; + case SbxDOUBLE: snprintf( buf, sizeof(buf), "%.16g", n ); break; } return Add( String::CreateFromAscii( buf ) ); } |