You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by db...@apache.org on 2006/02/08 18:06:02 UTC
svn commit: r375995 - in /xalan/c/trunk:
Projects/Win32/VC6/XalanExe/XalanExe.dsp
Projects/Win32/VC7.1/XalanExe/XalanExe.vcproj
Projects/Win32/VC7/XalanExe/XalanExe.vcproj src/xalanc/XalanExe/XalanExe.cpp
Author: dbertoni
Date: Wed Feb 8 09:05:59 2006
New Revision: 375995
URL: http://svn.apache.org/viewcvs?rev=375995&view=rev
Log:
Fix for Jira issue XALANC-587.
Modified:
xalan/c/trunk/Projects/Win32/VC6/XalanExe/XalanExe.dsp
xalan/c/trunk/Projects/Win32/VC7.1/XalanExe/XalanExe.vcproj
xalan/c/trunk/Projects/Win32/VC7/XalanExe/XalanExe.vcproj
xalan/c/trunk/src/xalanc/XalanExe/XalanExe.cpp
Modified: xalan/c/trunk/Projects/Win32/VC6/XalanExe/XalanExe.dsp
URL: http://svn.apache.org/viewcvs/xalan/c/trunk/Projects/Win32/VC6/XalanExe/XalanExe.dsp?rev=375995&r1=375994&r2=375995&view=diff
==============================================================================
--- xalan/c/trunk/Projects/Win32/VC6/XalanExe/XalanExe.dsp (original)
+++ xalan/c/trunk/Projects/Win32/VC6/XalanExe/XalanExe.dsp Wed Feb 8 09:05:59 2006
@@ -53,7 +53,7 @@
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 xerces-c_2.lib largeint.lib /nologo /stack:0x2f4000 /pdb:none /machine:I386 /nodefaultlib:"libc" /out:"..\..\..\..\Build\Win32\VC6\Release/Xalan.exe" /libpath:"..\..\..\..\..\..\xml-xerces\c\Build\Win32\VC6\Release" /libpath:"$(XERCESCROOT)\Build\Win32\VC6\Release" /libpath:"$(XERCESCROOT)\lib"
+# ADD LINK32 xerces-c_2.lib /nologo /stack:0x2f4000 /pdb:none /machine:I386 /nodefaultlib:"libc" /out:"..\..\..\..\Build\Win32\VC6\Release/Xalan.exe" /libpath:"..\..\..\..\..\..\xml-xerces\c\Build\Win32\VC6\Release" /libpath:"$(XERCESCROOT)\Build\Win32\VC6\Release" /libpath:"$(XERCESCROOT)\lib"
!ELSEIF "$(CFG)" == "XalanExe - Win32 Debug"
@@ -78,7 +78,7 @@
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 /nologo /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 xerces-c_2D.lib largeint.lib /nologo /stack:0x2f4000 /debug /machine:I386 /nodefaultlib:"libc" /out:"..\..\..\..\Build\Win32\VC6\Debug/Xalan.exe" /pdbtype:sept /libpath:"..\..\..\..\..\..\xml-xerces\c\Build\Win32\VC6\Debug\\" /libpath:"$(XERCESCROOT)\Build\Win32\VC6\Debug" /libpath:"$(XERCESCROOT)\lib"
+# ADD LINK32 xerces-c_2D.lib /nologo /stack:0x2f4000 /debug /machine:I386 /nodefaultlib:"libc" /out:"..\..\..\..\Build\Win32\VC6\Debug/Xalan.exe" /pdbtype:sept /libpath:"..\..\..\..\..\..\xml-xerces\c\Build\Win32\VC6\Debug\\" /libpath:"$(XERCESCROOT)\Build\Win32\VC6\Debug" /libpath:"$(XERCESCROOT)\lib"
# SUBTRACT LINK32 /pdb:none
!ELSEIF "$(CFG)" == "XalanExe - Win32 Release with symbols"
@@ -104,7 +104,7 @@
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 ..\..\..\..\..\..\xml-xerces\c\Build\Win32\VC6\Release\xerces-c_1.lib /nologo /pdb:none /machine:I386
-# ADD LINK32 xerces-c_2.lib largeint.lib /nologo /stack:0x2f4000 /debug /machine:I386 /nodefaultlib:"libc" /out:"..\..\..\..\Build\Win32\VC6\Release.symbols/Xalan.exe" /libpath:"..\..\..\..\..\..\xml-xerces\c\Build\Win32\VC6\Release" /libpath:"$(XERCESCROOT)\Build\Win32\VC6\Release" /libpath:"$(XERCESCROOT)\lib" /fixed:no
+# ADD LINK32 xerces-c_2.lib /nologo /stack:0x2f4000 /debug /machine:I386 /nodefaultlib:"libc" /out:"..\..\..\..\Build\Win32\VC6\Release.symbols/Xalan.exe" /libpath:"..\..\..\..\..\..\xml-xerces\c\Build\Win32\VC6\Release" /libpath:"$(XERCESCROOT)\Build\Win32\VC6\Release" /libpath:"$(XERCESCROOT)\lib" /fixed:no
# SUBTRACT LINK32 /pdb:none
!ELSEIF "$(CFG)" == "XalanExe - Win64 Release"
Modified: xalan/c/trunk/Projects/Win32/VC7.1/XalanExe/XalanExe.vcproj
URL: http://svn.apache.org/viewcvs/xalan/c/trunk/Projects/Win32/VC7.1/XalanExe/XalanExe.vcproj?rev=375995&r1=375994&r2=375995&view=diff
==============================================================================
--- xalan/c/trunk/Projects/Win32/VC7.1/XalanExe/XalanExe.vcproj (original)
+++ xalan/c/trunk/Projects/Win32/VC7.1/XalanExe/XalanExe.vcproj Wed Feb 8 09:05:59 2006
@@ -45,7 +45,7 @@
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
- AdditionalDependencies="xerces-c_2.lib largeint.lib"
+ AdditionalDependencies="xerces-c_2.lib"
OutputFile="..\..\..\..\Build\Win32\VC7.1\Release/Xalan.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
@@ -106,7 +106,7 @@
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
- AdditionalDependencies="xerces-c_2D.lib largeint.lib"
+ AdditionalDependencies="xerces-c_2D.lib"
OutputFile="..\..\..\..\Build\Win32\VC7.1\Debug/Xalan.exe"
LinkIncremental="2"
SuppressStartupBanner="TRUE"
@@ -169,7 +169,7 @@
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386 /FIXED:NO"
- AdditionalDependencies="xerces-c_2.lib largeint.lib"
+ AdditionalDependencies="xerces-c_2.lib"
OutputFile="..\..\..\..\Build\Win32\VC7.1\Release.symbols/Xalan.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
Modified: xalan/c/trunk/Projects/Win32/VC7/XalanExe/XalanExe.vcproj
URL: http://svn.apache.org/viewcvs/xalan/c/trunk/Projects/Win32/VC7/XalanExe/XalanExe.vcproj?rev=375995&r1=375994&r2=375995&view=diff
==============================================================================
--- xalan/c/trunk/Projects/Win32/VC7/XalanExe/XalanExe.vcproj (original)
+++ xalan/c/trunk/Projects/Win32/VC7/XalanExe/XalanExe.vcproj Wed Feb 8 09:05:59 2006
@@ -45,7 +45,7 @@
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
- AdditionalDependencies="xerces-c_2.lib largeint.lib"
+ AdditionalDependencies="xerces-c_2.lib"
OutputFile="..\..\..\..\Build\Win32\VC7\Release/Xalan.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
@@ -100,7 +100,7 @@
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
- AdditionalDependencies="xerces-c_2D.lib largeint.lib"
+ AdditionalDependencies="xerces-c_2D.lib"
OutputFile="..\..\..\..\Build\Win32\VC7\Debug/Xalan.exe"
LinkIncremental="2"
SuppressStartupBanner="TRUE"
@@ -157,7 +157,7 @@
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386 /FIXED:NO"
- AdditionalDependencies="xerces-c_2.lib largeint.lib"
+ AdditionalDependencies="xerces-c_2.lib"
OutputFile="..\..\..\..\Build\Win32\VC7\Release.symbols/Xalan.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
Modified: xalan/c/trunk/src/xalanc/XalanExe/XalanExe.cpp
URL: http://svn.apache.org/viewcvs/xalan/c/trunk/src/xalanc/XalanExe/XalanExe.cpp?rev=375995&r1=375994&r2=375995&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XalanExe/XalanExe.cpp (original)
+++ xalan/c/trunk/src/xalanc/XalanExe/XalanExe.cpp Wed Feb 8 09:05:59 2006
@@ -49,46 +49,12 @@
-#if defined(_MSC_VER) && !defined(_WIN64)
+#if defined(_MSC_VER)
#define XALAN_USE_WINDOWS_TIMING
#endif
#if defined(XALAN_USE_WINDOWS_TIMING)
-
#include "windows.h"
-#if (_MSC_VER < 1300)
-#include "largeint.h"
-#else
-
-// For whatever reason, these are no longer in the Windows
-// header files, although they still exist. And no word as
-// to why they disappeared or how to replace them.
-extern "C"
-{
-LARGE_INTEGER
-WINAPI
-LargeIntegerDivide (
- LARGE_INTEGER Dividend,
- LARGE_INTEGER Divisor,
- PLARGE_INTEGER Remainder
- );
-
-LARGE_INTEGER
-WINAPI
-ExtendedLargeIntegerDivide (
- LARGE_INTEGER Dividend,
- ULONG Divisor,
- PULONG Remainder
- );
-
-LARGE_INTEGER
-WINAPI
-LargeIntegerSubtract (
- LARGE_INTEGER Minuend,
- LARGE_INTEGER Subtrahend
- );
-};
-#endif
#else
#include <ctime>
#if defined(XALAN_STRICT_ANSI_HEADERS)
@@ -127,13 +93,11 @@
XALAN_USING_XALAN(XalanMessageLoader)
XALAN_USING_XALAN(XalanMessages)
XALAN_USING_XALAN(XalanMemMgrs)
- XALAN_USING_XALAN(MemoryManagerType)
-
- MemoryManagerType& theManager = XalanMemMgrs::getDefaultXercesMemMgr();
+ XALAN_USING_XERCES(MemoryManager)
+ MemoryManager& theManager = XalanMemMgrs::getDefaultXercesMemMgr();
-
- bool bErrorState = true ; // means OK
+ bool bErrorState = true; // means OK
XalanDOMString szXalanVersion(theManager);
XalanMessageLoader::getMessage(
@@ -156,20 +120,24 @@
szXercesVersion.transcode(cvtXercesVersion);
cerr << &cvtXalanVersion[0] << endl;
- cerr << &cvtXercesVersion[0]<< endl;
+ cerr << &cvtXercesVersion[0] << endl;
}
catch(const XalanDOMString::TranscodingError&)
{
- cerr << endl << "Transcoding error: wrong XalanC or XercesC versions." <<endl;
+ cerr << endl
+ << "Transcoding error: wrong XalanC or XercesC versions."
+ << endl;
bErrorState = false;
}
XalanDOMString::CharVectorType cvtXalanExeHelpMenu(theManager);
-
+
XalanDOMString theBuffer(theManager);
- for (int i = XalanMessages::XalanExeHelpMenu; bErrorState && ( i <= XalanMessages::XalanExeHelpMenu12 ); ++i)
+ for (int i = XalanMessages::XalanExeHelpMenu;
+ bErrorState && (i <= XalanMessages::XalanExeHelpMenu12);
+ ++i)
{
try
{
@@ -184,7 +152,11 @@
}
catch(const XalanDOMString::TranscodingError&)
{
- cerr << endl << "Cannot read help message " << i << "." << endl;
+ cerr << endl
+ << "Cannot read help message "
+ << i
+ << "."
+ << endl;
bErrorState = false;
}
@@ -289,6 +261,12 @@
const char* m_encoding;
+ unsigned long
+ getMaxParams() const
+ {
+ return m_maxParams;
+ }
+
private:
struct ParamPair
@@ -409,7 +387,10 @@
if (params.addParam(name, value) == false)
{
- cerr << "Maximum numbers of stylesheets params has been exceeded!" << endl;
+ cerr << "The maximum number of parameters is "
+ << params.getMaxParams()
+ << "."
+ << endl;
fSuccess = false;
}
@@ -519,11 +500,11 @@
{
ClockType theInterval;
- ULONG theDummy;
-
QueryPerformanceFrequency(&theInterval);
- return ExtendedLargeIntegerDivide(theInterval, 1000UL, &theDummy);
+ theInterval.QuadPart /= 1000UL;
+
+ return theInterval;
}
#endif
@@ -536,21 +517,35 @@
OstreamType& theStream)
{
#if defined(XALAN_USE_WINDOWS_TIMING)
- static const ClockType theInterval = getPerformanceFrequencyInMilliseconds();
+ static const ClockType theInterval =
+ getPerformanceFrequencyInMilliseconds();
char theBuffer[1000];
- const ClockType theDiff = LargeIntegerSubtract(theEndClock, theStartClock);
+ ClockType theDiff;
+
+ theDiff.QuadPart =
+ theEndClock.QuadPart - theStartClock.QuadPart;
- ClockType theRemainder;
+ ClockType theResult;
+ ClockType theRemainder;
+
+ theResult.QuadPart =
+ theDiff.QuadPart / theInterval.QuadPart;
- const ClockType theResult = LargeIntegerDivide(theDiff, theInterval, &theRemainder);
+ theRemainder.QuadPart =
+ theDiff.QuadPart % theInterval.QuadPart;
- sprintf(theBuffer, "%I64d.%I64d", theResult, theRemainder);
+ sprintf(
+ theBuffer,
+ "%I64d.%I64d",
+ theResult.QuadPart,
+ theRemainder.QuadPart);
theStream << theBuffer;
#else
- theStream << (double(theEndClock - theStartClock) / CLOCKS_PER_SEC) * 1000.0;
+ theStream << (double(theEndClock - theStartClock) /
+ CLOCKS_PER_SEC) * 1000.0;
#endif
}
@@ -565,13 +560,25 @@
{
theStream << theString;
- writeElapsedMilliseconds(theStartClock, theEndClock, theStream);
+ writeElapsedMilliseconds(
+ theStartClock,
+ theEndClock,
+ theStream);
theStream << " milliseconds.\n";
}
+XALAN_USING_XALAN(XalanParsedSource)
+XALAN_USING_XALAN(XalanCompiledStylesheet)
+
+
+typedef XalanTransformer::EnsureDestroyParsedSource SourceGuard;
+typedef XalanTransformer::EnsureDestroyCompiledStylesheet StylesheetGuard;
+
+
+
inline int
transform(
XalanTransformer& theTransformer,
@@ -587,8 +594,6 @@
}
else
{
- XALAN_USING_XALAN(XalanParsedSource)
-
ClockType theStartClock = getClock();
const XalanParsedSource* theParsedSource = 0;
@@ -605,7 +610,7 @@
theEndClock,
cerr);
- const XalanTransformer::EnsureDestroyParsedSource theGuard(theTransformer, theParsedSource);
+ const SourceGuard theGuard(theTransformer, theParsedSource);
theStartClock = getClock();
@@ -643,13 +648,14 @@
}
else
{
- XALAN_USING_XALAN(XalanParsedSource)
-
ClockType theStartClock = getClock();
const XalanParsedSource* theParsedSource = 0;
- int theResult = theTransformer.parseSource(theSource, theParsedSource);
+ int theResult =
+ theTransformer.parseSource(
+ theSource,
+ theParsedSource);
if (theResult == 0)
{
@@ -661,15 +667,16 @@
theEndClock,
cerr);
- const XalanTransformer::EnsureDestroyParsedSource theSourceGuard(theTransformer, theParsedSource);
-
- XALAN_USING_XALAN(XalanCompiledStylesheet)
+ const SourceGuard theGuard(theTransformer, theParsedSource);
- const XalanCompiledStylesheet* theCompiledStylesheet = 0;
+ const XalanCompiledStylesheet* theStylesheet = 0;
theStartClock = getClock();
- theResult = theTransformer.compileStylesheet(theStylesheetSource, theCompiledStylesheet);
+ theResult =
+ theTransformer.compileStylesheet(
+ theStylesheetSource,
+ theStylesheet);
if (theResult == 0)
{
@@ -681,13 +688,17 @@
theEndClock,
cerr);
- assert(theCompiledStylesheet != 0);
+ assert(theStylesheet != 0);
- const XalanTransformer::EnsureDestroyCompiledStylesheet theStylesheetGuard(theTransformer, theCompiledStylesheet);
+ const StylesheetGuard theGuard(theTransformer, theStylesheet);
theStartClock = getClock();
- theResult = theTransformer.transform(*theParsedSource, theCompiledStylesheet, theTarget);
+ theResult =
+ theTransformer.transform(
+ *theParsedSource,
+ theStylesheet,
+ theTarget);
theEndClock = getClock();
@@ -714,15 +725,17 @@
{
XALAN_USING_XALAN(XalanDOMString)
XALAN_USING_XALAN(XSLTResultTarget)
- XALAN_USING_XALAN(MemoryManagerType)
+ XALAN_USING_XERCES(MemoryManager)
- MemoryManagerType& theManager = theTransformer.getMemoryManager();
+ MemoryManager& theManager = theTransformer.getMemoryManager();
XSLTResultTarget theTarget(theManager);
if (theParams.m_encoding != 0)
{
- theTarget.setEncoding(XalanDOMString(theParams.m_encoding, theManager));
+ const XalanDOMString theEncoding(theParams.m_encoding, theManager);
+
+ theTarget.setEncoding(theEncoding);
}
if (theParams.m_outFileName != 0)
@@ -736,11 +749,20 @@
if (theParams.m_useStylesheetPI == true)
{
- return transform(theTransformer, theParams, theSource, theTarget);
+ return transform(
+ theTransformer,
+ theParams,
+ theSource,
+ theTarget);
}
else
{
- return transform(theTransformer, theParams, theSource, theStylesheetSource, theTarget);
+ return transform(
+ theTransformer,
+ theParams,
+ theSource,
+ theStylesheetSource,
+ theTarget);
}
}
@@ -752,7 +774,9 @@
const Params& theParams,
const XSLTInputSource& theSource)
{
- assert(theParams.m_useStylesheetPI == true || theParams.m_xslFileName != 0);
+ assert(
+ theParams.m_useStylesheetPI == true ||
+ theParams.m_xslFileName != 0);
if (theParams.m_useStylesheetPI == true ||
(theParams.m_xslFileName[0] == '-' &&
@@ -786,11 +810,17 @@
if (theParams.m_inFileName[0] == '-' &&
theParams.m_inFileName[1] == '\0')
{
- return transform(theTransformer, theParams, &cin);
+ return transform(
+ theTransformer,
+ theParams,
+ &cin);
}
else
{
- return transform(theTransformer, theParams, theParams.m_inFileName);
+ return transform(
+ theTransformer,
+ theParams,
+ theParams.m_inFileName);
}
}
@@ -805,16 +835,17 @@
int theResult = -1;
XALAN_USING_XERCES(XMLPlatformUtils)
-
+
// Call the static initializer for Xerces...
XMLPlatformUtils::Initialize();
-
+
// Initialize Xalan...
XalanTransformer::initialize();
-
+
{
- // we need to read the params after the XMLPlatformUtils::Initialize(), because we may
- // need the local and the local dlls for usage of the Usage function
+ // we need to read the params after the XMLPlatformUtils::Initialize(),
+ // because we may need the local and the local dlls for usage of the
+ // Usage function.
// Set the maximum number of params as half of argc - 1.
// It's actually argc - 2, but that could get us into negative
@@ -842,13 +873,13 @@
}
}
}
-
+
// Terminate Xalan...
XalanTransformer::terminate();
-
+
// Terminate Xerces...
XMLPlatformUtils::Terminate();
-
+
// Clean up the ICU, if it's integrated...
XalanTransformer::ICUCleanUp();
@@ -863,7 +894,8 @@
char* argv[])
{
#if !defined(NDEBUG) && defined(_MSC_VER)
- _CrtSetDbgFlag(_CrtSetDbgFlag(_CRTDBG_REPORT_FLAG) | _CRTDBG_LEAK_CHECK_DF);
+ _CrtSetDbgFlag(
+ _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG) | _CRTDBG_LEAK_CHECK_DF);
_CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE);
_CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDERR);
@@ -875,5 +907,4 @@
#endif
return xsltMain(argc, argv);
-
- }
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org