Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog39
-rw-r--r--Makefile.am28
-rw-r--r--config.h.in51
-rw-r--r--configure.in8
-rw-r--r--doc/bugs69
-rw-r--r--doc/download106
-rw-r--r--doc/index19
-rwxr-xr-xdoc/mysql10
-rw-r--r--doc/pending-classes.in246
-rw-r--r--doc/web/makefile16
-rw-r--r--doc/web/team.xml2
-rw-r--r--doc/web/template.html.in25
-rw-r--r--mcs/Makefile1
-rw-r--r--mcs/build/profiles/default.make3
-rw-r--r--mcs/build/profiles/generics.make2
-rw-r--r--mcs/build/rules.make2
-rw-r--r--mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/ChangeLog10
-rw-r--r--mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds.cs13
-rw-r--r--mcs/class/Mono.GetOptions/ArgumentProcessorAttribute.cs7
-rw-r--r--mcs/class/Mono.GetOptions/ChangeLog4
-rw-r--r--mcs/class/Mono.GetOptions/OptionAttribute.cs7
-rw-r--r--mcs/class/PEAPI/ChangeLog5
-rw-r--r--mcs/class/PEAPI/PEAPI.cs2
-rw-r--r--mcs/class/System.Data.OracleClient/System.Data.OracleClient.Oci/OciParameterDescriptor.cs61
-rw-r--r--mcs/class/System.Data.OracleClient/System.Data.OracleClient/OracleDataReader.cs6
-rwxr-xr-xmcs/class/System.Data/System.Data.Common/ChangeLog5
-rw-r--r--mcs/class/System.Data/System.Data.Common/DbDataAdapter.cs2
-rwxr-xr-xmcs/class/System.Data/System.Data.SqlClient/ChangeLog19
-rw-r--r--mcs/class/System.Data/System.Data.SqlClient/SqlCommand.cs1
-rw-r--r--mcs/class/System.Data/System.Data.SqlClient/SqlConnectionPool.cs17
-rw-r--r--mcs/class/System.Data/System.Data.SqlClient/SqlDataReader.cs20
-rw-r--r--mcs/class/System.Drawing/ChangeLog4
-rwxr-xr-xmcs/class/System.Drawing/System.Drawing.dll.sources9
-rw-r--r--mcs/class/System.Drawing/System.Drawing/ChangeLog5
-rw-r--r--mcs/class/System.Drawing/System.Drawing/Color.cs2
-rwxr-xr-xmcs/class/System.Drawing/System.Drawing/Graphics.cs2
-rw-r--r--mcs/class/System.Drawing/System.Drawing/Image.cs1
-rw-r--r--mcs/class/System.Drawing/System.Drawing/impl/Xr/ChangeLog4
-rw-r--r--mcs/class/System.Drawing/System.Drawing/impl/Xr/Graphics.cs44
-rw-r--r--mcs/class/System.Drawing/System.Drawing/impl/cairo/Bitmap.cs317
-rw-r--r--mcs/class/System.Drawing/System.Drawing/impl/cairo/ChangeLog27
-rw-r--r--mcs/class/System.Drawing/System.Drawing/impl/cairo/Font.cs162
-rw-r--r--mcs/class/System.Drawing/System.Drawing/impl/cairo/FontFamily.cs92
-rw-r--r--mcs/class/System.Drawing/System.Drawing/impl/cairo/Graphics.cs1718
-rw-r--r--mcs/class/System.Drawing/System.Drawing/impl/cairo/Image.cs279
-rw-r--r--mcs/class/System.Drawing/System.Drawing/impl/cairo/Pen.cs141
-rw-r--r--mcs/class/System.Drawing/System.Drawing/impl/cairo/SolidBrush.cs57
-rw-r--r--mcs/class/System.Drawing/System.Drawing/impl/cairo/cairo-api.cs427
-rw-r--r--mcs/class/System.Drawing/System.Drawing/impl/cairo/gdk-helpers.cs34
-rw-r--r--mcs/class/System.Drawing/System.Drawing/impl/wine/Bitmap.cs14
-rw-r--r--mcs/class/System.Drawing/System.Drawing/impl/wine/ChangeLog9
-rw-r--r--mcs/class/System.Drawing/System.Drawing/impl/wine/Graphics.cs28
-rw-r--r--mcs/class/System.Drawing/System.Drawing/impl/wine/win32Enums.cs32
-rw-r--r--mcs/class/System.Drawing/System.Drawing/impl/wine/win32functions.cs5
-rw-r--r--mcs/class/System.Runtime.Remoting/ChangeLog17
-rw-r--r--mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels.Http/ChangeLog34
-rw-r--r--mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels.Http/HttpClientChannel.cs135
-rw-r--r--mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels.Http/HttpHelper.cs22
-rw-r--r--mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels.Http/HttpServer.cs81
-rw-r--r--mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels.Http/HttpServerChannel.cs22
-rw-r--r--mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels.Tcp/TcpConnectionPool.cs54
-rw-r--r--mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/ChangeLog6
-rw-r--r--mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/SoapClientFormatterSink.cs23
-rw-r--r--mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/SoapMessageFormatter.cs51
-rw-r--r--mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/SoapServerFormatterSink.cs60
-rw-r--r--mcs/class/System.Runtime.Remoting/System.Runtime.Remoting_test.dll.sources7
-rw-r--r--mcs/class/System.Runtime.Remoting/Test/AsyncCalls.cs162
-rw-r--r--mcs/class/System.Runtime.Remoting/Test/BaseCalls.cs452
-rw-r--r--mcs/class/System.Runtime.Remoting/Test/CallSeq.cs27
-rw-r--r--mcs/class/System.Runtime.Remoting/Test/ChangeLog20
-rw-r--r--mcs/class/System.Runtime.Remoting/Test/ContextHookAttribute.cs3
-rw-r--r--mcs/class/System.Runtime.Remoting/Test/ContextsTest.cs61
-rw-r--r--mcs/class/System.Runtime.Remoting/Test/DelegateCalls.cs120
-rw-r--r--mcs/class/System.Runtime.Remoting/Test/HttpCalls.cs67
-rw-r--r--mcs/class/System.Runtime.Remoting/Test/ReflectionCalls.cs154
-rw-r--r--mcs/class/System.Runtime.Remoting/Test/SyncCalls.cs106
-rw-r--r--mcs/class/System.Runtime.Remoting/Test/TcpCalls.cs67
-rw-r--r--mcs/class/System.Runtime.Serialization.Formatters.Soap/ChangeLog6
-rw-r--r--mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/SoapTypeMapper.cs76
-rwxr-xr-xmcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/SoapWriter.cs9
-rw-r--r--mcs/class/System.Web/System.Web.Security/ChangeLog4
-rw-r--r--mcs/class/System.Web/System.Web.Security/UrlAuthorizationModule.cs2
-rw-r--r--mcs/class/System.Web/System.Web.UI.HtmlControls/ChangeLog5
-rw-r--r--mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlGenericControl.cs2
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog36
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/CheckBox.cs26
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/HyperLinkColumn.cs66
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/ListControl.cs45
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/Style.cs175
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/WebControl.cs252
-rwxr-xr-xmcs/class/System.Web/System.Web.UI/BaseParser.cs2
-rw-r--r--mcs/class/System.Web/System.Web.UI/ChangeLog38
-rw-r--r--mcs/class/System.Web/System.Web.UI/Control.cs360
-rwxr-xr-xmcs/class/System.Web/System.Web.UI/ControlCollection.cs12
-rwxr-xr-xmcs/class/System.Web/System.Web.UI/EmptyControlCollection.cs2
-rw-r--r--mcs/class/System.Web/System.Web.UI/LosFormatter.cs35
-rwxr-xr-xmcs/class/System.Web/System.Web.UI/Page.cs30
-rw-r--r--mcs/class/System.Web/System.Web.UI/UserControlParser.cs4
-rw-r--r--mcs/class/System.Web/System.Web.Util/ChangeLog4
-rw-r--r--mcs/class/System.Web/System.Web.Util/UrlUtils.cs3
-rw-r--r--mcs/class/System.Web/System.Web/ChangeLog41
-rw-r--r--mcs/class/System.Web/System.Web/HttpApplication.cs8
-rw-r--r--mcs/class/System.Web/System.Web/HttpException.cs6
-rw-r--r--mcs/class/System.Web/System.Web/HttpMethodNotAllowedHandler.cs10
-rw-r--r--mcs/class/System.Web/System.Web/HttpRequest.cs8
-rw-r--r--mcs/class/System.Web/System.Web/HttpResponse.cs24
-rw-r--r--mcs/class/System.Web/System.Web/HttpRuntime.cs3
-rw-r--r--mcs/class/System.Web/System.Web/HttpServerUtility.cs2
-rw-r--r--mcs/class/System.Web/System.Web/MimeTypes.cs1
-rw-r--r--mcs/class/System.Web/System.Web/StaticFileHandler.cs18
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/AxHost.cs52
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/Button.cs12
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/ButtonBase.cs20
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/ChangeLog47
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/CheckBox.cs28
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/CheckedListBox.cs4
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/ComboBox.cs49
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/Control.cs20
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/ControlPaint.cs81
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/GroupBox.cs4
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/ListControl.cs74
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/MonthCalendar.cs1135
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/RadioButton.cs82
-rw-r--r--mcs/class/System.XML/ChangeLog20
-rw-r--r--mcs/class/System.XML/Mono.Xml.Schema/ChangeLog4
-rw-r--r--mcs/class/System.XML/Mono.Xml.Schema/XsdParticleValidationState.cs462
-rw-r--r--mcs/class/System.XML/Mono.Xml.Schema/XsdValidatingReader.cs468
-rw-r--r--mcs/class/System.XML/Mono.Xml.XPath/ChangeLog12
-rw-r--r--mcs/class/System.XML/Mono.Xml.XPath/DTMXPathDocument.cs39
-rw-r--r--mcs/class/System.XML/Mono.Xml.XPath/DTMXPathDocumentBuilder.cs43
-rw-r--r--mcs/class/System.XML/Mono.Xml.XPath/DTMXPathNavigator.cs62
-rw-r--r--mcs/class/System.XML/Mono.Xml.Xsl.Operations/ChangeLog67
-rw-r--r--mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslApplyTemplates.cs42
-rw-r--r--mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslCallTemplate.cs30
-rw-r--r--mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslComment.cs45
-rw-r--r--mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslCopyOf.cs24
-rw-r--r--mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslFallback.cs2
-rw-r--r--mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslLiteralElement.cs5
-rw-r--r--mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslMessage.cs2
-rw-r--r--mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslNumber.cs291
-rw-r--r--mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslProcessingInstruction.cs5
-rw-r--r--mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslTemplateContent.cs19
-rw-r--r--mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslVariable.cs6
-rw-r--r--mcs/class/System.XML/Mono.Xml.Xsl/ChangeLog82
-rw-r--r--mcs/class/System.XML/Mono.Xml.Xsl/Compiler.cs142
-rw-r--r--mcs/class/System.XML/Mono.Xml.Xsl/Outputter.cs60
-rw-r--r--mcs/class/System.XML/Mono.Xml.Xsl/TextOutputter.cs74
-rw-r--r--mcs/class/System.XML/Mono.Xml.Xsl/XmlOutputter.cs86
-rw-r--r--mcs/class/System.XML/Mono.Xml.Xsl/XslDecimalFormat.cs90
-rw-r--r--mcs/class/System.XML/Mono.Xml.Xsl/XslOutput.cs67
-rw-r--r--mcs/class/System.XML/Mono.Xml.Xsl/XslStylesheet.cs26
-rw-r--r--mcs/class/System.XML/Mono.Xml.Xsl/XslTransformProcessor.cs59
-rw-r--r--mcs/class/System.XML/Mono.Xml.Xsl/XsltCompiledContext.cs91
-rw-r--r--mcs/class/System.XML/Mono.Xml/ChangeLog8
-rw-r--r--mcs/class/System.XML/Mono.Xml/IHasXmlSchemaInfo.cs19
-rw-r--r--mcs/class/System.XML/Mono.Xml/XmlNodeWriter.cs14
-rw-r--r--mcs/class/System.XML/System.Xml.XPath/ChangeLog7
-rw-r--r--mcs/class/System.XML/System.Xml.XPath/Expression.cs3
-rw-r--r--mcs/class/System.XML/System.Xml.XPath/XPathNavigator.cs16
-rw-r--r--mcs/class/System.XML/System.Xml.Xsl/ChangeLog34
-rw-r--r--mcs/class/System.XML/System.Xml.Xsl/ManagedXslTransform.cs43
-rw-r--r--mcs/class/System.XML/System.Xml.Xsl/Multiplexer.cs58
-rw-r--r--mcs/class/System.XML/System.Xml.Xsl/XslTransform.cs13
-rw-r--r--mcs/class/System.XML/System.Xml.Xsl/XslTransformImpl.cs18
-rwxr-xr-xmcs/class/System.XML/System.Xml.dll.sources8
-rw-r--r--mcs/class/System.XML/System.Xml/ChangeLog59
-rw-r--r--mcs/class/System.XML/System.Xml/DTDObjectModel.cs1
-rw-r--r--mcs/class/System.XML/System.Xml/DTDValidatingReader.cs13
-rw-r--r--mcs/class/System.XML/System.Xml/XmlChar.cs6
-rw-r--r--mcs/class/System.XML/System.Xml/XmlDocumentNavigator.cs2
-rwxr-xr-xmcs/class/System.XML/System.Xml/XmlNodeReader.cs9
-rw-r--r--mcs/class/System.XML/System.Xml/XmlReader.cs7
-rw-r--r--mcs/class/System.XML/System.Xml/XmlTextReader.cs68
-rw-r--r--mcs/class/System.XML/System.Xml/XmlTextWriter.cs88
-rwxr-xr-xmcs/class/System.XML/System.Xml/XmlUrlResolver.cs32
-rw-r--r--mcs/class/System.XML/System.Xml/XmlValidatingReader.cs215
-rw-r--r--mcs/class/System.XML/System.Xml_test.dll.sources2
-rw-r--r--mcs/class/System.XML/Test/System.Xml/ChangeLog15
-rw-r--r--mcs/class/System.XML/Test/System.Xml/XmlAttributeTests.cs48
-rw-r--r--mcs/class/System.XML/Test/System.Xml/XmlElementTests.cs17
-rw-r--r--mcs/class/System.XML/Test/System.Xml/XmlReaderCommonTests.cs59
-rw-r--r--mcs/class/System.XML/Test/System.Xml/XmlTextReaderTests.cs417
-rw-r--r--mcs/class/System.XML/Test/System.Xml/XmlValidatingReaderTests.cs41
-rw-r--r--mcs/class/System.XML/Test/System.Xml/XsdParticleValidationTests.cs219
-rw-r--r--mcs/class/System.XML/Test/System.Xml/XsdValidatingReaderTests.cs184
-rw-r--r--mcs/class/System.XML/Test/XmlFiles/XsdValidation/1.xsd7
-rw-r--r--mcs/class/System.XML/Test/XmlFiles/XsdValidation/2.xsd15
-rw-r--r--mcs/class/System.XML/Test/XmlFiles/XsdValidation/3.xsd16
-rw-r--r--mcs/class/System.XML/Test/XmlFiles/XsdValidation/4.xsd16
-rw-r--r--mcs/class/System.XML/Test/XmlFiles/XsdValidation/ChangeLog3
-rw-r--r--mcs/class/System/Microsoft.CSharp/CSharpCodeGenerator.cs98
-rw-r--r--mcs/class/System/Microsoft.CSharp/ChangeLog17
-rw-r--r--mcs/class/System/System.CodeDom/ChangeLog7
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeTypeDeclaration.cs2
-rw-r--r--mcs/class/System/System.Net.Sockets/ChangeLog5
-rwxr-xr-xmcs/class/System/System.Net.Sockets/TcpListener.cs63
-rw-r--r--mcs/class/System/System.Net/ChangeLog4
-rw-r--r--mcs/class/System/System.Net/WebRequest.cs5
-rw-r--r--mcs/class/System/Test/System.Net.Sockets/ChangeLog4
-rwxr-xr-xmcs/class/System/Test/System.Net.Sockets/TcpListenerTest.cs156
-rw-r--r--mcs/class/System/Test/System/ChangeLog5
-rw-r--r--mcs/class/System/Test/System/UriBuilderTest.cs34
-rw-r--r--mcs/class/corlib/ChangeLog8
-rw-r--r--mcs/class/corlib/Makefile2
-rw-r--r--mcs/class/corlib/System.Collections/CaseInsensitiveHashCodeProvider.cs13
-rw-r--r--mcs/class/corlib/System.Collections/ChangeLog26
-rw-r--r--mcs/class/corlib/System.Collections/Hashtable.cs4
-rw-r--r--mcs/class/corlib/System.Collections/Stack.cs1
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting.Activation/AppDomainLevelActivator.cs2
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting.Activation/ChangeLog6
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting.Activation/ConstructionLevelActivator.cs2
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting.Activation/ContextLevelActivator.cs2
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting.Activation/RemoteActivationAttribute.cs2
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting.Activation/RemoteActivator.cs48
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting.Channels/ChangeLog9
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting.Channels/ChannelServices.cs18
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting.Channels/ClientChannelSinkStack.cs3
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting.Lifetime/ChangeLog4
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting.Lifetime/ClientSponsor.cs33
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting.Messaging/AsyncResult.cs20
-rwxr-xr-xmcs/class/corlib/System.Runtime.Remoting.Messaging/CADMessages.cs7
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting.Messaging/CallContext.cs67
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting.Messaging/ChangeLog30
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting.Messaging/LogicalCallContext.cs153
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting.Messaging/MethodCall.cs1
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting.Messaging/MonoMethodMessage.cs32
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting.Messaging/StackBuilderSink.cs2
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting.Proxies/ChangeLog15
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting.Proxies/RealProxy.cs6
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting.Proxies/RemotingProxy.cs10
-rwxr-xr-xmcs/class/corlib/System.Runtime.Remoting/ChangeLog10
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting/ObjRef.cs17
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting/RemotingServices.cs28
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/ChangeLog5
-rwxr-xr-xmcs/class/corlib/System.Security.Cryptography/SymmetricAlgorithm.cs32
-rwxr-xr-xmcs/class/corlib/System.Text/ChangeLog8
-rw-r--r--mcs/class/corlib/System.Text/StringBuilder.cs49
-rw-r--r--mcs/class/corlib/System.Threading/ChangeLog11
-rwxr-xr-xmcs/class/corlib/System.Threading/Thread.cs12
-rw-r--r--mcs/class/corlib/System/Array.cs6
-rw-r--r--mcs/class/corlib/System/ChangeLog23
-rw-r--r--mcs/class/corlib/System/Enum.cs2
-rw-r--r--mcs/class/corlib/System/Exception.cs21
-rw-r--r--mcs/class/corlib/System/String.cs14
-rw-r--r--mcs/class/corlib/Test/System.Diagnostics/ChangeLog5
-rw-r--r--mcs/class/corlib/Test/System.Diagnostics/StackFrameTest.cs5
-rw-r--r--mcs/class/corlib/Test/System/ArrayTest.cs23
-rw-r--r--mcs/class/corlib/Test/System/ChangeLog8
-rw-r--r--mcs/class/corlib/Test/System/StringTest.cs10
-rwxr-xr-xmcs/class/corlib/corlib_test.dll.sources1
-rw-r--r--mcs/gmcs/AssemblyInfo.cs2
-rwxr-xr-xmcs/gmcs/ChangeLog136
-rw-r--r--mcs/gmcs/Makefile4
-rwxr-xr-xmcs/gmcs/class.cs208
-rwxr-xr-xmcs/gmcs/codegen.cs7
-rwxr-xr-xmcs/gmcs/const.cs9
-rw-r--r--mcs/gmcs/convert.cs12
-rwxr-xr-xmcs/gmcs/cs-parser.jay117
-rwxr-xr-xmcs/gmcs/decl.cs306
-rw-r--r--mcs/gmcs/delegate.cs6
-rwxr-xr-xmcs/gmcs/driver.cs5
-rwxr-xr-xmcs/gmcs/ecore.cs53
-rwxr-xr-xmcs/gmcs/enum.cs5
-rwxr-xr-xmcs/gmcs/expression.cs23
-rw-r--r--mcs/gmcs/flowanalysis.cs1895
-rwxr-xr-xmcs/gmcs/interface.cs5
-rw-r--r--mcs/gmcs/iterators.cs3
-rwxr-xr-xmcs/gmcs/namespace.cs63
-rwxr-xr-xmcs/gmcs/rootcontext.cs8
-rwxr-xr-xmcs/gmcs/statement.cs145
-rwxr-xr-xmcs/gmcs/support.cs38
-rw-r--r--mcs/gmcs/symbolwriter.cs2
-rwxr-xr-xmcs/gmcs/tree.cs32
-rwxr-xr-xmcs/gmcs/typemanager.cs4
-rw-r--r--mcs/ilasm/ChangeLog7
-rw-r--r--mcs/ilasm/Driver.cs29
-rw-r--r--mcs/ilasm/Report.cs64
-rw-r--r--mcs/ilasm/codegen/ChangeLog17
-rw-r--r--mcs/ilasm/codegen/DataDef.cs4
-rw-r--r--mcs/ilasm/codegen/FieldDef.cs5
-rw-r--r--mcs/ilasm/codegen/IClassRef.cs6
-rw-r--r--mcs/ilasm/codegen/MethodDef.cs190
-rw-r--r--mcs/ilasm/codegen/ParamDef.cs12
-rw-r--r--mcs/ilasm/codegen/TypeDef.cs109
-rw-r--r--mcs/ilasm/ilasm.exe.sources1
-rw-r--r--mcs/ilasm/parser/ChangeLog10
-rw-r--r--mcs/ilasm/parser/ILParser.jay60
-rw-r--r--mcs/ilasm/tests/ChangeLog4
-rw-r--r--mcs/ilasm/tests/test-31.il30
-rwxr-xr-xmcs/mcs/ChangeLog86
-rwxr-xr-xmcs/mcs/class.cs206
-rwxr-xr-xmcs/mcs/codegen.cs7
-rwxr-xr-xmcs/mcs/const.cs9
-rw-r--r--mcs/mcs/convert.cs12
-rwxr-xr-xmcs/mcs/cs-parser.jay50
-rwxr-xr-xmcs/mcs/decl.cs248
-rw-r--r--mcs/mcs/delegate.cs6
-rwxr-xr-xmcs/mcs/ecore.cs51
-rwxr-xr-xmcs/mcs/enum.cs5
-rwxr-xr-xmcs/mcs/expression.cs5
-rw-r--r--mcs/mcs/flowanalysis.cs845
-rwxr-xr-xmcs/mcs/interface.cs5
-rw-r--r--mcs/mcs/iterators.cs3
-rwxr-xr-xmcs/mcs/namespace.cs51
-rwxr-xr-xmcs/mcs/rootcontext.cs2
-rwxr-xr-xmcs/mcs/statement.cs78
-rwxr-xr-xmcs/mcs/tree.cs14
-rwxr-xr-xmcs/mcs/typemanager.cs4
-rwxr-xr-xmcs/tests/ChangeLog24
-rw-r--r--mcs/tests/Makefile2
-rw-r--r--mcs/tests/README.tests17
-rw-r--r--mcs/tests/test-154.cs31
-rw-r--r--mcs/tests/test-213.cs24
-rw-r--r--mcs/tests/test-214.cs23
-rw-r--r--mcs/tests/test-215.cs21
-rwxr-xr-xmcs/tests/test-37.cs4
-rw-r--r--mcs/tests/verify-7.cs27
-rw-r--r--mono.pc.in2
-rw-r--r--mono/arch/ChangeLog3
-rw-r--r--mono/arch/sparc/.cvsignore1
-rw-r--r--mono/arch/sparc/sparc-codegen.h114
-rw-r--r--mono/arch/x86/tramp.c9
-rw-r--r--mono/dis/ChangeLog11
-rw-r--r--mono/dis/dump.c2
-rw-r--r--mono/dis/get.c12
-rw-r--r--mono/dis/get.h2
-rw-r--r--mono/dis/main.c6
-rw-r--r--mono/interpreter/ChangeLog28
-rw-r--r--mono/interpreter/interp.c293
-rw-r--r--mono/interpreter/interp.h2
-rw-r--r--mono/metadata/.cvsignore1
-rw-r--r--mono/metadata/ChangeLog177
-rw-r--r--mono/metadata/appdomain.c15
-rw-r--r--mono/metadata/appdomain.h2
-rw-r--r--mono/metadata/assembly.c160
-rw-r--r--mono/metadata/assembly.h1
-rw-r--r--mono/metadata/class.c184
-rw-r--r--mono/metadata/class.h3
-rw-r--r--mono/metadata/domain.c73
-rw-r--r--mono/metadata/icall.c18
-rw-r--r--mono/metadata/image.c101
-rw-r--r--mono/metadata/image.h4
-rw-r--r--mono/metadata/loader.c123
-rw-r--r--mono/metadata/loader.h18
-rw-r--r--mono/metadata/marshal.c201
-rw-r--r--mono/metadata/marshal.h3
-rw-r--r--mono/metadata/metadata.c26
-rw-r--r--mono/metadata/metadata.h1
-rw-r--r--mono/metadata/object.c43
-rw-r--r--mono/metadata/object.h12
-rw-r--r--mono/metadata/pedump.c12
-rw-r--r--mono/metadata/rand.c5
-rw-r--r--mono/metadata/rawbuffer.c41
-rw-r--r--mono/metadata/rawbuffer.h6
-rw-r--r--mono/metadata/reflection.c101
-rw-r--r--mono/metadata/reflection.h3
-rw-r--r--mono/metadata/socket-io.c30
-rw-r--r--mono/metadata/string-icalls.c20
-rw-r--r--mono/metadata/threads.c19
-rw-r--r--mono/metadata/threads.h3
-rw-r--r--mono/mini/.cvsignore3
-rw-r--r--mono/mini/ChangeLog56
-rw-r--r--mono/mini/Makefile.am1
-rw-r--r--mono/mini/driver.c1
-rw-r--r--mono/mini/inssel.brg43
-rw-r--r--mono/mini/jit-icalls.c2
-rw-r--r--mono/mini/linear-scan.c22
-rw-r--r--mono/mini/mini-ppc.h3
-rw-r--r--mono/mini/mini-sparc.h3
-rw-r--r--mono/mini/mini-x86.h3
-rw-r--r--mono/mini/mini.c87
-rw-r--r--mono/mini/mini.h19
-rw-r--r--mono/mini/regalloc.c35
-rw-r--r--mono/mini/regalloc.h14
-rw-r--r--mono/mini/tramp-ppc.c4
-rw-r--r--mono/mini/tramp-sparc.c2
-rw-r--r--mono/mini/tramp-x86.c2
-rw-r--r--mono/tests/Makefile.am5
-rwxr-xr-xmono/tests/checked.cs92
-rwxr-xr-xmono/tests/threadpool.cs2
-rwxr-xr-xmono/tests/threadpool1.cs2
-rw-r--r--mono/utils/ChangeLog16
-rw-r--r--mono/utils/mono-hash.c104
-rw-r--r--mono/utils/mono-hash.h7
-rw-r--r--mono/utils/strtod.c107
-rw-r--r--scripts/.cvsignore8
-rw-r--r--scripts/wsdl.in2
-rw-r--r--web/bugs69
-rw-r--r--web/download106
-rw-r--r--web/index19
-rwxr-xr-xweb/mysql10
-rw-r--r--web/pending-classes.in246
-rw-r--r--web/web/makefile16
-rw-r--r--web/web/team.xml2
-rw-r--r--web/web/template.html.in25
395 files changed, 5112 insertions, 17747 deletions
diff --git a/ChangeLog b/ChangeLog
index a1e85abcb42..2d5040dff93 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,42 +1,3 @@
-2003-08-25 Zoltan Varga <vargaz@freemail.hu>
-
- * mono.pc.in: Added gthread-2.0.
-
-2003-08-22 Zoltan Varga <vargaz@freemail.hu>
-
- * configure.in: Added gthread-2.0 to GLIB_CFLAGS and GLIB_LIBS, so we
- can call g_thread_init ().
-
-2003-08-21 Zoltan Varga <vargaz@freemail.hu>
-
- * mono/tests/threadpool.cs mono/tests/threadpool1.cs: Make increments
- of static variables atomic. Fixes bug #47683.
-
-2003-08-21 Johannes Roith <johannes@jroith.de>
-
- * mono/Makefile.am: small update. make sure, glib makes it in the build, add optional target for dependencies
-
-2003-08-18 Johannes Roith <johannes@jroith.de>
-
- * mono/Makefile.am: add windows build option
- * mono/monowiz.win32.nsi: add windows build script
- * mono/mono-win32-light.bmp: add bitmap
-
-2003-08-16 Zoltan Varga <vargaz@freemail.hu>
-
- * mono/tests/checked.cs: Added mul.ovf tests.
-
-2003-08-15 Duncan Mak <duncan@ximian.com>
-
- * doc/mysql: Change references to ByteFX.Data.MySQLClient to the
- correct ByteFX.Data.MySqlClient (note the change in
- capitalization). Thanks to Tom Wagner <Tom.Wagner@wacker.com> for
- spotting the error.
-
-2003-08-15 Zoltan Varga <vargaz@freemail.hu>
-
- * mono/tests/bug-47295.cs: Regression test for bug #47295.
-
2003-08-11 Duncan Mak <duncan@ximian.com>
* runtime/Makefile.am (assemblies_DATA): Add Mono.Cairo.dll.
diff --git a/Makefile.am b/Makefile.am
index 5265332e77a..403567fc8f2 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -33,30 +33,4 @@ mcs-rest:
(cd ../mcs/class; make)
remove-binaries:
- rm ../mcs/class/lib/corlib.dll ../mcs/mcs/mcs.exe runtime/*dll runtime/*.exe >& /dev/null; echo
-
-
-win32getdeps:
- wget http://www.go-mono.com/archive/pkgconfig-0.11-20020310.zip
- wget http://www.go-mono.com/archive/glib-2.0.4-20020703.zip
- wget http://www.go-mono.com/archive/glib-dev-2.0.4-20020703.zip
- wget http://www.go-mono.com/archive/libiconv-1.7.zip
- wget http://www.go-mono.com/archive/libiconv-dev-1.7.zip
- wget http://www.go-mono.com/archive/libintl-0.10.40-20020101.zip
- wget http://www.jroith.de/nsis4cygwin.zip
- unzip -n -d / pkgconfig-0.11-20020310.zip
- unzip -n -d / glib-2.0.4-20020703.zip
- unzip -n -d / glib-dev-2.0.4-20020703.zip
- unzip -n -d / libiconv-1.7.zip
- unzip -n -d / libiconv-dev-1.7.zip
- unzip -n -d / libintl-0.10.40-20020101.zip
- unzip -n -d / nsis4cygwin.zip
-
-win32setup:
- cp /usr/lib/libglib-2.0-0.dll @prefix@/lib
- cp /usr/lib/iconv.dll @prefix@/lib
- cp /usr/lib/libgmodule-2.0-0.dll @prefix@/lib
- cp /usr/lib/libgobject-2.0-0.dll @prefix@/lib
- cp /usr/lib/libgthread-2.0-0.dll @prefix@/lib
- cp /usr/lib/libintl-1.dll @prefix@/lib
- makensis /DMILESTONE=@VERSION@ /DSOURCE_INSTALL_DIR=`cygpath -a -w @prefix@`\\* monowiz.win32.nsi \ No newline at end of file
+ rm ../mcs/class/lib/corlib.dll ../mcs/mcs/mcs.exe runtime/*dll runtime/*.exe >& /dev/null; echo \ No newline at end of file
diff --git a/config.h.in b/config.h.in
deleted file mode 100644
index b412155c227..00000000000
--- a/config.h.in
+++ /dev/null
@@ -1,51 +0,0 @@
-/* config.h.in. Generated automatically from configure.in by autoheader 2.13. */
-
-/* Define if you have the ANSI C header files. */
-#undef STDC_HEADERS
-
-#undef HAVE_INET_PTON
-#undef HAVE_INET_ATON
-#undef HAVE_SOL_IP
-#undef HAVE_SOL_TCP
-#undef HAVE_IP_PKTINFO
-#undef HAVE_STRUCT_IP_MREQN
-#undef HAVE_PTHREAD
-#undef HAVE_PTHREAD_MUTEX_TIMEDLOCK
-#undef USE_MONO_MUTEX
-#undef HAVE_LARGE_FILE_SUPPORT
-#undef PLATFORM_WIN32
-#undef HAVE_NEW_ICONV
-#undef NAME_DEV_RANDOM
-#undef HAVE_CRYPT_RNG
-#undef HAVE_BOEHM_GC
-
-/* The number of bytes in a void *. */
-#undef SIZEOF_VOID_P
-
-/* Define if you have the inet_aton function. */
-#undef HAVE_INET_ATON
-
-/* Define if you have the inet_pton function. */
-#undef HAVE_INET_PTON
-
-/* Define if you have the <dlfcn.h> header file. */
-#undef HAVE_DLFCN_H
-
-/* Define if you have the <netdb.h> header file. */
-#undef HAVE_NETDB_H
-
-/* Define if you have the <sys/filio.h> header file. */
-#undef HAVE_SYS_FILIO_H
-
-/* Define if you have the <sys/sockio.h> header file. */
-#undef HAVE_SYS_SOCKIO_H
-
-/* Define if you have the <utime.h> header file. */
-#undef HAVE_UTIME_H
-
-/* Name of package */
-#undef PACKAGE
-
-/* Version number of package */
-#undef VERSION
-
diff --git a/configure.in b/configure.in
index 0056408dbdf..0b565a6b2f1 100644
--- a/configure.in
+++ b/configure.in
@@ -167,8 +167,8 @@ fi
dnl for use on the build system
dnl pkg-config is stupid
-BUILD_GLIB_CFLAGS=`$PKG_CONFIG --cflags glib-2.0 gthread-2.0`
-BUILD_GLIB_LIBS=`$PKG_CONFIG --libs glib-2.0 gthread-2.0`
+BUILD_GLIB_CFLAGS=`$PKG_CONFIG --cflags glib-2.0`
+BUILD_GLIB_LIBS=`$PKG_CONFIG --libs glib-2.0`
AC_SUBST(BUILD_GLIB_CFLAGS)
AC_SUBST(BUILD_GLIB_LIBS)
@@ -190,8 +190,8 @@ GLIB_REQUIRED_VERSION=1.3.11
PKG_CHECK_MODULES(BASE_DEPENDENCIES, glib-2.0 >= $GLIB_REQUIRED_VERSION)
-GLIB_CFLAGS=`$PKG_CONFIG --cflags glib-2.0 gthread-2.0`
-GLIB_LIBS=`$PKG_CONFIG --libs glib-2.0 gthread-2.0`
+GLIB_CFLAGS=`$PKG_CONFIG --cflags glib-2.0`
+GLIB_LIBS=`$PKG_CONFIG --libs glib-2.0`
GMODULE_CFLAGS=`$PKG_CONFIG --cflags gmodule-2.0`
GMODULE_LIBS=`$PKG_CONFIG --libs gmodule-2.0`
diff --git a/doc/bugs b/doc/bugs
new file mode 100644
index 00000000000..bfb06a1883e
--- /dev/null
+++ b/doc/bugs
@@ -0,0 +1,69 @@
+* Bug reporting
+
+ To report bugs you need to create a <a
+ href="http://bugzilla.ximian.com/createaccount.cgi">Bugzilla
+ Account</a>.
+
+ Here are some convenient shortcuts to browse or add bug reports.
+
+ <ul>
+ * <a href="http://bugzilla.ximian.com/buglist.cgi?product=Mono%2FClass+Libraries&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&email1=&emailtype1=substring&emailassigned_to1=1&email2=&emailtype2=substring&emailreporter2=1&changedin=&chfieldfrom=&chfieldto=Now&chfieldvalue=&short_desc=&short_desc_type=substring&long_desc=&long_desc_type=substring&bug_file_loc=&bug_file_loc_type=substring&keywords=&keywords_type=anywords&op_sys_details=&op_sys_details_type=substring&version_details=&version_details_type=substring&newqueryname=&form_name=query&order=bugs.priority%2C%20bugs.bug_id">[Query]</> <a href="http://bugzilla.ximian.com/enter_bug.cgi?product=Mono%2FClass%20Libraries">[Add]</a> Class Libraries
+
+ * <a href="http://bugzilla.ximian.com/buglist.cgi?product=Mono%2FAssembler&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&email1=&emailtype1=substring&emailassigned_to1=1&email2=&emailtype2=substring&emailreporter2=1&changedin=&chfieldfrom=&chfieldto=Now&chfieldvalue=&short_desc=&short_desc_type=substring&long_desc=&long_desc_type=substring&bug_file_loc=&bug_file_loc_type=substring&keywords=&keywords_type=anywords&op_sys_details=&op_sys_details_type=substring&version_details=&version_details_type=substring&cmdtype=doit&newqueryname=&order=Reuse+same+sort+as+last+time&form_name=query">[Query]</a> <a href="http://bugzilla.ximian.com/enter_bug.cgi?product=Mono%2FAssembler">[Add]</a> IL Assembler.
+
+ * <a href="http://bugzilla.ximian.com/buglist.cgi?product=Mono%2FMCS&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&email1=&emailtype1=substring&emailassigned_to1=1&email2=&emailtype2=substring&emailreporter2=1&changedin=&chfieldfrom=&chfieldto=Now&chfieldvalue=&short_desc=&short_desc_type=substring&long_desc=&long_desc_type=substring&bug_file_loc=&bug_file_loc_type=substring&keywords=&keywords_type=anywords&op_sys_details=&op_sys_details_type=substring&version_details=&version_details_type=substring&cmdtype=doit&newqueryname=&order=Reuse+same+sort+as+last+time&form_name=query">[Query]</a> <a href="http://bugzilla.ximian.com/enter_bug.cgi?product=Mono%2FMCS">[Add]</a> C# Compiler.
+
+ * <a href="http://bugzilla.ximian.com/buglist.cgi?product=Mono%2FRuntime&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&email1=&emailtype1=substring&emailassigned_to1=1&email2=&emailtype2=substring&emailreporter2=1&changedin=&chfieldfrom=&chfieldto=Now&chfieldvalue=&short_desc=&short_desc_type=substring&long_desc=&long_desc_type=substring&bug_file_loc=&bug_file_loc_type=substring&keywords=&keywords_type=anywords&op_sys_details=&op_sys_details_type=substring&version_details=&version_details_type=substring&cmdtype=doit&newqueryname=&order=Reuse+same+sort+as+last+time&form_name=query">[Query]</a> <a href="http://bugzilla.ximian.com/enter_bug.cgi?product=Mono%2FRuntime">[Add]</a> Runtime
+
+ * <a href="http://bugzilla.ximian.com/buglist.cgi?product=Mono%2FDoctools&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&email1=&emailtype1=substring&emailassigned_to1=1&email2=&emailtype2=substring&emailreporter2=1&changedin=&chfieldfrom=&chfieldto=Now&chfieldvalue=&short_desc=&short_desc_type=substring&long_desc=&long_desc_type=substring&bug_file_loc=&bug_file_loc_type=substring&keywords=&keywords_type=anywords&op_sys_details=&op_sys_details_type=substring&version_details=&version_details_type=substring&cmdtype=doit&newqueryname=&order=Reuse+same+sort+as+last+time&form_name=query">[Query]</a> <a href="http://bugzilla.ximian.com/enter_bug.cgi?product=Mono%2FDoctools">[Add]</a> Documentation system.
+
+ * <a href="http://bugzilla.ximian.com/buglist.cgi?product=gtk%23&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&email1=&emailtype1=substring&emailassigned_to1=1&email2=&emailtype2=substring&emailreporter2=1&changedin=&chfieldfrom=&chfieldto=Now&chfieldvalue=&short_desc=&short_desc_type=substring&long_desc=&long_desc_type=substring&bug_file_loc=&bug_file_loc_type=substring&keywords=&keywords_type=anywords&op_sys_details=&op_sys_details_type=substring&version_details=&version_details_type=substring&cmdtype=doit&newqueryname=&order=Reuse+same+sort+as+last+time&form_name=query">[Query]</a> <a href="http://bugzilla.ximian.com/enter_bug.cgi?product=gtk%23">[Add]</a> Gtk#
+
+ * <a href="http://bugzilla.ximian.com/buglist.cgi?product=Mono%2FDebugger&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&email1=&emailtype1=substring&emailassigned_to1=1&email2=&emailtype2=substring&emailreporter2=1&changedin=&chfieldfrom=&chfieldto=Now&chfieldvalue=&short_desc=&short_desc_type=substring&long_desc=&long_desc_type=substring&bug_file_loc=&bug_file_loc_type=substring&keywords=&keywords_type=anywords&op_sys_details=&op_sys_details_type=substring&version_details=&version_details_type=substring&cmdtype=doit&newqueryname=&order=Reuse+same+sort+as+last+time&form_name=query">[Query]</a> <a href="http://bugzilla.ximian.com/enter_bug.cgi?product=Mono%2FDebugger">[Add]</a> Debugger.
+
+ * <a href="http://bugzilla.ximian.com/buglist.cgi?product=Mono%2FClass+Libraries&product=Mono%2FMCS&product=Mono%2FRuntime&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&email1=&emailtype1=substring&emailassigned_to1=1&email2=&emailtype2=substring&emailreporter2=1&changedin=&chfieldfrom=&chfieldto=Now&chfieldvalue=&short_desc=&short_desc_type=substring&long_desc=&long_desc_type=substring&bug_file_loc=&bug_file_loc_type=substring&keywords=&keywords_type=anywords&op_sys_details=&op_sys_details_type=substring&version_details=&version_details_type=substring&cmdtype=doit&order=%27Importance%27&form_name=query">[Query]</a> All core components.
+ </ul>
+
+<a name="goodbugreport"/>
+** How to make good bug reports
+
+ <ol>
+ * Submit a test case, the smaller it is, the better
+
+ * Use <a href="http://bugzilla.ximian.com">
+ http://bugzilla.ximian.com</a> to report the bug.
+
+ <p>In <b>addition</b> to bugzilla, posting to the list is
+ fine if the bug merits larger exposure or design
+ discussions to solve; posting to the list twice or more
+ is just a way to annoy people and make them waste time,
+ specially when you start a new thread about it.
+
+ * If the test involves libraries or assemblies that are
+ not part of mono, add info about where to download all
+ the dependencies, and how to compile/install them.
+
+ * If compiling the test case requires more than:
+ <pre> mcs test.cs </pre>
+ provide the <b>full command line</b> you used to compile
+ the test.
+
+ * If running the test requires more than:
+ <pre> mono test.exe </pre>
+ provide the <b>full command line</b> needed to replicate
+ the bug.
+
+ * Provide info about the version of the software you're
+ using (both mono and the operating system or relevant
+ libraries).
+
+ * Provide the output you expect the test case to produce.
+
+ * Provide the actual output <b>you</b> get from the test case.
+ </ol>
+
+ A good bug report complies with at least 6 items from the list.
+ If your bug report complies with 3 or less items, it is very
+ poor and it means it will take much more time to fix (when it's
+ not ignored).
+
diff --git a/doc/download b/doc/download
index 211f6d4cb63..26f6380b3fb 100644
--- a/doc/download
+++ b/doc/download
@@ -12,113 +12,7 @@
href="http://www.go-mono.org/mono-beginning.html">Resources/Beginning
section</a>, the <a
href="http://www.go-mono.org/faq.html">FAQ</a>.
- <table>
- <tbody>
- <tr bgcolor="#DDDDDD">
- <td>
- <b>Release 0.26</b><br>
- <a href="archive/mono-0.26.html">Release notes</a><br>
- Aug 14, 2003
- </td>
- <td>
- <table cellspacing="1" cellpadding="3">
- <tr bgcolor="#BBBBBB">
- <td>
- <b>Source Code</b>
- </td>
- <td>
- <ul>
- <li><a href="archive/mcs-0.26.tar.gz">Mono Class Libraries and C# Compiler.</a>
- <li><a href="archive/mono-0.26.tar.gz">Mono Runtime</a>
- <li><a href="archive/xsp-0.5.tar.gz">XSP web server (0.5)</a>
- <li><a href="archive/mod_mono-0.4.tar.gz">Apache Mono module (mod_mono)</a>
- <li><a href="archive/monodoc-0.6.tar.gz">MonoDoc 0.6</a>
- </ul>
- </td>
- </tr>
- <tr bgcolor="#BBBBBB">
- <td>
- <b>Source RPMs</b><br>
- (No RPMS for XSP).
- </td>
- <td>
- <ul>
- <li><a href="archive/redhat-90-i386/mono-0.26-1.ximian.6.1.src.rpm">mono-0.26-1.src.rpm (RH9)</a>
- <li><a href="archive/redhat-90-i386/mono-0.26-1.ximian.5.1.src.rpm">mono-0.26-1.src.rpm (RH8)</a>
- </ul>
- </td>
- </tr>
- <tr>
- <td></td>
- </tr>
- <tr>
- <td bgcolor="#999999">
- <img src="images/redhat-36.gif"><b>Red Hat 9.0/x86</b>
- <ul>
- <li><a href="archive/redhat-90-i386/mono-0.26-1.ximian.6.1.i386.rpm">mono-0.26-1.ximian.6.1.i386.rpm</a>
- <li><a href="archive/redhat-90-i386/mono-devel-0.26-1.ximian.6.1.i386.rpm">mono-devel-0.26-1.ximian.6.1.i386.rpm</a>
- <li><a href="archive/redhat-90-i386/mono-debuginfo-0.26-1.ximian.6.1.i386.rpm">mono-debuginfo-0.26-1.i386.rpm</a>
- <br>
- <li><a href="archive/redhat-90-i386/libpixregion-0.1.0-1.ximian.6.1.i386.rpm">libpixregion-0.1.0-1.ximian.6.1.i386.rpm</a>
- <li><a href="archive/redhat-90-i386/libpixregion-debuginfo-0.1.0-1.ximian.6.1.i386.rpm">libpixregion-debuginfo-0.1.0-1.ximian.6.1.i386.rpm</a>
- <li><a href="archive/redhat-90-i386/libic-0.1.0-1.ximian.6.1.i386.rpm">libic-0.1.0-1.ximian.6.1.i386.rpm</a>
- <li><a href="archive/redhat-90-i386/libic-debuginfo-0.1.0-1.ximian.6.1.i386.rpm">libic-debuginfo-0.1.0-1.ximian.6.1.i386.rpm</a>
- <li><a href="archive/redhat-90-i386/xc-0.1.0-1.ximian.6.1.i386.rpm">xc-0.1.0-1.ximian.6.1.i386.rpm</a>
- <li><a href="archive/redhat-90-i386/xc-debuginfo-0.1.0-1.ximian.6.1.i386.rpm">xc-debuginfo-0.1.0-1.ximian.6.1.i386.rpm</a>
- <li><a href="archive/redhat-90-i386/xr-0.1.0-1.ximian.6.1.i386.rpm">xr-0.1.0-1.ximian.6.1.i386.rpm</a>
- <li><a href="archive/redhat-90-i386/xr-debuginfo-0.1.0-1.ximian.6.1.i386.rpm">xr-debuginfo-0.1.0-1.ximian.6.1.i386.rpm</a>
- <br>
- <li><a href="archive/redhat-90-i386/monodoc-0.6-1.ximian.6.1.i386.rpm">monodoc-0.6-1.ximian.6.1.i386.rpm</a> (To be used only with CVS gtk-sharp)
- <li><a href="archive/redhat-90-i386/monodoc-debuginfo-0.5-1.ximian.6.1.i386.rpm">monodoc-debuginfo-0.5-1.ximian.6.1.i386.rpm</a>
- <li><a href="archive/mono-wine-20030318-1.ximian.6.2.i386.rpm">mono-wine-20030318-1.ximian.6.2.i386.rpm</a>
- <li><a href="archive/mono-wine-debuginfo-20030318-1.ximian.6.2.i386.rpm">mono-wine-debuginfo-20030318-1.ximian.6.2.i386.rpm</a>
- </ul>
- </td>
- <td bgcolor="#999999">
- <img src="images/redhat-36.gif"><b>Red Hat 8.0/x86</b>
- <ul>
- <li><a href="archive/redhat-80-i386/mono-0.26-2.ximian.5.1.i386.rpm">mono-0.26-2.ximian.5.1.i386.rpm</a>
- <li><a href="archive/redhat-80-i386/mono-devel-0.26-2.ximian.5.1.i386.rpm">mono-devel-0.26-2.ximian.5.1.i386.rpm</a>
- <br>
- <li><a href="archive/redhat-80-i386/monodoc-0.5-1.ximian.5.1.i386.rpm">monodoc-0.5-1.ximian.5.1.i386.rpm</a> (To be used only with CVS gtk-sharp)
- <li><a href="archive/mono-wine-20030318-1.ximian.5.2.i386.rpm">mono-wine-20030318-1.ximian.5.2.i386.rpm</a>
- </ul>
- </td>
- </tr>
- <tr>
- <td bgcolor="#999999">
- <img src="images/debian-36.gif"><b>Debian</b>
- <ul>
- <li><a href="h#ttp://www.debianplanet.com/mono/">Debian Packages here.</a>
- </ul>
- </td>
- <td bgcolor="#999999">
- <img src="images/mandrake-36.gif"><b>Mandrake 9.1/x86</b>
- <ul>
- <li><a href="archive/mandrake-91-i586/mono-0.26-1.ximian.6.1.i586.rpm">mono-0.26-1.ximian.6.1.i586.rpm</a>
- <li><a href="archive/mandrake-91-i586/mono-devel-0.26-1.ximian.6.1.i586.rpm">mono-devel-0.26-1.ximian.6.1.i586.rpm</a>
-<!-- <li><a href="archive/mandrake-91-i586/monodoc-0.5-1.ximian.6.1.i586.rpm">monodoc-0.5-1.ximian.6.1.i586.rpm</a> -->
- </ul>
- </td>
- </tr>
- <tr>
- <td bgcolor="#999999">
- <img src="images/suse-36.gif"><b>SuSE 8.2</b>
- <ul>
- <li><a href="archive/suse-82-i586/mono-0.26-2.ximian.7.1.i586.rpm">mono-0.26-2.ximian.7.1.i586.rpm</a>
- <li><a href="archive/suse-82-i586/mono-devel-0.26-2.ximian.7.1.i586.rpm">mono-devel-0.26-2.ximian.7.1.i586.rpm</a>
- </ul>
- </td>
- <td bgcolor="#999999">
- <img src="images/windows-36.gif"><b>Windows installer</b>
- <ul>
- <li><a href="archive/mono-0.26-win32-2.exe">mono-0.26-win32-2.exe</a>
- </ul>
- </td>
- </tr>
- </table>
- </td>
<table>
<tbody>
<tr bgcolor="#DDDDDD">
diff --git a/doc/index b/doc/index
index dea9f820532..7138e25e740 100644
--- a/doc/index
+++ b/doc/index
@@ -14,8 +14,8 @@
runtime can be <a href="embedded-api.html">embedded</a> into your
application.
- Mono has implementations of both <a href="ado-net.html">ADO.NET</a>
- and <a href="asp-net.html">ASP.NET</a> as part of its distribution.
+ Mono has implementations of both <a href="ado-net">ADO.NET</a>
+ and <a href="asp-net">ASP.NET</a> as part of its distribution.
You can read our <a href="rationale.html">rationale</a> for
this project. If you have questions about the project, please
@@ -151,21 +151,6 @@
</tr>
</table>
-@item Aug 14th, 2003: Mono 0.26 has been released
-
- A new version of Mono is available, the new features include:
- <a href="http://www.cairographics.org/">Cairo support</a>, <a
- href="http://remoting-corba.sf.net">Remoting.Corba</a>
- support, as well as a managed XSLT implementation.
-
- Existing features have been improved vastly: better
- Windows.Forms, runtime, faster compiler, web services, better
- compliance to the spec and more.
-
- Check out the <a
- href="http://www.go-mono.com/archive/mono-0.26.html">Release
- notes</a> for details.
-
@item Aug 9th, 2003: Python for .NET Preview 2 available; Mono Documentation site up.
Brian Lloyd has <a
diff --git a/doc/mysql b/doc/mysql
index 7b0a4d5811b..56c5f112950 100755
--- a/doc/mysql
+++ b/doc/mysql
@@ -43,7 +43,7 @@
in the Microsoft .NET Environment</a> is an article
by Mr. Venu who is a MySQL AB developer.</li>
- <p>Testing for Mono's Mono.Data.MySql and ByteFX's ByteFX.Data.MySqlClient is below.
+ <p>Testing for Mono's Mono.Data.MySql and ByteFX's ByteFX.Data.MySQLClient is below.
** Current Status
@@ -51,7 +51,7 @@
<ul>
- <li>ByteFX.Data.MySqlClient
+ <li>ByteFX.Data.MySQLClient
<ul>
<li>Build and Runs on Microsoft .NET and Mono</li>
<li>Works with SQL# (command-line and GTK# GUI versions)</li>
@@ -109,7 +109,7 @@
The current plan for the MySQL data providers:
<ul>
- <li>ByteFX.Data.MySqlClient
+ <li>ByteFX.Data.MySQLClient
<ul>
<li>Testing and fixes</li>
<li>Implement missing features</li>
@@ -163,7 +163,7 @@
<pre>
using System;
using System.Data;
- using ByteFX.Data.MySqlClient;
+ using ByteFX.Data.MySQLClient;
public class Test
{
@@ -175,7 +175,7 @@
"User ID=myuserid;" +
"Password=mypassword;";
IDbConnection dbcon;
- dbcon = new MySqlConnection(connectionString);
+ dbcon = new MySQLConnection(connectionString);
dbcon.Open();
IDbCommand dbcmd = dbcon.CreateCommand();
// requires a table to be created named employee
diff --git a/doc/pending-classes.in b/doc/pending-classes.in
deleted file mode 100644
index 1cdb5a4cb36..00000000000
--- a/doc/pending-classes.in
+++ /dev/null
@@ -1,246 +0,0 @@
-System.Object
-System.Exception
-System.ValueType
-System.Delegate
-System.MulticastDelegate
-System.Enum
-System.Activator
-System.ArgIterator
-System.__ComObject
-System.TypedReference
-System.Security.AllowPartiallyTrustedCallersAttribute
-System.Runtime.Serialization.Formatter
-System.Runtime.Serialization.FormatterConverter
-System.Runtime.Serialization.FormatterServices
-System.Runtime.Serialization.ObjectIDGenerator
-System.Runtime.Serialization.ObjectManager
-System.Reflection.ModuleResolveEventHandler
-System.Reflection.Pointer
-System.Globalization.CompareInfo
-System.Globalization.HebrewCalendar
-System.Globalization.HijriCalendar
-System.Globalization.JapaneseCalendar
-System.Globalization.KoreanCalendar
-System.Globalization.SortKey
-System.Globalization.StringInfo
-System.Globalization.TaiwanCalendar
-System.Globalization.TextElementEnumerator
-System.Globalization.TextInfo
-System.Globalization.ThaiBuddhistCalendar
-System.IO.IsolatedStorage.IsolatedStorageFile
-System.Reflection.Emit.MethodRental
-System.Runtime.CompilerServices.AccessedThroughPropertyAttribute
-System.Runtime.CompilerServices.CallConvCdecl
-System.Runtime.CompilerServices.CallConvStdcall
-System.Runtime.CompilerServices.CallConvThiscall
-System.Runtime.CompilerServices.CallConvFastcall
-System.Runtime.CompilerServices.CustomConstantAttribute
-System.Runtime.CompilerServices.DateTimeConstantAttribute
-System.Runtime.CompilerServices.DiscardableAttribute
-System.Runtime.CompilerServices.DecimalConstantAttribute
-System.Runtime.CompilerServices.CompilationRelaxationsAttribute
-System.Runtime.CompilerServices.CompilerGlobalScopeAttribute
-System.Runtime.CompilerServices.IDispatchConstantAttribute
-System.Runtime.CompilerServices.IsVolatile
-System.Runtime.CompilerServices.IUnknownConstantAttribute
-System.Runtime.CompilerServices.RequiredAttributeAttribute
-System.Runtime.InteropServices.ArrayWithOffset
-System.Runtime.InteropServices.DispIdAttribute
-System.Runtime.InteropServices.ClassInterfaceType
-System.Runtime.InteropServices.ClassInterfaceAttribute
-System.Runtime.InteropServices.ComVisibleAttribute
-System.Runtime.InteropServices.LCIDConversionAttribute
-System.Runtime.InteropServices.ComRegisterFunctionAttribute
-System.Runtime.InteropServices.ComUnregisterFunctionAttribute
-System.Runtime.InteropServices.ProgIdAttribute
-System.Runtime.InteropServices.ImportedFromTypeLibAttribute
-System.Runtime.InteropServices.IDispatchImplType
-System.Runtime.InteropServices.IDispatchImplAttribute
-System.Runtime.InteropServices.ComSourceInterfacesAttribute
-System.Runtime.InteropServices.ComConversionLossAttribute
-System.Runtime.InteropServices.TypeLibTypeFlags
-System.Runtime.InteropServices.TypeLibFuncFlags
-System.Runtime.InteropServices.TypeLibVarFlags
-System.Runtime.InteropServices.TypeLibTypeAttribute
-System.Runtime.InteropServices.TypeLibFuncAttribute
-System.Runtime.InteropServices.TypeLibVarAttribute
-System.Runtime.InteropServices.ComImportAttribute
-System.Runtime.InteropServices.PreserveSigAttribute
-System.Runtime.InteropServices.ComAliasNameAttribute
-System.Runtime.InteropServices.AutomationProxyAttribute
-System.Runtime.InteropServices.PrimaryInteropAssemblyAttribute
-System.Runtime.InteropServices.CoClassAttribute
-System.Runtime.InteropServices.ComEventInterfaceAttribute
-System.Runtime.InteropServices.COMException
-System.Runtime.InteropServices.ComMemberType
-System.Runtime.InteropServices.CurrencyWrapper
-System.Runtime.InteropServices.DispatchWrapper
-System.Runtime.InteropServices.ErrorWrapper
-System.Runtime.InteropServices.ExtensibleClassFactory
-System.Runtime.InteropServices.HandleRef
-System.Runtime.InteropServices.InvalidComObjectException
-System.Runtime.InteropServices.InvalidOleVariantTypeException
-System.Runtime.InteropServices.TypeLibImporterFlags
-System.Runtime.InteropServices.ExporterEventKind
-System.Runtime.InteropServices.ITypeLibExporterNotifySink
-System.Runtime.InteropServices.ITypeLibConverter
-System.Runtime.InteropServices.MarshalDirectiveException
-System.Runtime.InteropServices.ObjectCreationDelegate
-System.Runtime.InteropServices.RuntimeEnvironment
-System.Runtime.InteropServices.RegistrationServices
-System.Runtime.InteropServices.SafeArrayRankMismatchException
-System.Runtime.InteropServices.SafeArrayTypeMismatchException
-System.Runtime.InteropServices.SEHException
-System.Runtime.InteropServices.TypeLibConverter
-System.Runtime.InteropServices.BIND_OPTS
-System.Runtime.InteropServices.UCOMIBindCtx
-System.Runtime.InteropServices.UCOMIConnectionPointContainer
-System.Runtime.InteropServices.UCOMIConnectionPoint
-System.Runtime.InteropServices.UCOMIEnumMoniker
-System.Runtime.InteropServices.CONNECTDATA
-System.Runtime.InteropServices.UCOMIEnumConnections
-System.Runtime.InteropServices.UCOMIEnumConnectionPoints
-System.Runtime.InteropServices.UCOMIEnumString
-System.Runtime.InteropServices.UCOMIEnumVARIANT
-System.Runtime.InteropServices.FILETIME
-System.Runtime.InteropServices.UCOMIMoniker
-System.Runtime.InteropServices.UCOMIPersistFile
-System.Runtime.InteropServices.UCOMIRunningObjectTable
-System.Runtime.InteropServices.STATSTG
-System.Runtime.InteropServices.UCOMIStream
-System.Runtime.InteropServices.DESCKIND
-System.Runtime.InteropServices.BINDPTR
-System.Runtime.InteropServices.UCOMITypeComp
-System.Runtime.InteropServices.TYPEKIND
-System.Runtime.InteropServices.TYPEFLAGS
-System.Runtime.InteropServices.IMPLTYPEFLAGS
-System.Runtime.InteropServices.TYPEATTR
-System.Runtime.InteropServices.FUNCDESC
-System.Runtime.InteropServices.IDLFLAG
-System.Runtime.InteropServices.IDLDESC
-System.Runtime.InteropServices.PARAMFLAG
-System.Runtime.InteropServices.PARAMDESC
-System.Runtime.InteropServices.TYPEDESC
-System.Runtime.InteropServices.ELEMDESC
-System.Runtime.InteropServices.VARDESC
-System.Runtime.InteropServices.DISPPARAMS
-System.Runtime.InteropServices.EXCEPINFO
-System.Runtime.InteropServices.FUNCKIND
-System.Runtime.InteropServices.INVOKEKIND
-System.Runtime.InteropServices.CALLCONV
-System.Runtime.InteropServices.FUNCFLAGS
-System.Runtime.InteropServices.VARFLAGS
-System.Runtime.InteropServices.UCOMITypeInfo
-System.Runtime.InteropServices.SYSKIND
-System.Runtime.InteropServices.LIBFLAGS
-System.Runtime.InteropServices.TYPELIBATTR
-System.Runtime.InteropServices.UCOMITypeLib
-System.Runtime.InteropServices.UnknownWrapper
-System.Runtime.Remoting.IObjectHandle
-System.Runtime.Remoting.IRemotingTypeInfo
-System.Runtime.Remoting.IChannelInfo
-System.Runtime.Remoting.IEnvoyInfo
-System.Runtime.Remoting.RemotingConfiguration
-System.Runtime.Remoting.TypeEntry
-System.Runtime.Remoting.ActivatedClientTypeEntry
-System.Runtime.Remoting.ActivatedServiceTypeEntry
-System.Runtime.Remoting.WellKnownClientTypeEntry
-System.Runtime.Remoting.WellKnownServiceTypeEntry
-System.Runtime.Remoting.RemotingException
-System.Runtime.Remoting.ServerException
-System.Runtime.Remoting.RemotingTimeoutException
-System.Runtime.Remoting.RemotingServices
-System.Runtime.Remoting.InternalRemotingServices
-System.Runtime.Remoting.SoapServices
-System.Runtime.Remoting.Activation.UrlAttribute
-System.Runtime.Remoting.Messaging.IMessageSink
-System.Runtime.Remoting.Messaging.AsyncResult
-System.Runtime.Remoting.Messaging.CallContext
-System.Runtime.Remoting.Messaging.ILogicalThreadAffinative
-System.Runtime.Remoting.Messaging.InternalMessageWrapper
-System.Runtime.Remoting.Messaging.IMethodCallMessage
-System.Runtime.Remoting.Messaging.MethodCallMessageWrapper
-System.Runtime.Remoting.Messaging.HeaderHandler
-System.Runtime.Remoting.Messaging.IMessageCtrl
-System.Runtime.Remoting.Messaging.IRemotingFormatter
-System.Runtime.Remoting.Messaging.ReturnMessage
-System.Runtime.Remoting.Messaging.MethodCall
-System.Runtime.Remoting.Messaging.ConstructionCall
-System.Runtime.Remoting.Messaging.MethodResponse
-System.Runtime.Remoting.Messaging.ConstructionResponse
-System.Runtime.Remoting.Messaging.MethodReturnMessageWrapper
-System.Runtime.Remoting.Messaging.OneWayAttribute
-System.Runtime.Remoting.Messaging.MessageSurrogateFilter
-System.Runtime.Remoting.Messaging.RemotingSurrogateSelector
-System.Runtime.Remoting.Contexts.CrossContextDelegate
-System.Runtime.Remoting.Contexts.ContextProperty
-System.Runtime.Remoting.Contexts.IContextPropertyActivator
-System.Runtime.Remoting.Contexts.IContributeClientContextSink
-System.Runtime.Remoting.Contexts.IContributeDynamicSink
-System.Runtime.Remoting.Contexts.IContributeEnvoySink
-System.Runtime.Remoting.Contexts.IContributeObjectSink
-System.Runtime.Remoting.Contexts.IContributeServerContextSink
-System.Runtime.Serialization.Formatters.InternalRM
-System.Runtime.Serialization.Formatters.InternalST
-System.Runtime.Serialization.Formatters.SoapMessage
-System.Runtime.Serialization.Formatters.SoapFault
-System.Runtime.Serialization.Formatters.ServerFault
-System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
-System.Security.Cryptography.CryptoConfig
-System.Security.Cryptography.KeyedHashAlgorithm
-System.Security.Cryptography.HMACSHA1
-System.Security.Cryptography.MACTripleDES
-System.Security.Cryptography.MaskGenerationMethod
-System.Security.Cryptography.PasswordDeriveBytes
-System.Security.Cryptography.PKCS1MaskGenerationMethod
-System.Security.Cryptography.RC2
-System.Security.Cryptography.RC2CryptoServiceProvider
-System.Security.Cryptography.RSACryptoServiceProvider
-System.Security.Cryptography.RSAOAEPKeyExchangeDeformatter
-System.Security.Cryptography.RSAOAEPKeyExchangeFormatter
-System.Security.Cryptography.RSAPKCS1KeyExchangeDeformatter
-System.Security.Cryptography.RSAPKCS1KeyExchangeFormatter
-System.Security.Cryptography.RSAPKCS1SignatureDeformatter
-System.Security.Cryptography.RSAPKCS1SignatureFormatter
-System.Security.Cryptography.SHA1Managed
-System.Security.Cryptography.TripleDES
-System.Security.Cryptography.TripleDESCryptoServiceProvider
-System.Security.Permissions.EnvironmentPermission
-System.Security.Permissions.FileDialogPermission
-System.Security.Permissions.IsolatedStorageFilePermission
-System.Security.Permissions.PrincipalPermissionAttribute
-System.Security.Permissions.SecurityPermissionAttribute
-System.Security.Permissions.PublisherIdentityPermissionAttribute
-System.Security.Permissions.PublisherIdentityPermission
-System.Security.Permissions.ReflectionPermission
-System.Security.Permissions.RegistryPermission
-System.Security.Permissions.PrincipalPermission
-System.Security.Permissions.SiteIdentityPermission
-System.Security.Permissions.StrongNameIdentityPermission
-System.Security.Permissions.StrongNamePublicKeyBlob
-System.Security.Permissions.UIPermission
-System.Security.Permissions.UrlIdentityPermission
-System.Security.Permissions.ZoneIdentityPermission
-System.Security.Policy.ApplicationDirectory
-System.Security.Policy.ApplicationDirectoryMembershipCondition
-System.Security.Policy.FirstMatchCodeGroup
-System.Security.Policy.Hash
-System.Security.Policy.HashMembershipCondition
-System.Security.Policy.NetCodeGroup
-System.Security.Policy.PermissionRequestEvidence
-System.Security.Policy.Publisher
-System.Security.Policy.PublisherMembershipCondition
-System.Security.Policy.Site
-System.Security.Policy.SiteMembershipCondition
-System.Security.Policy.StrongName
-System.Security.Policy.StrongNameMembershipCondition
-System.Security.Policy.UnionCodeGroup
-System.Security.Policy.Url
-System.Security.Policy.UrlMembershipCondition
-System.Security.Policy.Zone
-System.Security.Policy.ZoneMembershipCondition
-System.Security.Principal.WindowsIdentity
-System.Security.Principal.WindowsImpersonationContext
-System.Security.Principal.WindowsPrincipal
-System.Threading.CompressedStack
-
diff --git a/doc/web/makefile b/doc/web/makefile
index ed5b87ac8a5..90fe990fec1 100644
--- a/doc/web/makefile
+++ b/doc/web/makefile
@@ -64,6 +64,20 @@ OBJECTS= \
deploy/testing.html \
deploy/tools.html \
deploy/winforms.html \
+ deploy/class-status.html \
+ deploy/class-status-corlib.html \
+ deploy/class-status-System.html \
+ deploy/class-status-System.Xml.html \
+ deploy/class-status-System.Drawing.html \
+ deploy/class-status-System.Data.html \
+ deploy/class-status-System.Web.html \
+ deploy/class-status-System.Web.Services.html \
+ deploy/class-status-Microsoft.VisualBasic.html \
+ deploy/class-status-System.EnterpriseServices.html \
+ deploy/class-status-System.Runtime.Serialization.Formatters.Soap.html \
+ deploy/class-status-System.Security.html \
+ deploy/class-status-System.Windows.Forms.html \
+ deploy/class-status-Cscompmgd.html \
deploy/class-library.html \
deploy/classlib-doc.html
@@ -77,7 +91,7 @@ NON_HTML_SOURCES= \
../mono-build.sh \
../mono-build-w32.sh
-all: $(OBJECT) deploy/index.rss ../team
+all: $(OBJECTS) deploy/index.rss ../team
perl process.pl commands template.html.in deploy
-mkdir deploy/team
cp team/*png deploy/team
diff --git a/doc/web/team.xml b/doc/web/team.xml
index 7444d88f082..ccc9d97a16d 100644
--- a/doc/web/team.xml
+++ b/doc/web/team.xml
@@ -1453,7 +1453,7 @@
<e-mail>peter@newton.cx</e-mail>
- <image>peterw.png</image>
+ <image>none.png</image>
<location>Cambridge, MA</location>
diff --git a/doc/web/template.html.in b/doc/web/template.html.in
index fc2466834dc..2aab918a0a5 100644
--- a/doc/web/template.html.in
+++ b/doc/web/template.html.in
@@ -38,26 +38,11 @@
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
- <td><img src="images/pixel.gif" alt=""></td><!-- left border
- -->
- <td colspan="4">
- <table>
- <tr>
- <td>
- <a href="http://www.go-mono.com"><img
- src="images/mono-new.gif" alt="mono-logo" border="0"></a>
- </td>
- <td>
- <a class="navi0" href="download.html">Downloads</a> |
- <a class="navi0" href="http://go-mono.com/daily">Daily snapshots</a> |
- <a class="navi0" href="screenshots.html">Screenshots</a> |
- <a class="navi0" href="http://mono.ximian.com:8080">API Docs</a>
- </td>
- </tr>
- </table>
- </td>
- <td><img src="images/pixel.gif" alt=""></td><!-- right border
- -->
+ <td><img src="images/pixel.gif" alt=""></td><!-- left border -->
+ <td colspan="4">
+ <a href="http://www.go-mono.com"><img src="images/mono-new.gif"
+ alt="mono-logo" border="0"></a></td>
+ <td><img src="images/pixel.gif" alt=""></td><!-- right border -->
</tr>
<tr>
<td><img src="images/pixel.gif" width="1" height="1" alt=""></td>
diff --git a/mcs/Makefile b/mcs/Makefile
index cbc7d15733e..678ac7ea95a 100644
--- a/mcs/Makefile
+++ b/mcs/Makefile
@@ -41,6 +41,7 @@ DISTFILES = \
MIT.X11 \
MonoIcon.png \
README \
+ README.building \
ScalableMonoIcon.svg \
winexe.in
diff --git a/mcs/build/profiles/default.make b/mcs/build/profiles/default.make
index 04fe95370e3..cabf57344f7 100644
--- a/mcs/build/profiles/default.make
+++ b/mcs/build/profiles/default.make
@@ -25,4 +25,5 @@ endif
profile-check:
-PROFILE_MCS_FLAGS = -d:NET_1_1
+# Causes some build errors
+#PROFILE_MCS_FLAGS = /d:NET_1_1
diff --git a/mcs/build/profiles/generics.make b/mcs/build/profiles/generics.make
index c18bee1f5a5..9df5fa57222 100644
--- a/mcs/build/profiles/generics.make
+++ b/mcs/build/profiles/generics.make
@@ -26,4 +26,4 @@ endif
profile-check:
# Causes some build errors
-PROFILE_MCS_FLAGS = -d:GENERICS -d:NET_1_1
+PROFILE_MCS_FLAGS = -d:GENERICS
diff --git a/mcs/build/rules.make b/mcs/build/rules.make
index 75957307282..11c1fa7249e 100644
--- a/mcs/build/rules.make
+++ b/mcs/build/rules.make
@@ -13,7 +13,7 @@
dots := $(shell echo $(thisdir) |sed -e 's,[^./][^/]*,..,g')
topdir := $(dots)
-VERSION = 0.26.99
+VERSION = 0.25.99
USE_MCS_FLAGS = $(LOCAL_MCS_FLAGS) $(PLATFORM_MCS_FLAGS) $(PROFILE_MCS_FLAGS) $(MCS_FLAGS)
USE_CFLAGS = $(LOCAL_CFLAGS) $(CFLAGS)
diff --git a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/ChangeLog b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/ChangeLog
index 02d0d61dc86..f91ed45c0cd 100644
--- a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/ChangeLog
+++ b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/ChangeLog
@@ -1,13 +1,3 @@
-2003-08-22 Duncan Mak <duncan@ximian.com>
-
- * Tds.cs (ProcessEndToken): RecordsAffected was not filled
- correctly. I've found out that the record count was submitted for
- TdsPacketSubType.Done. So I changed the behaviour to include this
- (without deeper knowledge of the TDS protocol). Patch from Jörg
- Rosenkranz <joergr@voelcker.com>.
-
- This is part of a fix to bug #40315.
-
2003-05-07 Miguel de Icaza <miguel@ximian.com>
Patches from Igor Nosyryev <nosyryev@attbi.com>
diff --git a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds.cs b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds.cs
index 557d192aab9..440364565f4 100644
--- a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds.cs
+++ b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds.cs
@@ -915,15 +915,10 @@ namespace Mono.Data.Tds.Protocol {
moreResults = ((status & 0x01) != 0);
bool cancelled = ((status & 0x20) != 0);
- switch (type) {
- case TdsPacketSubType.DoneProc:
- doneProc = true;
- goto case TdsPacketSubType.Done;
-
- case TdsPacketSubType.Done:
- if (rowCount > 0)
- recordsAffected += rowCount;
- break;
+ if (type == TdsPacketSubType.DoneProc) {
+ doneProc = true;
+ if (rowCount > 0)
+ recordsAffected += rowCount;
}
if (moreResults)
diff --git a/mcs/class/Mono.GetOptions/ArgumentProcessorAttribute.cs b/mcs/class/Mono.GetOptions/ArgumentProcessorAttribute.cs
index da0e8459462..bbe235f7179 100644
--- a/mcs/class/Mono.GetOptions/ArgumentProcessorAttribute.cs
+++ b/mcs/class/Mono.GetOptions/ArgumentProcessorAttribute.cs
@@ -1,10 +1,3 @@
-//
-// ArgumentProcessorAttribute.cs
-//
-// Author: Rafael Teixeira (rafaelteixeirabr@hotmail.com)
-//
-// (C) 2002 Rafael Teixeira
-//
using System;
namespace Mono.GetOptions
diff --git a/mcs/class/Mono.GetOptions/ChangeLog b/mcs/class/Mono.GetOptions/ChangeLog
index cc5d9256a12..f3d23373345 100644
--- a/mcs/class/Mono.GetOptions/ChangeLog
+++ b/mcs/class/Mono.GetOptions/ChangeLog
@@ -1,7 +1,3 @@
-2003-08-25 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
- * ArgumentProcessorAttribute.cs, OptionAttribute.cs:
- - Copyright attribute was missing
-
2003-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
* OptionDetails.cs :
- Now handles correctly options specifiying maxOccurs != 1 (that was preventing mbas from being useable)
diff --git a/mcs/class/Mono.GetOptions/OptionAttribute.cs b/mcs/class/Mono.GetOptions/OptionAttribute.cs
index a6462ab2f7a..1602fd2e797 100644
--- a/mcs/class/Mono.GetOptions/OptionAttribute.cs
+++ b/mcs/class/Mono.GetOptions/OptionAttribute.cs
@@ -1,10 +1,3 @@
-//
-// OptionAttribute.cs
-//
-// Author: Rafael Teixeira (rafaelteixeirabr@hotmail.com)
-//
-// (C) 2002 Rafael Teixeira
-//
using System;
namespace Mono.GetOptions
diff --git a/mcs/class/PEAPI/ChangeLog b/mcs/class/PEAPI/ChangeLog
index c885631ef94..610a4aa6253 100644
--- a/mcs/class/PEAPI/ChangeLog
+++ b/mcs/class/PEAPI/ChangeLog
@@ -1,8 +1,3 @@
-2003-08-19 Jackson Harper <jackson@latitudegeo.com>
-
- * PEAPI.cs: Make no super method public so we can have types
- with no super type.
-
2003-08-03 Jackson Harper <jackson@latitudegeo.com>
* PEAPI.cs: New Sentinel type.
diff --git a/mcs/class/PEAPI/PEAPI.cs b/mcs/class/PEAPI/PEAPI.cs
index d52483dec75..c7a56ff998a 100644
--- a/mcs/class/PEAPI/PEAPI.cs
+++ b/mcs/class/PEAPI/PEAPI.cs
@@ -1729,7 +1729,7 @@ namespace PEAPI
typeIndex = superType.GetTypeIndex();
}
- public void SpecialNoSuper() {
+ internal void SpecialNoSuper() {
superType = null;
}
diff --git a/mcs/class/System.Data.OracleClient/System.Data.OracleClient.Oci/OciParameterDescriptor.cs b/mcs/class/System.Data.OracleClient/System.Data.OracleClient.Oci/OciParameterDescriptor.cs
index f3ef0bbebf7..72f42c45eaa 100644
--- a/mcs/class/System.Data.OracleClient/System.Data.OracleClient.Oci/OciParameterDescriptor.cs
+++ b/mcs/class/System.Data.OracleClient/System.Data.OracleClient.Oci/OciParameterDescriptor.cs
@@ -65,67 +65,6 @@ namespace System.Data.OracleClient.Oci {
return (OciDataType) GetAttributeInt32 (OciAttributeType.DataType, ErrorHandle);
}
- public string GetDataTypeName ()
- {
- switch(GetDataType())
- {
- case OciDataType.VarChar2:
- return "VarChar2";
- case OciDataType.Number:
- return "Number";
- case OciDataType.Integer:
- return "Integer";
- case OciDataType.Float:
- return "Float";
- case OciDataType.String:
- return "String";
- case OciDataType.VarNum:
- return "VarNum";
- case OciDataType.Long:
- return "Long";
- case OciDataType.VarChar:
- return "VarChar";
- case OciDataType.RowId:
- return "RowId";
- case OciDataType.Date:
- return "Date";
- case OciDataType.VarRaw:
- return "VarRaw";
- case OciDataType.Raw:
- return "Raw";
- case OciDataType.LongRaw:
- return "LongRaw";
- case OciDataType.UnsignedInt:
- return "UnsignedInt";
- case OciDataType.LongVarChar:
- return "LongVarChar";
- case OciDataType.LongVarRaw:
- return "LongVarRaw";
- case OciDataType.Char:
- return "Char";
- case OciDataType.CharZ:
- return "CharZ";
- case OciDataType.RowIdDescriptor:
- return "RowIdDescriptor";
- case OciDataType.NamedDataType:
- return "NamedDataType";
- case OciDataType.Ref:
- return "Ref";
- case OciDataType.Clob:
- return "Clob";
- case OciDataType.Blob:
- return "Blob";
- case OciDataType.BFile:
- return "BFile";
- case OciDataType.OciString:
- return "OciString";
- case OciDataType.OciDate:
- return "OciDate";
- default:
- return "Unknown";
- }
- }
-
public short GetPrecision ()
{
return (short) GetAttributeByte (OciAttributeType.Precision, ErrorHandle);
diff --git a/mcs/class/System.Data.OracleClient/System.Data.OracleClient/OracleDataReader.cs b/mcs/class/System.Data.OracleClient/System.Data.OracleClient/OracleDataReader.cs
index c848d9891cd..08bcfd15ea9 100644
--- a/mcs/class/System.Data.OracleClient/System.Data.OracleClient/OracleDataReader.cs
+++ b/mcs/class/System.Data.OracleClient/System.Data.OracleClient/OracleDataReader.cs
@@ -127,7 +127,6 @@ namespace System.Data.OracleClient {
schemaTable.Columns.Add ("AllowDBNull", booleanType);
schemaTable.Columns.Add ("IsUnique", booleanType);
schemaTable.Columns.Add ("IsKey", booleanType);
- schemaTable.Columns.Add ("IsReadOnly", booleanType);
schemaTable.Columns.Add ("BaseSchemaTable", stringType);
schemaTable.Columns.Add ("BaseCatalogName", stringType);
schemaTable.Columns.Add ("BaseTableName", stringType);
@@ -322,7 +321,7 @@ namespace System.Data.OracleClient {
{
if (schemaTable.Rows != null && schemaTable.Rows.Count > 0)
return schemaTable;
-
+
dataTypeNames = new ArrayList ();
for (int i = 0; i < statement.ColumnCount; i += 1) {
@@ -330,8 +329,6 @@ namespace System.Data.OracleClient {
OciParameterDescriptor parameter = statement.GetParameter (i);
- dataTypeNames.Add(parameter.GetDataTypeName());
-
row ["ColumnName"] = parameter.GetName ();
row ["ColumnOrdinal"] = i + 1;
row ["ColumnSize"] = parameter.GetDataSize ();
@@ -342,7 +339,6 @@ namespace System.Data.OracleClient {
row ["DataType"] = typeof(string);
row ["AllowDBNull"] = parameter.GetIsNull ();
row ["BaseColumnName"] = parameter.GetName ();
- row ["IsReadOnly"] = true;
schemaTable.Rows.Add (row);
}
diff --git a/mcs/class/System.Data/System.Data.Common/ChangeLog b/mcs/class/System.Data/System.Data.Common/ChangeLog
index 2216cc125b0..a342bb057f0 100755
--- a/mcs/class/System.Data/System.Data.Common/ChangeLog
+++ b/mcs/class/System.Data/System.Data.Common/ChangeLog
@@ -1,8 +1,3 @@
-2003-08-26 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * DbDataAdapter.cs: provide a Type for ToArray to avoid invalid cast
- exception. Thanks to Mark Easton <measton@tebiki.co.uk>.
-
2003-07-31 Duncan Mak <duncan@ximian.com>
* DataAdapter.cs (CloneInternals): Mark with ObsoleteAttribute for
diff --git a/mcs/class/System.Data/System.Data.Common/DbDataAdapter.cs b/mcs/class/System.Data/System.Data.Common/DbDataAdapter.cs
index a1e110f51e5..1da624e4939 100644
--- a/mcs/class/System.Data/System.Data.Common/DbDataAdapter.cs
+++ b/mcs/class/System.Data/System.Data.Common/DbDataAdapter.cs
@@ -347,7 +347,7 @@ namespace System.Data.Common {
primaryKey.Add (table.Columns [dsColumnName]);
}
if (MissingSchemaAction == MissingSchemaAction.AddWithKey && primaryKey.Count > 0)
- table.PrimaryKey = (DataColumn[])(primaryKey.ToArray(typeof (DataColumn)));
+ table.PrimaryKey = (DataColumn[])(primaryKey.ToArray());
}
[MonoTODO]
diff --git a/mcs/class/System.Data/System.Data.SqlClient/ChangeLog b/mcs/class/System.Data/System.Data.SqlClient/ChangeLog
index 35a67175c8f..47b6a73cbe2 100755
--- a/mcs/class/System.Data/System.Data.SqlClient/ChangeLog
+++ b/mcs/class/System.Data/System.Data.SqlClient/ChangeLog
@@ -1,22 +1,3 @@
-2003-08-22 Duncan Mak <duncan@ximian.com>
-
- * SqlCommand.cs (ExecuteNonQuery): Return
- Connection.Tds.RecordsAffected if it is successful. Patch from
- Jörg Rosenkranz <joergr@voelcker.com>.
-
- This is part of a fix to bug #40315.
-
-2003-08-20 Duncan Mak <duncan@ximian.com>
-
- * SqlConnectionPool.cs (ReleaseConnection): A patch from Joerg
- Rosenkranz <JoergR@voelcker.com>. Currently, if a connection is
- closed by an external event (network problem, etc.) it is pushed
- back into the connection pool. The next Open call retrieves this
- invalid connection which leads to exceptions when executing
- statements.
-
- This patch fixes this problem. This closes bug #47429.
-
2003-07-04 Miguel de Icaza <miguel@ximian.com>
* SqlDataReader.cs: Added extra information to the exceptions
diff --git a/mcs/class/System.Data/System.Data.SqlClient/SqlCommand.cs b/mcs/class/System.Data/System.Data.SqlClient/SqlCommand.cs
index 1022a753dc0..51e51cce74f 100644
--- a/mcs/class/System.Data/System.Data.SqlClient/SqlCommand.cs
+++ b/mcs/class/System.Data/System.Data.SqlClient/SqlCommand.cs
@@ -283,7 +283,6 @@ namespace System.Data.SqlClient {
try {
Execute (CommandBehavior.Default, false);
- result = Connection.Tds.RecordsAffected;
}
catch (TdsTimeoutException e) {
throw SqlException.FromTdsInternalException ((TdsInternalException) e);
diff --git a/mcs/class/System.Data/System.Data.SqlClient/SqlConnectionPool.cs b/mcs/class/System.Data/System.Data.SqlClient/SqlConnectionPool.cs
index 57a2b13068e..e2cfcdd732f 100644
--- a/mcs/class/System.Data/System.Data.SqlClient/SqlConnectionPool.cs
+++ b/mcs/class/System.Data/System.Data.SqlClient/SqlConnectionPool.cs
@@ -139,22 +139,7 @@ namespace System.Data.SqlClient {
public void ReleaseConnection (ITds tds)
{
- // Check if connection is still valid
- try
- {
- // Send dummy statement to check connection
- tds.Execute("select 1");
- }
- catch
- {
- // Remove invalid connection
- list.Remove(tds);
- }
- finally
- {
- // Release lock
- Monitor.Exit (tds);
- }
+ Monitor.Exit (tds);
}
public int IndexOf (object o)
diff --git a/mcs/class/System.Data/System.Data.SqlClient/SqlDataReader.cs b/mcs/class/System.Data/System.Data.SqlClient/SqlDataReader.cs
index 3272903c021..c9db7a57137 100644
--- a/mcs/class/System.Data/System.Data.SqlClient/SqlDataReader.cs
+++ b/mcs/class/System.Data/System.Data.SqlClient/SqlDataReader.cs
@@ -187,24 +187,10 @@ namespace System.Data.SqlClient {
public long GetChars (int i, long dataIndex, char[] buffer, int bufferIndex, int length)
{
object value = GetValue (i);
- char [] valueBuffer;
-
- if (value is char[])
- valueBuffer = (char[])value;
- else if (value is string)
- valueBuffer = ((string)value).ToCharArray();
- else
+ if (!(value is char[]))
throw new InvalidCastException ("Type is " + value.GetType ().ToString ());
-
- if ( buffer == null ) {
- // Return length of data
- return valueBuffer.Length;
- }
- else {
- // Copy data into buffer
- Array.Copy (valueBuffer, (int) dataIndex, buffer, bufferIndex, length);
- return valueBuffer.Length - dataIndex;
- }
+ Array.Copy ((char []) value, (int) dataIndex, buffer, bufferIndex, length);
+ return ((char []) value).Length - dataIndex;
}
[MonoTODO ("Implement GetData")]
diff --git a/mcs/class/System.Drawing/ChangeLog b/mcs/class/System.Drawing/ChangeLog
index 2d8e9a1e82e..0286e4ac18a 100644
--- a/mcs/class/System.Drawing/ChangeLog
+++ b/mcs/class/System.Drawing/ChangeLog
@@ -1,7 +1,3 @@
-2003-08-24 Duncan Mak <duncan@ximian.com>
-
- * System.Drawing.dll.sources: Add Cairo implementation.
-
2003-07-23 Peter Williams <peter@newton.cx>
* System.Drawing.dll.sources: Add Pens.cs
diff --git a/mcs/class/System.Drawing/System.Drawing.dll.sources b/mcs/class/System.Drawing/System.Drawing.dll.sources
index a2c2a95f906..98ae103902a 100755
--- a/mcs/class/System.Drawing/System.Drawing.dll.sources
+++ b/mcs/class/System.Drawing/System.Drawing.dll.sources
@@ -58,15 +58,6 @@ System.Drawing/impl/ItfPen.cs
System.Drawing/impl/ItfRegion.cs
System.Drawing/impl/ItfSolidBrush.cs
System.Drawing/impl/ItfTextureBrush.cs
-System.Drawing/impl/cairo/Bitmap.cs
-System.Drawing/impl/cairo/Font.cs
-System.Drawing/impl/cairo/FontFamily.cs
-System.Drawing/impl/cairo/Graphics.cs
-System.Drawing/impl/cairo/Image.cs
-System.Drawing/impl/cairo/Pen.cs
-System.Drawing/impl/cairo/SolidBrush.cs
-System.Drawing/impl/cairo/cairo-api.cs
-System.Drawing/impl/cairo/gdk-helpers.cs
System.Drawing/impl/gtk/Bitmap.cs
System.Drawing/impl/gtk/Image.cs
System.Drawing/impl/wine/Bitmap.cs
diff --git a/mcs/class/System.Drawing/System.Drawing/ChangeLog b/mcs/class/System.Drawing/System.Drawing/ChangeLog
index c659253a644..271a8049811 100644
--- a/mcs/class/System.Drawing/System.Drawing/ChangeLog
+++ b/mcs/class/System.Drawing/System.Drawing/ChangeLog
@@ -1,8 +1,3 @@
-2003-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * Color.cs: fixed FromArgb to handle alpha value correctly. Closes
- bug #47727.
-
2003-08-08 Duncan Mak <duncan@ximian.com>
* Graphics.cs (DrawBezier): Fixed.
diff --git a/mcs/class/System.Drawing/System.Drawing/Color.cs b/mcs/class/System.Drawing/System.Drawing/Color.cs
index 0bb005b1426..b0031f7a9fd 100644
--- a/mcs/class/System.Drawing/System.Drawing/Color.cs
+++ b/mcs/class/System.Drawing/System.Drawing/Color.cs
@@ -117,7 +117,7 @@ namespace System.Drawing
public static Color FromArgb (int argb)
{
- return FromArgb ((argb >> 24) & 0x0FF, (argb >> 16) & 0x0FF, (argb >> 8) & 0x0FF, argb & 0x0FF);
+ return FromArgb (argb >> 24, (argb >> 16) & 0x0FF, (argb >> 8) & 0x0FF, argb & 0x0FF);
}
public static Color FromKnownColor (KnownColor knownColorToConvert)
diff --git a/mcs/class/System.Drawing/System.Drawing/Graphics.cs b/mcs/class/System.Drawing/System.Drawing/Graphics.cs
index 14709ff3222..8273275616d 100755
--- a/mcs/class/System.Drawing/System.Drawing/Graphics.cs
+++ b/mcs/class/System.Drawing/System.Drawing/Graphics.cs
@@ -62,7 +62,7 @@ namespace System.Drawing
[MonoTODO]
public void Clear (Color color)
{
- implementation.Clear (color);
+ throw new NotImplementedException ();
}
[MonoTODO]
diff --git a/mcs/class/System.Drawing/System.Drawing/Image.cs b/mcs/class/System.Drawing/System.Drawing/Image.cs
index ce910fd1f74..5019fc4d112 100644
--- a/mcs/class/System.Drawing/System.Drawing/Image.cs
+++ b/mcs/class/System.Drawing/System.Drawing/Image.cs
@@ -104,6 +104,7 @@ internal class InternalImageInfo : IDisposable {
int destinationPixelIncrement = (destPixelFormat == PixelFormat.Format32bppArgb) ? 1 : 0;
int destStride = (Image.GetPixelFormatSize(destPixelFormat) >> 3 ) * imageSize.Width;
+ Console.WriteLine ("Destination stride {0}", destStride);
byte[] temp = new byte [destStride * imageSize.Height];
fixed( byte *psrc = image, pbuf = temp) {
byte* curSrc = psrc;
diff --git a/mcs/class/System.Drawing/System.Drawing/impl/Xr/ChangeLog b/mcs/class/System.Drawing/System.Drawing/impl/Xr/ChangeLog
index 9709217db16..8bb99b3ea6c 100644
--- a/mcs/class/System.Drawing/System.Drawing/impl/Xr/ChangeLog
+++ b/mcs/class/System.Drawing/System.Drawing/impl/Xr/ChangeLog
@@ -1,7 +1,3 @@
-2003-08-24 Duncan Mak <duncan@ximian.com>
-
- * Graphics.cs (FillEllipse): Implemented.
-
2003-08-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* Image.cs: commented out [MonoTODO]'s to fix windows build. Why?
diff --git a/mcs/class/System.Drawing/System.Drawing/impl/Xr/Graphics.cs b/mcs/class/System.Drawing/System.Drawing/impl/Xr/Graphics.cs
index 6a3f4af80ad..f7b489de871 100644
--- a/mcs/class/System.Drawing/System.Drawing/impl/Xr/Graphics.cs
+++ b/mcs/class/System.Drawing/System.Drawing/impl/Xr/Graphics.cs
@@ -299,7 +299,7 @@ namespace System.Drawing
xrPen.SetXrValues (native_object);
Xr.XrMoveTo (native_object, cx + rx, cy);
-
+
// Do an approprimation of the ellipse by drawing a curve in each quatrant
Xr.XrCurveTo (native_object,
cx + rx, cy - C1 * ry,
@@ -1025,52 +1025,28 @@ namespace System.Drawing
throw new NotImplementedException ();
}
+ [MonoTODO]
void IGraphics.FillEllipse (System.Drawing.Brush brush, Rectangle rect)
{
- ((IGraphics) this).FillEllipse (brush, rect.X, rect.Y, rect.Width, rect.Height);
+ throw new NotImplementedException ();
}
+ [MonoTODO]
void IGraphics.FillEllipse (System.Drawing.Brush brush, RectangleF rect)
{
- ((IGraphics) this).FillEllipse (brush, rect.X, rect.Y, rect.Width, rect.Height);
+ throw new NotImplementedException ();
}
+ [MonoTODO]
void IGraphics.FillEllipse (System.Drawing.Brush brush, float x, float y, float width, float height)
- {
- double rx = width / 2;
- double ry = height / 2;
- double cx = x + rx;
- double cy = y + ry;
-
- Brush xrBrush = ConvertBrush (brush);
-// xrBrush.SetXrValues (native_object);
- Xr.XrMoveTo (native_object, cx + rx, cy);
-
- Xr.XrCurveTo (native_object,
- cx + rx, cy - C1 * ry,
- cx + C1 * rx, cy - ry,
- cx, cy - ry);
- Xr.XrCurveTo (native_object,
- cx - C1 * rx, cy - ry,
- cx - rx, cy - C1 * ry,
- cx - rx, cy);
- Xr.XrCurveTo (native_object,
- cx - rx, cy + C1 * ry,
- cx - C1 * rx, cy + ry,
- cx, cy + ry);
- Xr.XrCurveTo (native_object,
- cx + C1 * rx, cy + ry,
- cx + rx, cy + C1 * ry,
- cx + rx, cy);
-
- Xr.XrClosePath (native_object);
-
- Xr.XrFill (native_object);
+ {
+ throw new NotImplementedException ();
}
+ [MonoTODO]
void IGraphics.FillEllipse (System.Drawing.Brush brush, int x, int y, int width, int height)
{
- ((IGraphics) this).FillEllipse (brush, (float) x, (float) y, (float) width, (float) height);
+ throw new NotImplementedException ();
}
[MonoTODO]
diff --git a/mcs/class/System.Drawing/System.Drawing/impl/cairo/Bitmap.cs b/mcs/class/System.Drawing/System.Drawing/impl/cairo/Bitmap.cs
deleted file mode 100644
index e61af54cb84..00000000000
--- a/mcs/class/System.Drawing/System.Drawing/impl/cairo/Bitmap.cs
+++ /dev/null
@@ -1,317 +0,0 @@
-//
-// System.Drawing.Bitmap.cs
-//
-// (C) 2002/3 Ximian, Inc. http://www.ximian.com
-// Author: Christian Meyer <Christian.Meyer@cs.tum.edu>
-// Jason Perkins <jason@379.com>
-// Dennis Hayes <dennish@raytek.com>
-// Alexandre Pigolkine <pigolkine@gmx.de>
-//
-using System;
-using System.IO;
-using System.Runtime.InteropServices;
-using System.Drawing.Imaging;
-
-namespace System.Drawing.Cairo {
-
- internal class BitmapFactory : IBitmapFactory
- {
- public IBitmap Bitmap (int width, int height)
- {
- return new Bitmap (width, height);
- }
-
- public IBitmap Bitmap (int width, int height, System.Drawing.Graphics g)
- {
- return new Bitmap (width, height, (Graphics) g.implementation);
- }
-
- public IBitmap Bitmap (int width, int height, System.Drawing.Imaging.PixelFormat format)
- {
- return new Bitmap (width, height, format);
- }
-
- public IBitmap Bitmap (System.Drawing.Image original, Size newSize)
- {
- return new Bitmap ((System.Drawing.Cairo.Image) original.implementation, newSize);
- }
-
- public IBitmap Bitmap (Stream stream, bool useIcm)
- {
- return new Bitmap (stream);
- }
-
- public IBitmap Bitmap (string filename, bool useIcm)
- {
- return new Bitmap (filename, useIcm);
- }
-
- public IBitmap Bitmap (Type type, string resource)
- {
- return new Bitmap (type, resource);
- }
-
- public IBitmap Bitmap (int width, int height, int stride,
- System.Drawing.Imaging.PixelFormat format, IntPtr scan0)
- {
- return new Bitmap (width, height, stride, format, scan0);
- }
- }
-
- internal sealed class Bitmap : Image, IBitmap {
-
- float horizontalResolution;
- float verticalResolution;
-
- internal void CommonInit (int width, int height)
- {
- CommonInit (width, height, true);
- }
-
- internal void CommonInit (int width, int height, bool allocNativeObject)
- {
- size = new Size (width, height);
- imageFormat = ImageFormat.Bmp;
- switch( pixelFormat) {
- case PixelFormat.Format32bppArgb:
- cairo_format = Format.ARGB32;
- if (allocNativeObject)
- state = Gdk.Pixbuf.New (0, true, 8, width, height);
- break;
- case PixelFormat.Format24bppRgb:
- cairo_format = Format.RGB24;
- if (allocNativeObject)
- state = Gdk.Pixbuf.New (0, true, 8, width, height);
- break;
- default:
- throw new NotImplementedException ();
- }
-
- horizontalResolution = verticalResolution = 96.0F;
- }
-
-#region constructors
- /// <summary>
- /// Constructors
- /// </summary>
-
- internal Bitmap (int width, int height)
- {
- pixelFormat = PixelFormat.Format32bppArgb;
- CommonInit (width, height);
- }
-
- internal Bitmap (int width, int height, Graphics g)
- {
- // TODO: Get pixelFormat from g
- CommonInit (width,height);
- //TODO: use graphics to set vertial and horzontal resolution.
- //TODO: that is all the spec requires or desires
- }
-
- [MonoTODO]
- internal Bitmap (int width, int height, PixelFormat format)
- {
- this.pixelFormat = format;
- CommonInit (width, height);
- }
-
- internal Bitmap (Image origial)
- {
- throw new NotImplementedException ();
- //this.original = original;
- }
-
- unsafe void InitFromStream (Stream stream)
- {
- InternalImageInfo info = System.Drawing.Image.Decode (stream);
- if (info != null) {
- imageFormat = info.RawFormat;
- pixelFormat = info.PixelFormat;
- CommonInit (info.Size.Width, info.Size.Height, false);
- if (pixelFormat == PixelFormat.Format32bppArgb) {
- state = Gdk.Pixbuf.NewFromData (
- info.UnmanagedImagePtr, Gdk.Colorspace.Rgb, true, 8,
- ((IImage) this).Size.Width, ((IImage) this).Size.Height,
- info.Stride, IntPtr.Zero, IntPtr.Zero);
-
- } else if (pixelFormat == PixelFormat.Format24bppRgb) {
- info.ChangePixelFormat (PixelFormat.Format32bppArgb);
- state = Gdk.Pixbuf.NewFromData (
- info.UnmanagedImagePtr, Gdk.Colorspace.Rgb, true, 8,
- ((IImage) this).Size.Width, ((IImage) this).Size.Height,
- info.Stride, IntPtr.Zero, IntPtr.Zero);
-
- } else {
- throw new NotImplementedException();
- }
- // FIXME: It is not safe to dispose the info here
- // Memory leak!!!
- //info.Dispose();
- }
- }
-
- internal Bitmap (Stream stream)
- : this (stream, false)
- {
- }
-
-
- internal Bitmap (string filename)
- : this (filename, false)
- {
- }
-
- internal Bitmap (Image original, Size newSize)
- {
- throw new NotImplementedException ();
- //this.original = original;
- //this.newSize = newSize;
- }
-
- internal Bitmap (Stream stream, bool useIcm)
- {
- InitFromStream(stream);
- }
-
- internal Bitmap (string filename, bool useIcm)
- {
- FileStream file = new FileStream(filename, FileMode.Open);
- InitFromStream(file);
- file.Close();
- }
-
- internal Bitmap (Type type, string resource)
- {
- throw new NotImplementedException ();
- //this.type = type;
- //this.resource = resource;
- }
-
- internal Bitmap (Image original, int width, int heigth)
- {
- throw new NotImplementedException ();
- //this.original = original;
- //this.width = width;
- //this.heigth = heigth;
- }
-
-
- internal Bitmap (
- int width, int height, int stride,
- PixelFormat format, IntPtr scan0)
- {
- throw new NotImplementedException ();
- //this.width = width;
- //this.heigth = heigth;
- //this.stride = stride;
- //this.format = format;
- //this.scan0 = scan0;
- }
-#endregion
-
- // methods
- Color IBitmap.GetPixel (int x, int y)
- {
- throw new NotImplementedException ();
- }
-
- void IBitmap.SetPixel (int x, int y, Color color)
- {
- throw new NotImplementedException ();
- }
- IBitmap IBitmap.Clone (Rectangle rect,PixelFormat format)
- {
- throw new NotImplementedException ();
- }
-
- IBitmap IBitmap.Clone (RectangleF rect, PixelFormat format)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static Bitmap FromHicon (IntPtr hicon) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static Bitmap FromResource (IntPtr hinstance, string bitmapName)
- {
- throw new NotImplementedException ();
- }
-
- IntPtr IBitmap.GetHbitmap ()
- {
- throw new NotImplementedException ();
- }
-
- IntPtr IBitmap.GetHbitmap (Color background)
- {
- throw new NotImplementedException ();
- }
-
- IntPtr IBitmap.GetHicon ()
- {
- throw new NotImplementedException ();
- }
-
-
- [MonoTODO]
- BitmapData IBitmap.LockBits (Rectangle rect, ImageLockMode flags, PixelFormat format)
- {
- throw new NotImplementedException ();
- }
-
- void IBitmap.MakeTransparent ()
- {
- throw new NotImplementedException ();
- }
-
- void IBitmap.MakeTransparent (Color transparentColor)
- {
- throw new NotImplementedException ();
- }
-
- void IBitmap.SetResolution (float xDpi, float yDpi)
- {
- horizontalResolution = xDpi;
- verticalResolution = yDpi;
- }
-
- //Fixme: gtk should be inherited from Image
- PixelFormat IImage.PixelFormat {
- get {
- return pixelFormat;
- }
- }
-
- void IBitmap.UnlockBits (BitmapData bitmapdata)
- {
- // nothing to do!
- }
-
- // properties
- // needs to be done ###FIXME###
-
-
- /// <summary>
- /// Methods
- /// </summary>
- protected override void Dispose (bool disposing)
- {
- if (selected_into_graphics == null)
- Gdk.Pixbuf.Finalize (state);
-
- base.Dispose(disposing);
- }
-
- //FIXME: included with gtk code. should be inherited from Image.
- // [MonoTODO]
- // public override void RotateFlip (RotateFlipType rotateFlipType) {
- // throw new NotImplementedException();
- // }
-
- }
-}
-
diff --git a/mcs/class/System.Drawing/System.Drawing/impl/cairo/ChangeLog b/mcs/class/System.Drawing/System.Drawing/impl/cairo/ChangeLog
deleted file mode 100644
index 004167c89a6..00000000000
--- a/mcs/class/System.Drawing/System.Drawing/impl/cairo/ChangeLog
+++ /dev/null
@@ -1,27 +0,0 @@
-2003-08-24 Duncan Mak <duncan@ximian.com>
-
- * cairo-api.cs: New file, replace Cairo.cs and cairo.cs. That
- naming thing is just too confusing.
-
- * Cairo.cs: Make all references to the enums (Cairo.Foo) be just
- Foo. This should (hopefully) fix the build on Windows.
-
-2003-08-24 Duncan Mak <duncan@ximian.com>
-
- Initial checkin of System.Drawing.XrImpl ported to use Cairo.
-
- * Graphics.cs (DrawCurve):
- (DrawImageUnscaled):
- (IsVisible):Implement the overloads in terms of the other overloads.
-
- (FillClosedCurve): Implement the simple APIs, the default tension
- is 0.5, the default FillMode is FillMode.Alternate.
-
- * cairo.cs: A copy of the CairoAPI class from the Mono.Cairo
- assembly, with some method parameter/return type changed to better
- fit the usage within System.Drawing.
-
- * gdk-helpers.cs: Emulate some of Gdk.Pixbuf's API here,
- basically the same as XrImpl's GDKfunctions.cs, but the names of
- the functions are nicer, with the help of the DllImportAttribute's
- EntryPoint field. \ No newline at end of file
diff --git a/mcs/class/System.Drawing/System.Drawing/impl/cairo/Font.cs b/mcs/class/System.Drawing/System.Drawing/impl/cairo/Font.cs
deleted file mode 100644
index 7b0aadac1f6..00000000000
--- a/mcs/class/System.Drawing/System.Drawing/impl/cairo/Font.cs
+++ /dev/null
@@ -1,162 +0,0 @@
-//
-// System.Drawing.Font.cs
-//
-// Author:
-// Alexandre Pigolkine (pigolkine@gmx.de)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Drawing;
-
-namespace System.Drawing.Cairo {
-
- internal class FontFactory : IFontFactory
- {
-
- IFont IFontFactory.Font (FontFamily family,
- float emSize, FontStyle style,
- GraphicsUnit unit, byte charSet, bool isVertical) {
-
- return new Font (family, emSize, style, unit, charSet, isVertical);
- }
-
- IFont IFontFactory.Font (
- string familyName, float emSize, FontStyle style,
- GraphicsUnit unit, byte charSet, bool isVertical) {
-
- return new Font (familyName, emSize, style, unit, charSet, isVertical);
- }
-
- IFont IFontFactory.FromHfont(IntPtr font) {
- return Win32Impl.Font.FromHfont(font);
- }
- }
-
- internal sealed class Font : MarshalByRefObject, IFont
- {
- FontFamily fontFamily;
- byte gdiCharSet;
- bool gdiVerticalFont;
- int height;
- string name;
- float size;
- float sizeInPoints;
- FontStyle style;
- GraphicsUnit unit;
-
- public void Dispose () {
- }
-
- public static Font FromHfont(IntPtr font)
- {
- //FIXME: how to get those values ?
- Font result = new Font("Arial", (float)12.0, FontStyle.Regular, GraphicsUnit.Point, (byte)0, false);
- return result;
- }
-
- public IntPtr ToHfont () { throw new NotImplementedException(); }
-
- public Font(FontFamily family, float size, FontStyle style, GraphicsUnit unit, byte charSet, bool isVertical){
- fontFamily = family;
- this.size = size;
- this.style = style;
- this.unit = unit;
- this.gdiCharSet = charSet;
- this.gdiVerticalFont = isVertical;
- }
-
- public Font(string familyName, float size, FontStyle style, GraphicsUnit unit, byte charSet, bool isVertical){
- fontFamily = new FontFamily(familyName);
- this.size = size;
- this.style = style;
- this.unit = unit;
- this.gdiCharSet = charSet;
- this.gdiVerticalFont = isVertical;
- }
-
- internal void initialize (IntPtr cr)
- {
- Cairo.cairo_select_font (cr, fontFamily.Name + "--" + size);
- }
-
- public bool Bold {
- get {
- return (style & FontStyle.Bold) == FontStyle.Bold;
- }
- }
-
- public FontFamily FontFamily {
- get {
- return fontFamily;
- }
- }
-
- public byte GdiCharSet {
- get {
- return gdiCharSet;
- }
- }
-
- public bool GdiVerticalFont {
- get {
- return gdiVerticalFont;
- }
- }
-
- public int Height {
- get {
- return height;
- }
- }
-
- public bool Italic {
- get {
- return (style & FontStyle.Italic) == FontStyle.Italic;
- }
- }
-
- public string Name {
- get {
- return name;
- }
- }
-
- public float Size {
- get {
- return size;
- }
- }
-
- public float SizeInPoints {
- get {
- return sizeInPoints;
- }
- }
-
- public bool Strikeout {
- get {
- return (style & FontStyle.Strikeout) == FontStyle.Strikeout;
- }
- }
-
- public FontStyle Style {
- get {
- return style;
- }
- }
-
- public bool Underline {
- get {
- return (style & FontStyle.Underline) == FontStyle.Underline;
- }
- }
-
- public GraphicsUnit Unit {
- get {
- return unit;
- }
- }
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing/impl/cairo/FontFamily.cs b/mcs/class/System.Drawing/System.Drawing/impl/cairo/FontFamily.cs
deleted file mode 100644
index 4db9f1e60f3..00000000000
--- a/mcs/class/System.Drawing/System.Drawing/impl/cairo/FontFamily.cs
+++ /dev/null
@@ -1,92 +0,0 @@
-//
-// System.Drawing.XrImpl.FontFamily.cs
-//
-// Author:
-// Alexandre Pigolkine (pigolkine@gmx.de)
-//
-//
-
-using System;
-using System.Drawing;
-using System.Drawing.Text;
-
-namespace System.Drawing.Cairo {
-
- internal class FontFamilyFactory : IFontFamilyFactory {
-
- IFontFamily IFontFamilyFactory.FontFamily(GenericFontFamilies genericFamily){
- return new CairoFontFamily (genericFamily);
- }
-
- IFontFamily IFontFamilyFactory.FontFamily(string familyName){
- return new CairoFontFamily (familyName);
- }
-
- IFontFamily IFontFamilyFactory.FontFamily( string familyName, FontCollection collection){
- return new CairoFontFamily (familyName,collection);
- }
-
- IFontFamily[] IFontFamilyFactory.GetFamilies(System.Drawing.Graphics graphics) {
- throw new NotImplementedException();
- }
-
- }
-
- internal class CairoFontFamily : MarshalByRefObject, IFontFamily
- {
- string name;
- static CairoFontFamily genericMonospace;
- static CairoFontFamily genericSansSerif;
- static CairoFontFamily genericSerif;
-
- public CairoFontFamily (GenericFontFamilies genericFamily)
- {
- throw new NotImplementedException();
- }
-
- public CairoFontFamily (string familyName)
- {
- name = familyName;
- }
-
- public CairoFontFamily (string familyName, FontCollection collection)
- {
- name = familyName;
- }
-
- public string Name {
- get {
- return name;
- }
- }
-
- public int GetCellAscent (FontStyle style)
- {
- return 0;
- }
-
- public int GetCellDescent (FontStyle style)
- {
- return 0;
- }
-
- public int GetEmHeight (FontStyle style)
- {
- return 0;
- }
-
- public int GetLineSpacing (FontStyle style)
- {
- return 0;
- }
-
- public bool IsStyleAvailable (FontStyle style)
- {
- return false;
- }
-
- public void Dispose()
- {
- }
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing/impl/cairo/Graphics.cs b/mcs/class/System.Drawing/System.Drawing/impl/cairo/Graphics.cs
deleted file mode 100644
index 980c89dc529..00000000000
--- a/mcs/class/System.Drawing/System.Drawing/impl/cairo/Graphics.cs
+++ /dev/null
@@ -1,1718 +0,0 @@
-//v
-// System.Drawing.Bitmap.cs (Cairo implementation)
-//
-// (C) 2003 Ximian, Inc. http://www.ximian.com
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-using System;
-using System.Drawing;
-using System.Drawing.Drawing2D;
-using System.Drawing.Imaging;
-using System.Drawing.Text;
-using System.Runtime.InteropServices;
-
-namespace System.Drawing.Cairo {
-
- internal class GraphicsFactory : IGraphicsFactory {
-
- public System.Drawing.IGraphics Graphics (IntPtr nativeGraphics)
- {
- return new Graphics (nativeGraphics);
- }
-
- public System.Drawing.IGraphics FromImage (System.Drawing.Image image)
- {
- return System.Drawing.Cairo.Graphics.FromImage (image);
- }
-
- public System.Drawing.IGraphics FromHwnd (IntPtr hwnd)
- {
- return System.Drawing.Cairo.Graphics.FromHwnd (hwnd);
- }
- }
-
-
- [ComVisible (false)]
- internal sealed class Graphics : MarshalByRefObject, IGraphics
- {
- public delegate bool EnumerateMetafileProc (EmfPlusRecordType recordType,
- int flags,
- int dataSize,
- IntPtr data,
- PlayRecordCallback callbackData);
-
- public delegate bool DrawImageAbort (IntPtr callbackData);
-
- internal enum GraphicsType {
- FromHDC, FromHwnd, FromImage
- };
-
- internal GraphicsType type;
- internal IntPtr state = IntPtr.Zero;
-
- internal IntPtr initial_hwnd = IntPtr.Zero;
- internal System.Drawing.Cairo.Image initialized_from_image = null;
-
- internal const double C1 = 0.552; // this is some *magic* number
-
- internal Graphics (IntPtr nativeGraphics)
- {
- state = nativeGraphics;
- }
-
-#region Converters
- internal static Pen ConvertPen (System.Drawing.Pen pen)
- {
- return pen.implementation as System.Drawing.Cairo.Pen;
- }
-
- internal static Brush ConvertBrush (System.Drawing.Brush brush)
- {
- return brush.implementation as Brush;
- }
-
- internal static Image ConvertImage (System.Drawing.Image image)
- {
- return image.implementation as System.Drawing.Cairo.Image;
- }
-
- internal static Font ConvertFont (System.Drawing.Font font)
- {
- return font.implementation as System.Drawing.Cairo.Font;
- }
-#endregion
-
- [MonoTODO]
- void IGraphics.AddMetafileComment (byte [] data)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- GraphicsContainer IGraphics.BeginContainer ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- GraphicsContainer IGraphics.BeginContainer (Rectangle dstrect, Rectangle srcrect, GraphicsUnit unit)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- GraphicsContainer IGraphics.BeginContainer (RectangleF dstrect, RectangleF srcrect, GraphicsUnit unit)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.Clear (Color color)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IDisposable.Dispose ()
- {
- switch (type) {
- case GraphicsType.FromHwnd:
- break;
- case GraphicsType.FromHDC:
- break;
- case GraphicsType.FromImage:
- Cairo.cairo_destroy (state);
- break;
- }
- }
-
- void IGraphics.DrawArc (System.Drawing.Pen pen, Rectangle rect, float startAngle, float sweepAngle)
- {
- ((IGraphics) this).DrawArc (pen, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle);
- }
-
- void IGraphics.DrawArc (System.Drawing.Pen pen, RectangleF rect, float startAngle, float sweepAngle)
- {
- ((IGraphics) this).DrawArc (pen, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle);
- }
-
- [MonoTODO]
- void IGraphics.DrawArc (System.Drawing.Pen pen,
- float x, float y, float width, float height, float startAngle, float sweepAngle)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.DrawArc (System.Drawing.Pen pen,
- int x, int y, int width, int height, int startAngle, int sweepAngle)
- {
- throw new NotImplementedException ();
- }
-
- void IGraphics.DrawBezier (System.Drawing.Pen pen, PointF pt1, PointF pt2, PointF pt3, PointF pt4)
- {
- ((IGraphics) this).DrawBezier (pen, pt1.X, pt1.Y, pt2.X, pt2.Y, pt3.X, pt3.Y, pt4.X, pt4.Y);
- }
-
- void IGraphics.DrawBezier (System.Drawing.Pen pen, Point pt1, Point pt2, Point pt3, Point pt4)
- {
- ((IGraphics) this).DrawBezier (pen, pt1.X, pt1.Y, pt2.X, pt2.Y, pt3.X, pt3.Y, pt4.X, pt4.Y);
- }
-
- void IGraphics.DrawBezier (System.Drawing.Pen pen, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4)
- {
- Pen cPen = ConvertPen (pen);
- cPen.initialize (state);
-
- Cairo.cairo_move_to (state, x1, y1);
- Cairo.cairo_curve_to (state, x2, y2, x3, y3, x4, y4);
-
- Cairo.cairo_stroke (state);
- }
-
- void IGraphics.DrawBeziers (System.Drawing.Pen pen, Point [] points)
- {
- Pen cPen = ConvertPen (pen);
- cPen.initialize (state);
-
- Cairo.cairo_move_to (state, points [0].X, points [0].Y);
-
- for (int i = 1; i < points.Length; i += 3)
- Cairo.cairo_curve_to (
- state,
- points [i].X, points [i].Y,
- points [i + 1].X, points [i + 1].Y,
- points [i + 2].X, points [i + 2].Y);
-
- Cairo.cairo_stroke (state);
- }
-
- void IGraphics.DrawBeziers (System.Drawing.Pen pen, PointF [] points)
- {
- Pen cPen = ConvertPen (pen);
- cPen.initialize (state);
-
- Cairo.cairo_move_to (state, points [0].X, points [0].Y);
-
- for (int i = 1; i < points.Length; i += 3)
- Cairo.cairo_curve_to (
- state,
- points [i].X, points [i].Y,
- points [i + 1].X, points [i + 1].Y,
- points [i + 2].X, points [i + 2].Y);
-
- Cairo.cairo_stroke (state);
- }
-
- [MonoTODO]
- void IGraphics.DrawClosedCurve (System.Drawing.Pen pen, PointF [] points)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.DrawClosedCurve (System.Drawing.Pen pen, Point [] points)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.DrawClosedCurve (System.Drawing.Pen pen, Point [] points, float tension, FillMode fillmode)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.DrawClosedCurve (System.Drawing.Pen pen, PointF [] points, float tension, FillMode fillmode)
- {
- throw new NotImplementedException ();
- }
-
- void IGraphics.DrawCurve (System.Drawing.Pen pen, Point [] points)
- {
- ((IGraphics) this).DrawCurve (pen, points, 0.5f);
- }
-
- [MonoTODO]
- void IGraphics.DrawCurve (System.Drawing.Pen pen, PointF [] points)
- {
- ((IGraphics) this).DrawCurve (pen, points, 0.5f);
- }
-
- [MonoTODO]
- void IGraphics.DrawCurve (System.Drawing.Pen pen, PointF [] points, float tension)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.DrawCurve (System.Drawing.Pen pen, Point [] points, float tension)
- {
- throw new NotImplementedException ();
- }
-
- void IGraphics.DrawCurve (System.Drawing.Pen pen, PointF [] points, int offset, int numberOfSegments)
- {
- ((IGraphics) this).DrawCurve (pen, points, offset, numberOfSegments, 0.5f);
- }
-
- [MonoTODO]
- void IGraphics.DrawCurve (System.Drawing.Pen pen, Point [] points, int offset, int numberOfSegments, float tension)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.DrawCurve (System.Drawing.Pen pen, PointF [] points, int offset, int numberOfSegments, float tension)
- {
- throw new NotImplementedException ();
- }
-
- void IGraphics.DrawEllipse (System.Drawing.Pen pen, Rectangle rect)
- {
- ((IGraphics) this).DrawEllipse (pen, rect.X, rect.Y, rect.Width, rect.Height);
- }
-
- void IGraphics.DrawEllipse (System.Drawing.Pen pen, RectangleF rect)
- {
- ((IGraphics) this).DrawEllipse (pen, rect.X, rect.Y, rect.Width, rect.Height);
- }
-
- void IGraphics.DrawEllipse (System.Drawing.Pen pen, int x, int y, int width, int height)
- {
- ((IGraphics) this).DrawEllipse (pen, (float) x, (float) y, (float) width, (float) height);
- }
-
- void IGraphics.DrawEllipse (System.Drawing.Pen pen, float x, float y, float width, float height)
- {
- double rx = width / 2;
- double ry = height / 2;
- double cx = x + rx;
- double cy = y + ry;
-
- Pen cPen = ConvertPen (pen);
-
- cPen.initialize (state);
- Cairo.cairo_move_to (state, cx + rx, cy);
-
- // Do an approprimation of the ellipse by drawing a curve in each quatrant
- Cairo.cairo_curve_to (
- state,
- cx + rx, cy - C1 * ry,
- cx + C1 * rx, cy - ry,
- cx, cy - ry);
- Cairo.cairo_curve_to (
- state,
- cx - C1 * rx, cy - ry,
- cx - rx, cy - C1 * ry,
- cx - rx, cy);
- Cairo.cairo_curve_to (
- state,
- cx - rx, cy + C1 * ry,
- cx - C1 * rx, cy + ry,
- cx, cy + ry);
- Cairo.cairo_curve_to (
- state,
- cx + C1 * rx, cy + ry,
- cx + rx, cy + C1 * ry,
- cx + rx, cy);
-
- Cairo.cairo_close_path (state);
- Cairo.cairo_stroke (state);
- }
-
- [MonoTODO]
- void IGraphics.DrawIcon (System.Drawing.Icon icon, Rectangle targetRect)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.DrawIcon (System.Drawing.Icon icon, int x, int y)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.DrawIconUnstretched (System.Drawing.Icon icon, Rectangle targetRect)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.DrawImage (System.Drawing.Image image, RectangleF rect)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.DrawImage (System.Drawing.Image image, PointF point)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.DrawImage (System.Drawing.Image image, Point [] destPoints)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.DrawImage (System.Drawing.Image image, Point point)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.DrawImage (System.Drawing.Image image, Rectangle rect)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.DrawImage (System.Drawing.Image image, PointF [] destPoints)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.DrawImage (System.Drawing.Image image, int x, int y)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.DrawImage (System.Drawing.Image image, float x, float y)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.DrawImage (System.Drawing.Image image, Rectangle destRect, Rectangle srcRect, GraphicsUnit srcUnit)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.DrawImage (System.Drawing.Image image, RectangleF destRect, RectangleF srcRect, GraphicsUnit srcUnit)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.DrawImage (System.Drawing.Image image, Point [] destPoints, Rectangle srcRect, GraphicsUnit srcUnit)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.DrawImage (System.Drawing.Image image, PointF [] destPoints, RectangleF srcRect, GraphicsUnit srcUnit)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.DrawImage (System.Drawing.Image image, Point [] destPoints, Rectangle srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttr)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.DrawImage (System.Drawing.Image image, float x, float y, float width, float height)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.DrawImage (System.Drawing.Image image, PointF [] destPoints, RectangleF srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttr)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.DrawImage (System.Drawing.Image image, int x, int y, Rectangle srcRect, GraphicsUnit srcUnit)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.DrawImage (System.Drawing.Image image, int x, int y, int width, int height)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.DrawImage (System.Drawing.Image image, float x, float y, RectangleF srcRect, GraphicsUnit srcUnit)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.DrawImage (System.Drawing.Image image, PointF [] destPoints, RectangleF srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttr, System.Drawing.Graphics.DrawImageAbort callback)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.DrawImage (System.Drawing.Image image, Point [] destPoints, Rectangle srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttr, System.Drawing.Graphics.DrawImageAbort callback)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.DrawImage (System.Drawing.Image image, Point [] destPoints, Rectangle srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttr, System.Drawing.Graphics.DrawImageAbort callback, int callbackData)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.DrawImage (System.Drawing.Image image, Rectangle destRect, float srcX, float srcY, float srcWidth, float srcHeight, GraphicsUnit srcUnit)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.DrawImage (System.Drawing.Image image, PointF [] destPoints, RectangleF srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttr, System.Drawing.Graphics.DrawImageAbort callback, int callbackData)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.DrawImage (System.Drawing.Image image, Rectangle destRect, int srcX, int srcY, int srcWidth, int srcHeight, GraphicsUnit srcUnit)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.DrawImage (System.Drawing.Image image, Rectangle destRect, float srcX, float srcY, float srcWidth, float srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttrs)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.DrawImage (System.Drawing.Image image, Rectangle destRect, int srcX, int srcY, int srcWidth, int srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttr)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.DrawImage (System.Drawing.Image image, Rectangle destRect, int srcX, int srcY, int srcWidth, int srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttr, System.Drawing.Graphics.DrawImageAbort callback)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.DrawImage (System.Drawing.Image image, Rectangle destRect, float srcX, float srcY, float srcWidth, float srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttrs, System.Drawing.Graphics.DrawImageAbort callback)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.DrawImage (System.Drawing.Image image, Rectangle destRect, float srcX, float srcY, float srcWidth, float srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttrs, System.Drawing.Graphics.DrawImageAbort callback, IntPtr callbackData)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.DrawImage (System.Drawing.Image image, Rectangle destRect, int srcX, int srcY, int srcWidth, int srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttrs, System.Drawing.Graphics.DrawImageAbort callback, IntPtr callbackData)
- {
- throw new NotImplementedException ();
- }
-
- void IGraphics.DrawImageUnscaled (System.Drawing.Image image, Point point)
- {
- ((IGraphics) this).DrawImageUnscaled (image, point.X, point.Y);
- }
-
- void IGraphics.DrawImageUnscaled (System.Drawing.Image image, Rectangle rect)
- {
- ((IGraphics) this).DrawImageUnscaled (image, rect.X, rect.Y, rect.Width, rect.Height);
- }
-
- [MonoTODO]
- void IGraphics.DrawImageUnscaled (System.Drawing.Image image, int x, int y)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.DrawImageUnscaled (System.Drawing.Image image, int x, int y, int width, int height)
- {
- throw new NotImplementedException ();
- }
-
- void DrawLine (Pen cPen, float x1, float y1, float x2, float y2)
- {
- cPen.initialize (state);
- Cairo.cairo_move_to (state, (double) x1, (double) y1);
- Cairo.cairo_line_to (state, (double) x2, (double) y2);
- Cairo.cairo_stroke (state);
- }
-
- [MonoTODO]
- void IGraphics.DrawLine (System.Drawing.Pen pen, PointF pt1, PointF pt2)
- {
- DrawLine (ConvertPen (pen), pt1.X, pt1.Y, pt2.X, pt2.Y);
- }
-
- [MonoTODO]
- void IGraphics.DrawLine (System.Drawing.Pen pen, Point pt1, Point pt2)
- {
- DrawLine (ConvertPen (pen),
- (float) pt1.X, (float) pt1.Y,
- (float) pt2.X, (float) pt2.Y);
- }
-
- [MonoTODO]
- void IGraphics.DrawLine (System.Drawing.Pen pen, int x1, int y1, int x2, int y2)
- {
- DrawLine (ConvertPen (pen),
- (float) x1, (float) y1,
- (float) x2, (float) y2);
- }
-
- [MonoTODO]
- void IGraphics.DrawLine (System.Drawing.Pen pen, float x1, float y1, float x2, float y2)
- {
- DrawLine (ConvertPen (pen), x1, y1, x2, y2);
- }
-
- [MonoTODO]
- void IGraphics.DrawLines (System.Drawing.Pen pen, PointF [] points)
- {
- if (points.Length == 0)
- return;
-
- Pen cPen = ConvertPen (pen);
- cPen.initialize (state);
- Cairo.cairo_move_to (state, (double) points [0].X, (double) points [0].Y);
-
- if (points.Length == 1)
- Cairo.cairo_line_to (state, (double) points [0].X, (double) points [0].Y);
-
- else
- for (int i = 1; i < points.Length; i++)
- Cairo.cairo_line_to (state, (double) points [i].X, (double) points [i].Y);
-
- Cairo.cairo_stroke (state);
- }
-
- [MonoTODO]
- void IGraphics.DrawLines (System.Drawing.Pen pen, Point [] points)
- {
- if (points.Length == 0)
- return;
-
- PointF [] pointsf = new PointF [points.Length];
-
- for (int i = 0; i < points.Length; i++)
- pointsf [i] = new PointF (points [i].X, points [i].Y);
-
- ((IGraphics) this).DrawLines (pen, pointsf);
- }
-
- [MonoTODO]
- void IGraphics.DrawPath (System.Drawing.Pen pen, GraphicsPath path)
- {
- throw new NotImplementedException ();
- }
-
- void IGraphics.DrawPie (System.Drawing.Pen pen, Rectangle rect, float startAngle, float sweepAngle)
- {
- ((IGraphics) this).DrawPie (pen, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle);
- }
-
- void IGraphics.DrawPie (System.Drawing.Pen pen, RectangleF rect, float startAngle, float sweepAngle)
- {
- ((IGraphics) this).DrawPie (pen, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle);
- }
-
- [MonoTODO]
- void IGraphics.DrawPie (System.Drawing.Pen pen, float x, float y, float width, float height, float startAngle, float sweepAngle)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.DrawPie (System.Drawing.Pen pen, int x, int y, int width, int height, int startAngle, int sweepAngle)
- {
- throw new NotImplementedException ();
- }
-
- void IGraphics.DrawPolygon (System.Drawing.Pen pen, Point [] points)
- {
- Pen cPen = ConvertPen (pen);
-
- cPen.initialize (state);
- Cairo.cairo_move_to (state, (double) points [0].X, (double) points [0].Y);
-
- for (int i = 1; i < points.Length; i ++)
- Cairo.cairo_line_to (state, (double) points [i].X, (double) points [i].Y);
-
- Cairo.cairo_close_path (state);
- Cairo.cairo_stroke (state);
- }
-
- void IGraphics.DrawPolygon (System.Drawing.Pen pen, PointF [] points)
- {
- Pen cPen = ConvertPen (pen);
-
- cPen.initialize (state);
-
- for (int i = 0; i < points.Length; i += 2)
- ((IGraphics) this).DrawLine (pen, points [i], points [i + 1]);
-
- Cairo.cairo_close_path (state);
- Cairo.cairo_stroke (state);
- }
-
- void IGraphics.DrawRectangle (System.Drawing.Pen pen, Rectangle rect)
- {
- DrawRectangle (
- ConvertPen (pen),
- (double) rect.Left, (double) rect.Top,
- (double) rect.Width, (double)rect.Height);
- }
-
- [MonoTODO]
- void IGraphics.DrawRectangle (System.Drawing.Pen pen, float x, float y, float width, float height)
- {
- DrawRectangle (
- ConvertPen (pen),
- (double) x, (double) y,
- (double) width, (double) height);
- }
-
- void DrawRectangle (Pen cPen, double x, double y, double width, double height)
- {
- cPen.initialize (state);
-
- Cairo.cairo_move_to (state, x, y);
- Cairo.cairo_line_to (state, x + width, y);
- Cairo.cairo_line_to (state, x + width, y + height);
- Cairo.cairo_line_to (state, x, y + height);
- Cairo.cairo_line_to (state, x, y);
- Cairo.cairo_stroke (state);
- }
-
- void IGraphics.DrawRectangle (System.Drawing.Pen pen, int x, int y, int width, int height)
- {
- DrawRectangle (
- ConvertPen (pen),
- (double) x, (double) y,
- (double) width, (double) height);
- }
-
- void IGraphics.DrawRectangles (System.Drawing.Pen pen, RectangleF [] rects)
- {
- foreach (RectangleF rc in rects)
- DrawRectangle (
- ConvertPen (pen),
- (double) rc.Left, (double) rc.Top,
- (double) rc.Width, (double) rc.Height);
- }
-
- void IGraphics.DrawRectangles (System.Drawing.Pen pen, Rectangle [] rects)
- {
- foreach (RectangleF rc in rects)
- DrawRectangle (
- ConvertPen (pen),
- (double) rc.Left, (double) rc.Top,
- (double) rc.Width, (double) rc.Height);
- }
-
- [MonoTODO]
- void IGraphics.DrawString (string s, System.Drawing.Font font, System.Drawing.Brush brush, RectangleF layoutRectangle)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.DrawString (string s, System.Drawing.Font font, System.Drawing.Brush brush, PointF point)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.DrawString (string s, System.Drawing.Font font, System.Drawing.Brush brush, PointF point, StringFormat format)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.DrawString (string s, System.Drawing.Font font, System.Drawing.Brush brush, RectangleF layoutRectangle, StringFormat format)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.DrawString (string s, System.Drawing.Font font, System.Drawing.Brush brush, float x, float y)
- {
- Font cFont = ConvertFont (font);
- cFont.initialize (state);
- Brush cBrush = ConvertBrush (brush);
- if (cBrush is SolidBrush) {
- SolidBrush cSolidBrush = cBrush as SolidBrush;
- cSolidBrush.initialize (state);
- Cairo.cairo_move_to (state, (double) x, (double) y);
- Cairo.cairo_show_text (state, s);
- }
- }
-
- [MonoTODO]
- void IGraphics.DrawString (string s, System.Drawing.Font font, System.Drawing.Brush brush, float x, float y, StringFormat format)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.EndContainer (GraphicsContainer container)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.EnumerateMetafile (Metafile metafile, Point [] destPoints, System.Drawing.Graphics.EnumerateMetafileProc callback)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.EnumerateMetafile (Metafile metafile, RectangleF destRect, System.Drawing.Graphics.EnumerateMetafileProc callback)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.EnumerateMetafile (Metafile metafile, PointF [] destPoints, System.Drawing.Graphics.EnumerateMetafileProc callback)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.EnumerateMetafile (Metafile metafile, Rectangle destRect, System.Drawing.Graphics.EnumerateMetafileProc callback)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.EnumerateMetafile (Metafile metafile, Point destPoint, System.Drawing.Graphics.EnumerateMetafileProc callback)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.EnumerateMetafile (Metafile metafile, PointF destPoint, System.Drawing.Graphics.EnumerateMetafileProc callback)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.EnumerateMetafile (Metafile metafile, PointF destPoint, System.Drawing.Graphics.EnumerateMetafileProc callback, IntPtr callbackData)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.EnumerateMetafile (Metafile metafile, Rectangle destRect, System.Drawing.Graphics.EnumerateMetafileProc callback, IntPtr callbackData)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.EnumerateMetafile (Metafile metafile, PointF [] destPoints, System.Drawing.Graphics.EnumerateMetafileProc callback, IntPtr callbackData)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.EnumerateMetafile (Metafile metafile, Point destPoint, System.Drawing.Graphics.EnumerateMetafileProc callback, IntPtr callbackData)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.EnumerateMetafile (Metafile metafile, Point [] destPoints, System.Drawing.Graphics.EnumerateMetafileProc callback, IntPtr callbackData)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.EnumerateMetafile (Metafile metafile, RectangleF destRect, System.Drawing.Graphics.EnumerateMetafileProc callback, IntPtr callbackData)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.EnumerateMetafile (Metafile metafile, PointF destPoint, RectangleF srcRect, GraphicsUnit srcUnit, System.Drawing.Graphics.EnumerateMetafileProc callback)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.EnumerateMetafile (Metafile metafile, Point destPoint, Rectangle srcRect, GraphicsUnit srcUnit, System.Drawing.Graphics.EnumerateMetafileProc callback)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.EnumerateMetafile (Metafile metafile, PointF [] destPoints, RectangleF srcRect, GraphicsUnit srcUnit, System.Drawing.Graphics.EnumerateMetafileProc callback)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.EnumerateMetafile (Metafile metafile, Point [] destPoints, Rectangle srcRect, GraphicsUnit srcUnit, System.Drawing.Graphics.EnumerateMetafileProc callback)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.EnumerateMetafile (Metafile metafile, RectangleF destRect, RectangleF srcRect, GraphicsUnit srcUnit, System.Drawing.Graphics.EnumerateMetafileProc callback)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.EnumerateMetafile (Metafile metafile, Rectangle destRect, Rectangle srcRect, GraphicsUnit srcUnit, System.Drawing.Graphics.EnumerateMetafileProc callback)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.EnumerateMetafile (Metafile metafile, RectangleF destRect, System.Drawing.Graphics.EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.EnumerateMetafile (Metafile metafile, Point destPoint, System.Drawing.Graphics.EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.EnumerateMetafile (Metafile metafile, PointF destPoint, System.Drawing.Graphics.EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.EnumerateMetafile (Metafile metafile, Point [] destPoints, System.Drawing.Graphics.EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.EnumerateMetafile (Metafile metafile, PointF [] destPoints, System.Drawing.Graphics.EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.EnumerateMetafile (Metafile metafile, Rectangle destRect, System.Drawing.Graphics.EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.EnumerateMetafile (Metafile metafile, Rectangle destRect, Rectangle srcRect, GraphicsUnit srcUnit, System.Drawing.Graphics.EnumerateMetafileProc callback, IntPtr callbackData)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.EnumerateMetafile (Metafile metafile, PointF [] destPoints, RectangleF srcRect, GraphicsUnit srcUnit, System.Drawing.Graphics.EnumerateMetafileProc callback, IntPtr callbackData)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.EnumerateMetafile (Metafile metafile, RectangleF destRect, RectangleF srcRect, GraphicsUnit srcUnit, System.Drawing.Graphics.EnumerateMetafileProc callback, IntPtr callbackData)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.EnumerateMetafile (Metafile metafile, PointF destPoint, RectangleF srcRect, GraphicsUnit srcUnit, System.Drawing.Graphics.EnumerateMetafileProc callback, IntPtr callbackData)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.EnumerateMetafile (Metafile metafile, Point destPoint, Rectangle srcRect, GraphicsUnit srcUnit, System.Drawing.Graphics.EnumerateMetafileProc callback, IntPtr callbackData)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.EnumerateMetafile (Metafile metafile, Point [] destPoints, Rectangle srcRect, GraphicsUnit srcUnit, System.Drawing.Graphics.EnumerateMetafileProc callback, IntPtr callbackData)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.EnumerateMetafile (Metafile metafile, Point [] destPoints, Rectangle srcRect, GraphicsUnit unit, System.Drawing.Graphics.EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.EnumerateMetafile (Metafile metafile, Rectangle destRect, Rectangle srcRect, GraphicsUnit unit, System.Drawing.Graphics.EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.EnumerateMetafile (Metafile metafile, Point destPoint, Rectangle srcRect, GraphicsUnit unit, System.Drawing.Graphics.EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.EnumerateMetafile (Metafile metafile, RectangleF destRect, RectangleF srcRect, GraphicsUnit unit, System.Drawing.Graphics.EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.EnumerateMetafile (Metafile metafile, PointF [] destPoints, RectangleF srcRect, GraphicsUnit unit, System.Drawing.Graphics.EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.EnumerateMetafile (Metafile metafile, PointF destPoint, RectangleF srcRect, GraphicsUnit unit, System.Drawing.Graphics.EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.ExcludeClip (Rectangle rect)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.ExcludeClip (System.Drawing.Region region)
- {
- throw new NotImplementedException ();
- }
-
- void IGraphics.FillClosedCurve (System.Drawing.Brush brush, PointF [] points)
- {
- ((IGraphics) this).FillClosedCurve (brush, points, FillMode.Alternate, 0.5f);
- }
-
- void IGraphics.FillClosedCurve (System.Drawing.Brush brush, Point [] points)
- {
- ((IGraphics) this).FillClosedCurve (brush, points, FillMode.Alternate, 0.5f);
- }
-
- void IGraphics.FillClosedCurve (System.Drawing.Brush brush, PointF [] points, FillMode fillmode)
- {
- ((IGraphics) this).FillClosedCurve (brush, points, fillmode, 0.5f);
- }
-
- void IGraphics.FillClosedCurve (System.Drawing.Brush brush, Point [] points, FillMode fillmode)
- {
- ((IGraphics) this).FillClosedCurve (brush, points, fillmode, 0.5f);
- }
-
- [MonoTODO]
- void IGraphics.FillClosedCurve (System.Drawing.Brush brush, PointF [] points, FillMode fillmode, float tension)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.FillClosedCurve (System.Drawing.Brush brush, Point [] points, FillMode fillmode, float tension)
- {
- throw new NotImplementedException ();
- }
-
- void IGraphics.FillEllipse (System.Drawing.Brush brush, Rectangle rect)
- {
- ((IGraphics) this).FillEllipse (brush, rect.X, rect.Y, rect.Width, rect.Height);
- }
-
- void IGraphics.FillEllipse (System.Drawing.Brush brush, RectangleF rect)
- {
- ((IGraphics) this).FillEllipse (brush, rect.X, rect.Y, rect.Width, rect.Height);
- }
-
- void IGraphics.FillEllipse (System.Drawing.Brush brush, float x, float y, float width, float height)
- {
- double rx = width / 2;
- double ry = height / 2;
- double cx = x + rx;
- double cy = y + ry;
-
- Brush cBrush = ConvertBrush (brush);
- // cBrush.initialize (state);
- Cairo.cairo_move_to (state, cx + rx, cy);
-
- Cairo.cairo_curve_to (
- state,
- cx + rx, cy - C1 * ry,
- cx + C1 * rx, cy - ry,
- cx, cy - ry);
-
- Cairo.cairo_curve_to (
- state,
- cx - C1 * rx, cy - ry,
- cx - rx, cy - C1 * ry,
- cx - rx, cy);
-
- Cairo.cairo_curve_to (
- state,
- cx - rx, cy + C1 * ry,
- cx - C1 * rx, cy + ry,
- cx, cy + ry);
-
- Cairo.cairo_curve_to (
- state,
- cx + C1 * rx, cy + ry,
- cx + rx, cy + C1 * ry,
- cx + rx, cy);
-
- Cairo.cairo_close_path (state);
-
- Cairo.cairo_fill (state);
- }
-
- void IGraphics.FillEllipse (System.Drawing.Brush brush, int x, int y, int width, int height)
- {
- ((IGraphics) this).FillEllipse (brush, (float) x, (float) y, (float) width, (float) height);
- }
-
- [MonoTODO]
- void IGraphics.FillPath (System.Drawing.Brush brush, GraphicsPath path)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.FillPie (System.Drawing.Brush brush, Rectangle rect, float startAngle, float sweepAngle)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.FillPie (System.Drawing.Brush brush, int x, int y, int width, int height, int startAngle, int sweepAngle)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.FillPie (System.Drawing.Brush brush, float x, float y, float width, float height, float startAngle, float sweepAngle)
- {
- throw new NotImplementedException ();
- }
-
- void IGraphics.FillPolygon (System.Drawing.Brush brush, PointF [] points)
- {
- ((IGraphics) this).FillPolygon (brush, points, FillMode.Alternate);
- }
-
- void IGraphics.FillPolygon (System.Drawing.Brush brush, Point [] points)
- {
- ((IGraphics) this).FillPolygon (brush, points, FillMode.Alternate);
- }
-
- [MonoTODO]
- void IGraphics.FillPolygon (System.Drawing.Brush brush, Point [] points, FillMode fillMode)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.FillPolygon (System.Drawing.Brush brush, PointF [] points, FillMode fillMode)
- {
- throw new NotImplementedException ();
- }
-
- void IGraphics.FillRectangle (System.Drawing.Brush brush, RectangleF rect)
- {
- FillRectangle (ConvertBrush (brush), rect.Left, rect.Top, rect.Width, rect.Height);
- }
-
- void IGraphics.FillRectangle (System.Drawing.Brush brush, Rectangle rect)
- {
- FillRectangle (
- ConvertBrush (brush),
- (float) rect.Left, (float) rect.Top,
- (float) rect.Width, (float) rect.Height);
- }
-
- void FillRectangle (Brush brush, RectangleF rect)
- {
- FillRectangle (brush, rect.Left, rect.Top, rect.Width, rect.Height);
- }
-
- void FillRectangle (Brush brush, Rectangle rect)
- {
- FillRectangle (
- brush,
- (float) rect.Left, (float) rect.Top,
- (float) rect.Width, (float) rect.Height);
- }
-
- void FillRectangle (Brush brush, float x, float y, float width, float height)
- {
- if (brush is SolidBrush) {
- SolidBrush cBrush = brush as SolidBrush;
- cBrush.initialize (state);
- Cairo.cairo_rectangle (state, x, y, width, height);
- Cairo.cairo_fill (state);
- }
- }
-
- void IGraphics.FillRectangle (System.Drawing.Brush brush, int x, int y, int width, int height)
- {
- FillRectangle (brush, (float)x, (float)y, (float)width, (float)height);
- }
-
- void IGraphics.FillRectangle (System.Drawing.Brush brush, float x, float y, float width, float height)
- {
- FillRectangle (ConvertBrush (brush), x, y, width, height);
- }
-
- [MonoTODO]
- void IGraphics.FillRectangles (System.Drawing.Brush brush, Rectangle [] rects)
- {
- if (rects == null)
- return;
-
- foreach (Rectangle rc in rects)
- FillRectangle (ConvertBrush (brush), rc);
- }
-
- [MonoTODO]
- void IGraphics.FillRectangles (System.Drawing.Brush brush, RectangleF [] rects)
- {
- if (rects == null)
- return;
-
- foreach (RectangleF rc in rects)
- FillRectangle (ConvertBrush (brush), rc);
- }
-
- [MonoTODO]
- void IGraphics.FillRegion (System.Drawing.Brush brush, System.Drawing.Region region)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.Flush ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.Flush (FlushIntention intention)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static Graphics FromHdc (IntPtr hdc)
- {
- Graphics result = new Graphics (hdc);
- result.type = GraphicsType.FromHDC;
- return result;
- }
-
- [MonoTODO]
- public static Graphics FromHdc (IntPtr hdc, IntPtr hdevice)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static Graphics FromHdcInternal (IntPtr hdc)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static Graphics FromHwnd (IntPtr hwnd)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static Graphics FromHwndInternal (IntPtr hwnd)
- {
- throw new NotImplementedException ();
- }
-
- // TODO
- [MonoTODO]
- public static Graphics FromImage (System.Drawing.Image image)
- {
- System.Drawing.Cairo.Image cairo_image = ConvertImage (image);
- IntPtr native = Cairo.cairo_create ();
- Graphics result = new Graphics (native);
-
- Cairo.cairo_set_target_image (native,
- Gdk.Pixbuf.GetPixels (cairo_image.state),
- cairo_image.cairo_format,
- ((IImage) cairo_image).Width, ((IImage) cairo_image).Height,
- Gdk.Pixbuf.GetRowstride (cairo_image.state));
-
- cairo_image.selected_into_graphics = result;
- result.initialized_from_image = cairo_image;
- result.type = GraphicsType.FromImage;
- return result;
- }
-
- [MonoTODO]
- public static IntPtr GetHalftonePalette ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public IntPtr GetHdc ()
- {
- return state;
- }
-
- [MonoTODO]
- public Color GetNearestColor (Color color)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.IntersectClip (System.Drawing.Region region)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.IntersectClip (RectangleF rect)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.IntersectClip (Rectangle rect)
- {
- throw new NotImplementedException ();
- }
-
- public bool IsVisible (Point point)
- {
- return IsVisible (point.X, point.Y);
- }
-
- public bool IsVisible (RectangleF rect)
- {
- return IsVisible (rect.X, rect.Y, rect.Width, rect.Height);
- }
-
- public bool IsVisible (PointF point)
- {
- return IsVisible (point.X, point.Y);
- }
-
- public bool IsVisible (Rectangle rect)
- {
- return IsVisible (rect.X, rect.Y, rect.Width, rect.Height);
- }
-
- [MonoTODO]
- public bool IsVisible (float x, float y)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public bool IsVisible (int x, int y)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public bool IsVisible (float x, float y, float width, float height)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public bool IsVisible (int x, int y, int width, int height)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public System.Drawing.Region [] MeasureCharacterRanges (string text, System.Drawing.Font font, RectangleF layoutRect, StringFormat stringFormat)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public SizeF MeasureString (string text, System.Drawing.Font font)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public SizeF MeasureString (string text, System.Drawing.Font font, SizeF layoutArea)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public SizeF MeasureString (string text, System.Drawing.Font font, int width)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public SizeF MeasureString (string text, System.Drawing.Font font, SizeF layoutArea, StringFormat stringFormat)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public SizeF MeasureString (string text, System.Drawing.Font font, int width, StringFormat format)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public SizeF MeasureString (string text, System.Drawing.Font font, PointF origin, StringFormat stringFormat)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public SizeF MeasureString (string text, System.Drawing.Font font, SizeF layoutArea, StringFormat stringFormat, ref int charactersFitted, ref int linesFilled)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.MultiplyTransform (Matrix matrix)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.MultiplyTransform (Matrix matrix, MatrixOrder order)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- internal void ReleaseHdc (IntPtr hdc)
- {
- }
-
- [MonoTODO]
- void IGraphics.ReleaseHdc (IntPtr hdc)
- {
- }
-
- [MonoTODO]
- void IGraphics.ReleaseHdcInternal (IntPtr hdc)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.ResetClip ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.ResetTransform ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.Restore (GraphicsState gstate)
- {
- Cairo.cairo_restore (state);
- }
-
- void IGraphics.RotateTransform (float angle)
- {
- double rad = angle * Math.PI / 180.0;
- Cairo.cairo_rotate (state, rad);
- }
-
- [MonoTODO]
- void IGraphics.RotateTransform (float angle, MatrixOrder order)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public GraphicsState Save ()
- {
- Cairo.cairo_save (state);
- return new GraphicsState ();
- }
-
- [MonoTODO]
- void IGraphics.ScaleTransform (float sx, float sy)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.ScaleTransform (float sx, float sy, MatrixOrder order)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.SetClip (RectangleF rect)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.SetClip (GraphicsPath path)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.SetClip (Rectangle rect)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.SetClip (System.Drawing.Graphics g)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.SetClip (System.Drawing.Graphics g, CombineMode combineMode)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.SetClip (Rectangle rect, CombineMode combineMode)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.SetClip (RectangleF rect, CombineMode combineMode)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.SetClip (System.Drawing.Region region, CombineMode combineMode)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.SetClip (GraphicsPath path, CombineMode combineMode)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.TransformPoints (CoordinateSpace destSpace, CoordinateSpace srcSpace, PointF [] pts)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.TransformPoints (CoordinateSpace destSpace, CoordinateSpace srcSpace, Point [] pts)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.TranslateClip (int dx, int dy)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.TranslateClip (float dx, float dy)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IGraphics.TranslateTransform (float dx, float dy)
- {
- Cairo.cairo_translate (state, (double) dx, (double) dy);
- }
-
- [MonoTODO]
- void IGraphics.TranslateTransform (float dx, float dy, MatrixOrder order)
- {
- throw new NotImplementedException ();
- }
-
- System.Drawing.Region System.Drawing.IGraphics.Clip {
- get {
- throw new NotImplementedException ();
- }
- set {
- //throw new NotImplementedException ();
- }
- }
-
- RectangleF IGraphics.ClipBounds {
- get {
- throw new NotImplementedException ();
- }
- }
-
- CompositingMode IGraphics.CompositingMode {
- get {
- throw new NotImplementedException ();
- }
- set {
- throw new NotImplementedException ();
- }
-
- }
- CompositingQuality IGraphics.CompositingQuality {
- get {
- throw new NotImplementedException ();
- }
- set {
- throw new NotImplementedException ();
- }
- }
-
- float IGraphics.DpiX {
- get {
- throw new NotImplementedException ();
- }
- }
-
- float IGraphics.DpiY {
- get {
- throw new NotImplementedException ();
- }
- }
-
- InterpolationMode IGraphics.InterpolationMode {
- get {
- throw new NotImplementedException ();
- }
- set {
- throw new NotImplementedException ();
- }
- }
-
- bool IGraphics.IsClipEmpty {
- get {
- throw new NotImplementedException ();
- }
- }
-
- bool IGraphics.IsVisibleClipEmpty {
- get {
- throw new NotImplementedException ();
- }
- }
-
- float IGraphics.PageScale {
- get {
- throw new NotImplementedException ();
- }
-
- set {
- throw new NotImplementedException ();
- }
- }
-
- GraphicsUnit IGraphics.PageUnit {
- get {
- throw new NotImplementedException ();
- }
- set {
- throw new NotImplementedException ();
- }
- }
-
- PixelOffsetMode IGraphics.PixelOffsetMode {
- get {
- throw new NotImplementedException ();
- }
- set {
- throw new NotImplementedException ();
- }
- }
-
- Point IGraphics.RenderingOrigin {
- get {
- throw new NotImplementedException ();
- }
- set {
- throw new NotImplementedException ();
- }
- }
-
- SmoothingMode IGraphics.SmoothingMode {
- get {
- throw new NotImplementedException ();
- }
-
- set {
- throw new NotImplementedException ();
- }
- }
-
- int IGraphics.TextContrast {
- get {
- throw new NotImplementedException ();
- }
-
- set {
- throw new NotImplementedException ();
- }
- }
-
- TextRenderingHint IGraphics.TextRenderingHint {
- get {
- throw new NotImplementedException ();
- }
-
- set {
- throw new NotImplementedException ();
- }
- }
-
- Matrix IGraphics.Transform {
- get {
- throw new NotImplementedException ();
- }
-
- set {
- throw new NotImplementedException ();
- }
- }
-
- RectangleF IGraphics.VisibleClipBounds {
- get {
- throw new NotImplementedException ();
- }
- }
- }
-}
-
diff --git a/mcs/class/System.Drawing/System.Drawing/impl/cairo/Image.cs b/mcs/class/System.Drawing/System.Drawing/impl/cairo/Image.cs
deleted file mode 100644
index 92b394a9b8c..00000000000
--- a/mcs/class/System.Drawing/System.Drawing/impl/cairo/Image.cs
+++ /dev/null
@@ -1,279 +0,0 @@
-//
-// System.Drawing.Image.cs
-//
-// (C) 2002/3 Ximian, Inc. http://www.ximian.com
-// Authors:
-// Christian Meyer <Christian.Meyer@cs.tum.edu>
-// Jason Perkins <jason@379.com>
-// Dennis Hayes <dennish@raytek.com>
-// Alexandre Pigolkine <pigolkine@gmx.de>
-
-using System;
-using System.Runtime.Remoting;
-using System.Runtime.Serialization;
-using System.Drawing.Imaging;
-using System.IO;
-using System.Runtime.InteropServices;
-
-namespace System.Drawing.Cairo {
- //[Serializable]
- //[ComVisible(true)]
-
- internal abstract class Image : MarshalByRefObject, IImage /*, ICloneable, ISerializable */
- {
-
- internal IntPtr state;
- internal Format cairo_format;
- internal System.Drawing.Cairo.Graphics selected_into_graphics = null;
- internal Size size;
- internal PixelFormat pixelFormat;
- protected ImageFormat imageFormat;
-
- // constructor
- public Image () {}
-
- [MonoTODO]
- public virtual object Clone()
- {
- throw new NotImplementedException ();
- }
-
- // public methods
- // static
- public static Image FromFile (string filename)
- {
- // Fixme: implement me
- throw new NotImplementedException ();
- }
-
- public static Image FromFile (string filename, bool useEmbeddedColorManagement)
- {
-
- // Fixme: implement me
- throw new NotImplementedException ();
- }
-
- public static Bitmap FromHbitmap (IntPtr hbitmap)
- {
- // Fixme: implement me
- throw new NotImplementedException ();
- }
-
- public static Bitmap FromHbitmap (IntPtr hbitmap, IntPtr hpalette)
- {
- // Fixme: implement me
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static Image FromStream (Stream stream)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static Image FromStream (Stream stream, bool useIcm)
- {
- throw new NotImplementedException ();
- }
-
- public static int GetPixelFormatSize (PixelFormat pixfmt)
- {
- // Fixme: implement me
- throw new NotImplementedException ();
- }
-
- public static bool IsAlphaPixelFormat (PixelFormat pixfmt)
- {
- // Fixme: implement me
- throw new NotImplementedException ();
- }
-
- public static bool IsCanonicalPixelFormat (PixelFormat pixfmt)
- {
- // Fixme: implement me
- throw new NotImplementedException ();
- }
-
- public static bool IsExtendedPixelFormat (PixelFormat pixfmt)
- {
- // Fixme: implement me
- throw new NotImplementedException ();
- }
-
- // non-static
- RectangleF IImage.GetBounds (ref GraphicsUnit pageUnit)
- {
- // Fixme: implement me
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- int IImage.GetFrameCount (FrameDimension dimension)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- PropertyItem IImage.GetPropertyItem (int propid)
- {
- throw new NotImplementedException();
- }
-
- void IImage.RemovePropertyItem (int propid)
- {
- // Fixme: implement me
- throw new NotImplementedException ();
- }
-
- void IImage.RotateFlip (RotateFlipType rotateFlipType)
- {
- // Fixme: implement me
- throw new NotImplementedException ();
- }
-
- protected InternalImageInfo sourceImageInfo = null;
- unsafe InternalImageInfo IImage.ConvertToInternalImageInfo ()
- {
-
- if (sourceImageInfo == null) {
- sourceImageInfo = new InternalImageInfo();
- sourceImageInfo.Size = size;
- sourceImageInfo.RawFormat = imageFormat;
- sourceImageInfo.PixelFormat = PixelFormat.Format32bppArgb;
- sourceImageInfo.Stride = Gdk.Pixbuf.GetRowstride (state);
- sourceImageInfo.RawImageBytes = new byte[sourceImageInfo.Stride * size.Height];
- IntPtr memptr = Gdk.Pixbuf.GetPixels (state);
- Marshal.Copy( memptr, sourceImageInfo.RawImageBytes, 0, sourceImageInfo.RawImageBytes.Length);
- sourceImageInfo.ChangePixelFormat (pixelFormat);
- }
- return sourceImageInfo;
- }
-
- void IImage.Save (string filename)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IImage.Save(Stream stream, ImageFormat format)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IImage.Save (string filename, ImageFormat format)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- int IImage.SelectActiveFrame (FrameDimension dimension, int frameIndex)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- void IImage.SetPropertyItem (PropertyItem item)
- {
- throw new NotImplementedException();
- }
- // destructor
- ~Image() {}
-
- // properties
- int IImage.Flags {
- get {
- throw new NotImplementedException ();
- }
- }
-
- Guid [] IImage.FrameDimensionsList {
- get {
- throw new NotImplementedException ();
- }
- }
-
- int IImage.Height {
- get {
- return size.Height;
- }
- }
-
- float IImage.HorizontalResolution {
- get {
- throw new NotImplementedException ();
- }
- }
-
- ColorPalette IImage.Palette {
- get {
- throw new NotImplementedException ();
- }
- set {
- throw new NotImplementedException ();
- }
- }
-
- SizeF IImage.PhysicalDimension {
- get {
- throw new NotImplementedException ();
- }
- }
-
- PixelFormat IImage.PixelFormat {
- get {
- return pixelFormat;
- }
- }
-
- int [] IImage.PropertyIdList {
- get {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- PropertyItem [] IImage.PropertyItems {
- get {
- throw new NotImplementedException();
- }
- }
-
- [MonoTODO]
- ImageFormat IImage.RawFormat {
- get {
- return imageFormat;
- }
- }
-
- Size IImage.Size {
- get {
- return size;
- }
- }
-
- float IImage.VerticalResolution {
- get {
- throw new NotImplementedException ();
- }
- }
-
- int IImage.Width {
- get {
- return size.Width;
- }
- }
-
- [MonoTODO]
- public void Dispose ()
- {
- }
-
- [MonoTODO]
- protected virtual void Dispose (bool disposing)
- {
- throw new NotImplementedException();
- }
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing/impl/cairo/Pen.cs b/mcs/class/System.Drawing/System.Drawing/impl/cairo/Pen.cs
deleted file mode 100644
index 7dc4c12c8ec..00000000000
--- a/mcs/class/System.Drawing/System.Drawing/impl/cairo/Pen.cs
+++ /dev/null
@@ -1,141 +0,0 @@
-//
-// System.Drawing.Pen.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-// Alexandre Pigolkine(pigolkine@gmx.de)
-//
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Drawing.Cairo {
-
- internal class PenFactory : IPenFactory
- {
- public IPen Pen (System.Drawing.Brush brush, float width)
- {
- return new Pen (brush, width);
- }
-
- public IPen Pen (System.Drawing.Color color, float width)
- {
- return new Pen (color, width);
- }
- }
-
- public sealed class Pen : MarshalByRefObject, IPen
- {
- System.Drawing.Brush brush = null;
- Color color = Color.Black;
- float width = 1.0F;
-
- void CommonInit()
- {
- //nativeObject_ = Xr.MonoGI_CreatePen((double)color.R, (double)color.G, (double)color.B,(double)width);
- }
-
- public Pen (System.Drawing.Brush brush)
- {
- this.brush = brush;
- // FIXME: get color from brush
- CommonInit();
- }
-
- public Pen (Color color)
- {
- this.color = color;
- CommonInit();
- }
-
- public Pen (System.Drawing.Brush brush, float width)
- {
- this.width = width;
- this.brush = brush;
- // FIXME: get color from brush
- CommonInit();
- }
-
- public Pen (Color color, float width)
- {
- this.width = width;
- this.color = color;
- CommonInit();
- }
-
- internal void initialize (IntPtr cs)
- {
- Cairo.cairo_set_rgb_color (cs,
- (double) color.R,
- (double) color.G,
- (double) color.B);
-
- Cairo.cairo_set_line_width (cs, (double) width);
- }
-
- //
- // Properties
- //
- // public PenAlignment Alignment {
- // get {
- // return alignment;
- // }
- //
- // set {
- // alignment = value;
- // }
- // }
-
- System.Drawing.Brush IPen.Brush {
- get {
- return brush;
- }
-
- set {
- brush = value;
- }
- }
-
- Color IPen.Color {
- get {
- return color;
- }
-
- set {
- color = value;
- }
- }
-
- float IPen.Width {
- get {
- return width;
- }
-
- set {
- width = value;
- }
- }
-
- void IDisposable.Dispose ()
- {
- Dispose (true);
- System.GC.SuppressFinalize (this);
- }
-
- void Dispose (bool disposing)
- {
- if( disposing)
- {
- //Xr.MonoGI_DestroyPen(nativeObject_);
- }
- }
-
- ~Pen ()
- {
- Dispose (false);
- }
- }
-}
-
diff --git a/mcs/class/System.Drawing/System.Drawing/impl/cairo/SolidBrush.cs b/mcs/class/System.Drawing/System.Drawing/impl/cairo/SolidBrush.cs
deleted file mode 100644
index d94e71304ac..00000000000
--- a/mcs/class/System.Drawing/System.Drawing/impl/cairo/SolidBrush.cs
+++ /dev/null
@@ -1,57 +0,0 @@
- //
-// System.Drawing.SolidBrush.cs
-//
-// Author:
-// Dennis Hayes (dennish@Raytek.com)
-// Alexandre Pigolkine(pigolkine@gmx.de)
-//
-// (C) 2002 Ximian, Inc
-//
-using System;
-
-namespace System.Drawing.Cairo {
-
- internal class SolidBrushFactory : ISolidBrushFactory
- {
- ISolidBrush ISolidBrushFactory.SolidBrush (Color color)
- {
- return new SolidBrush(color);
- }
- }
-
- internal class SolidBrush : Brush, ISolidBrush
- {
-
- Color color;
-
- public SolidBrush (Color color)
- {
- this.Color = color;
- }
-
- public Color Color {
-
- get { return color; }
-
- set { color = value; }
- }
-
- public override object Clone ()
- {
- return new SolidBrush (color);
- }
-
- Color IBrush.TextColor
- {
- get { return Color; }
- }
-
- internal void initialize (IntPtr cr)
- {
- Cairo.cairo_set_rgb_color (cr,
- (double) color.R,
- (double) color.G,
- (double) color.B);
- }
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing/impl/cairo/cairo-api.cs b/mcs/class/System.Drawing/System.Drawing/impl/cairo/cairo-api.cs
deleted file mode 100644
index 80364292909..00000000000
--- a/mcs/class/System.Drawing/System.Drawing/impl/cairo/cairo-api.cs
+++ /dev/null
@@ -1,427 +0,0 @@
-//
-// Cairo.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. 2003
-//
-// This is a simplistic binding of the Cairo API to C#. All functions
-// in cairo.h are transcribed into their C# equivelants and all
-// enumerations are also listed here.
-//
-
-using System;
-using System.Drawing;
-using System.Runtime.InteropServices;
-
-namespace System.Drawing.Cairo {
-
- public class Cairo
- {
- const string CairoImp = "cairo";
- //
- // Manipulating state objects
- //
- [DllImport (CairoImp)]
- public static extern IntPtr cairo_create ();
-
- [DllImport (CairoImp)]
- public static extern IntPtr cairo_destroy (IntPtr cr);
-
- [DllImport (CairoImp)]
- public static extern void cairo_save (IntPtr cr);
-
- [DllImport (CairoImp)]
- public static extern void cairo_restore (IntPtr cr);
-
- //
- // Modify state
- //
- [DllImport (CairoImp)]
- public static extern void cairo_set_target_surface (IntPtr cr, IntPtr surface);
-
- [DllImport (CairoImp)]
- public static extern void cairo_set_target_image (
- IntPtr cr, IntPtr data, Format format, int width, int height, int stride);
-
- [DllImport (CairoImp)]
- [CLSCompliant(false)]
- public static extern void cairo_set_target_drawble (IntPtr cr, IntPtr dpy, ulong drawable);
-
- [DllImport (CairoImp)]
- public static extern void cairo_set_operator (IntPtr cr, Operator op);
-
- [DllImport (CairoImp)]
- public static extern void cairo_set_rgb_color (IntPtr cr, double red, double green, double blue);
-
- [DllImport (CairoImp)]
- public static extern void cairo_set_alpha (IntPtr cr, double alpha);
-
- [DllImport (CairoImp)]
- public static extern void cairo_set_pattern (IntPtr cr, IntPtr pattern);
-
- [DllImport (CairoImp)]
- public static extern void cairo_set_tolerence (IntPtr cr, double tolerance);
-
- [DllImport (CairoImp)]
- public static extern void cairo_set_fill_rule (IntPtr cr, FillRule fill_rule);
-
- [DllImport (CairoImp)]
- public static extern void cairo_set_line_width (IntPtr cr, double width);
-
- [DllImport (CairoImp)]
- public static extern void cairo_set_line_cap (IntPtr cr, LineCap line_cap);
-
- [DllImport (CairoImp)]
- public static extern void cairo_set_line_join (IntPtr cr, LineJoin line_join);
-
- [DllImport (CairoImp)]
- public static extern void cairo_set_dash (IntPtr cr, double [] dashes, int ndash, double offset);
-
- [DllImport (CairoImp)]
- public static extern void cairo_set_miter_limit (IntPtr cr, double limit);
-
- [DllImport (CairoImp)]
- public static extern void cairo_translate (IntPtr cr, double tx, double ty);
-
- [DllImport (CairoImp)]
- public static extern void cairo_scale (IntPtr cr, double sx, double sy);
-
- [DllImport (CairoImp)]
- public static extern void cairo_rotate (IntPtr cr, double angle);
-
- [DllImport (CairoImp)]
- public static extern void cairo_concat_matrix (IntPtr cr, IntPtr matrix);
-
- [DllImport (CairoImp)]
- public static extern void cairo_set_matrix (IntPtr cr, IntPtr matrix);
-
- [DllImport (CairoImp)]
- public static extern void cairo_default_matrix (IntPtr cr);
-
- [DllImport (CairoImp)]
- public static extern void cairo_identity_matrix (IntPtr cr);
-
- [DllImport (CairoImp)]
- public static extern void cairo_transform_point (IntPtr cr, ref double x, ref double y);
-
- [DllImport (CairoImp)]
- public static extern void cairo_transform_distance (IntPtr cr, ref double dx, ref double dy);
-
- [DllImport (CairoImp)]
- public static extern void cairo_inverse_transform_point (IntPtr cr, ref double x, ref double y);
-
- [DllImport (CairoImp)]
- public static extern void cairo_inverse_transform_distance (IntPtr cr, ref double dx, ref double dy);
-
- //
- // Path creation
- //
- [DllImport (CairoImp)]
- public static extern void cairo_new_path (IntPtr cr);
-
- [DllImport (CairoImp)]
- public static extern void cairo_move_to (IntPtr cr, double x, double y);
-
- [DllImport (CairoImp)]
- public static extern void cairo_line_to (IntPtr cr, double x, double y);
-
- [DllImport (CairoImp)]
- public static extern void cairo_curve_to (
- IntPtr cr, double x1, double y1, double x2, double y2, double x3, double y3);
-
- [DllImport (CairoImp)]
- public static extern void cairo_rel_move_to (IntPtr cr, double dx, double dy);
-
- [DllImport (CairoImp)]
- public static extern void cairo_rel_line_to (IntPtr cr, double dx, double dy);
-
- [DllImport (CairoImp)]
- public static extern void cairo_rel_curve_to (
- IntPtr cr, double dx1, double dy1, double dx2, double dy2, double dx3, double dy3);
-
- [DllImport (CairoImp)]
- public static extern void cairo_rectangle (IntPtr cr, double x, double y, double width, double height);
-
- [DllImport (CairoImp)]
- public static extern void cairo_close_path (IntPtr cr);
-
- //
- // Painting
- //
- [DllImport (CairoImp)]
- public static extern void cairo_stroke (IntPtr cr);
-
- [DllImport (CairoImp)]
- public static extern void cairo_fill (IntPtr cr);
-
- [DllImport (CairoImp)]
- public static extern void cairo_clip (IntPtr cr);
-
- //
- // Font / Text
- //
- [DllImport (CairoImp)]
- public static extern void cairo_select_font (IntPtr cr, string key);
-
- [DllImport (CairoImp)]
- public static extern void cairo_scale_font (IntPtr cr, double scale);
-
- [DllImport (CairoImp)]
- public static extern void cairo_transform_font (
- IntPtr cr, double a, double b, double c, double d);
-
- [DllImport (CairoImp)]
- public static extern void cairo_text_extents (
- IntPtr cr, string utf8,
- ref double x, ref double y,
- ref double width, ref double height,
- ref double dx, ref double dy);
-
- [DllImport (CairoImp)]
- public static extern void cairo_show_text (IntPtr cr, string utf8);
-
- //
- // Image
- //
- [DllImport (CairoImp)]
- public static extern void cairo_show_surface (IntPtr cr, IntPtr surface, int width, int height);
-
- //
- // query
- //
- [DllImport (CairoImp)]
- public static extern Operator cairo_get_operator (IntPtr cr);
-
- [DllImport (CairoImp)]
- public static extern void cairo_get_rgb_color (
- IntPtr cr, out double red, out double green, out double blue);
-
- [DllImport (CairoImp)]
- public static extern double cairo_get_alpha (IntPtr cr);
-
- [DllImport (CairoImp)]
- public static extern double cairo_get_tolerence (IntPtr cr);
-
- [DllImport (CairoImp)]
- public static extern void cairo_get_current_point (
- IntPtr cr, out double x, out double y);
-
- [DllImport (CairoImp)]
- public static extern FillRule cairo_get_fill_rule (IntPtr cr);
-
- [DllImport (CairoImp)]
- public static extern double cairo_get_line_width (IntPtr cr);
-
- [DllImport (CairoImp)]
- public static extern LineCap cairo_get_line_cap (IntPtr cr);
-
- [DllImport (CairoImp)]
- public static extern LineJoin cairo_get_line_join (IntPtr cr);
-
- [DllImport (CairoImp)]
- public static extern double cairo_get_miter_limit (IntPtr cr);
-
- [DllImport (CairoImp)]
- public static extern void cairo_get_matrix (
- IntPtr cr,
- out double a, out double b,
- out double c, out double d,
- out double tx, out double ty);
-
- [DllImport (CairoImp)]
- public static extern void cairo_get_target_surface (IntPtr cr);
-
- //
- // Error status queries
- //
- [DllImport (CairoImp)]
- public static extern Status cairo_get_status (IntPtr cr);
-
- [DllImport (CairoImp)]
- public static extern string cairo_get_status_string (IntPtr cr);
-
- //
- // Surface Manipulation
- //
-
- [DllImport (CairoImp)]
- [CLSCompliant (false)]
- public static extern IntPtr cairo_surface_create_for_drawable (
- IntPtr display, ulong drawable, IntPtr visual,
- Format format, ulong colormap);
-
- [DllImport (CairoImp)]
- public static extern IntPtr cairo_surface_create_for_image (
- string data, Format format, int width, int height, int stride);
-
- [DllImport (CairoImp)]
- public static extern IntPtr cairo_surface_create_similar (
- IntPtr surface, Format format, int width, int height);
-
- [DllImport (CairoImp)]
- public static extern IntPtr cairo_surface_create_similar_solid (
- IntPtr surface, Format format,
- int width, int height, double red, double green, double blue, double alpha);
-
- [DllImport (CairoImp)]
- public static extern void cairo_surface_destroy (IntPtr surface);
-
- [DllImport (CairoImp)]
- public static extern Status cairo_surface_put_image (
- IntPtr surface, string data, int width, int height, int stride);
-
- [DllImport (CairoImp)]
- public static extern Status cairo_surface_set_repeat (
- IntPtr surface, int repeat);
-
- [DllImport (CairoImp)]
- public static extern Status cairo_surface_set_matrix (
- IntPtr surface, IntPtr matrix);
-
- [DllImport (CairoImp)]
- public static extern Status cairo_surface_get_matrix (
- IntPtr surface, ref IntPtr matrix);
-
- [DllImport (CairoImp)]
- public static extern Status cairo_surface_set_filter (
- IntPtr surface, Filter filter);
-
- //
- // Matrix
- //
-
- [DllImport (CairoImp)]
- public static extern IntPtr cairo_matrix_create ();
-
- [DllImport (CairoImp)]
- public static extern void cairo_matrix_destroy (IntPtr matrix);
-
- [DllImport (CairoImp)]
- public static extern Status cairo_matrix_copy (
- IntPtr matrix, out IntPtr other);
-
- [DllImport (CairoImp)]
- public static extern Status cairo_matrix_set_identity (IntPtr matrix);
-
- [DllImport (CairoImp)]
- public static extern Status cairo_matrix_set_affine (
- IntPtr matrix,
- double a, double b, double c, double d, double tx, double ty);
-
- [DllImport (CairoImp)]
- public static extern Status cairo_matrix_get_affine (
- IntPtr matrix,
- out double a, out double b, out double c, out double d, out double tx, out double ty);
-
- [DllImport (CairoImp)]
- public static extern Status cairo_matrix_translate (
- IntPtr matrix, double tx, double ty);
-
- [DllImport (CairoImp)]
- public static extern Status cairo_matrix_scale (
- IntPtr matrix, double sx, double sy);
-
- [DllImport (CairoImp)]
- public static extern Status cairo_matrix_rotate (
- IntPtr matrix, double radians);
-
- [DllImport (CairoImp)]
- public static extern Status cairo_matrix_invert (IntPtr matrix);
-
- [DllImport (CairoImp)]
- public static extern Status cairo_matrix_multiply (
- out IntPtr result, IntPtr a, IntPtr b);
-
- [DllImport (CairoImp)]
- public static extern Status cairo_matrix_transform_distance (
- IntPtr matrix, ref double dx, ref double dy);
-
- [DllImport (CairoImp)]
- public static extern Status cairo_matrix_transform_point (
- IntPtr matrix, ref double x, ref double y);
- }
-
- //
- // Enumerations
- //
- public enum Format {
- ARGB32 = 0,
- RGB24 = 1,
- A8 = 2,
- A1 = 4
- }
-
- public enum Operator {
- Clear = 0,
- Src = 1,
- Dst = 2,
- Over = 3,
- OverReverse = 4,
- In = 5,
- InReverse = 6,
- Out = 7,
- OutReverse = 8,
- Atop = 9,
- AtopReverse = 10,
- Xor = 11,
- Add = 12,
- Saturate = 13,
-
- DisjointClear = 16,
- DisjointSrc = 17,
- DisjointDst = 18,
- DisjointOver = 19,
- DisjointOverReverse = 20,
- DisjointIn = 21,
- DisjointInReverse = 22,
- DisjointOut = 23,
- DisjointOutReverse = 24,
- DisjointAtop = 25,
- DisjointAtopReverse = 26,
- DisjointXor = 27,
-
- ConjointClear = 32,
- ConjointSrc = 33,
- ConjointDst = 34,
- ConjointOver = 35,
- ConjointOverReverse = 36,
- ConjointIn = 37,
- ConjointInReverse = 38,
- ConjointOut = 39,
- ConjointOutReverse = 40,
- ConjointAtop = 41,
- ConjointAtopReverse = 42,
- ConjointXor = 43
- }
-
- public enum FillRule {
- Winding,
- EvenOdd
- }
-
- public enum LineCap {
- Butt, Round, Square
- }
-
- public enum LineJoin {
- Miter, Round, Bevel
- }
-
- public enum Status {
- Success = 0,
- NoMemory,
- InvalidRestore,
- InvalidPopGroup,
- NoCurrentPoint,
- InvalidMatrix
- }
-
- public enum Filter {
- Fast,
- Good,
- Best,
- Nearest,
- Bilinear
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing/impl/cairo/gdk-helpers.cs b/mcs/class/System.Drawing/System.Drawing/impl/cairo/gdk-helpers.cs
deleted file mode 100644
index 54ae9dcaf9b..00000000000
--- a/mcs/class/System.Drawing/System.Drawing/impl/cairo/gdk-helpers.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-using System;
-using System.Runtime.InteropServices;
-
-namespace Gdk {
-
- internal class Pixbuf
- {
- const string libgdk_pixbuf = "libgdk_pixbuf-2.0.0.dll";
-
- [DllImport (libgdk_pixbuf, EntryPoint="gdk_pixbuf_new")]
- internal static extern IntPtr New (
- int colorspace, bool has_alpha, int bits_per_sample,
- int width, int height);
-
- [DllImport(libgdk_pixbuf, EntryPoint = "gdk_pixbuf_new_from_data")]
- internal static extern IntPtr NewFromData (
- IntPtr data, Gdk.Colorspace colorspace, bool has_alpha, int bits_per_sample,
- int width, int height, int rowstride,
- IntPtr destroy_fn, IntPtr destroy_fn_data);
-
- [DllImport(libgdk_pixbuf, EntryPoint = "gdk_pixbuf_finalize")]
- internal static extern void Finalize (IntPtr pixbuf);
-
- [DllImport (libgdk_pixbuf, EntryPoint = "gdk_pixbuf_get_pixels")]
- internal static extern IntPtr GetPixels (IntPtr pixbuf);
-
- [DllImport (libgdk_pixbuf, EntryPoint = "gdk_pixbuf_get_rowstride")]
- internal static extern int GetRowstride (IntPtr pixbuf);
- }
-
- internal enum Colorspace {
- Rgb = 0
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing/impl/wine/Bitmap.cs b/mcs/class/System.Drawing/System.Drawing/impl/wine/Bitmap.cs
index ddc17b00b28..52c038bb451 100644
--- a/mcs/class/System.Drawing/System.Drawing/impl/wine/Bitmap.cs
+++ b/mcs/class/System.Drawing/System.Drawing/impl/wine/Bitmap.cs
@@ -72,19 +72,6 @@ namespace System.Drawing {
IntPtr hdc = g.GetHdc();
nativeObject_ = Win32.CreateCompatibleBitmap(hdc, width, height);
imageSize_ = new Size(width, height);
- imageFormat_ = ImageFormat.Bmp;
- // FIXME: shall we get pixel format from device or just set PixelFormat.Format32bppArgb
- switch (Win32.GetDeviceCaps (g.GetHdc(), GetDeviceCapsParams.BITSPIXEL)){
- case 32:
- pixelFormat_ = PixelFormat.Format32bppArgb;
- break;
- case 24:
- pixelFormat_ = PixelFormat.Format24bppRgb;
- break;
- default:
- pixelFormat_ = PixelFormat.Format32bppArgb;
- break;
- }
g.ReleaseHdc(hdc);
}
@@ -92,7 +79,6 @@ namespace System.Drawing {
{
IntPtr hdc = Win32.GetDC(IntPtr.Zero);
pixelFormat_ = format;
- imageFormat_ = ImageFormat.Bmp;
BITMAPINFO_FLAT bmi = new BITMAPINFO_FLAT();
bmi.bmiHeader_biSize = 40;
bmi.bmiHeader_biWidth = width;
diff --git a/mcs/class/System.Drawing/System.Drawing/impl/wine/ChangeLog b/mcs/class/System.Drawing/System.Drawing/impl/wine/ChangeLog
index 5d64c7e1d60..c63e8ab3833 100644
--- a/mcs/class/System.Drawing/System.Drawing/impl/wine/ChangeLog
+++ b/mcs/class/System.Drawing/System.Drawing/impl/wine/ChangeLog
@@ -1,12 +1,3 @@
-2003-08-24 Alexandre Pigolkine
- * Graphics.cs Clear, DrawImage functions
-
-2003-08-23 Alexandre Pigolkine
- * Bitmap.cs set ImageFormat and PixelFormat in contstuctors
- * win32Enums.cs
- * win32functions.cs GetDeviceCaps function and parameters
-
-
2003-08-06 Duncan Mak <duncan@ximian.com>
* Bitmap.cs:
diff --git a/mcs/class/System.Drawing/System.Drawing/impl/wine/Graphics.cs b/mcs/class/System.Drawing/System.Drawing/impl/wine/Graphics.cs
index 96e83e7f4fa..06552ba142d 100644
--- a/mcs/class/System.Drawing/System.Drawing/impl/wine/Graphics.cs
+++ b/mcs/class/System.Drawing/System.Drawing/impl/wine/Graphics.cs
@@ -104,18 +104,7 @@ namespace System.Drawing
[MonoTODO]
void IGraphics.Clear (Color color)
{
- Size sz = new Size(0, 0);
- switch(type_) {
- case GraphicsType.fromHwnd:
- //FIXME: get window size
- break;
- case GraphicsType.fromHdc:
- break;
- case GraphicsType.fromImage:
- sz = ((IImage)initializedFromImage_).Size;
- break;
- }
- FillRectangle (new SolidBrush (color), 0, 0, sz.Width, sz.Height);
+ throw new NotImplementedException ();
}
[MonoTODO]
@@ -381,20 +370,7 @@ namespace System.Drawing
[MonoTODO]
void IGraphics.DrawImage (System.Drawing.Image image, Rectangle destRect, Rectangle srcRect, GraphicsUnit srcUnit)
{
- Image wineImage = ConvertImage(image);
- Graphics imageGraphics = wineImage.selectedIntoGraphics_;
- if( imageGraphics == null) {
- IntPtr tempDC = Win32.CreateCompatibleDC (hdc_);
- IntPtr oldBmp = Win32.SelectObject (tempDC, wineImage.nativeObject_);
- Win32.StretchBlt(hdc_, destRect.X, destRect.Y, destRect.Width, destRect.Height,
- tempDC, srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height, PatBltTypes.SRCCOPY);
- Win32.SelectObject (tempDC, oldBmp);
- Win32.DeleteDC (tempDC);
- }
- else {
- Win32.StretchBlt(hdc_, destRect.X, destRect.Y, destRect.Width, destRect.Height,
- imageGraphics.hdc_, srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height, PatBltTypes.SRCCOPY);
- }
+ throw new NotImplementedException ();
}
[MonoTODO]
diff --git a/mcs/class/System.Drawing/System.Drawing/impl/wine/win32Enums.cs b/mcs/class/System.Drawing/System.Drawing/impl/wine/win32Enums.cs
index 7a2ed716007..38864634eab 100644
--- a/mcs/class/System.Drawing/System.Drawing/impl/wine/win32Enums.cs
+++ b/mcs/class/System.Drawing/System.Drawing/impl/wine/win32Enums.cs
@@ -2399,36 +2399,4 @@ namespace System.Drawing.Win32Impl {
DIB_RGB_COLORS = 0,
DIB_PAL_COLORS = 1
}
-
- internal enum GetDeviceCapsParams : int {
- DRIVERVERSION =0,
- TECHNOLOGY =2,
- HORZSIZE =4,
- VERTSIZE =6,
- HORZRES =8,
- VERTRES =10,
- BITSPIXEL =12,
- PLANES =14,
- NUMBRUSHES =16,
- NUMPENS =18,
- NUMMARKERS =20,
- NUMFONTS =22,
- NUMCOLORS =24,
- PDEVICESIZE =26,
- CURVECAPS =28,
- LINECAPS =30,
- POLYGONALCAPS =32,
- TEXTCAPS =34,
- CLIPCAPS =36,
- RASTERCAPS =38,
- ASPECTX =40,
- ASPECTY =42,
- ASPECTXY =44,
- LOGPIXELSX =88,
- LOGPIXELSY =90,
- CAPS1 =94,
- SIZEPALETTE =104,
- NUMRESERVED =106,
- COLORRES =108
- }
}
diff --git a/mcs/class/System.Drawing/System.Drawing/impl/wine/win32functions.cs b/mcs/class/System.Drawing/System.Drawing/impl/wine/win32functions.cs
index 2d197884607..8b69f7bd430 100644
--- a/mcs/class/System.Drawing/System.Drawing/impl/wine/win32functions.cs
+++ b/mcs/class/System.Drawing/System.Drawing/impl/wine/win32functions.cs
@@ -143,11 +143,6 @@ namespace System.Drawing.Win32Impl {
CallingConvention = CallingConvention.StdCall,
CharSet = CharSet.Ansi)]
internal static extern int GdiFlush();
-
- [DllImport ("gdi32.dll",
- CallingConvention = CallingConvention.StdCall,
- CharSet = CharSet.Ansi)]
- internal static extern int GetDeviceCaps (IntPtr hdc, GetDeviceCapsParams index);
#endregion
diff --git a/mcs/class/System.Runtime.Remoting/ChangeLog b/mcs/class/System.Runtime.Remoting/ChangeLog
index e5388f61dae..8258e3f096c 100644
--- a/mcs/class/System.Runtime.Remoting/ChangeLog
+++ b/mcs/class/System.Runtime.Remoting/ChangeLog
@@ -1,20 +1,3 @@
-2003-08-22 Lluis Sanchez Gual <lluis@ximian.com>
-
- * System.Runtime.Remoting_test.dll.sources: Added DelegateCalls.cs test file.
-
-2003-08-20 Lluis Sanchez Gual <lluis@ximian.com>
-
- * TcpConnectionPool.cs: Check if a connection is alive before reusing
- it. Added some properties to support this.
-
-2003-08-20 Lluis Sanchez Gual <lluis@ximian.com>
-
- * System.Runtime.Remoting_test.dll.sources: Added new test files.
-
-2003-08-18 Lluis Sanchez Gual <lluis@ximian.com>
-
- * HttpClientChannel.cs, HttpServerChannel.cs: Fixed bug #47703
-
2003-07-23 Lluis Sanchez Gual <lluis@ximian.com>
* Makefile: added dll extension to System.Runtime.Remoting reference
diff --git a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels.Http/ChangeLog b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels.Http/ChangeLog
deleted file mode 100644
index 2b9ff524380..00000000000
--- a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels.Http/ChangeLog
+++ /dev/null
@@ -1,34 +0,0 @@
-2003-08-22 Lluis Sanchez Gual <lluis@ximian.com>
-
- * HttpClientChannel.cs: Changed text for user-agent header (removed references
- to MS.NET).
- Removed try/catch from AsyncProcessRequest. If there is an exception it must
- flow to the caller.
- in AsyncRequestHandler, improved management of exceptions. HttpWebRequest
- throws an exception if the result code is 400, 500. Is is not a communication
- error, but an application or server error. The content of the body must be
- deserialized like in normal responses.
- In CreateWebRequest, if the stream being sent is a MemoryStream, use a more
- efficient way of writing the content.
- In SendAndRecieve, same as in AsyncRequestHandler. Also moved some code to a
- new method named ReceiveResponse, so it can be reused from AsyncRequestHandler.
- * HttpHelper.cs: Removed some debugging code that is not needed.
- * HttpServer.cs: Improved formatting of some code.
- In CheckRequest method, send a 100-continue response if the request has
- the header: expect:100-continue.
- Method SendResponse: the remoting formatter may include the result code and
- reason phrase to use in the transport headers. Used them if provided.
- * HttpServerChannel.cs: Use ThreadPool to create the thread that will answer
- a request.
-
-2003-08-18 Lluis Sanchez Gual <lluis@ximian.com>
-
- * HttpClientChannel.cs, HttpServerChannel.cs: Fixed bug #47703
-
-2003-06-21 Lluis Sanchez Gual <lluis@ximian.com>
-
- * HttpChannel.cs, HttpClientChannel.cs, HttpHelper.cs, HttpServer.cs,
- HttpServerChannel.cs, HttpThread.cs: added new implementation of the HttpChannel
- by Ahmad Tantawy, Ahmad Kadry and Hussein Mehanna.
- * unix.args: added HttpHelper.cs,HttpServer.cs,HttpThread.cs.
-
diff --git a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels.Http/HttpClientChannel.cs b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels.Http/HttpClientChannel.cs
index 8e43472700d..165216b2ec8 100644
--- a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels.Http/HttpClientChannel.cs
+++ b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels.Http/HttpClientChannel.cs
@@ -28,6 +28,11 @@ using System.Text;
namespace System.Runtime.Remoting.Channels.Http
{
+
+
+
+
+
public class HttpClientChannel : IChannelSender,IChannel
{
// Property Keys (purposely all lower-case)
@@ -198,7 +203,8 @@ namespace System.Runtime.Remoting.Channels.Http
{
if(sinkProvider == null)
{
- _sinkProvider = new SoapClientFormatterSinkProvider();
+ //_sinkProvider = new SoapClientFormatterSinkProvider();
+ _sinkProvider = new BinaryClientFormatterSinkProvider();
_sinkProvider.Next = new HttpClientTransportSinkProvider();
}
else
@@ -247,7 +253,8 @@ namespace System.Runtime.Remoting.Channels.Http
private const String s_defaultVerb = "POST";
private static String s_userAgent =
- "Mono Remoting Client (Mono CLR " + System.Environment.Version.ToString() + ")";
+ "Mozilla/4.0+(compatible; MSIE 6.0; Windows " +
+ "; MS .NET Remoting; MS .NET CLR " + System.Environment.Version.ToString() + " )";
// Property keys (purposely all lower-case)
private const String UserNameKey = "username";
@@ -300,6 +307,8 @@ namespace System.Runtime.Remoting.Channels.Http
ITransportHeaders requestHeaders, Stream requestStream,
out ITransportHeaders responseHeaders, out Stream responseStream)
{
+
+
string url = null;
string uri = (string)requestHeaders[CommonTransportKeys.RequestUri];
CreateUrl(uri,out url);
@@ -313,14 +322,22 @@ namespace System.Runtime.Remoting.Channels.Http
public void AsyncProcessRequest(IClientChannelSinkStack sinkStack, IMessage msg,
ITransportHeaders headers, Stream stream)
{
- string url = null;
- string uri = (string)headers[CommonTransportKeys.RequestUri];
- CreateUrl(uri,out url);
+ try
+ {
+ string url = null;
+ string uri = (string)headers[CommonTransportKeys.RequestUri];
+ CreateUrl(uri,out url);
+
+ HttpWebRequest httpWebRequest = CreateWebRequest(url,headers,stream);
+ RequestState reqState = new RequestState(httpWebRequest,sinkStack);
- HttpWebRequest httpWebRequest = CreateWebRequest(url,headers,stream);
- RequestState reqState = new RequestState(httpWebRequest,sinkStack);
+ httpWebRequest.BeginGetResponse(new AsyncCallback(AsyncRequestHandler),reqState);
- httpWebRequest.BeginGetResponse(new AsyncCallback(AsyncRequestHandler),reqState);
+ }
+ catch
+ {
+ Console.WriteLine("Error Sending Async Request");
+ }
}
private void AsyncRequestHandler(IAsyncResult ar)
@@ -329,29 +346,36 @@ namespace System.Runtime.Remoting.Channels.Http
RequestState reqState = (RequestState) ar.AsyncState;
HttpWebRequest httpWebRequest = reqState.webRquest;
- IClientChannelSinkStack sinkStack = reqState.sinkStack;
try
{
httpWebResponse = (HttpWebResponse) httpWebRequest.EndGetResponse(ar);
- }
- catch (WebException ex)
- {
- httpWebResponse = ex.Response as HttpWebResponse;
- if (httpWebResponse == null) sinkStack.DispatchException (ex);
- }
+
+ Stream responseStream ;
+ ITransportHeaders responseHeaders;
- Stream responseStream;
- ITransportHeaders responseHeaders;
+ IClientChannelSinkStack sinkStack = reqState.sinkStack;
+
+ responseStream = new MemoryStream();
+ HttpHelper.CopyStream(httpWebResponse.GetResponseStream(),ref responseStream);
+
+
+ responseHeaders = new TransportHeaders();
+
+ for(int i=0; i < httpWebResponse.Headers.Count; ++i)
+ responseHeaders[httpWebResponse.Headers.Keys[i].ToString()] = httpWebResponse.Headers[i].ToString();
- try
- {
- ReceiveResponse (httpWebResponse, out responseHeaders, out responseStream);
sinkStack.AsyncProcessResponse(responseHeaders,responseStream);
+
+ }
+ catch
+ {
+ Console.WriteLine("Error Recieving Async Response");
}
- catch (Exception ex)
+ finally
{
- sinkStack.DispatchException (ex);
+ if(httpWebResponse!=null)
+ httpWebResponse.Close();
}
}
@@ -510,6 +534,10 @@ namespace System.Runtime.Remoting.Channels.Http
private HttpWebRequest CreateWebRequest(string url, ITransportHeaders requestHeaders, Stream requestStream)
{
+
+
+
+
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);;
request.AllowAutoRedirect = _bAllowAutoRedirect;
request.ContentLength = requestStream.Length;
@@ -548,74 +576,57 @@ namespace System.Runtime.Remoting.Channels.Http
}
Stream reqStream = request.GetRequestStream();
- if (requestStream is MemoryStream)
- {
- MemoryStream memStream = (MemoryStream)requestStream;
- reqStream.Write (memStream.GetBuffer(), 0, (int)memStream.Length);
- }
- else
- HttpHelper.CopyStream(requestStream, reqStream);
-
+ HttpHelper.CopyStream(requestStream,ref reqStream);
+
reqStream.Close();
return request;
}
- private void SendAndRecieve(HttpWebRequest httpRequest,out ITransportHeaders responseHeaders,out Stream responseStream)
+ private bool SendAndRecieve(HttpWebRequest httpRequest,out ITransportHeaders responseHeaders,out Stream responseStream)
{
responseStream = null;
responseHeaders = null;
HttpWebResponse httpWebResponse = null;
- try
- {
- httpWebResponse = (HttpWebResponse)httpRequest.GetResponse();
- }
- catch (WebException ex)
- {
- httpWebResponse = ex.Response as HttpWebResponse;
- if (httpWebResponse == null) throw ex;
- }
-
- ReceiveResponse (httpWebResponse, out responseHeaders, out responseStream);
- }
+ bool returnValue = false;
- private void ReceiveResponse (HttpWebResponse httpWebResponse, out ITransportHeaders responseHeaders, out Stream responseStream)
- {
- responseHeaders = new TransportHeaders();
try
{
- Stream webStream = httpWebResponse.GetResponseStream();
+ httpWebResponse = (HttpWebResponse)httpRequest.GetResponse();
- if (httpWebResponse.ContentLength != -1)
- {
- byte[] buffer = new byte [httpWebResponse.ContentLength];
- int nr = 0;
- while (nr < buffer.Length)
- nr += webStream.Read (buffer, nr, buffer.Length - nr);
- responseStream = new MemoryStream (buffer);
- }
- else
- {
- responseStream = new MemoryStream();
- HttpHelper.CopyStream(webStream, responseStream);
- }
+ responseStream = new MemoryStream();
+ HttpHelper.CopyStream(httpWebResponse.GetResponseStream(),ref responseStream);
+
+ responseHeaders = new TransportHeaders();
+
+
//Use the two commented lines below instead of the 3 below lines when HttpWebResponse
//class is fully implemented in order to support custom headers
//for(int i=0; i < httpWebResponse.Headers.Count; ++i)
// responseHeaders[httpWebResponse.Headers.Keys[i].ToString()] = httpWebResponse.Headers[i].ToString();
-
+
responseHeaders["Content-Type"] = httpWebResponse.ContentType;
responseHeaders["Server"] = httpWebResponse.Server;
responseHeaders["Content-Length"] = httpWebResponse.ContentLength;
+
+ returnValue =true;
}
+ catch(Exception e)
+ {
+
+ Console.WriteLine(e);
+ returnValue = false;
+ }
+
finally
{
if(httpWebResponse!=null)
- httpWebResponse.Close();
+ httpWebResponse.Close();
}
+ return returnValue;
}
private void ProcessErrorCode()
diff --git a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels.Http/HttpHelper.cs b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels.Http/HttpHelper.cs
index 5cde8444f9f..400f27908a6 100644
--- a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels.Http/HttpHelper.cs
+++ b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels.Http/HttpHelper.cs
@@ -22,6 +22,7 @@ namespace System.Runtime.Remoting.Channels.Http
{
internal class HttpHelper
{
+ public static int d;
public static string Parse(string URL , out string ObjectURI)
{
@@ -38,9 +39,9 @@ namespace System.Runtime.Remoting.Channels.Http
Pos = URL.IndexOf("/",0);
}
- if(Pos >= 0)
+ if(Pos>0 || Pos == 0)
{
- ObjectURI = URL.Substring(Pos + 1);
+ ObjectURI = URL.Substring(Pos);
return URL.Substring(0,Pos);
}
return URL;
@@ -81,21 +82,32 @@ namespace System.Runtime.Remoting.Channels.Http
return outStream;
}
- public static bool CopyStream(Stream inStream, Stream outStream)
+ public static bool CopyStream(Stream inStream,ref Stream outStream)
{
int temp;
-
+ d++;
try
{
+ FileStream f=null;
+ if(d==2)
+ f = new FileStream("f.txt",System.IO.FileMode.Create);
+
while(true)
{
temp = inStream.ReadByte();
-
+
+
+ if(d==2)
+ f.WriteByte((byte)temp);
+
+
if(temp==-1)
break;
outStream.WriteByte((byte)temp);
}
+ if(d==2)
+ f.Close();
outStream.Flush();
if(outStream.CanSeek)
diff --git a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels.Http/HttpServer.cs b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels.Http/HttpServer.cs
index 64577e879d7..e4d2c2c5f84 100644
--- a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels.Http/HttpServer.cs
+++ b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels.Http/HttpServer.cs
@@ -60,9 +60,11 @@ namespace System.Runtime.Remoting.Channels.Http
public static void ProcessRequest(object Object)
{
+
if(Object as RequestArguments == null)
return;
+
Socket socket;
HttpServerTransportSink snk;
@@ -71,30 +73,40 @@ namespace System.Runtime.Remoting.Channels.Http
socket = reqArg.socket;
snk = reqArg.snk;
- if(!socket.Connected)
- return;
+ if(!socket.Connected)
+ return;
- //Step (1) Start Reciceve the header
- ArrayList Headers = RecieveHeader(socket);
+ //Step (1) Start Reciceve the header
+ ArrayList Headers = RecieveHeader(socket);
- //Step (2) Start Parse the header
- IDictionary HeaderFields = new Hashtable();
- IDictionary CustomHeaders = new Hashtable();
- if(!ParseHeader(socket,Headers,HeaderFields,CustomHeaders))
- return;
+
+ //Step (2) Start Parse the header
+ IDictionary HeaderFields = new Hashtable();
+ IDictionary CustomHeaders = new Hashtable();
+ if(!ParseHeader(socket,Headers,HeaderFields,CustomHeaders))
+ return;
+
- //Step (3)
- if(!CheckRequest(socket,HeaderFields,CustomHeaders))
- return;
- //Step (4) Recieve the entity body
- byte [] buffer =new byte[(int)HeaderFields["content-length"]];
- if(!RecieveEntityBody(socket,buffer))
- return ;
- //Step (5)
- if(! SendRequestForChannel(socket,snk,HeaderFields,CustomHeaders,buffer))
- return ;
+ //Step (3)
+ if(!CheckRequest(socket,HeaderFields,CustomHeaders))
+ return;
+
+
+ //Step (4) Recieve the entity body
+ byte [] buffer =new byte[(int)HeaderFields["content-length"]];
+ if(!RecieveEntityBody(socket,buffer))
+ return ;
+
+
+
+ //Step (5)
+
+ if(! SendRequestForChannel(socket,snk,HeaderFields,CustomHeaders,buffer))
+ return ;
+
+
}
private static ArrayList RecieveHeader(Socket socket)
@@ -105,6 +117,8 @@ namespace System.Runtime.Remoting.Channels.Http
byte[] buffer = new byte[1024];
ArrayList Headers = new ArrayList();
+
+
int index =0;
while(!bLastLine)
{
@@ -140,6 +154,8 @@ namespace System.Runtime.Remoting.Channels.Http
continue;
Headers.Add( Encoding.ASCII.GetString(buffer,0,index));
+
+
}//end while loop
return Headers;
@@ -178,9 +194,6 @@ namespace System.Runtime.Remoting.Channels.Http
return false;
}
- if (HeaderFields["expect"].ToString() == "100-continue")
- SendResponse(socket,100,null,null);
-
//Check for the content-length field
if(HeaderFields["content-length"]==null)
{
@@ -193,8 +206,11 @@ namespace System.Runtime.Remoting.Channels.Http
private static bool RecieveEntityBody(Socket socket, byte[] buffer)
{
+
+
try
{
+ //Recieved = socket.Receive(buffer,0,buffer.Length,SocketFlags.None);
int nr = 0;
while (nr < buffer.Length)
nr += socket.Receive (buffer, nr, buffer.Length - nr,SocketFlags.None);
@@ -219,10 +235,14 @@ namespace System.Runtime.Remoting.Channels.Http
private static bool SendRequestForChannel(Socket socket ,HttpServerTransportSink snk ,IDictionary HeaderFields , IDictionary CustomHeaders, byte[]buffer)
{
+
+
TransportHeaders THeaders = new TransportHeaders();
+
Stream stream = new MemoryStream(buffer);
+
if(stream.Position !=0)
stream.Seek(0,SeekOrigin.Begin);
@@ -262,26 +282,19 @@ namespace System.Runtime.Remoting.Channels.Http
byte [] headersBuffer = null;
byte [] entityBuffer = null;
- StringBuilder ResponseStr;
+ StringBuilder ResponseStr ;
String Reason = GetReasonPhrase(HttpStatusCode);
- if (headers != null && headers["__HttpStatusCode"] != null) {
- // The formatter can override the result code
- HttpStatusCode = int.Parse ((string)headers["__HttpStatusCode"]);
- Reason = (string)headers["__HttpReasonPhrase"];
- }
//Response Line
- ResponseStr = new StringBuilder( "HTTP/1.0 " + HttpStatusCode + " " + Reason + "\r\n" );
+ ResponseStr = new StringBuilder( "HTTP/1.1 " + HttpStatusCode.ToString() + " " + Reason + "\r\n" );
if(headers!=null)
foreach(DictionaryEntry entry in headers)
{
- string key = entry.Key.ToString();
- if (key != "__HttpStatusCode" && key != "__HttpReasonPhrase")
- ResponseStr.Append(key + ": " + entry.Value.ToString() + "\r\n");
+ ResponseStr.Append(entry.Key.ToString()+": "+entry.Value.ToString()+"\r\n");
}
- ResponseStr.Append("Server: Mono Remoting, Mono CLR " + System.Environment.Version.ToString() + "\r\n");
+ ResponseStr.Append("Server: MS .NET Remoting, MS .NET CLR 1.0.3705.0\r\n");
if(responseStream != null)
if(responseStream.Length!=0)
@@ -330,7 +343,7 @@ namespace System.Runtime.Remoting.Channels.Http
{
switch (HttpStatusCode)
{
- case 100 : return "Continue" ;
+ case 100 : return " Continue" ;
case 101 :return "Switching Protocols";
case 200 :return "OK";
case 201 :return "Created";
diff --git a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels.Http/HttpServerChannel.cs b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels.Http/HttpServerChannel.cs
index c3bcf6a87a5..f90beea3476 100644
--- a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels.Http/HttpServerChannel.cs
+++ b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels.Http/HttpServerChannel.cs
@@ -147,9 +147,12 @@ namespace System.Runtime.Remoting.Channels.Http
_channelData = new ChannelDataStore(urls);
+ //Change this into BinaryFormatterSinkProvider() in mono
if(_sinkProvider == null)
- _sinkProvider = new SoapServerFormatterSinkProvider();
+ _sinkProvider = new BinaryServerFormatterSinkProvider();
+
+
// collect channel data from all providers
IServerChannelSinkProvider provider = _sinkProvider;
while (provider != null)
@@ -161,6 +164,7 @@ namespace System.Runtime.Remoting.Channels.Http
// create the sink chain
IServerChannelSink snk =
ChannelServices.CreateServerChannelSinkChain(_sinkProvider,this);
+
_transportSink = new HttpServerTransportSink(snk);
@@ -178,7 +182,8 @@ namespace System.Runtime.Remoting.Channels.Http
{
Socket socket = _tcpListener.AcceptSocket();
RequestArguments reqArg = new RequestArguments(socket,_transportSink);
- ThreadPool.QueueUserWorkItem (new WaitCallback (HttpServer.ProcessRequest), reqArg);
+ HttpThread httpThread = new HttpThread(reqArg);
+
}
}
@@ -193,11 +198,14 @@ namespace System.Runtime.Remoting.Channels.Http
ThreadStart t = new ThreadStart(this.Listen);
_listenerThread = new Thread(t);
_listenerThread.IsBackground = true;
+
}
if(!_listenerThread.IsAlive)
_listenerThread.Start();
+
+
_bListening = true;
}
@@ -205,7 +213,6 @@ namespace System.Runtime.Remoting.Channels.Http
{
if( _bListening)
{
- _listenerThread.Abort ();
_tcpListener.Stop();
}
@@ -365,7 +372,7 @@ namespace System.Runtime.Remoting.Channels.Http
ITransportHeaders responseHeaders;
Stream responseStream;
- ServerProcessing processing = ServerProcessing.Complete;
+ ServerProcessing processing= ServerProcessing.Complete;
try
{
processing =
@@ -373,6 +380,8 @@ namespace System.Runtime.Remoting.Channels.Http
out responseMessage,
out responseHeaders, out responseStream);
+
+
switch (processing)
{
case ServerProcessing.Complete:
@@ -397,7 +406,10 @@ namespace System.Runtime.Remoting.Channels.Http
catch(Exception )
{
}
- }
+
+}
+
+
//
diff --git a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels.Tcp/TcpConnectionPool.cs b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels.Tcp/TcpConnectionPool.cs
index f3e36def999..becffaf63c5 100644
--- a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels.Tcp/TcpConnectionPool.cs
+++ b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels.Tcp/TcpConnectionPool.cs
@@ -1,11 +1,11 @@
-//
-// System.Runtime.Remoting.Channels.Tcp.TcpConnectionPool.cs
-//
-// Author: Lluis Sanchez Gual (lluis@ideary.com)
-//
-// 2002 (C) Lluis Sanchez Gual
-//
-
+//
+// System.Runtime.Remoting.Channels.Tcp.TcpConnectionPool.cs
+//
+// Author: Lluis Sanchez Gual (lluis@ideary.com)
+//
+// 2002 (C) Lluis Sanchez Gual
+//
+
using System;
using System.Collections;
using System.Threading;
@@ -98,36 +98,15 @@ namespace System.Runtime.Remoting.Channels.Tcp
}
}
- internal class ReusableTcpClient : TcpClient
- {
- public ReusableTcpClient (string host, int port): base (host, port)
- {
- }
-
- public bool IsAlive
- {
- get
- {
- // This Poll will return true if there is data pending to
- // be read. It prob. means that a client object using this
- // connection got an exception and did not finish to read
- // the data. It can also mean that the connection has been
- // closed in the server. In both cases, the connection cannot
- // be reused.
- return !Client.Poll (0, SelectMode.SelectRead);
- }
- }
- }
-
internal class TcpConnection
{
DateTime _controlTime;
Stream _stream;
- ReusableTcpClient _client;
+ TcpClient _client;
HostConnectionPool _pool;
byte[] _buffer;
- public TcpConnection (HostConnectionPool pool, ReusableTcpClient client)
+ public TcpConnection (HostConnectionPool pool, TcpClient client)
{
_pool = pool;
_client = client;
@@ -147,11 +126,6 @@ namespace System.Runtime.Remoting.Channels.Tcp
set { _controlTime = value; }
}
- public bool IsAlive
- {
- get { return _client.IsAlive; }
- }
-
// This is a "thread safe" buffer that can be used by
// TcpClientTransportSink to read or send data to the stream.
// The buffer is "thread safe" since only one thread can
@@ -198,14 +172,8 @@ namespace System.Runtime.Remoting.Channels.Tcp
if (_pool.Count > 0)
{
// There are available connections
-
connection = (TcpConnection)_pool[_pool.Count - 1];
_pool.RemoveAt(_pool.Count - 1);
- if (!connection.IsAlive) {
- CancelConnection (connection);
- connection = null;
- continue;
- }
}
if (connection == null && _activeConnections < TcpConnectionPool.MaxOpenConnections)
@@ -233,7 +201,7 @@ namespace System.Runtime.Remoting.Channels.Tcp
{
try
{
- ReusableTcpClient client = new ReusableTcpClient(_host, _port);
+ TcpClient client = new TcpClient(_host, _port);
TcpConnection entry = new TcpConnection(this, client);
_activeConnections++;
return entry;
diff --git a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/ChangeLog b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/ChangeLog
index 7be4308ce83..e7c9b27ec60 100644
--- a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/ChangeLog
+++ b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/ChangeLog
@@ -1,9 +1,3 @@
-2003-08-22 Lluis Sanchez Gual <lluis@ximian.com>
-
- * SoapClientFormatterSink.cs: Fixed a some bugs to make async calls work.
- * SoapMessageFormatter.cs: Fixed some problems with out and ref parameters.
- * SoapServerFormatterSink.cs: Improved catching of exceptions.
-
2003-07-23 Lluis Sanchez Gual <lluis@ximian.com>
* SoapMessageFormatter.cs: ParameterInfo.Position is now zero-based.
diff --git a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/SoapClientFormatterSink.cs b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/SoapClientFormatterSink.cs
index 60abd818da4..1d58b719ecb 100644
--- a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/SoapClientFormatterSink.cs
+++ b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/SoapClientFormatterSink.cs
@@ -67,7 +67,7 @@ namespace System.Runtime.Remoting.Channels
SerializeMessage(msg, out requestStream, out requestHeaders, out soapMsgFormatter);
ClientChannelSinkStack stack = new ClientChannelSinkStack(replySink);
- stack.Push(this, new CallData (msg, soapMsgFormatter));
+ stack.Push(this, soapMsgFormatter);
_nextChannelSink.AsyncProcessRequest(stack, msg, requestHeaders, requestStream);
@@ -88,9 +88,10 @@ namespace System.Runtime.Remoting.Channels
ITransportHeaders headers,
Stream stream)
{
- CallData data = (CallData)state;
- SoapMessageFormatter soapMsgFormatter = data.Formatter;
- IMessage replyMessage = (IMessage) DeserializeMessage(stream, headers, (IMethodCallMessage)data.Msg, soapMsgFormatter);
+ SoapMessageFormatter soapMsgFormatter = (SoapMessageFormatter)state;
+
+ IMessage replyMessage = (IMessage) DeserializeMessage(stream, headers, (IMethodCallMessage)state, soapMsgFormatter);
+
sinkStack.DispatchReplyMessage(replyMessage);
}
@@ -115,6 +116,7 @@ namespace System.Runtime.Remoting.Channels
}
+// ////[MonoTODO]
public IMessage SyncProcessMessage (IMessage msg)
{
Stream requestStream, responseStream;
@@ -123,7 +125,7 @@ namespace System.Runtime.Remoting.Channels
SerializeMessage(msg, out requestStream, out requestHeaders, out soapMsgFormatter);
_nextChannelSink.ProcessMessage(msg, requestHeaders, requestStream, out responseHeaders, out responseStream);
-
+
return DeserializeMessage(responseStream, responseHeaders, (IMethodCallMessage)msg, soapMsgFormatter);
}
@@ -144,6 +146,8 @@ namespace System.Runtime.Remoting.Channels
if(requestStream is MemoryStream){
requestStream.Position = 0;
}
+
+
}
@@ -153,13 +157,8 @@ namespace System.Runtime.Remoting.Channels
object objReturn = _deserializationFormatter.Deserialize(responseStream);
return soapMsgFormatter.FormatResponse((ISoapMessage) objReturn, mcm);
- }
-
- class CallData
- {
- public CallData (IMessage msg, SoapMessageFormatter formatter) { Msg = msg; Formatter = formatter; }
- public IMessage Msg;
- public SoapMessageFormatter Formatter;
+
+
}
}
}
diff --git a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/SoapMessageFormatter.cs b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/SoapMessageFormatter.cs
index f479dc8da38..93837e7c0ed 100644
--- a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/SoapMessageFormatter.cs
+++ b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/SoapMessageFormatter.cs
@@ -80,14 +80,14 @@ namespace System.Runtime.Remoting.Channels {
// check if there are *out* parameters
foreach(ParameterInfo paramInfo in _methodCallParameters) {
- if(paramInfo.ParameterType.IsByRef) {
+ if(paramInfo.IsOut) {
int index = Array.IndexOf(soapMsg.ParamNames, paramInfo.Name);
nbOutParams++;
object outParam = soapMsg.ParamValues[index];
if(outParam is IConvertible)
outParam = Convert.ChangeType(
outParam,
- paramInfo.ParameterType.GetElementType());
+ paramInfo.ParameterType);
outParams.Add(outParam);
}
// else outParams.Insert(paramInfo.Position, null);
@@ -148,44 +148,40 @@ namespace System.Runtime.Remoting.Channels {
// used by the server
internal IMessage BuildMethodCallFromSoapMessage(SoapMessage soapMessage, string uri) {
ArrayList headersList = new ArrayList();
+ ArrayList argsList = new ArrayList();
headersList.Add(new Header("__Uri", uri));
headersList.Add(new Header("__MethodName", soapMessage.MethodName));
string typeNamespace, assemblyName;
bool b = SoapServices.DecodeXmlNamespaceForClrTypeNamespace(soapMessage.XmlNameSpace, out typeNamespace, out assemblyName);
-
_serverType = RemotingServices.GetServerTypeForUri(uri);
-
headersList.Add(new Header("__TypeName", _serverType.FullName, false));
_xmlNamespace = soapMessage.XmlNameSpace;
+
RemMessageType messageType;
_methodCallInfo = _serverType.GetMethod(soapMessage.MethodName);
-
+
// the *out* parameters aren't serialized
// have to add them here
_methodCallParameters = _methodCallInfo.GetParameters();
- object[] args = new object[_methodCallParameters.Length];
-
- foreach(ParameterInfo paramInfo in _methodCallParameters)
- {
- Type paramType = (paramInfo.ParameterType.IsByRef ? paramInfo.ParameterType.GetElementType() : paramInfo.ParameterType);
-
+ foreach(ParameterInfo paramInfo in _methodCallParameters) {
if(paramInfo.IsOut) {
- args [paramInfo.Position] = GetNullValue (paramType);
+ argsList.Insert(paramInfo.Position, null);
}
else{
int index = Array.IndexOf(soapMessage.ParamNames, paramInfo.Name);
if(soapMessage.ParamValues[index] is IConvertible)
soapMessage.ParamValues[index] = Convert.ChangeType(
soapMessage.ParamValues[index],
- paramType);
- args [paramInfo.Position] = soapMessage.ParamValues[index];
+ paramInfo.ParameterType);
+ argsList.Insert(paramInfo.Position, soapMessage.ParamValues[index]);
}
}
+ Object[] args = (Object[])argsList.ToArray(typeof(object));
headersList.Add(new Header("__Args", args, false));
Header[] headers = (Header[])headersList.ToArray(typeof(Header));
-
+
// build the MethodCall from the headers
MethodCall mthCall = new MethodCall(headers);
return (IMessage)mthCall;
@@ -228,8 +224,8 @@ namespace System.Runtime.Remoting.Channels {
}
else {
// an Exception was thrown while executing the function
- responseHeaders["__HttpStatusCode"] = "400";
- responseHeaders["__HttpReasonPhrase"] = "Bad Request";
+ responseHeaders["__HttpStatusCode"] = "500";
+ responseHeaders["__HttpReasonPhrase"] = "Internal Server Error";
// fill the transport headers
responseHeaders["Content-Type"] = "text/xml; charset=\"utf-8\"";
ServerFault serverFault = CreateServerFault(mrm.Exception);
@@ -266,25 +262,6 @@ namespace System.Runtime.Remoting.Channels {
_methodCallParameters = _methodCallInfo.GetParameters();
}
- object GetNullValue (Type paramType)
- {
- switch (Type.GetTypeCode (paramType))
- {
- case TypeCode.Boolean: return false;
- case TypeCode.Byte: return (byte)0;
- case TypeCode.Char: return '\0';
- case TypeCode.Decimal: return (decimal)0;
- case TypeCode.Double: return (double)0;
- case TypeCode.Int16: return (short)0;
- case TypeCode.Int32: return (int)0;
- case TypeCode.Int64: return (long)0;
- case TypeCode.SByte: return (sbyte)0;
- case TypeCode.Single: return (float)0;
- case TypeCode.UInt16: return (ushort)0;
- case TypeCode.UInt32: return (uint)0;
- case TypeCode.UInt64: return (ulong)0;
- default: return null;
- }
- }
+
}
}
diff --git a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/SoapServerFormatterSink.cs b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/SoapServerFormatterSink.cs
index 1fb925e2640..6d7d57d4975 100644
--- a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/SoapServerFormatterSink.cs
+++ b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/SoapServerFormatterSink.cs
@@ -95,50 +95,46 @@ namespace System.Runtime.Remoting.Channels {
responseMsg = null;
responseHeaders = null;
responseStream = null;
-
- Exception exception;
+
+ string url = (string)requestHeaders[CommonTransportKeys.RequestUri];
+ string uri;
+ _receiver.Parse(url, out uri);
+ if(uri == null) uri = url;
+ Type serverType = RemotingServices.GetServerTypeForUri(uri);
+
+ SoapMessage soapMessage = new SoapMessage();
+ _deserializationFormatter.TopObject = soapMessage;
ServerProcessing sp;
+ object rtnMessageObject;
SoapMessageFormatter soapMsgFormatter = new SoapMessageFormatter();
+ requestStream.Position = 0;
+ _deserializationFormatter.Deserialize(requestStream);
+ requestMsg = soapMsgFormatter.BuildMethodCallFromSoapMessage(soapMessage, uri);
+
sinkStack.Push(this, soapMsgFormatter);
- try {
- string url = (string)requestHeaders[CommonTransportKeys.RequestUri];
- string uri;
- _receiver.Parse(url, out uri);
- if(uri == null) uri = url;
- Type serverType = RemotingServices.GetServerTypeForUri(uri);
- if (serverType == null) throw new RemotingException ("No receiver for uri " + uri);
-
- SoapMessage soapMessage = new SoapMessage();
- _deserializationFormatter.TopObject = soapMessage;
- requestStream.Position = 0;
- _deserializationFormatter.Deserialize(requestStream);
-
- requestMsg = soapMsgFormatter.BuildMethodCallFromSoapMessage(soapMessage, uri);
-
+ try{
sp = next_sink.ProcessMessage(sinkStack, requestMsg, requestHeaders, null, out responseMsg, out responseHeaders, out responseStream);
- if(sp == ServerProcessing.Complete) {
- if(responseMsg != null && responseStream == null) {
-
- object rtnMessageObject = soapMsgFormatter.BuildSoapMessageFromMethodResponse((IMethodReturnMessage) responseMsg, out responseHeaders);
- responseStream = new MemoryStream();
- _serializationFormatter.Serialize(responseStream, rtnMessageObject);
- }
- }
}
- catch(Exception e)
- {
+ catch(Exception e) {
responseMsg = (IMethodReturnMessage)new ReturnMessage(e, (IMethodCallMessage)requestMsg);
- object rtnMessageObject = soapMsgFormatter.BuildSoapMessageFromMethodResponse((IMethodReturnMessage) responseMsg, out responseHeaders);
- responseStream = new MemoryStream();
- _serializationFormatter.Serialize(responseStream, rtnMessageObject);
sp = ServerProcessing.Complete;
}
+
+ if(sp == ServerProcessing.Complete) {
+ if(responseMsg != null && responseStream == null) {
+
+ rtnMessageObject = soapMsgFormatter.BuildSoapMessageFromMethodResponse((IMethodReturnMessage) responseMsg, out responseHeaders);
+
+ responseStream = new MemoryStream();
+
+ _serializationFormatter.Serialize(responseStream, rtnMessageObject);
+ }
- if (sp == ServerProcessing.Complete)
sinkStack.Pop(this);
-
+ }
+
return sp;
}
diff --git a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting_test.dll.sources b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting_test.dll.sources
index 282df16027b..9751d50591f 100644
--- a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting_test.dll.sources
+++ b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting_test.dll.sources
@@ -2,10 +2,3 @@ ServerObject.cs
ContextsTest.cs
CallSeq.cs
ContextHookAttribute.cs
-BaseCalls.cs
-SyncCalls.cs
-AsyncCalls.cs
-ReflectionCalls.cs
-DelegateCalls.cs
-TcpCalls.cs
-HttpCalls.cs
diff --git a/mcs/class/System.Runtime.Remoting/Test/AsyncCalls.cs b/mcs/class/System.Runtime.Remoting/Test/AsyncCalls.cs
deleted file mode 100644
index b6f6753979c..00000000000
--- a/mcs/class/System.Runtime.Remoting/Test/AsyncCalls.cs
+++ /dev/null
@@ -1,162 +0,0 @@
-//
-// MonoTests.System.Runtime.Remoting.AsyncCalls.cs
-//
-// Author: Lluis Sanchez Gual (lluis@ximian.com)
-//
-// 2003 (C) Copyright, Ximian, Inc.
-//
-
-using System;
-using System.Collections;
-using NUnit.Framework;
-
-namespace MonoTests.System.Runtime.Remoting
-{
- public abstract class AsyncCallTest : BaseCallTest
- {
- public override InstanceSurrogate GetInstanceSurrogate () { return new AsyncInstanceSurrogate (); }
- public override AbstractSurrogate GetAbstractSurrogate () { return new AsyncAbstractSurrogate (); }
- public override InterfaceSurrogate GetInterfaceSurrogate () { return new AsyncInterfaceSurrogate (); }
-
- public static void DoWork ()
- {
- for (int n=0; n<10; n++)
- System.Threading.Thread.Sleep (1);
- }
- }
-
- public delegate int DelegateSimple ();
- public delegate string DelegatePrimitiveParams (int a, uint b, char c, string d);
- public delegate string DelegatePrimitiveParamsInOut (ref int a1, out int a2, ref float b1, out float b2, ref char c1, out char c2, ref string d1, out string d2);
- public delegate Complex DelegateComplexParams (ArrayList a, Complex b, string c);
- public delegate Complex DelegateComplexParamsInOut (ref ArrayList a, out Complex b, string c);
-
- public class AsyncInstanceSurrogate : InstanceSurrogate
- {
- public override int Simple ()
- {
- DelegateSimple de = new DelegateSimple (RemoteObject.Simple);
- IAsyncResult ar = de.BeginInvoke (null,null);
- AsyncCallTest.DoWork ();
- return de.EndInvoke (ar);
- }
-
- public override string PrimitiveParams (int a, uint b, char c, string d)
- {
- DelegatePrimitiveParams de = new DelegatePrimitiveParams (RemoteObject.PrimitiveParams);
- IAsyncResult ar = de.BeginInvoke (a,b,c,d,null,null);
- AsyncCallTest.DoWork ();
- return de.EndInvoke (ar);
- }
-
- public override string PrimitiveParamsInOut (ref int a1, out int a2, ref float b1, out float b2, ref char c1, out char c2, ref string d1, out string d2)
- {
- DelegatePrimitiveParamsInOut de = new DelegatePrimitiveParamsInOut (RemoteObject.PrimitiveParamsInOut);
- IAsyncResult ar = de.BeginInvoke (ref a1, out a2, ref b1, out b2, ref c1, out c2, ref d1, out d2, null,null);
- AsyncCallTest.DoWork ();
- return de.EndInvoke (ref a1, out a2, ref b1, out b2, ref c1, out c2, ref d1, out d2, ar);
- }
-
- public override Complex ComplexParams (ArrayList a, Complex b, string c)
- {
- DelegateComplexParams de = new DelegateComplexParams (RemoteObject.ComplexParams);
- IAsyncResult ar = de.BeginInvoke (a,b,c,null,null);
- AsyncCallTest.DoWork ();
- return de.EndInvoke (ar);
- }
-
- public override Complex ComplexParamsInOut (ref ArrayList a, out Complex b, string c)
- {
- DelegateComplexParamsInOut de = new DelegateComplexParamsInOut (RemoteObject.ComplexParamsInOut);
- IAsyncResult ar = de.BeginInvoke (ref a, out b, c,null,null);
- AsyncCallTest.DoWork ();
- return de.EndInvoke (ref a, out b, ar);
- }
- }
-
- public class AsyncAbstractSurrogate : AbstractSurrogate
- {
- public override int Simple ()
- {
- DelegateSimple de = new DelegateSimple (RemoteObject.Simple);
- IAsyncResult ar = de.BeginInvoke (null,null);
- AsyncCallTest.DoWork ();
- return de.EndInvoke (ar);
- }
-
- public override string PrimitiveParams (int a, uint b, char c, string d)
- {
- DelegatePrimitiveParams de = new DelegatePrimitiveParams (RemoteObject.PrimitiveParams);
- IAsyncResult ar = de.BeginInvoke (a,b,c,d,null,null);
- AsyncCallTest.DoWork ();
- return de.EndInvoke (ar);
- }
-
- public override string PrimitiveParamsInOut (ref int a1, out int a2, ref float b1, out float b2, ref char c1, out char c2, ref string d1, out string d2)
- {
- DelegatePrimitiveParamsInOut de = new DelegatePrimitiveParamsInOut (RemoteObject.PrimitiveParamsInOut);
- IAsyncResult ar = de.BeginInvoke (ref a1, out a2, ref b1, out b2, ref c1, out c2, ref d1, out d2, null,null);
- AsyncCallTest.DoWork ();
- return de.EndInvoke (ref a1, out a2, ref b1, out b2, ref c1, out c2, ref d1, out d2, ar);
- }
-
- public override Complex ComplexParams (ArrayList a, Complex b, string c)
- {
- DelegateComplexParams de = new DelegateComplexParams (RemoteObject.ComplexParams);
- IAsyncResult ar = de.BeginInvoke (a,b,c,null,null);
- AsyncCallTest.DoWork ();
- return de.EndInvoke (ar);
- }
-
- public override Complex ComplexParamsInOut (ref ArrayList a, out Complex b, string c)
- {
- DelegateComplexParamsInOut de = new DelegateComplexParamsInOut (RemoteObject.ComplexParamsInOut);
- IAsyncResult ar = de.BeginInvoke (ref a, out b, c,null,null);
- AsyncCallTest.DoWork ();
- return de.EndInvoke (ref a, out b, ar);
- }
- }
-
- public class AsyncInterfaceSurrogate : InterfaceSurrogate
- {
- public override int Simple ()
- {
- DelegateSimple de = new DelegateSimple (RemoteObject.Simple);
- IAsyncResult ar = de.BeginInvoke (null,null);
- AsyncCallTest.DoWork ();
- return de.EndInvoke (ar);
- }
-
- public override string PrimitiveParams (int a, uint b, char c, string d)
- {
- DelegatePrimitiveParams de = new DelegatePrimitiveParams (RemoteObject.PrimitiveParams);
- IAsyncResult ar = de.BeginInvoke (a,b,c,d,null,null);
- AsyncCallTest.DoWork ();
- return de.EndInvoke (ar);
- }
-
- public override string PrimitiveParamsInOut (ref int a1, out int a2, ref float b1, out float b2, ref char c1, out char c2, ref string d1, out string d2)
- {
- DelegatePrimitiveParamsInOut de = new DelegatePrimitiveParamsInOut (RemoteObject.PrimitiveParamsInOut);
- IAsyncResult ar = de.BeginInvoke (ref a1, out a2, ref b1, out b2, ref c1, out c2, ref d1, out d2, null,null);
- AsyncCallTest.DoWork ();
- return de.EndInvoke (ref a1, out a2, ref b1, out b2, ref c1, out c2, ref d1, out d2, ar);
- }
-
- public override Complex ComplexParams (ArrayList a, Complex b, string c)
- {
- DelegateComplexParams de = new DelegateComplexParams (RemoteObject.ComplexParams);
- IAsyncResult ar = de.BeginInvoke (a,b,c,null,null);
- AsyncCallTest.DoWork ();
- return de.EndInvoke (ar);
- }
-
- public override Complex ComplexParamsInOut (ref ArrayList a, out Complex b, string c)
- {
- DelegateComplexParamsInOut de = new DelegateComplexParamsInOut (RemoteObject.ComplexParamsInOut);
- IAsyncResult ar = de.BeginInvoke (ref a, out b, c,null,null);
- AsyncCallTest.DoWork ();
- return de.EndInvoke (ref a, out b, ar);
- }
- }
-}
diff --git a/mcs/class/System.Runtime.Remoting/Test/BaseCalls.cs b/mcs/class/System.Runtime.Remoting/Test/BaseCalls.cs
deleted file mode 100644
index 790c71ae9f7..00000000000
--- a/mcs/class/System.Runtime.Remoting/Test/BaseCalls.cs
+++ /dev/null
@@ -1,452 +0,0 @@
-//
-// MonoTests.System.Runtime.Remoting.BaseCalls.cs
-//
-// Author: Lluis Sanchez Gual (lluis@ximian.com)
-//
-// 2003 (C) Copyright, Ximian, Inc.
-//
-
-using System;
-using System.Net;
-using System.Threading;
-using System.Collections;
-using System.Runtime.Remoting;
-using System.Runtime.Remoting.Channels;
-using System.Runtime.Remoting.Lifetime;
-using System.Runtime.Remoting.Channels.Tcp;
-using System.Runtime.Remoting.Activation;
-using System.Runtime.Remoting.Contexts;
-using NUnit.Framework;
-
-namespace MonoTests.System.Runtime.Remoting
-{
- public abstract class BaseCallTest : Assertion
- {
- IChannelSender chs;
- string[] remoteUris;
- CallsDomainServer server;
- int remoteDomId;
-
- [TestFixtureSetUp]
- public void Run()
- {
- remoteDomId = CreateServer ();
- }
-
- [TestFixtureTearDown]
- public void End ()
- {
- ShutdownServer ();
- }
-
- protected virtual int CreateServer ()
- {
- ChannelManager cm = CreateChannelManager ();
- chs = cm.CreateClientChannel ();
- ChannelServices.RegisterChannel (chs);
-
- AppDomain domain = AppDomain.CreateDomain ("testdomain");
- server = (CallsDomainServer) domain.CreateInstanceAndUnwrap(GetType().Assembly.FullName,"MonoTests.System.Runtime.Remoting.CallsDomainServer");
- remoteUris = server.Start (cm);
- return server.GetDomId ();
- }
-
- protected virtual void ShutdownServer ()
- {
- server.Stop ();
- if (chs != null)
- ChannelServices.UnregisterChannel (chs);
- }
-
- protected virtual RemoteObject CreateRemoteInstance ()
- {
- return (RemoteObject) Activator.GetObject (typeof(RemoteObject), remoteUris[0]);
- }
-
- protected virtual AbstractRemoteObject CreateRemoteAbstract ()
- {
- return (AbstractRemoteObject) Activator.GetObject (typeof(AbstractRemoteObject), remoteUris[1]);
- }
-
- protected virtual IRemoteObject CreateRemoteInterface ()
- {
- return (IRemoteObject) Activator.GetObject (typeof(IRemoteObject), remoteUris[2]);
- }
-
- public InstanceSurrogate InternalGetInstanceSurrogate ()
- {
- InstanceSurrogate s = GetInstanceSurrogate ();
- s.RemoteObject = CreateRemoteInstance ();
- return s;
- }
-
- public AbstractSurrogate InternalGetAbstractSurrogate ()
- {
- AbstractSurrogate s = GetAbstractSurrogate ();
- s.RemoteObject = CreateRemoteAbstract ();
- return s;
- }
-
- public InterfaceSurrogate InternalGetInterfaceSurrogate ()
- {
- InterfaceSurrogate s = GetInterfaceSurrogate ();
- s.RemoteObject = CreateRemoteInterface ();
- return s;
- }
-
- public abstract InstanceSurrogate GetInstanceSurrogate ();
- public abstract AbstractSurrogate GetAbstractSurrogate ();
- public abstract InterfaceSurrogate GetInterfaceSurrogate ();
- public abstract ChannelManager CreateChannelManager ();
-
- //
- // The tests
- //
-
- [Test]
- public void TestInstanceSimple ()
- {
- RunTestSimple (InternalGetInstanceSurrogate());
- }
-
- [Test]
- public void TestAbstractSimple ()
- {
- RunTestSimple (InternalGetAbstractSurrogate());
- }
-
- [Test]
- public void TestInterfaceSimple ()
- {
- RunTestSimple (InternalGetInterfaceSurrogate());
- }
-
- [Test]
- public void TestInstancePrimitiveParams ()
- {
- RunTestPrimitiveParams (InternalGetInstanceSurrogate());
- }
-
- [Test]
- public void TestAbstractPrimitiveParams ()
- {
- RunTestPrimitiveParams (InternalGetAbstractSurrogate());
- }
-
- [Test]
- public void TestInterfacePrimitiveParams ()
- {
- RunTestPrimitiveParams (InternalGetInterfaceSurrogate());
- }
-
- [Test]
- public void TestInstancePrimitiveParamsInOut ()
- {
- RunTestPrimitiveParamsInOut (InternalGetInstanceSurrogate());
- }
-
- [Test]
- public void TestAbstractPrimitiveParamsInOut ()
- {
- RunTestPrimitiveParamsInOut (InternalGetAbstractSurrogate());
- }
-
- [Test]
- public void TestInterfacePrimitiveParamsInOut ()
- {
- RunTestPrimitiveParamsInOut (InternalGetInterfaceSurrogate());
- }
-
- [Test]
- public void TestInstanceComplexParams ()
- {
- RunTestComplexParams (InternalGetInstanceSurrogate());
- }
-
- [Test]
- public void TestAbstractComplexParams ()
- {
- RunTestComplexParams (InternalGetAbstractSurrogate());
- }
-
- [Test]
- public void TestInterfaceComplexParams ()
- {
- RunTestComplexParams (InternalGetInterfaceSurrogate());
- }
-
- [Test]
- public void TestInstanceComplexParamsInOut ()
- {
- RunTestComplexParamsInOut (InternalGetInstanceSurrogate());
- }
-
- [Test]
- public void TestAbstractComplexParamsInOut ()
- {
- RunTestComplexParamsInOut (InternalGetAbstractSurrogate());
- }
-
- [Test]
- public void TestInterfaceComplexParamsInOut ()
- {
- RunTestComplexParamsInOut (InternalGetInterfaceSurrogate());
- }
-
- //
- // The tests runners
- //
-
- public void RunTestSimple (IRemoteObject testerSurrogate)
- {
- AssertEquals ("ReturnValue", 130772 + remoteDomId, testerSurrogate.Simple ());
- }
-
- public void RunTestPrimitiveParams (IRemoteObject testerSurrogate)
- {
- AssertEquals ("ReturnValue", "11-22-L-SG@"+remoteDomId, testerSurrogate.PrimitiveParams (11, 22, 'L', "SG"));
- }
-
- public void RunTestPrimitiveParamsInOut (IRemoteObject testerSurrogate)
- {
- int a2, a1 = 9876543;
- float b2, b1 = 82437.83f;
- char c2, c1 = 's';
- string d2, d1 = "asdASDzxcZXC";
-
- string res = testerSurrogate.PrimitiveParamsInOut (ref a1, out a2, ref b1, out b2, ref c1, out c2, ref d1, out d2);
-
- AssertEquals ("ReturnValue", "9876543-82437.83-s-asdASDzxcZXC@" + remoteDomId, res);
-
- AssertEquals ("a2", 12345678, a2);
- AssertEquals ("b2", 53455.345f, b2);
- AssertEquals ("c2", 'g', c2);
- AssertEquals ("d2", "sfARREG$5345DGDfgY7656gDFG>><<dasdasd", d2);
-
- AssertEquals ("a1", 65748392, a1);
- AssertEquals ("b1", 98395.654f, b1);
- AssertEquals ("c1", 'l', c1);
- AssertEquals ("d1", "aasbasbdyhasbduybo234243", d1);
- }
-
- public void RunTestComplexParams (IRemoteObject testerSurrogate)
- {
- ArrayList list = new ArrayList ();
- list.Add (new Complex (11,"first"));
- Complex c = new Complex (22,"second");
-
- Complex r = testerSurrogate.ComplexParams (list, c, "third");
-
- AssertNotNull ("ReturnValue is null", r);
- AssertNotNull ("ReturnValue.Child is null", r.Child);
- AssertNotNull ("ReturnValue.Child.Child is null", r.Child.Child);
-
- AssertEquals ("ReturnValue.Id", 33, r.Id);
- AssertEquals ("ReturnValue.Name", "third@"+remoteDomId, r.Name);
- AssertEquals ("ReturnValue.Child.Id", 22, r.Child.Id);
- AssertEquals ("ReturnValue.Child.Name", "second", r.Child.Name);
- AssertEquals ("ReturnValue.Child.Child.Id", 11, r.Child.Child.Id);
- AssertEquals ("ReturnValue.Child.Child.Name", "first", r.Child.Child.Name);
- }
-
- public void RunTestComplexParamsInOut (IRemoteObject testerSurrogate)
- {
- ArrayList list = new ArrayList ();
- list.Add (new Complex (11,"first"));
- list.Add (new Complex (22,"second"));
-
- Complex c;
- Complex r = testerSurrogate.ComplexParamsInOut (ref list, out c, "third");
-
- AssertNotNull ("ReturnValue is null", r);
- AssertNotNull ("c is null", c);
- AssertNotNull ("list is null", list);
- Assert ("Invalid list count", list.Count == 3);
- AssertNotNull ("list[0] is null", list[0]);
- AssertNotNull ("list[1] is null", list[1]);
- AssertNotNull ("list[2] is null", list[2]);
-
- AssertEquals ("ReturnValue.Id", 33, r.Id);
- AssertEquals ("ReturnValue.Name", "third@"+remoteDomId, r.Name);
- AssertEquals ("c.Id", 33, c.Id);
- AssertEquals ("c.Name", "third@"+remoteDomId, c.Name);
-
- AssertEquals ("list[2].Id", 33, ((Complex)list[2]).Id);
- AssertEquals ("list[2].Name", "third@"+remoteDomId, ((Complex)list[2]).Name);
- AssertEquals ("list[1].Id", 22, ((Complex)list[1]).Id);
- AssertEquals ("list[1].Name", "second", ((Complex)list[1]).Name);
- AssertEquals ("list[0].Id", 11, ((Complex)list[0]).Id);
- AssertEquals ("list[0].Name", "first", ((Complex)list[0]).Name);
- }
- }
-
- //
- // The server running in the remote domain
- //
-
- class CallsDomainServer: MarshalByRefObject
- {
- IChannelReceiver ch;
-
- public string[] Start(ChannelManager cm)
- {
- try
- {
- ch = cm.CreateServerChannel ();
- ChannelServices.RegisterChannel ((IChannel)ch);
- RemotingConfiguration.RegisterWellKnownServiceType (typeof (RemoteObject), "test1", WellKnownObjectMode.SingleCall);
- RemotingConfiguration.RegisterWellKnownServiceType (typeof (RemoteObject), "test2", WellKnownObjectMode.SingleCall);
- RemotingConfiguration.RegisterWellKnownServiceType (typeof (RemoteObject), "test3", WellKnownObjectMode.SingleCall);
- string[] uris = new string[3];
- uris[0] = ch.GetUrlsForUri ("test1")[0];
- uris[1] = ch.GetUrlsForUri ("test2")[0];
- uris[2] = ch.GetUrlsForUri ("test3")[0];
- return uris;
- }
- catch (Exception ex)
- {
- Console.WriteLine (ex.ToString());
- throw;
- }
- }
-
- public void Stop ()
- {
- if (ch != null)
- ChannelServices.UnregisterChannel (ch);
- }
-
- public int GetDomId ()
- {
- return Thread.GetDomainID();
- }
- }
-
- [Serializable]
- public abstract class ChannelManager
- {
- public abstract IChannelSender CreateClientChannel ();
- public abstract IChannelReceiver CreateServerChannel ();
- }
-
-
- //
- // Test interface
- //
- public interface IRemoteObject
- {
- int Simple ();
- string PrimitiveParams (int a, uint b, char c, string d);
- string PrimitiveParamsInOut (ref int a1, out int a2, ref float b1, out float b2, ref char c1, out char c2, ref string d1, out string d2);
- Complex ComplexParams (ArrayList a, Complex b, string c);
- Complex ComplexParamsInOut (ref ArrayList a, out Complex b, string c);
- }
-
- // Base classes for tester surrogates
-
- public abstract class InstanceSurrogate : IRemoteObject
- {
- public RemoteObject RemoteObject;
- public abstract int Simple ();
- public abstract string PrimitiveParams (int a, uint b, char c, string d);
- public abstract string PrimitiveParamsInOut (ref int a1, out int a2, ref float b1, out float b2, ref char c1, out char c2, ref string d1, out string d2);
- public abstract Complex ComplexParams (ArrayList a, Complex b, string c);
- public abstract Complex ComplexParamsInOut (ref ArrayList a, out Complex b, string c);
- }
-
- public abstract class AbstractSurrogate : IRemoteObject
- {
- public AbstractRemoteObject RemoteObject;
- public abstract int Simple ();
- public abstract string PrimitiveParams (int a, uint b, char c, string d);
- public abstract string PrimitiveParamsInOut (ref int a1, out int a2, ref float b1, out float b2, ref char c1, out char c2, ref string d1, out string d2);
- public abstract Complex ComplexParams (ArrayList a, Complex b, string c);
- public abstract Complex ComplexParamsInOut (ref ArrayList a, out Complex b, string c);
- }
-
- public abstract class InterfaceSurrogate : IRemoteObject
- {
- public IRemoteObject RemoteObject;
- public abstract int Simple ();
- public abstract string PrimitiveParams (int a, uint b, char c, string d);
- public abstract string PrimitiveParamsInOut (ref int a1, out int a2, ref float b1, out float b2, ref char c1, out char c2, ref string d1, out string d2);
- public abstract Complex ComplexParams (ArrayList a, Complex b, string c);
- public abstract Complex ComplexParamsInOut (ref ArrayList a, out Complex b, string c);
- }
-
-
- //
- // Test abstract base class
- //
-
- public abstract class AbstractRemoteObject : MarshalByRefObject
- {
- public abstract int Simple ();
- public abstract string PrimitiveParams (int a, uint b, char c, string d);
- public abstract string PrimitiveParamsInOut (ref int a1, out int a2, ref float b1, out float b2, ref char c1, out char c2, ref string d1, out string d2);
- public abstract Complex ComplexParams (ArrayList a, Complex b, string c);
- public abstract Complex ComplexParamsInOut (ref ArrayList a, out Complex b, string c);
- }
-
- //
- // Test class
- //
-
- public class RemoteObject : AbstractRemoteObject, IRemoteObject
- {
- public override int Simple ()
- {
- return 130772 + Thread.GetDomainID();
- }
-
- public override string PrimitiveParams (int a, uint b, char c, string d)
- {
- return "" + a + "-" + b + "-" + c + "-" + d + "@" + Thread.GetDomainID();
- }
-
- public override string PrimitiveParamsInOut (ref int a1, out int a2, ref float b1, out float b2, ref char c1, out char c2, ref string d1, out string d2)
- {
- string res = "" + a1 + "-" + b1 + "-" + c1 + "-" + d1 + "@" + Thread.GetDomainID();
- a2 = 12345678;
- b2 = 53455.345f;
- c2 = 'g';
- d2 = "sfARREG$5345DGDfgY7656gDFG>><<dasdasd";
- a1 = 65748392;
- b1 = 98395.654f;
- c1 = 'l';
- d1 = "aasbasbdyhasbduybo234243";
- return res;
- }
-
- public override Complex ComplexParams (ArrayList a, Complex b, string c)
- {
- Complex cp = new Complex (33,c+ "@" + Thread.GetDomainID());
- cp.Child = b;
- cp.Child.Child = (Complex)a[0];
- return cp;
- }
-
- public override Complex ComplexParamsInOut (ref ArrayList a, out Complex b, string c)
- {
- b = new Complex (33,c+ "@" + Thread.GetDomainID());
- a.Add (b);
- return b;
- }
- }
-
- [Serializable]
- public class Complex
- {
- public Complex (int id, string name)
- {
- Id = id;
- Name = name;
- }
-
- public string Name;
- public int Id;
- public Complex Child;
- }
-}
-
-
diff --git a/mcs/class/System.Runtime.Remoting/Test/CallSeq.cs b/mcs/class/System.Runtime.Remoting/Test/CallSeq.cs
index 32210d7c752..5ab15951d0a 100644
--- a/mcs/class/System.Runtime.Remoting/Test/CallSeq.cs
+++ b/mcs/class/System.Runtime.Remoting/Test/CallSeq.cs
@@ -19,42 +19,17 @@ namespace MonoTests.System.Runtime.Remoting
static int checkPos = 0;
static int writePos = 0;
static string name = "";
- static ArrayList contexts = new ArrayList ();
- static int domId = 1;
public static void Add (string msg)
{
writePos++;
-
- msg = writePos.ToString ("000") + " (d" + CommonDomainId + ",c" + CommonContextId + ") " + msg;
+ msg = writePos.ToString ("000") + " (d" + Thread.GetDomainID() + ",c" + Thread.CurrentContext.ContextID + ") " + msg;
calls.Add (msg);
}
- public static int CommonContextId
- {
- get
- {
- int id = Thread.CurrentContext.ContextID;
- int idc = contexts.IndexOf (id);
- if (idc == -1)
- {
- idc = contexts.Count;
- contexts.Add (id);
- }
- return idc;
- }
- }
-
- public static int CommonDomainId
- {
- get { return domId; }
- set { domId = value; }
- }
-
public static void Init (string str)
{
calls = new ArrayList();
- contexts = new ArrayList ();
name = str;
checkPos = 0;
writePos = 0;
diff --git a/mcs/class/System.Runtime.Remoting/Test/ChangeLog b/mcs/class/System.Runtime.Remoting/Test/ChangeLog
index 7af5e39fec5..2cedeb2afb7 100644
--- a/mcs/class/System.Runtime.Remoting/Test/ChangeLog
+++ b/mcs/class/System.Runtime.Remoting/Test/ChangeLog
@@ -1,23 +1,3 @@
-2003-08-22 Lluis Sanchez Gual <lluis@ximian.com>
-
- * BaseCalls.cs: Create 3 test remote objects, one for each kind of access,
- to avoid reuse of client proxies.
- * CallSeq.cs: Now, "domain ID" is set manually.
- * ContextsTest.cs: Added initialization of common domain id. Other small fixes.
- * ReflectionCalls.cs: Get the method for the invoke for the correct type.
- GetType() for a proxy to interface always return MarshalByRefObject.
- * TcpCalls.cs, HttpCalls.cs: Added delegate tests.
- * DelegateCalls.cs: New test suite for calls using delegates.
-
-2003-08-20 Lluis Sanchez Gual <lluis@ximian.com>
-
- * AsyncCalls.cs, BaseCalls.cs, HttpCalls.cs, ReflectionCalls.cs, SyncCalls.cs,
- TcpCalls.cs: new test suite for remoting. It tests sync calls, async calls
- and reflection calls using tcp and http channels.
- * CallSeq.cs, ContextHookAttribute.cs: Add methods for getting a context and
- domain ids that are the same between tests runs.
- * ContextsTest.cs: unregister channel on test shutdown.
-
2003-07-23 Lluis Sanchez Gual <lluis@ximian.com>
* ContextsTest.cs, CallSeq.cs, ContextHookAttribute.cs, ServerObject.cs: Added.
diff --git a/mcs/class/System.Runtime.Remoting/Test/ContextHookAttribute.cs b/mcs/class/System.Runtime.Remoting/Test/ContextHookAttribute.cs
index df5f4dcd154..0c78a2bb136 100644
--- a/mcs/class/System.Runtime.Remoting/Test/ContextHookAttribute.cs
+++ b/mcs/class/System.Runtime.Remoting/Test/ContextHookAttribute.cs
@@ -30,13 +30,12 @@ namespace MonoTests.System.Runtime.Remoting
{
id = idp;
if (id != "") id += ".";
- id += "d" + CallSeq.CommonDomainId;
+ id += "d" + Thread.GetDomainID();
this.newContext = newContext;
}
public override object TypeId
{
-
get { return "ContextHook"; }
}
diff --git a/mcs/class/System.Runtime.Remoting/Test/ContextsTest.cs b/mcs/class/System.Runtime.Remoting/Test/ContextsTest.cs
index aabe7f28e63..273705d54a6 100644
--- a/mcs/class/System.Runtime.Remoting/Test/ContextsTest.cs
+++ b/mcs/class/System.Runtime.Remoting/Test/ContextsTest.cs
@@ -28,7 +28,6 @@ namespace MonoTests.System.Runtime.Remoting
[TestFixtureSetUp]
public void Run()
{
- CallSeq.CommonDomainId = 1;
Context.RegisterDynamicProperty (new DynProperty("global"), null, null);
ch = new TcpChannel(0);
@@ -39,8 +38,7 @@ namespace MonoTests.System.Runtime.Remoting
public void End ()
{
Context.UnregisterDynamicProperty ("global", null, null);
- if (ch != null)
- ChannelServices.UnregisterChannel (ch);
+// ChannelServices.UnregisterChannel (ch);
}
[Test]
@@ -59,8 +57,6 @@ namespace MonoTests.System.Runtime.Remoting
[Test]
public void TestNewContext ()
{
- try
- {
CallSeq.Init("TestNewContext");
CallSeq.Add (">> TestNewContext");
object[] at = new object[] { new ContextHookAttribute ("1",true)};
@@ -70,11 +66,6 @@ namespace MonoTests.System.Runtime.Remoting
RunTestObject (list);
CallSeq.Add ("<< TestNewContext");
CallSeq.Check (Checks.seqNewContext,1);
- }
- catch (Exception eX)
- {
- Console.WriteLine (eX);
- }
}
[Test]
@@ -82,31 +73,21 @@ namespace MonoTests.System.Runtime.Remoting
{
AppDomain domain = AppDomain.CreateDomain ("test");
DomainServer server = (DomainServer) domain.CreateInstanceAndUnwrap(GetType().Assembly.FullName,"MonoTests.System.Runtime.Remoting.DomainServer");
- try
- {
- CallSeq.Init("TestRemoteContext");
- CallSeq.Add (">> TestRemoteContext");
- object[] at = new object[] { new ContextHookAttribute ("1",true), new UrlAttribute ("tcp://localhost:1122")};
- CallSeq.Add (">> Creating instance");
- ServerList list = (ServerList) Activator.CreateInstance (typeof (ServerList),null,at);
- CallSeq.Add ("<< Creating instance");
- RunTestObject (list);
- CallSeq.Add ("<< TestRemoteContext");
- CallSeq.Check (Checks.seqRemoteContext,1);
- CallSeq.Init ("TestRemoteContext Server");
- CallSeq.Seq = server.GetRemoteSeq ();
- CallSeq.Check (Checks.seqRemoteContext,2);
- }
- catch (Exception ex)
- {
- Console.WriteLine (ex);
- throw ex;
- }
- finally
- {
- server.Stop ();
- }
+ CallSeq.Init("TestRemoteContext");
+ CallSeq.Add (">> TestRemoteContext");
+ object[] at = new object[] { new ContextHookAttribute ("1",true), new UrlAttribute ("tcp://localhost:1122")};
+ CallSeq.Add (">> Creating instance");
+ ServerList list = (ServerList) Activator.CreateInstance (typeof (ServerList),null,at);
+ CallSeq.Add ("<< Creating instance");
+ RunTestObject (list);
+ CallSeq.Add ("<< TestRemoteContext");
+ CallSeq.Check (Checks.seqRemoteContext,1);
+
+ CallSeq.Init ("TestRemoteContext Server");
+ CallSeq.Seq = server.GetRemoteSeq ();
+ CallSeq.Check (Checks.seqRemoteContext,2);
+ server.Stop ();
// AppDomain.Unload (domain);
}
@@ -190,7 +171,7 @@ namespace MonoTests.System.Runtime.Remoting
}
catch (Exception ex)
{
- // Console.WriteLine (ex.ToString());
+ Console.WriteLine (ex.ToString());
throw;
}
}
@@ -201,8 +182,7 @@ namespace MonoTests.System.Runtime.Remoting
TcpChannel ch;
public DomainServer()
- {
- CallSeq.CommonDomainId = 2;
+ {
try
{
ch = new TcpChannel(1122);
@@ -225,8 +205,7 @@ namespace MonoTests.System.Runtime.Remoting
public void Stop ()
{
- if (ch != null)
- ChannelServices.UnregisterChannel (ch);
+// ChannelServices.UnregisterChannel (ch);
}
}
@@ -408,7 +387,6 @@ namespace MonoTests.System.Runtime.Remoting
"119 (d1,c1) --> ServerContextSink(x.d1) SyncProcessMessage FieldGetter",
"120 (d1,c1) --> ObjectSink(1.d1) SyncProcessMessage FieldGetter",
"121 (d1,c1) --> ObjectSink(x.d1) SyncProcessMessage FieldGetter",
-
"122 (d1,c1) <-- ObjectSink(x.d1) SyncProcessMessage FieldGetter",
"123 (d1,c1) <-- ObjectSink(1.d1) SyncProcessMessage FieldGetter",
"124 (d1,c1) <-- ServerContextSink(x.d1) SyncProcessMessage FieldGetter",
@@ -452,7 +430,6 @@ namespace MonoTests.System.Runtime.Remoting
"162 (d1,c0) <-> defcontext DynamicSink Start ParameterTest2 client:True",
"163 (d1,c1) <-> global DynamicSink Start ParameterTest2 client:False",
"164 (d1,c1) --> ServerContextSink(1.d1) SyncProcessMessage ParameterTest2",
-
"165 (d1,c1) --> ServerContextSink(x.d1) SyncProcessMessage ParameterTest2",
"166 (d1,c1) --> ObjectSink(1.d1) SyncProcessMessage ParameterTest2",
"167 (d1,c1) --> ObjectSink(x.d1) SyncProcessMessage ParameterTest2",
@@ -631,7 +608,6 @@ namespace MonoTests.System.Runtime.Remoting
"339 (d1,c1) <-> global DynamicSink Finish ProcessItems client:False",
"340 (d1,c0) <-> global DynamicSink Finish ProcessItems client:True",
"341 (d1,c0) <-> defcontext DynamicSink Finish ProcessItems client:True",
-
"342 (d1,c0) <-- EnvoySink(1.d1) SyncProcessMessage ProcessItems",
"343 (d1,c0) <-- EnvoySink(x.d1) SyncProcessMessage ProcessItems",
"344 (d1,c0) <-> proxy DynamicSink Finish ProcessItems client:True",
@@ -746,7 +722,6 @@ namespace MonoTests.System.Runtime.Remoting
"034 (d1,c0) <-> defcontext DynamicSink Finish FieldSetter client:True",
"035 (d1,c0) <-- EnvoySink(1.d1) SyncProcessMessage FieldSetter",
"036 (d1,c0) <-- EnvoySink(x.d1) SyncProcessMessage FieldSetter",
-
"037 (d1,c0) <-- EnvoySink(x.d2) SyncProcessMessage FieldSetter",
"038 (d1,c0) <-> proxy DynamicSink Finish FieldSetter client:True",
diff --git a/mcs/class/System.Runtime.Remoting/Test/DelegateCalls.cs b/mcs/class/System.Runtime.Remoting/Test/DelegateCalls.cs
deleted file mode 100644
index 7655ea93c62..00000000000
--- a/mcs/class/System.Runtime.Remoting/Test/DelegateCalls.cs
+++ /dev/null
@@ -1,120 +0,0 @@
-//
-// MonoTests.System.Runtime.Remoting.DelegateCalls.cs
-//
-// Author: Lluis Sanchez Gual (lluis@ximian.com)
-//
-// 2003 (C) Copyright, Ximian, Inc.
-//
-
-using System;
-using System.Collections;
-using NUnit.Framework;
-
-namespace MonoTests.System.Runtime.Remoting
-{
- public abstract class DelegateCallTest : BaseCallTest
- {
- public override InstanceSurrogate GetInstanceSurrogate () { return new DelegateInstanceSurrogate (); }
- public override AbstractSurrogate GetAbstractSurrogate () { return new DelegateAbstractSurrogate (); }
- public override InterfaceSurrogate GetInterfaceSurrogate () { return new DelegateInterfaceSurrogate (); }
- }
-
- public class DelegateInstanceSurrogate : InstanceSurrogate
- {
- public override int Simple ()
- {
- DelegateSimple de = new DelegateSimple (RemoteObject.Simple);
- return de ();
- }
-
- public override string PrimitiveParams (int a, uint b, char c, string d)
- {
- DelegatePrimitiveParams de = new DelegatePrimitiveParams (RemoteObject.PrimitiveParams);
- return de (a,b,c,d);
- }
-
- public override string PrimitiveParamsInOut (ref int a1, out int a2, ref float b1, out float b2, ref char c1, out char c2, ref string d1, out string d2)
- {
- DelegatePrimitiveParamsInOut de = new DelegatePrimitiveParamsInOut (RemoteObject.PrimitiveParamsInOut);
- return de (ref a1, out a2, ref b1, out b2, ref c1, out c2, ref d1, out d2);
- }
-
- public override Complex ComplexParams (ArrayList a, Complex b, string c)
- {
- DelegateComplexParams de = new DelegateComplexParams (RemoteObject.ComplexParams);
- return de (a,b,c);
- }
-
- public override Complex ComplexParamsInOut (ref ArrayList a, out Complex b, string c)
- {
- DelegateComplexParamsInOut de = new DelegateComplexParamsInOut (RemoteObject.ComplexParamsInOut);
- return de (ref a, out b, c);
- }
- }
-
- public class DelegateAbstractSurrogate : AbstractSurrogate
- {
- public override int Simple ()
- {
- DelegateSimple de = new DelegateSimple (RemoteObject.Simple);
- return de ();
- }
-
- public override string PrimitiveParams (int a, uint b, char c, string d)
- {
- DelegatePrimitiveParams de = new DelegatePrimitiveParams (RemoteObject.PrimitiveParams);
- return de (a,b,c,d);
- }
-
- public override string PrimitiveParamsInOut (ref int a1, out int a2, ref float b1, out float b2, ref char c1, out char c2, ref string d1, out string d2)
- {
- DelegatePrimitiveParamsInOut de = new DelegatePrimitiveParamsInOut (RemoteObject.PrimitiveParamsInOut);
- return de (ref a1, out a2, ref b1, out b2, ref c1, out c2, ref d1, out d2);
- }
-
- public override Complex ComplexParams (ArrayList a, Complex b, string c)
- {
- DelegateComplexParams de = new DelegateComplexParams (RemoteObject.ComplexParams);
- return de (a,b,c);
- }
-
- public override Complex ComplexParamsInOut (ref ArrayList a, out Complex b, string c)
- {
- DelegateComplexParamsInOut de = new DelegateComplexParamsInOut (RemoteObject.ComplexParamsInOut);
- return de (ref a, out b, c);
- }
- }
-
- public class DelegateInterfaceSurrogate : InterfaceSurrogate
- {
- public override int Simple ()
- {
- DelegateSimple de = new DelegateSimple (RemoteObject.Simple);
- return de ();
- }
-
- public override string PrimitiveParams (int a, uint b, char c, string d)
- {
- DelegatePrimitiveParams de = new DelegatePrimitiveParams (RemoteObject.PrimitiveParams);
- return de (a,b,c,d);
- }
-
- public override string PrimitiveParamsInOut (ref int a1, out int a2, ref float b1, out float b2, ref char c1, out char c2, ref string d1, out string d2)
- {
- DelegatePrimitiveParamsInOut de = new DelegatePrimitiveParamsInOut (RemoteObject.PrimitiveParamsInOut);
- return de (ref a1, out a2, ref b1, out b2, ref c1, out c2, ref d1, out d2);
- }
-
- public override Complex ComplexParams (ArrayList a, Complex b, string c)
- {
- DelegateComplexParams de = new DelegateComplexParams (RemoteObject.ComplexParams);
- return de (a,b,c);
- }
-
- public override Complex ComplexParamsInOut (ref ArrayList a, out Complex b, string c)
- {
- DelegateComplexParamsInOut de = new DelegateComplexParamsInOut (RemoteObject.ComplexParamsInOut);
- return de (ref a, out b, c);
- }
- }
-}
diff --git a/mcs/class/System.Runtime.Remoting/Test/HttpCalls.cs b/mcs/class/System.Runtime.Remoting/Test/HttpCalls.cs
deleted file mode 100644
index 6ba81691fd9..00000000000
--- a/mcs/class/System.Runtime.Remoting/Test/HttpCalls.cs
+++ /dev/null
@@ -1,67 +0,0 @@
-//
-// MonoTests.System.Runtime.Remoting.HttpCalls.cs
-//
-// Author: Lluis Sanchez Gual (lluis@ximian.com)
-//
-// 2003 (C) Copyright, Ximian, Inc.
-//
-
-using System;
-using System.Runtime.Remoting;
-using System.Runtime.Remoting.Channels;
-using System.Runtime.Remoting.Channels.Http;
-using NUnit.Framework;
-
-namespace MonoTests.System.Runtime.Remoting
-{
- [TestFixture]
- public class HttpSyncCallTest : SyncCallTest
- {
- public override ChannelManager CreateChannelManager ()
- {
- return new HttpChannelManager ();
- }
- }
-
- [TestFixture]
- public class HttpAsyncCallTest : AsyncCallTest
- {
- public override ChannelManager CreateChannelManager ()
- {
- return new HttpChannelManager ();
- }
- }
-
- [TestFixture]
- public class HttpReflectionCallTest : ReflectionCallTest
- {
- public override ChannelManager CreateChannelManager ()
- {
- return new HttpChannelManager ();
- }
- }
-
- [TestFixture]
- public class HttpDelegateCallTest : DelegateCallTest
- {
- public override ChannelManager CreateChannelManager ()
- {
- return new HttpChannelManager ();
- }
- }
-
- [Serializable]
- public class HttpChannelManager : ChannelManager
- {
- public override IChannelSender CreateClientChannel ()
- {
- return new HttpChannel ();
- }
-
- public override IChannelReceiver CreateServerChannel ()
- {
- return new HttpChannel (1133);
- }
- }
-}
-
diff --git a/mcs/class/System.Runtime.Remoting/Test/ReflectionCalls.cs b/mcs/class/System.Runtime.Remoting/Test/ReflectionCalls.cs
deleted file mode 100644
index e7d4b5cd253..00000000000
--- a/mcs/class/System.Runtime.Remoting/Test/ReflectionCalls.cs
+++ /dev/null
@@ -1,154 +0,0 @@
-//
-// MonoTests.System.Runtime.Remoting.ReflectionCalls.cs
-//
-// Author: Lluis Sanchez Gual (lluis@ximian.com)
-//
-// 2003 (C) Copyright, Ximian, Inc.
-//
-
-using System;
-using System.Reflection;
-using System.Collections;
-using NUnit.Framework;
-
-namespace MonoTests.System.Runtime.Remoting
-{
- public abstract class ReflectionCallTest : BaseCallTest
- {
- public override InstanceSurrogate GetInstanceSurrogate () { return new ReflectionInstanceSurrogate (); }
- public override AbstractSurrogate GetAbstractSurrogate () { return new ReflectionAbstractSurrogate (); }
- public override InterfaceSurrogate GetInterfaceSurrogate () { return new ReflectionInterfaceSurrogate (); }
-
- public static int Simple (Type type, object target)
- {
- object[] parms = new object[0];
- MethodBase m = type.GetMethod ("Simple");
- return (int) m.Invoke (target, parms);
- }
-
- public static string PrimitiveParams (Type type, object target, int a, uint b, char c, string d)
- {
- object[] parms = new object[] {a,b,c,d};
- MethodBase m = type.GetMethod ("PrimitiveParams");
- return (string) m.Invoke (target, parms);
- }
-
- public static string PrimitiveParamsInOut (Type type, object target, ref int a1, out int a2, ref float b1, out float b2, ref char c1, out char c2, ref string d1, out string d2)
- {
- object[] parms = new object[] {a1,0,b1,0f,c1,'\0',d1,null};
- MethodBase m = type.GetMethod ("PrimitiveParamsInOut");
- string res = (string) m.Invoke (target, parms);
- a1 = (int)parms[0];
- b1 = (float)parms[2];
- c1 = (char)parms[4];
- d1 = (string)parms[6];
- a2 = (int)parms[1];
- b2 = (float)parms[3];
- c2 = (char)parms[5];
- d2 = (string)parms[7];
- return res;
- }
-
- public static Complex ComplexParams (Type type, object target, ArrayList a, Complex b, string c)
- {
- object[] parms = new object[] {a,b,c};
- MethodBase m = type.GetMethod ("ComplexParams");
- return (Complex) m.Invoke (target, parms);
- }
-
- public static Complex ComplexParamsInOut (Type type, object target, ref ArrayList a, out Complex b, string c)
- {
- object[] parms = new object[] {a,null,c};
- MethodBase m = type.GetMethod ("ComplexParamsInOut");
- Complex res = (Complex) m.Invoke (target, parms);
- a = (ArrayList) parms[0];
- b = (Complex) parms[1];
- return res;
- }
- }
-
- public class ReflectionInstanceSurrogate : InstanceSurrogate
- {
- public override int Simple ()
- {
- return ReflectionCallTest.Simple (typeof (RemoteObject), RemoteObject);
- }
-
- public override string PrimitiveParams (int a, uint b, char c, string d)
- {
- return ReflectionCallTest.PrimitiveParams (typeof (RemoteObject), RemoteObject, a, b, c, d);
- }
-
- public override string PrimitiveParamsInOut (ref int a1, out int a2, ref float b1, out float b2, ref char c1, out char c2, ref string d1, out string d2)
- {
- return ReflectionCallTest.PrimitiveParamsInOut (typeof (RemoteObject), RemoteObject, ref a1, out a2, ref b1, out b2, ref c1, out c2, ref d1, out d2);
- }
-
- public override Complex ComplexParams (ArrayList a, Complex b, string c)
- {
- return ReflectionCallTest.ComplexParams (typeof (RemoteObject), RemoteObject, a, b, c);
- }
-
- public override Complex ComplexParamsInOut (ref ArrayList a, out Complex b, string c)
- {
- return ReflectionCallTest.ComplexParamsInOut (typeof (RemoteObject), RemoteObject, ref a, out b, c);
- }
- }
-
- public class ReflectionAbstractSurrogate : AbstractSurrogate
- {
- public override int Simple ()
- {
- return ReflectionCallTest.Simple (typeof (AbstractRemoteObject), RemoteObject);
- }
-
- public override string PrimitiveParams (int a, uint b, char c, string d)
- {
- return ReflectionCallTest.PrimitiveParams (typeof (AbstractRemoteObject), RemoteObject, a, b, c, d);
- }
-
- public override string PrimitiveParamsInOut (ref int a1, out int a2, ref float b1, out float b2, ref char c1, out char c2, ref string d1, out string d2)
- {
- return ReflectionCallTest.PrimitiveParamsInOut (typeof (AbstractRemoteObject), RemoteObject, ref a1, out a2, ref b1, out b2, ref c1, out c2, ref d1, out d2);
- }
-
- public override Complex ComplexParams (ArrayList a, Complex b, string c)
- {
- return ReflectionCallTest.ComplexParams (typeof (AbstractRemoteObject), RemoteObject, a, b, c);
- }
-
- public override Complex ComplexParamsInOut (ref ArrayList a, out Complex b, string c)
- {
- return ReflectionCallTest.ComplexParamsInOut (typeof (AbstractRemoteObject), RemoteObject, ref a, out b, c);
- }
- }
-
- public class ReflectionInterfaceSurrogate : InterfaceSurrogate
- {
- public override int Simple ()
- {
- return ReflectionCallTest.Simple (typeof (IRemoteObject), RemoteObject);
- }
-
- public override string PrimitiveParams (int a, uint b, char c, string d)
- {
- return ReflectionCallTest.PrimitiveParams (typeof (IRemoteObject), RemoteObject, a, b, c, d);
- }
-
- public override string PrimitiveParamsInOut (ref int a1, out int a2, ref float b1, out float b2, ref char c1, out char c2, ref string d1, out string d2)
- {
- return ReflectionCallTest.PrimitiveParamsInOut (typeof (IRemoteObject), RemoteObject, ref a1, out a2, ref b1, out b2, ref c1, out c2, ref d1, out d2);
- }
-
- public override Complex ComplexParams (ArrayList a, Complex b, string c)
- {
- return ReflectionCallTest.ComplexParams (typeof (IRemoteObject), RemoteObject, a, b, c);
- }
-
- public override Complex ComplexParamsInOut (ref ArrayList a, out Complex b, string c)
- {
- return ReflectionCallTest.ComplexParamsInOut (typeof (IRemoteObject), RemoteObject, ref a, out b, c);
- }
- }
-}
-
diff --git a/mcs/class/System.Runtime.Remoting/Test/SyncCalls.cs b/mcs/class/System.Runtime.Remoting/Test/SyncCalls.cs
deleted file mode 100644
index 7b015e33de5..00000000000
--- a/mcs/class/System.Runtime.Remoting/Test/SyncCalls.cs
+++ /dev/null
@@ -1,106 +0,0 @@
-//
-// MonoTests.System.Runtime.Remoting.SyncCalls.cs
-//
-// Author: Lluis Sanchez Gual (lluis@ximian.com)
-//
-// 2003 (C) Copyright, Ximian, Inc.
-//
-
-using System;
-using System.Collections;
-using NUnit.Framework;
-
-namespace MonoTests.System.Runtime.Remoting
-{
- public abstract class SyncCallTest : BaseCallTest
- {
- public override InstanceSurrogate GetInstanceSurrogate () { return new SyncInstanceSurrogate (); }
- public override AbstractSurrogate GetAbstractSurrogate () { return new SyncAbstractSurrogate (); }
- public override InterfaceSurrogate GetInterfaceSurrogate () { return new SyncInterfaceSurrogate (); }
- }
-
- public class SyncInstanceSurrogate : InstanceSurrogate
- {
- public override int Simple ()
- {
- return RemoteObject.Simple ();
- }
-
- public override string PrimitiveParams (int a, uint b, char c, string d)
- {
- return RemoteObject.PrimitiveParams (a, b, c, d);
- }
-
- public override string PrimitiveParamsInOut (ref int a1, out int a2, ref float b1, out float b2, ref char c1, out char c2, ref string d1, out string d2)
- {
- return RemoteObject.PrimitiveParamsInOut (ref a1, out a2, ref b1, out b2, ref c1, out c2, ref d1, out d2);
- }
-
- public override Complex ComplexParams (ArrayList a, Complex b, string c)
- {
- return RemoteObject.ComplexParams (a, b, c);
- }
-
- public override Complex ComplexParamsInOut (ref ArrayList a, out Complex b, string c)
- {
- return RemoteObject.ComplexParamsInOut (ref a, out b, c);
- }
- }
-
- public class SyncAbstractSurrogate : AbstractSurrogate
- {
- public override int Simple ()
- {
- return RemoteObject.Simple ();
- }
-
- public override string PrimitiveParams (int a, uint b, char c, string d)
- {
- return RemoteObject.PrimitiveParams (a, b, c, d);
- }
-
- public override string PrimitiveParamsInOut (ref int a1, out int a2, ref float b1, out float b2, ref char c1, out char c2, ref string d1, out string d2)
- {
- return RemoteObject.PrimitiveParamsInOut (ref a1, out a2, ref b1, out b2, ref c1, out c2, ref d1, out d2);
- }
-
- public override Complex ComplexParams (ArrayList a, Complex b, string c)
- {
- return RemoteObject.ComplexParams (a, b, c);
- }
-
- public override Complex ComplexParamsInOut (ref ArrayList a, out Complex b, string c)
- {
- return RemoteObject.ComplexParamsInOut (ref a, out b, c);
- }
- }
-
- public class SyncInterfaceSurrogate : InterfaceSurrogate
- {
- public override int Simple ()
- {
- return RemoteObject.Simple ();
- }
-
- public override string PrimitiveParams (int a, uint b, char c, string d)
- {
- return RemoteObject.PrimitiveParams (a, b, c, d);
- }
-
- public override string PrimitiveParamsInOut (ref int a1, out int a2, ref float b1, out float b2, ref char c1, out char c2, ref string d1, out string d2)
- {
- return RemoteObject.PrimitiveParamsInOut (ref a1, out a2, ref b1, out b2, ref c1, out c2, ref d1, out d2);
- }
-
- public override Complex ComplexParams (ArrayList a, Complex b, string c)
- {
- return RemoteObject.ComplexParams (a, b, c);
- }
-
- public override Complex ComplexParamsInOut (ref ArrayList a, out Complex b, string c)
- {
- return RemoteObject.ComplexParamsInOut (ref a, out b, c);
- }
- }
-}
-
diff --git a/mcs/class/System.Runtime.Remoting/Test/TcpCalls.cs b/mcs/class/System.Runtime.Remoting/Test/TcpCalls.cs
deleted file mode 100644
index 6639d76f6be..00000000000
--- a/mcs/class/System.Runtime.Remoting/Test/TcpCalls.cs
+++ /dev/null
@@ -1,67 +0,0 @@
-//
-// MonoTests.System.Runtime.Remoting.TcpCalls.cs
-//
-// Author: Lluis Sanchez Gual (lluis@ximian.com)
-//
-// 2003 (C) Copyright, Ximian, Inc.
-//
-
-using System;
-using System.Runtime.Remoting;
-using System.Runtime.Remoting.Channels;
-using System.Runtime.Remoting.Channels.Tcp;
-using NUnit.Framework;
-
-namespace MonoTests.System.Runtime.Remoting
-{
- [TestFixture]
- public class TcpSyncCallTest : SyncCallTest
- {
- public override ChannelManager CreateChannelManager ()
- {
- return new TcpChannelManager ();
- }
- }
-
- [TestFixture]
- public class TcpAsyncCallTest : AsyncCallTest
- {
- public override ChannelManager CreateChannelManager ()
- {
- return new TcpChannelManager ();
- }
- }
-
- [TestFixture]
- public class TcpReflectionCallTest : ReflectionCallTest
- {
- public override ChannelManager CreateChannelManager ()
- {
- return new TcpChannelManager ();
- }
- }
-
- [TestFixture]
- public class TcpDelegateCallTest : DelegateCallTest
- {
- public override ChannelManager CreateChannelManager ()
- {
- return new TcpChannelManager ();
- }
- }
-
- [Serializable]
- public class TcpChannelManager : ChannelManager
- {
- public override IChannelSender CreateClientChannel ()
- {
- return new TcpChannel (0);
- }
-
- public override IChannelReceiver CreateServerChannel ()
- {
- return new TcpChannel (1122);
- }
- }
-}
-
diff --git a/mcs/class/System.Runtime.Serialization.Formatters.Soap/ChangeLog b/mcs/class/System.Runtime.Serialization.Formatters.Soap/ChangeLog
index 99930f6d60b..c1a3a00c632 100644
--- a/mcs/class/System.Runtime.Serialization.Formatters.Soap/ChangeLog
+++ b/mcs/class/System.Runtime.Serialization.Formatters.Soap/ChangeLog
@@ -1,9 +1,3 @@
-2003-08-25 Lluis Sanchez Gual <lluis@ximian.com>
-
- * SoapTypeMapper.cs: Added mappings for more primitive types.
- * SoapWriter.cs: Use XmlSchema.Namespace and XmlSchema.InstanceNamespace
- instead of string constants.
-
2003-06-30 Jean-Marc Andre <jean-marc.andre@polymtl.ca>
* SoapServices:
removed because it is now included in the
diff --git a/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/SoapTypeMapper.cs b/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/SoapTypeMapper.cs
index bad2897af56..e5c9da532ea 100644
--- a/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/SoapTypeMapper.cs
+++ b/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/SoapTypeMapper.cs
@@ -11,7 +11,6 @@ using System.Reflection;
using System.Collections;
using System.Runtime.Remoting;
using System.Xml.Serialization;
-using System.Xml.Schema;
namespace System.Runtime.Serialization.Formatters.Soap {
@@ -27,9 +26,7 @@ namespace System.Runtime.Serialization.Formatters.Soap {
// returns the SoapTypeMapping corresponding to the System.Type
public static SoapTypeMapping GetSoapType(Type type) {
object rtnMapping;
-
- if (type.IsByRef) type = type.GetElementType ();
-
+
if(type.IsArray){
rtnMapping = _mappingTable[typeof(System.Array)];
@@ -38,6 +35,7 @@ namespace System.Runtime.Serialization.Formatters.Soap {
rtnMapping = (object) _mappingTable[type];
if(rtnMapping == null){
+
string sTypeNamespace;
AssemblyName assName = type.Assembly.GetName();
if(assName.Name.StartsWith("mscorlib")) sTypeNamespace = "http://schemas.microsoft.com/clr/ns/"+type.Namespace;
@@ -81,13 +79,6 @@ namespace System.Runtime.Serialization.Formatters.Soap {
return (Type)rtnObject;
}
-
- private static void RegisterSchemaType (Type type, string typeName, bool canBeValue, bool isPrimitive,bool isValueType,bool needId)
- {
- SoapTypeMapping mapping = new SoapTypeMapping (type, typeName, canBeValue, isPrimitive, isValueType, needId);
- _mappingTable.Add(type, mapping);
- _invertMappingTable.Add(mapping, type);
- }
// initialize the mapping tables
private static void InitMappingTable() {
@@ -97,26 +88,51 @@ namespace System.Runtime.Serialization.Formatters.Soap {
mapping = new SoapTypeMapping(typeof(string), "string", true, false, false, true);
_mappingTable.Add(typeof(string),mapping);
_invertMappingTable.Add(mapping, typeof(string));
- mapping = new SoapTypeMapping(typeof(string), "string", XmlSchema.Namespace, true, false, false, true);
+ mapping = new SoapTypeMapping(typeof(string), "string", "http://www.w3.org/2001/XMLSchema", true, false, false, true);
_invertMappingTable.Add(mapping, typeof(string));
-
- RegisterSchemaType (typeof(short), "short", true, true, true, false);
- RegisterSchemaType (typeof(ushort), "unsignedShort", true, true, true, false);
- RegisterSchemaType (typeof(int), "int", true, true, true, false);
- RegisterSchemaType (typeof(uint), "unsignedInt", true, true, true, false);
- RegisterSchemaType (typeof(long), "long", true, true, true, false);
- RegisterSchemaType (typeof(ulong), "unsignedLong", true, true, true, false);
- RegisterSchemaType (typeof(decimal), "decimal", true, true, true, false);
- RegisterSchemaType (typeof(sbyte), "byte", true, true, true, false);
- RegisterSchemaType (typeof(byte), "unsignedByte", true, true, true, false);
- RegisterSchemaType (typeof(DateTime), "dateTime", true, true, true, false);
- RegisterSchemaType (typeof(TimeSpan), "duration", true, true, true, false);
- RegisterSchemaType (typeof(double), "double", true, true, true, false);
- RegisterSchemaType (typeof(Char), "char", true, true, true, false);
- RegisterSchemaType (typeof(bool), "boolean", true, true, true, false);
- RegisterSchemaType (typeof(System.Single), "float", true, true, true, false);
- RegisterSchemaType (typeof(System.Array), "Array", false, false, false, true);
- RegisterSchemaType (typeof(object), "anyType", false, false, false, true);
+
+ // the primitive type "System.Int16"
+ mapping = new SoapTypeMapping(typeof(short), "short", "http://www.w3.org/2001/XMLSchema", true, true, true, false);
+ _mappingTable.Add(typeof(short), mapping);
+ _invertMappingTable.Add(mapping, typeof(short));
+
+ // the primitive type "System.Int32"
+ mapping = new SoapTypeMapping(typeof(int), "int", "http://www.w3.org/2001/XMLSchema", true, true, true, false);
+ _mappingTable.Add(typeof(int), mapping);
+ _invertMappingTable.Add(mapping, typeof(int));
+
+ // the primitive type "System.Boolean"
+ mapping = new SoapTypeMapping(typeof(bool), "boolean", "http://www.w3.org/2001/XMLSchema", true, true, true, false);
+ _mappingTable.Add(typeof(bool), mapping);
+ _invertMappingTable.Add(mapping, typeof(bool));
+
+ // the primitive type "System.long"
+ mapping = new SoapTypeMapping(typeof(long), "long", "http://www.w3.org/2001/XMLSchema", true, true, true, false);
+ _mappingTable.Add(typeof(long), mapping);
+ _invertMappingTable.Add(mapping, typeof(long));
+
+ // the primitive type "System.double"
+ mapping = new SoapTypeMapping(typeof(double), "double", "http://www.w3.org/2001/XMLSchema", true, true, true, false);
+ _mappingTable.Add(typeof(double), mapping);
+ _invertMappingTable.Add(mapping, typeof(double));
+
+ // the primitive type "System.Char"
+ mapping = new SoapTypeMapping(typeof(Char), "Char", "http://www.w3.org/2001/XMLSchema", true, true, true, false);
+ _mappingTable.Add(typeof(Char), mapping);
+ _invertMappingTable.Add(mapping, typeof(Char));
+
+ // the primitive type "System.Single"
+ mapping = new SoapTypeMapping(typeof(System.Single), "float", "http://www.w3.org/2001/XMLSchema", true, true, true, false);
+ _mappingTable.Add(typeof(System.Single), mapping);
+ _invertMappingTable.Add(mapping, typeof(System.Single));
+
+ mapping = new SoapTypeMapping(typeof(System.Array), "Array", false, false, false, true);
+ _mappingTable.Add(typeof(System.Array), mapping);
+ _invertMappingTable.Add(mapping, typeof(System.Array));
+
+ mapping = new SoapTypeMapping(typeof(object), "anyType", "http://www.w3.org/2001/XMLSchema", false, false, false, true);
+ _mappingTable.Add(typeof(object), mapping);
+ _invertMappingTable.Add(mapping, typeof(object));
mapping = new SoapTypeMapping(typeof(System.Runtime.Serialization.Formatters.SoapFault), "Fault", "http://schemas.xmlsoap.org/soap/envelope/", false, false, false, true);
_mappingTable.Add(typeof(System.Runtime.Serialization.Formatters.SoapFault), mapping);
diff --git a/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/SoapWriter.cs b/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/SoapWriter.cs
index acafaf8dc29..3a539d7d1ac 100755
--- a/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/SoapWriter.cs
+++ b/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/SoapWriter.cs
@@ -14,7 +14,6 @@ using System.Runtime.Remoting;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters;
using System.Xml;
-using System.Xml.Schema;
using System.Xml.Serialization;
using System.Globalization;
@@ -108,7 +107,6 @@ namespace System.Runtime.Serialization.Formatters.Soap {
soapEntry.elementType = ElementType.Id;
_objectIds[objValue] = id;
}
-
return soapEntry;
}
@@ -237,7 +235,7 @@ namespace System.Runtime.Serialization.Formatters.Soap {
}
}
-
+
private void WriteElement(SoapSerializationEntry entry) {
_xmlWriter.WriteStartElement(entry.prefix, XmlConvert.EncodeNmToken(entry.elementName), entry.elementNamespace);
@@ -260,7 +258,6 @@ namespace System.Runtime.Serialization.Formatters.Soap {
Done = DoneWithElementEvent;
SoapSerializationEntry entry = FillEntry(rootType, rootValue); //new SoapSerializationEntry();
if(rootType.IsArray) {
-
Done = DoneWithArray;
entry.IsArray = true;
}
@@ -308,8 +305,8 @@ namespace System.Runtime.Serialization.Formatters.Soap {
ArrayList lstAttr = new ArrayList();
_xmlWriter.WriteStartElement("SOAP-ENV", "Envelope", "http://schemas.xmlsoap.org/soap/envelope/");
- _xmlWriter.WriteAttributeString("xmlns", "xsi", null, XmlSchema.InstanceNamespace);
- _xmlWriter.WriteAttributeString("xmlns", "xsd", null, XmlSchema.Namespace );
+ _xmlWriter.WriteAttributeString("xmlns", "xsi", null, "http://www.w3.org/2001/XMLSchema-instance");
+ _xmlWriter.WriteAttributeString("xmlns", "xsd", null, "http://www.w3.org/2001/XMLSchema" );
_xmlWriter.WriteAttributeString("xmlns", "SOAP-ENC", null, "http://schemas.xmlsoap.org/soap/encoding/");
_xmlWriter.WriteAttributeString("xmlns", "SOAP-ENV", null, "http://schemas.xmlsoap.org/soap/envelope/");
_xmlWriter.WriteAttributeString("xmlns", "clr", null, "http://schemas.microsoft.com/soap/encoding/clr/1.0" );
diff --git a/mcs/class/System.Web/System.Web.Security/ChangeLog b/mcs/class/System.Web/System.Web.Security/ChangeLog
index 009d458eb32..11fe7b35129 100644
--- a/mcs/class/System.Web/System.Web.Security/ChangeLog
+++ b/mcs/class/System.Web/System.Web.Security/ChangeLog
@@ -1,7 +1,3 @@
-2003-08-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * UrlAuthorizationModule.cs: fixed description for status code.
-
2003-07-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* FormsAuthenticationModule.cs: really renew the ticket. Thanks to
diff --git a/mcs/class/System.Web/System.Web.Security/UrlAuthorizationModule.cs b/mcs/class/System.Web/System.Web.Security/UrlAuthorizationModule.cs
index 698a10f5f0f..1463d716c56 100644
--- a/mcs/class/System.Web/System.Web.Security/UrlAuthorizationModule.cs
+++ b/mcs/class/System.Web/System.Web.Security/UrlAuthorizationModule.cs
@@ -41,7 +41,7 @@ namespace System.Web.Security
return;
if (!config.IsValidUser (context.User, context.Request.HttpMethod)) {
- HttpException e = new HttpException (401, "Unauthorized");
+ HttpException e = new HttpException (401, "Forbidden");
context.Response.StatusCode = 401;
context.Response.Write (e.GetHtmlErrorMessage ());
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/ChangeLog b/mcs/class/System.Web/System.Web.UI.HtmlControls/ChangeLog
index 3c9c23f4aff..337eecf9941 100644
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/ChangeLog
+++ b/mcs/class/System.Web/System.Web.UI.HtmlControls/ChangeLog
@@ -1,8 +1,3 @@
-2003-08-26 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * HtmlGenericControl.cs: ConstructorNeedsTag defaults to false so we
- need to pass true here. Fixes bug #47918.
-
2003-07-17 Andreas Nahr <ClassDevelopment@A-SoftTech.com>
* HtmlContainerControl.cs: Added attributes
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlGenericControl.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlGenericControl.cs
index ca8940adb1d..bd5c1432efb 100644
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlGenericControl.cs
+++ b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlGenericControl.cs
@@ -16,7 +16,7 @@ using System.Web.UI;
namespace System.Web.UI.HtmlControls{
- [ConstructorNeedsTag(true)]
+ [ConstructorNeedsTag]
public class HtmlGenericControl : HtmlContainerControl {
public HtmlGenericControl() :
this ("span")
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog b/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
index ef5d8736b80..91ae8f5eb90 100644
--- a/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
+++ b/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
@@ -1,39 +1,3 @@
-2003-08-26 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * CheckBox.cs: in LoadPostData, only return
- true when the new data is different from the one we had. Fixed
- conditions to save Checked state. Thanks to yaronshkop@hotmail.com
- (Yaron Shkop).
-
-2003-08-26 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * Style.cs: Font.Strikeout renders as 'line-through'. Fixes bug #47871.
-
-2003-08-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * WebControl.cs: removed dangling ^M and unneeded fields. Keep track
- of Enable in ViewState. Fixes bug #47865.
-
-2003-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * Style.cs: the MARKED bit is not send set in ViewState unless something
- is changed. Fixed TrackViewState condition.
-
- * WebControl.cs: save the base ViewState *after* ControlStyle is done,
- because it uses the same ViewState as the control. Fixes bug #47725.
-
-2003-08-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * HyperLinkColumn.cs: patch from David Pickens <dsp@rci.rutgers.edu>
- that fixes databinding when only DataTextField or DataNavigateUrlField
- is set.
-
-2003-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * ListControl.cs: patch sent by Yaacov Akiba Slama <ya@slamail.org> on
- behalf of Yaron Shkop <yaronsh@mainsoft.com> that fixes selection of
- values before assigning a data source and other issues.
-
2003-08-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* CheckBox.cs: save viewstate when needed and correctly handle post
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/CheckBox.cs b/mcs/class/System.Web/System.Web.UI.WebControls/CheckBox.cs
index 6bf54d48105..bef20829b03 100644
--- a/mcs/class/System.Web/System.Web.UI.WebControls/CheckBox.cs
+++ b/mcs/class/System.Web/System.Web.UI.WebControls/CheckBox.cs
@@ -74,11 +74,18 @@ namespace System.Web.UI.WebControls
private bool SaveCheckedViewState
{
get {
- if (Events [CheckedChangedEvent] != null || !Enabled)
- return true;
+ if (Events [CheckedChangedEvent] != null){
+ if (!Enabled)
+ return true;
- Type type = GetType ();
- return (type != typeof (CheckBox) && type != typeof (RadioButton));
+ Type type = GetType ();
+ if (type == typeof (CheckBox))
+ return false;
+
+ if (type == typeof (RadioButton))
+ return false;
+ }
+ return true;
}
}
@@ -204,12 +211,13 @@ namespace System.Web.UI.WebControls
bool IPostBackDataHandler.LoadPostData (string postDataKey, NameValueCollection postCollection)
{
string postedVal = postCollection [postDataKey];
- bool haveData = (postedVal != null && postedVal.Length > 0);
- if (haveData == Checked)
- return false;
- Checked = haveData;
- return true;;
+ if (postedVal != null && postedVal.Length > 0) {
+ Checked = !Checked;
+ return true;
+ }
+
+ return false;
}
void IPostBackDataHandler.RaisePostDataChangedEvent()
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/HyperLinkColumn.cs b/mcs/class/System.Web/System.Web.UI.WebControls/HyperLinkColumn.cs
index 4c06d734d29..da18a2d4b1c 100644
--- a/mcs/class/System.Web/System.Web.UI.WebControls/HyperLinkColumn.cs
+++ b/mcs/class/System.Web/System.Web.UI.WebControls/HyperLinkColumn.cs
@@ -166,41 +166,37 @@ namespace System.Web.UI.WebControls
}
}
- private void OnDataBindHyperLinkColumn (object sender, EventArgs e)
- {
- HyperLink link = (HyperLink) sender;
- object item = ((DataGridItem) link.NamingContainer).DataItem;
-
- PropertyDescriptorCollection properties = TypeDescriptor.GetProperties (item);
- if (textFieldDescriptor == null)
- textFieldDescriptor = properties.Find (DataTextField, true);
-
- if (urlFieldDescriptor == null)
- urlFieldDescriptor = properties.Find (DataNavigateUrlField, true);
-
- if (DataTextField.Length > 0 && textFieldDescriptor == null && !DesignMode)
- throw new HttpException (HttpRuntime.FormatResourceString (
- "Field_Not_Found", DataTextField));
-
- if (DataNavigateUrlField.Length > 0 && urlFieldDescriptor == null && !DesignMode)
- throw new HttpException (HttpRuntime.FormatResourceString (
- "Field_Not_Found", DataNavigateUrlField));
-
- if (textFieldDescriptor != null) {
- link.Text = FormatDataTextValue (textFieldDescriptor.GetValue (item));
- } else if ( Text != String.Empty ) {
- link.Text = Text;
- } else {
- link.Text = "Sample_DataBound_Text";
- }
-
- if (urlFieldDescriptor != null) {
- link.NavigateUrl = FormatDataNavigateUrlValue (urlFieldDescriptor.GetValue (item));
- } else {
- link.NavigateUrl = "url";
- }
- }
-
+ private void OnDataBindHyperLinkColumn (object sender, EventArgs e)
+ {
+ HyperLink link = (HyperLink) sender;
+ object item = ((DataGridItem) link.NamingContainer).DataItem;
+
+ if (textFieldDescriptor == null && urlFieldDescriptor == null) {
+ PropertyDescriptorCollection properties = TypeDescriptor.GetProperties (item);
+ textFieldDescriptor = properties.Find (DataTextField, true);
+ if (textFieldDescriptor == null && !DesignMode)
+ throw new HttpException (HttpRuntime.FormatResourceString (
+ "Field_Not_Found", DataTextField));
+
+ urlFieldDescriptor = properties.Find (DataNavigateUrlField, true);
+ if (urlFieldDescriptor == null && !DesignMode)
+ throw new HttpException (HttpRuntime.FormatResourceString (
+ "Field_Not_Found", DataNavigateUrlField));
+ }
+
+ if (textFieldDescriptor != null) {
+ link.Text = FormatDataTextValue (textFieldDescriptor.GetValue (item));
+ } else {
+ link.Text = "Sample_DataBound_Text";
+ }
+
+ if (urlFieldDescriptor != null) {
+ link.NavigateUrl = FormatDataNavigateUrlValue (urlFieldDescriptor.GetValue (item));
+ } else {
+ link.NavigateUrl = "url";
+ }
+ }
+
protected virtual string FormatDataNavigateUrlValue (object dataUrlValue)
{
if (dataUrlValue == null)
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ListControl.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ListControl.cs
index 1c869dca233..4b2913d3c8c 100644
--- a/mcs/class/System.Web/System.Web.UI.WebControls/ListControl.cs
+++ b/mcs/class/System.Web/System.Web.UI.WebControls/ListControl.cs
@@ -32,7 +32,6 @@ namespace System.Web.UI.WebControls
private ListItemCollection items;
private int cachedSelectedIndex = -1;
- private string cachedSelectedValue;
public ListControl(): base(HtmlTextWriterTag.Select)
{
@@ -98,10 +97,14 @@ namespace System.Web.UI.WebControls
}
set
{
- if(value == null || value is IListSource || value is IEnumerable) {
- dataSource = value;
- return;
- }
+ if(value != null)
+ {
+ if(value is IListSource || value is IEnumerable)
+ {
+ dataSource = value;
+ return;
+ }
+ }
throw new ArgumentException(HttpRuntime.FormatResourceString(ID, "Invalid DataSource Type"));
}
}
@@ -232,14 +235,9 @@ namespace System.Web.UI.WebControls
ListItem item = null;
if (value != null) {
- if (Items.Count > 0) {
- item = Items.FindByValue (value);
- if (item == null)
- throw new ArgumentOutOfRangeException ("value");
- } else {
- cachedSelectedValue = value;
- return;
- }
+ item = Items.FindByValue (value);
+ if (item == null)
+ throw new ArgumentOutOfRangeException (value);
}
ClearSelection ();
@@ -312,11 +310,11 @@ namespace System.Web.UI.WebControls
Items.Clear();
- bool dontUseProperties = (dtf.Length == 0 && dvf.Length == 0);
+ bool useProperties = (dtf.Length > 0 && dvf.Length > 0);
foreach (object current in ds) {
ListItem li = new ListItem();
- if (dontUseProperties){
+ if (!useProperties){
li.Text = String.Format (dtfs, current);
li.Value = current.ToString ();
Items.Add (li);
@@ -337,22 +335,7 @@ namespace System.Web.UI.WebControls
Items.Add(li);
}
}
-
- if (cachedSelectedValue != null) {
- int index = Items.FindByValueInternal (cachedSelectedValue);
- if (index == -1)
- throw new ArgumentOutOfRangeException("value");
-
- if (cachedSelectedIndex != -1 && cachedSelectedIndex != index)
- throw new ArgumentException(HttpRuntime.FormatResourceString(
- "Attributes_mutually_exclusive", "Selected Index", "Selected Value"));
-
- SelectedIndex = index;
- cachedSelectedIndex = -1;
- cachedSelectedValue = null;
- return;
- }
-
+
if (cachedSelectedIndex != -1) {
SelectedIndex = cachedSelectedIndex;
cachedSelectedIndex = -1;
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/Style.cs b/mcs/class/System.Web/System.Web.UI.WebControls/Style.cs
index d99e49538c3..b94de2f69c0 100644
--- a/mcs/class/System.Web/System.Web.UI.WebControls/Style.cs
+++ b/mcs/class/System.Web/System.Web.UI.WebControls/Style.cs
@@ -7,46 +7,45 @@
//
// (C) Gaurav Vaish (2002)
// (C) 2003 Andreas Nahr
-//
-
-using System;
-using System.Text;
-using System.Collections;
-using System.Drawing;
-using System.Globalization;
-using System.ComponentModel;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- [ToolboxItem(false)]
- [TypeConverter(typeof(ExpandableObjectConverter))]
- public class Style : Component , IStateManager
- {
- internal static int MARKED = (0x01 << 0);
- internal static int BACKCOLOR = (0x01 << 1);
- internal static int BORDERCOLOR = (0x01 << 2);
- internal static int BORDERSTYLE = (0x01 << 3);
- internal static int BORDERWIDTH = (0x01 << 4);
- internal static int CSSCLASS = (0x01 << 5);
- internal static int FORECOLOR = (0x01 << 6);
- internal static int HEIGHT = (0x01 << 7);
- internal static int WIDTH = (0x01 << 8);
- internal static int FONT_BOLD = (0x01 << 9);
- internal static int FONT_ITALIC = (0x01 << 10);
- internal static int FONT_NAMES = (0x01 << 11);
- internal static int FONT_SIZE = (0x01 << 12);
- internal static int FONT_STRIKE = (0x01 << 13);
- internal static int FONT_OLINE = (0x01 << 14);
- internal static int FONT_ULINE = (0x01 << 15);
-
- internal static string selectionBitString = "_SBS";
-
- StateBag viewState;
- int selectionBits;
- bool selfStateBag;
- bool marked;
+//
+
+using System;
+using System.Text;
+using System.Collections;
+using System.Drawing;
+using System.Globalization;
+using System.ComponentModel;
+using System.Web;
+using System.Web.UI;
+
+namespace System.Web.UI.WebControls
+{
+ [ToolboxItem(false)]
+ [TypeConverter(typeof(ExpandableObjectConverter))]
+ public class Style : Component , IStateManager
+ {
+ internal static int MARKED = (0x01 << 0);
+ internal static int BACKCOLOR = (0x01 << 1);
+ internal static int BORDERCOLOR = (0x01 << 2);
+ internal static int BORDERSTYLE = (0x01 << 3);
+ internal static int BORDERWIDTH = (0x01 << 4);
+ internal static int CSSCLASS = (0x01 << 5);
+ internal static int FORECOLOR = (0x01 << 6);
+ internal static int HEIGHT = (0x01 << 7);
+ internal static int WIDTH = (0x01 << 8);
+ internal static int FONT_BOLD = (0x01 << 9);
+ internal static int FONT_ITALIC = (0x01 << 10);
+ internal static int FONT_NAMES = (0x01 << 11);
+ internal static int FONT_SIZE = (0x01 << 12);
+ internal static int FONT_STRIKE = (0x01 << 13);
+ internal static int FONT_OLINE = (0x01 << 14);
+ internal static int FONT_ULINE = (0x01 << 15);
+
+ internal static string selectionBitString = "_SystemWebUIWebControlsStyle_SBS";
+
+ private StateBag viewState;
+ private int selectionBits;
+ private bool selfStateBag;
private FontInfo font;
@@ -87,12 +86,12 @@ namespace System.Web.UI.WebControls
return ( (selectionBits & bit) != 0x00);
}
- internal virtual void Set(int bit)
- {
- selectionBits |= bit;
- if (IsTrackingViewState)
- selectionBits |= MARKED;
- }
+ internal virtual void Set(int bit)
+ {
+ selectionBits |= bit;
+ if(IsTrackingViewState)
+ selectionBits |= MARKED;
+ }
[NotifyParentProperty (true)]
[DefaultValue (null), Bindable (true), WebCategory ("Appearance")]
@@ -358,7 +357,7 @@ namespace System.Web.UI.WebControls
string textDecoration = String.Empty;
if(Font.Strikeout)
{
- textDecoration += " line-through";
+ textDecoration += " strikeout";
}
if(Font.Underline)
{
@@ -494,44 +493,50 @@ namespace System.Web.UI.WebControls
font.Reset();
selectionBits = 0x00;
}
-
- protected bool IsTrackingViewState {
- get { return marked; }
- }
-
- protected internal virtual void TrackViewState ()
- {
- if (selfStateBag)
- ViewState.TrackViewState ();
-
- marked = true;
- }
-
- protected internal virtual object SaveViewState ()
- {
- if (viewState != null) {
- if (marked)
- ViewState [selectionBitString] = selectionBits;
-
- if (selfStateBag)
- return ViewState.SaveViewState ();
- }
-
- return null;
- }
-
- protected internal void LoadViewState(object state)
- {
- if (state != null && selfStateBag)
- ViewState.LoadViewState (state);
-
- if (viewState != null) {
- object o = ViewState [selectionBitString];
- if (o != null)
- selectionBits = (int) o;
- }
- }
-
+
+ protected bool IsTrackingViewState
+ {
+ get
+ {
+ return ( (selectionBits & MARKED) != 0x00 );
+ }
+ }
+
+ protected internal virtual void TrackViewState()
+ {
+ if(viewState!=null)
+ ViewState.TrackViewState();
+ Set(MARKED);
+ }
+
+ protected internal virtual object SaveViewState()
+ {
+ if(viewState != null)
+ {
+ if(IsSet(MARKED))
+ {
+ ViewState[selectionBitString] = selectionBits;
+ }
+ if(selfStateBag)
+ {
+ return ViewState.SaveViewState();
+ }
+ }
+ return null;
+ }
+
+ protected internal void LoadViewState(object state)
+ {
+ if (state != null && selfStateBag)
+ ViewState.LoadViewState(state);
+
+ if (viewState != null) {
+ object o = ViewState[selectionBitString];
+ if (o != null)
+ selectionBits = (int) o;
+ }
+ }
+
void IStateManager.LoadViewState(object state)
{
LoadViewState(state);
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/WebControl.cs b/mcs/class/System.Web/System.Web.UI.WebControls/WebControl.cs
index abc6dfbc032..e0aa65f74a0 100755
--- a/mcs/class/System.Web/System.Web.UI.WebControls/WebControl.cs
+++ b/mcs/class/System.Web/System.Web.UI.WebControls/WebControl.cs
@@ -7,43 +7,59 @@
//
// (C) Gaurav Vaish (2002)
// (C) 2003 Andreas Nahr
-//
-
-using System;
-using System.Collections;
-using System.ComponentModel;
-using System.Web;
-using System.Web.UI;
-using System.Drawing;
-using System.Collections.Specialized;
-
-namespace System.Web.UI.WebControls
-{
- [PersistChildrenAttribute(false)]
- [ParseChildrenAttribute(true)]
- public class WebControl : Control, IAttributeAccessor
- {
- HtmlTextWriterTag tagKey;
- AttributeCollection attributes;
- StateBag attributeState;
- Style controlStyle;
- bool enabled = true;
- string tagName;
-
- // TODO: The constructors definitions
- protected WebControl () : this (HtmlTextWriterTag.Span)
- {
- }
-
- public WebControl (HtmlTextWriterTag tag)
- {
- tagKey = tag;
- }
-
- protected WebControl (string tag)
- {
- tagName = tag;
- }
+//
+
+using System;
+using System.Collections;
+using System.ComponentModel;
+using System.Web;
+using System.Web.UI;
+using System.Drawing;
+using System.Collections.Specialized;
+
+namespace System.Web.UI.WebControls
+{
+ [PersistChildrenAttribute(false)]
+ [ParseChildrenAttribute(true)]
+ public class WebControl : Control, IAttributeAccessor
+ {
+ //TODO: A list of private members may be incomplete
+
+ private HtmlTextWriterTag tagKey;
+ private string stringTag;
+ private AttributeCollection attributes;
+ private StateBag attributeState;
+ private Style controlStyle;
+ private bool enabled;
+ private string tagName;
+
+ // TODO: The constructors definitions
+ protected WebControl () : this (HtmlTextWriterTag.Span)
+ {
+ }
+
+ public WebControl(HtmlTextWriterTag tag): base()
+ {
+ //FIXME: am i right?
+ tagKey = tag;
+ //stringTag = null;
+ Initialize();
+ }
+
+ protected WebControl(string tag): base()
+ {
+ //FIXME: am i right?
+ stringTag = tag;
+ Initialize();
+ }
+
+ private void Initialize()
+ {
+ controlStyle = null;
+ enabled = true;
+ tagName = stringTag;
+ attributeState = null;
+ }
[DefaultValue (""), Bindable (true), WebCategory ("Behavior")]
[WebSysDescription ("A keyboard shortcut for the WebControl.")]
@@ -194,16 +210,18 @@ namespace System.Web.UI.WebControls
}
[DefaultValue (true), Bindable (true), WebCategory ("Behavior")]
- [WebSysDescription ("The activation state of this WebControl.")]
- public virtual bool Enabled {
- get { return enabled; }
- set {
- if (enabled != value)
- ViewState ["Enabled"] = value;
-
- enabled = value;
- }
- }
+ [WebSysDescription ("The activation state of this WebControl.")]
+ public virtual bool Enabled
+ {
+ get
+ {
+ return enabled;
+ }
+ set
+ {
+ enabled = value;
+ }
+ }
[DefaultValue (null), NotifyParentProperty (true), WebCategory ("Appearance")]
[DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
@@ -401,77 +419,69 @@ namespace System.Web.UI.WebControls
}
}
}
-
- protected virtual Style CreateControlStyle ()
- {
- return new Style (ViewState);
- }
-
- protected override void LoadViewState (object savedState)
- {
- if (savedState == null)
- return;
-
- Triplet saved = (Triplet) savedState;
- base.LoadViewState (saved.First);
- if (saved.Second != null ||
- ViewState [System.Web.UI.WebControls.Style.selectionBitString] != null)
- ControlStyle.LoadViewState (saved.Second);
-
- if (attributeState != null)
- attributeState.LoadViewState (saved.Third);
-
- object e = ViewState ["Enabled"];
- if (e != null)
- enabled = (bool) e;
- }
-
- protected override void Render(HtmlTextWriter writer)
- {
- RenderBeginTag (writer);
- RenderContents (writer);
- RenderEndTag (writer);
- }
-
- protected virtual void RenderContents(HtmlTextWriter writer)
- {
- base.Render (writer);
- }
-
- protected override object SaveViewState()
- {
- object controlView = null;
- if (ControlStyleCreated)
- controlView = ControlStyle.SaveViewState ();
-
- object baseView = base.SaveViewState ();
- object attrView = null;
- if (attributeState != null)
- attrView = attributeState.SaveViewState ();
-
- return new Triplet (baseView, controlView, attrView);
- }
-
- protected override void TrackViewState()
- {
- base.TrackViewState();
- if (ControlStyleCreated)
- ControlStyle.TrackViewState ();
- if (attributeState != null)
- attributeState.TrackViewState ();
- }
-
- string IAttributeAccessor.GetAttribute(string key)
- {
- if(Attributes!=null)
- return Attributes[key] as string;
- return null;
- }
-
- void IAttributeAccessor.SetAttribute(string key, string value)
- {
- Attributes[key] = value;
- }
- }
-}
-
+
+ protected virtual Style CreateControlStyle()
+ {
+ return new Style(ViewState);
+ }
+
+ protected override void LoadViewState (object savedState)
+ {
+ if (savedState != null) {
+ Triplet saved = (Triplet) savedState;
+ base.LoadViewState (saved.First);
+ if (ControlStyleCreated)
+ ControlStyle.LoadViewState (saved.Second);
+ if (attributeState != null)
+ attributeState.LoadViewState (saved.Third);
+ }
+ }
+
+ protected override void Render(HtmlTextWriter writer)
+ {
+ RenderBeginTag(writer);
+ RenderContents(writer);
+ RenderEndTag(writer);
+ }
+
+ protected virtual void RenderContents(HtmlTextWriter writer)
+ {
+ base.Render(writer);
+ }
+
+ protected override object SaveViewState()
+ {
+ object baseView = base.SaveViewState ();
+ object controlView = null;
+ if (ControlStyleCreated)
+ controlView = ControlStyle.SaveViewState();
+
+ object attrView = null;
+ if (attributeState != null)
+ attrView = attributeState.SaveViewState();
+
+ return new Triplet (baseView, controlView, attrView);
+ }
+
+ protected override void TrackViewState()
+ {
+ base.TrackViewState();
+ if (ControlStyleCreated)
+ ControlStyle.TrackViewState ();
+ if (attributeState != null)
+ attributeState.TrackViewState ();
+ }
+
+ string IAttributeAccessor.GetAttribute(string key)
+ {
+ if(Attributes!=null)
+ return Attributes[key] as string;
+ return null;
+ }
+
+ void IAttributeAccessor.SetAttribute(string key, string value)
+ {
+ Attributes[key] = value;
+ }
+ }
+}
diff --git a/mcs/class/System.Web/System.Web.UI/BaseParser.cs b/mcs/class/System.Web/System.Web.UI/BaseParser.cs
index b907394a0a5..b0976f22003 100755
--- a/mcs/class/System.Web/System.Web.UI/BaseParser.cs
+++ b/mcs/class/System.Web/System.Web.UI/BaseParser.cs
@@ -108,8 +108,6 @@ namespace System.Web.UI
return baseVDir;
}
-
- set { baseVDir = value; }
}
}
}
diff --git a/mcs/class/System.Web/System.Web.UI/ChangeLog b/mcs/class/System.Web/System.Web.UI/ChangeLog
index 76f9888fef5..f628f01b6e1 100644
--- a/mcs/class/System.Web/System.Web.UI/ChangeLog
+++ b/mcs/class/System.Web/System.Web.UI/ChangeLog
@@ -1,41 +1,3 @@
-2003-08-26 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * Page.cs: check if controls that require postback have
- been changed by an event and register them to be notified of data
- changed event.
-
-2003-08-26 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * Control.cs: patch by yaronshkop@hotmail.com (Yaron Shkop) that fixes
- bug #47866.
-
-2003-08-21 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * LosFormatter.cs: handle Unit and FonrUnit as special cases as they
- are not serializable. Fixes bug #47784.
-
-2003-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * Control.cs: index the viewstates saved by the control position, not
- the control name. Fixes bug #47697.
-
-2003-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * ControlCollection.cs:
- * EmptyControlCollection.cs: create a minimum ArrayList for this.
-
- * BaseParser.cs: added setter for BaseVirtualDir.
-
- * Page.cs: fixed message when restoring view state fails.
- * UserControlParser.cs: set the BaseVirtualDirectory to handle the case
- when a relative path to the control is given. Fixes bug #47685.
-
-2003-08-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * Control.cs: when we load the viewstate for a control that has children
- viewstates and the child is not found, keep its viewstate around and
- wait until the child is added to load the viewstate. Fixes bug #47697.
-
2003-08-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* TemplateControl.cs: more Delegate.CreateDelegate fixes.
diff --git a/mcs/class/System.Web/System.Web.UI/Control.cs b/mcs/class/System.Web/System.Web.UI/Control.cs
index 9cd8a6f3fdc..1fb54707b6b 100644
--- a/mcs/class/System.Web/System.Web.UI/Control.cs
+++ b/mcs/class/System.Web/System.Web.UI/Control.cs
@@ -1,30 +1,100 @@
-//
-// System.Web.UI.Control.cs
-//
-// Authors:
-// Bob Smith <bob@thestuff.net>
-// Gonzalo Paniagua Javier (gonzalo@ximian.com
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//
-// (C) Bob Smith
-// (c) 2002,2003 Ximian, Inc. (http://www.ximian.com)
-//
-
-using System;
-using System.Collections;
+//
+// System.Web.UI.Control.cs
+//
+// Authors:
+// Bob Smith <bob@thestuff.net>
+// Gonzalo Paniagua Javier (gonzalo@ximian.com)
+// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
+//
+// (C) Bob Smith
+// (c) 2002 Ximian, Inc. (http://www.ximian.com)
+//
+
+/*
+ * Maintainer: bob@thestuff.net, gvaish@iitk.ac.in
+ * (C) Bob Smith, Gaurav Vaish
+ */
+
+//notes: view state only tracks changes after OnInit method is executed for the page request. You can read from it at any time, but cant write to it during rendering.
+//even more notes: view state info in trackviewstate method description. read later.
+//Ok, enough notes: what the heck is different between enable view state, and track view state.
+//Well, maybe not. How does the ViewState know when to track changes? Does it look at the property
+//on the owning control, or does it have a method/property of its own that gets called?
+// I think this last question is solved in the Interface for it. Look into this.
+
+//cycle:
+//init is called when control is first created.
+//load view state ic called right after init to populate the view state.
+//loadpostdata is called if ipostbackdatahandler is implemented.
+//load is called when control is loaded into a page
+//raisepostdatachangedevent if ipostbackdatahandler is implemented.
+//raisepostbackevent if ipostbackeventhandler is implemented.
+//prerender is called when the server is about to render its page object
+//SaveViewState is called.
+//Unload then dispose it apears. :)
+
+//Naming Container MUST have some methods. What are they? No clue. Help? (updated: the doc says that it's just a marker interface)
+
+//read this later. http://gotdotnet.com/quickstart/aspplus/
+//This to: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguidnf/html/cpconattributesdesign-timesupport.asp
+//http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguidnf/html/cpcontracefunctionality.asp
+
+// Isnt life grand? :)
+// See the undocumented methods? Gota love um. ;)
+// ASP.test4_aspx.Page_Load(Object Sender, EventArgs e) in \\genfs2\www24\bobsmith11\test4.aspx:6
+// System.Web.UI.Control.OnLoad(EventArgs e) +67
+// System.Web.UI.Control.LoadRecursive() +73
+// System.Web.UI.Page.ProcessRequestMain() +394
+
+// ASP.test4_aspx.Page_Unload(Object Sender, EventArgs e) in \\genfs2\www24\bobsmith11\test4.aspx:6
+// System.EventHandler.Invoke(Object sender, EventArgs e) +0
+// System.Web.UI.Control.OnUnload(EventArgs e) +67
+// System.Web.UI.Control.UnloadRecursive(Boolean dispose) +78
+// System.Web.UI.Page.ProcessRequest() +194
+// System.Web.UI.Page.ProcessRequest(HttpContext context) +18
+// System.Web.CallHandlerExecutionStep.Execute() +179
+// System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +87
+
+
+// ASP.test4_aspx.Page_Unload(Object Sender, EventArgs e) in \\genfs2\www24\bobsmith11\test4.aspx:6
+// System.Web.UI.Control.OnUnload(EventArgs e) +67
+// System.Web.UI.Control.UnloadRecursive(Boolean dispose) +78
+// System.Web.UI.Page.ProcessRequest()
+
+// ASP.test4_aspx.Page_Kill(Object Sender, EventArgs e) in \\genfs2\www24\bobsmith11\test4.aspx:6
+// System.Web.UI.Control.OnPreRender(EventArgs e) +67
+// System.Web.UI.Control.PreRenderRecursiveInternal() +61
+// System.Web.UI.Page.ProcessRequestMain() +753
+
+// ASP.test4_aspx.OnInit(EventArgs e) in \\genfs2\www24\bobsmith11\test4.aspx:6
+// System.Web.UI.Control.InitRecursive(Control namingContainer) +202
+// System.Web.UI.Page.ProcessRequestMain() +120
+
+// ASP.test4_aspx.SaveViewState() in \\genfs2\www24\bobsmith11\test4.aspx:12
+// System.Web.UI.Control.SaveViewStateRecursive() +51
+// System.Web.UI.Page.SavePageViewState() +174
+// System.Web.UI.Page.ProcessRequestMain() +861
+
+// ASP.test_aspx.LoadViewState(Object t) +28
+// System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +125
+// System.Web.UI.Page.LoadPageViewState() +182
+// System.Web.UI.Page.ProcessRequestMain() +256
+
+using System;
+using System.Collections;
using System.ComponentModel;
using System.ComponentModel.Design;
-using System.ComponentModel.Design.Serialization;
-using System.Web;
-using System.Web.Util;
-
-namespace System.Web.UI
+using System.ComponentModel.Design.Serialization;
+using System.Web;
+using System.Web.Util;
+
+namespace System.Web.UI
{
[DefaultProperty ("ID"), DesignerCategory ("Code"), ToolboxItemFilter ("System.Web.UI", ToolboxItemFilterType.Require)]
[ToolboxItem ("System.Web.UI.Design.WebControlToolboxItem, " + Consts.AssemblySystem_Design)]
[Designer ("System.Web.UI.Design.ControlDesigner, " + Consts.AssemblySystem_Design, typeof (IDesigner))]
- [DesignerSerializer ("Microsoft.VSDesigner.WebForms.ControlCodeDomSerializer, " + Consts.AssemblyMicrosoft_VSDesigner, "System.ComponentModel.Design.Serialization.CodeDomSerializer, " + Consts.AssemblySystem_Design)]
- public class Control : IComponent, IDisposable, IParserAccessor, IDataBindingsAccessor
+ [DesignerSerializer ("Microsoft.VSDesigner.WebForms.ControlCodeDomSerializer, " + Consts.AssemblyMicrosoft_VSDesigner, "System.ComponentModel.Design.Serialization.CodeDomSerializer, " + Consts.AssemblySystem_Design)]
+ public class Control : IComponent, IDisposable, IParserAccessor, IDataBindingsAccessor
{
private static readonly object DataBindingEvent = new object();
private static readonly object DisposedEvent = new object();
@@ -54,16 +124,14 @@ namespace System.Web.UI
private bool creatingControls = false;
private bool bindingContainer = true;
private bool autoEventWireup = true;
-
- bool inited = false;
- bool viewStateLoaded;
- bool loaded = false;
- bool prerendered = false;
- int defaultNumberID = 0;
-
- private DataBindingCollection dataBindings = null;
- Hashtable pendingVS; // may hold unused viewstate data from child controls
-
+
+ bool inited = false;
+ bool loaded = false;
+ bool prerendered = false;
+ int defaultNumberID = 0;
+
+ private DataBindingCollection dataBindings = null;
+
public Control()
{
if (this is INamingContainer) _isNamingContainer = true;
@@ -231,26 +299,24 @@ namespace System.Web.UI
}
[DefaultValue (true), Bindable (true), WebCategory ("FIXME")]
- [WebSysDescription ("Visiblity state of the control.")]
- public virtual bool Visible {
- get {
- if (_visible == false)
- return false;
-
- if (_parent != null)
- return _parent.Visible;
-
- return true;
- }
-
- set {
- if (value != _visible)
- ViewState ["Visible"] = value;
-
- _visible = value;
- }
- }
-
+ [WebSysDescription ("Visiblity state of the control.")]
+ public virtual bool Visible
+ {
+ get
+ {
+ if (_visible == false)
+ return false;
+
+ if (_parent != null)
+ return _parent.Visible;
+
+ return true;
+ }
+ set
+ {
+ _visible = value;
+ }
+ }
protected bool ChildControlsCreated //DIT
{
get
@@ -358,43 +424,30 @@ namespace System.Web.UI
protected internal virtual void AddedControl (Control control, int index)
{
- /* Ensure the control don't have more than 1 parent */
- if (control._parent != null)
- control._parent.Controls.Remove (control);
-
- control._parent = this;
- control._page = _page;
- Control nc = _isNamingContainer ? this : NamingContainer;
-
- if (nc != null) {
- control._namingContainer = nc;
- if (control.AutoID == true && control._userId == null)
- control._userId = nc.GetDefaultName () + "a";
- }
-
- if (inited)
- control.InitRecursive (nc);
-
- if (viewStateLoaded || loaded) {
- if (pendingVS != null) {
- object vs = pendingVS [index];
- if (vs != null) {
- pendingVS.Remove (index);
- if (pendingVS.Count == 0)
- pendingVS = null;
-
- control.LoadViewStateRecursive (vs);
- }
- }
- }
-
- if (loaded)
- control.LoadRecursive ();
-
- if (prerendered)
- control.PreRenderRecursiveInternal ();
- }
-
+ /* Ensure the control don't have more than 1 parent */
+ if (control._parent != null)
+ control._parent.Controls.Remove (control);
+
+ control._parent = this;
+ control._page = _page;
+ Control nc = _isNamingContainer ? this : NamingContainer;
+
+ if (nc != null) {
+ control._namingContainer = nc;
+ if (control.AutoID == true && control._userId == null)
+ control._userId = nc.GetDefaultName () + "a";
+ }
+
+ if (inited)
+ control.InitRecursive (nc);
+
+ if (loaded)
+ control.LoadRecursive ();
+
+ if (prerendered)
+ control.PreRenderRecursiveInternal ();
+ }
+
protected virtual void AddParsedSubObject(object obj) //DIT
{
WebTrace.PushContext ("Control.AddParsedSubobject ()");
@@ -488,18 +541,14 @@ namespace System.Web.UI
return null;
return namingContainer.FindControl (id, colon + 1);
- }
-
- protected virtual void LoadViewState(object savedState)
- {
- if (savedState != null) {
- ViewState.LoadViewState (savedState);
- object o = ViewState ["Visible"];
- if (o != null)
- _visible = (bool) o;
- }
- }
-
+ }
+
+ protected virtual void LoadViewState(object savedState)
+ {
+ if (savedState != null)
+ ViewState.LoadViewState (savedState);
+ }
+
[MonoTODO("Secure?")]
protected string MapPathSecure(string virtualPath)
{
@@ -795,67 +844,56 @@ namespace System.Web.UI
TrackViewState ();
inited = true;
}
-
- internal object SaveViewStateRecursive ()
- {
- if (!EnableViewState)
- return null;
-
- ArrayList controlList = null;
- ArrayList controlStates = null;
-
- int idx = -1;
- foreach (Control ctrl in Controls) {
- object ctrlState = ctrl.SaveViewStateRecursive ();
- idx++;
- if (ctrlState == null)
- continue;
-
- if (controlList == null) {
- controlList = new ArrayList ();
- controlStates = new ArrayList ();
- }
-
- controlList.Add (idx);
- controlStates.Add (ctrlState);
- }
-
- object thisState = SaveViewState ();
- if (thisState == null && controlList == null && controlStates == null)
- return null;
-
- return new Triplet (thisState, controlList, controlStates);
- }
-
- internal void LoadViewStateRecursive (object savedState)
- {
- if (!EnableViewState || !Visible || savedState == null)
- return;
-
- Triplet savedInfo = (Triplet) savedState;
- LoadViewState (savedInfo.First);
-
- ArrayList controlList = savedInfo.Second as ArrayList;
- if (controlList == null)
- return;
- ArrayList controlStates = savedInfo.Third as ArrayList;
- int nControls = controlList.Count;
- for (int i = 0; i < nControls; i++) {
- int k = (int) controlList [i];
- if (k < Controls.Count && controlStates != null) {
- Control c = Controls [k];
- c.LoadViewStateRecursive (controlStates [i]);
- } else {
- if (pendingVS == null)
- pendingVS = new Hashtable ();
-
- pendingVS [k] = controlStates [i];
- }
- }
-
- viewStateLoaded = true;
- }
-
+
+ internal object SaveViewStateRecursive ()
+ {
+ if (!EnableViewState)
+ return null;
+
+ ArrayList controlList = null;
+ ArrayList controlStates = null;
+
+ foreach (Control ctrl in Controls) {
+ object ctrlState = ctrl.SaveViewStateRecursive ();
+ if (ctrlState == null || ctrl.ID == null)
+ continue;
+
+ if (controlList == null) {
+ controlList = new ArrayList ();
+ controlStates = new ArrayList ();
+ }
+
+ controlList.Add (ctrl.ID);
+ controlStates.Add (ctrlState);
+ }
+
+ object thisState = SaveViewState ();
+ if (thisState == null && controlList == null && controlStates == null)
+ return null;
+
+ return new Triplet (thisState, controlList, controlStates);
+ }
+
+ internal void LoadViewStateRecursive (object savedState)
+ {
+ if (!EnableViewState || !Visible || savedState == null)
+ return;
+
+ Triplet savedInfo = (Triplet) savedState;
+ LoadViewState (savedInfo.First);
+
+ ArrayList controlList = savedInfo.Second as ArrayList;
+ if (controlList == null)
+ return;
+ ArrayList controlStates = savedInfo.Third as ArrayList;
+ int nControls = controlList.Count;
+ for (int i = 0; i < nControls; i++) {
+ Control c = FindControl ((string) controlList [i]);
+ if (c != null && controlStates != null)
+ c.LoadViewStateRecursive (controlStates [i]);
+ }
+ }
+
void IParserAccessor.AddParsedSubObject(object obj)
{
AddParsedSubObject(obj);
diff --git a/mcs/class/System.Web/System.Web.UI/ControlCollection.cs b/mcs/class/System.Web/System.Web.UI/ControlCollection.cs
index 2cd04ff5e8c..adfc1a2dfcb 100755
--- a/mcs/class/System.Web/System.Web.UI/ControlCollection.cs
+++ b/mcs/class/System.Web/System.Web.UI/ControlCollection.cs
@@ -13,7 +13,7 @@ namespace System.Web.UI {
public class ControlCollection : ICollection, IEnumerable
{
- ArrayList list;
+ ArrayList list = new ArrayList ();
Control owner;
public ControlCollection (Control owner)
@@ -21,16 +21,6 @@ namespace System.Web.UI {
if (owner == null)
throw new ArgumentException ();
- list = new ArrayList ();
- this.owner = owner;
- }
-
- internal ControlCollection (Control owner, bool shortList)
- {
- if (owner == null)
- throw new ArgumentException ();
-
- list = new ArrayList (shortList ? 1 : 0);
this.owner = owner;
}
diff --git a/mcs/class/System.Web/System.Web.UI/EmptyControlCollection.cs b/mcs/class/System.Web/System.Web.UI/EmptyControlCollection.cs
index 4ef39b980e5..9d5a039625e 100755
--- a/mcs/class/System.Web/System.Web.UI/EmptyControlCollection.cs
+++ b/mcs/class/System.Web/System.Web.UI/EmptyControlCollection.cs
@@ -13,7 +13,7 @@ namespace System.Web.UI {
public class EmptyControlCollection : ControlCollection
{
public EmptyControlCollection (Control owner)
- : base (owner, true)
+ : base (owner)
{
}
diff --git a/mcs/class/System.Web/System.Web.UI/LosFormatter.cs b/mcs/class/System.Web/System.Web.UI/LosFormatter.cs
index f42c919a045..d06317cfd97 100644
--- a/mcs/class/System.Web/System.Web.UI/LosFormatter.cs
+++ b/mcs/class/System.Web/System.Web.UI/LosFormatter.cs
@@ -14,7 +14,6 @@ using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
using System.Text;
using System.Web.UI;
-using System.Web.UI.WebControls;
using System.Web.Util;
namespace System.Web.UI
@@ -38,8 +37,6 @@ namespace System.Web.UI
const char binaryID = 'b';
const char arrayID = 'a';
const char dateTimeID = 'd';
- const char unitID = 'u';
- const char fontUnitID = 'f';
static Hashtable specialTypes;
static Hashtable idToType;
@@ -55,8 +52,6 @@ namespace System.Web.UI
specialTypes.Add (typeof (Hashtable), new WriteObject (WriteHashtable));
specialTypes.Add (typeof (Array), new WriteObject (WriteArray));
specialTypes.Add (typeof (DateTime), new WriteObject (WriteDateTime));
- specialTypes.Add (typeof (Unit), new WriteObject (WriteUnit));
- specialTypes.Add (typeof (FontUnit), new WriteObject (WriteFontUnit));
idToType = new Hashtable ();
idToType.Add (typeof (string), stringID);
@@ -71,8 +66,6 @@ namespace System.Web.UI
idToType.Add (typeof (ArrayList), arrayListID);
idToType.Add (typeof (Hashtable), hashtableID);
idToType.Add (typeof (Array), arrayID);
- idToType.Add (typeof (Unit), unitID);
- idToType.Add (typeof (FontUnit), fontUnitID);
}
public object Deserialize (Stream stream)
@@ -266,12 +259,6 @@ namespace System.Web.UI
case dateTimeID:
obj = new DateTime (Int64.Parse (enclosed));
break;
- case unitID:
- obj = Unit.Parse (enclosed);
- break;
- case fontUnitID:
- obj = FontUnit.Parse (enclosed);
- break;
default:
throw new ArgumentException ("input");
}
@@ -419,28 +406,6 @@ namespace System.Web.UI
output.Write('>');
}
- static void WriteUnit (LosFormatter formatter, TextWriter output, object value)
- {
- if (value == null)
- return;
-
- output.Write (unitID);
- output.Write ('<');
- output.Write (((Unit) value).ToString ());
- output.Write('>');
- }
-
- static void WriteFontUnit (LosFormatter formatter, TextWriter output, object value)
- {
- if (value == null)
- return;
-
- output.Write (fontUnitID);
- output.Write ('<');
- output.Write (((FontUnit) value).ToString ());
- output.Write('>');
- }
-
private static string EscapeSpecialChars (string str)
{
if (str.IndexOfAny (specialChars) == -1)
diff --git a/mcs/class/System.Web/System.Web.UI/Page.cs b/mcs/class/System.Web/System.Web.UI/Page.cs
index 0e510f0a855..42c1bd0f5df 100755
--- a/mcs/class/System.Web/System.Web.UI/Page.cs
+++ b/mcs/class/System.Web/System.Web.UI/Page.cs
@@ -541,8 +541,6 @@ public class Page : TemplateControl, IHttpHandler
if (requiresPostDataChanged == null)
requiresPostDataChanged = new ArrayList ();
requiresPostDataChanged.Add (pbdh);
- if (_requiresPostBack != null)
- _requiresPostBack.Remove (ctrl.ID);
}
} else if (!second) {
if (secondPostData == null)
@@ -550,26 +548,6 @@ public class Page : TemplateControl, IHttpHandler
secondPostData.Add (real_id, data [id]);
}
}
-
- if (_requiresPostBack != null) {
- string [] handlers = (string []) _requiresPostBack.ToArray (typeof (string));
- foreach (string id in handlers) {
- IPostBackDataHandler pbdh = FindControl (id) as IPostBackDataHandler;
- if (pbdh == null)
- continue;
-
- _requiresPostBack.Remove (id);
- if (pbdh.LoadPostData (id, data)) {
- if (requiresPostDataChanged == null)
- requiresPostDataChanged = new ArrayList ();
-
- requiresPostDataChanged.Add (pbdh);
- }
- }
-
- if (_requiresPostBack.Count == 0)
- _requiresPostBack = null;
- }
}
[EditorBrowsable (EditorBrowsableState.Never)]
@@ -645,7 +623,7 @@ public class Page : TemplateControl, IHttpHandler
foreach (IPostBackDataHandler ipdh in requiresPostDataChanged)
ipdh.RaisePostDataChangedEvent ();
- requiresPostDataChanged = null;
+ requiresPostDataChanged.Clear ();
}
[EditorBrowsable (EditorBrowsableState.Advanced)]
@@ -749,7 +727,7 @@ public class Page : TemplateControl, IHttpHandler
try {
_savedViewState = fmt.Deserialize (view_state);
} catch (Exception e) {
- throw new HttpException ("Error restoring page viewstate.\n", e);
+ throw new HttpException ("Error restoring page viewstate.\n{0}", e);
}
return _savedViewState;
@@ -777,10 +755,6 @@ public class Page : TemplateControl, IHttpHandler
pair.First = SaveViewStateRecursive ();
if (_requiresPostBack != null && _requiresPostBack.Count > 0)
pair.Second = _requiresPostBack;
-
- if (pair.First == null && pair.Second == null)
- pair = null;
-
SavePageStateToPersistenceMedium (pair);
}
diff --git a/mcs/class/System.Web/System.Web.UI/UserControlParser.cs b/mcs/class/System.Web/System.Web.UI/UserControlParser.cs
index 11ed81005ff..bc1e57e4465 100644
--- a/mcs/class/System.Web/System.Web.UI/UserControlParser.cs
+++ b/mcs/class/System.Web/System.Web.UI/UserControlParser.cs
@@ -19,9 +19,7 @@ namespace System.Web.UI
internal UserControlParser (string virtualPath, string inputFile, HttpContext context)
{
Context = context;
- string vp = UrlUtils.Combine (virtualPath, inputFile);
- BaseVirtualDir = UrlUtils.GetDirectory (vp);
- InputFile = context.Request.MapPath (vp);
+ InputFile = context.Request.MapPath (inputFile);
}
public static Type GetCompiledType (string virtualPath, string inputFile, HttpContext context)
diff --git a/mcs/class/System.Web/System.Web.Util/ChangeLog b/mcs/class/System.Web/System.Web.Util/ChangeLog
index 10f042fa6cf..865b98ba483 100644
--- a/mcs/class/System.Web/System.Web.Util/ChangeLog
+++ b/mcs/class/System.Web/System.Web.Util/ChangeLog
@@ -1,7 +1,3 @@
-2003-08-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * UrlUtils.cs: made Reduce work when a "/" is passed.
-
2003-05-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* UrlUtils.cs: fixed Combine and reworked Reduce.
diff --git a/mcs/class/System.Web/System.Web.Util/UrlUtils.cs b/mcs/class/System.Web/System.Web.Util/UrlUtils.cs
index 0977ae0d622..48e1e3c31da 100644
--- a/mcs/class/System.Web/System.Web.Util/UrlUtils.cs
+++ b/mcs/class/System.Web/System.Web.Util/UrlUtils.cs
@@ -236,9 +236,6 @@ namespace System.Web.Util
result.Add (current);
}
- if (result.Count == 0)
- return "/";
-
result.Insert (0, "");
return String.Join ("/", (string []) result.ToArray (typeof (string)));
}
diff --git a/mcs/class/System.Web/System.Web/ChangeLog b/mcs/class/System.Web/System.Web/ChangeLog
index 5491972ab57..6c66d0f963e 100644
--- a/mcs/class/System.Web/System.Web/ChangeLog
+++ b/mcs/class/System.Web/System.Web/ChangeLog
@@ -1,44 +1,3 @@
-2003-08-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * HttpApplication.cs: when the request is completed or an
- error happens, execute all the delegates attached to EndRequest, not
- only the last one. This makes xsp/test/authtest work again.
-
- * HttpMethodNotAllowedHandler.cs: fixed description for http
- status code.
-
-2003-08-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * HttpRequest.cs: quick way of checking that the path is within the
- root for the application. Thanks to Johannes for reporting.
-
- * HttpRuntime.cs: use the status code from teh exception when it'ss a
- HttpException.
-
- * StaticFileHandler.cs: forbidden is 403.
-
-2003-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * HttpServerUtility.cs: fixed path and query. Path by Rich Alimi
- <rich@velvetsea.net>.
-
-2003-08-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * HttpException.cs: make the unhandled error more like the MS one.
- * HttpRuntime.cs: set a 500 error code on unhandled exceptions.
-
-2003-08-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * HttpResponse.cs: flush headers when the body length is 0.
- * StaticFileHandler.cs: added If-Modified-Since handling patch slightly
- modified from the original by Piers Haken <piersh@friskit.com>.
-
-2003-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * HttpResponse.cs: another patch from totte and me. This one prevents
- writing output if the client have disconnected and filters the data
- when there's a non-final Flush in the middle of the process.
-
2003-08-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* HttpApplication.cs: fixed typos. Closes bug #44197.
diff --git a/mcs/class/System.Web/System.Web/HttpApplication.cs b/mcs/class/System.Web/System.Web/HttpApplication.cs
index d9cb1ee3b8e..1da9b945a00 100644
--- a/mcs/class/System.Web/System.Web/HttpApplication.cs
+++ b/mcs/class/System.Web/System.Web/HttpApplication.cs
@@ -474,7 +474,6 @@ namespace System.Web
IStateHandler [] _handlers;
int _currentStateIdx;
int _endStateIdx;
- int _endRequestStateIdx;
int _countSteps;
int _countSyncSteps;
@@ -562,7 +561,6 @@ namespace System.Web
GetAsStates (HttpApplication.UpdateRequestCacheId, states);
// EndRequest
- _endRequestStateIdx = states.Count;
if (null != _app._endRequestAsync)
_app._endRequestAsync.GetAsStates (_app, states);
GetAsStates (HttpApplication.EndRequestId, states);
@@ -611,10 +609,8 @@ namespace System.Web
// Check if request flow is to be stopped
if (_app.GetLastError () != null || _app._CompleteRequest) {
- if (_currentStateIdx >= _endRequestStateIdx)
- break;
-
- _currentStateIdx = _endRequestStateIdx;
+ _currentStateIdx = _endStateIdx;
+ break;
} else if (_currentStateIdx < _endStateIdx) {
// Get next state handler
_currentStateIdx++;
diff --git a/mcs/class/System.Web/System.Web/HttpException.cs b/mcs/class/System.Web/System.Web/HttpException.cs
index f172d3d6759..9cd5f6310a0 100644
--- a/mcs/class/System.Web/System.Web/HttpException.cs
+++ b/mcs/class/System.Web/System.Web/HttpException.cs
@@ -80,11 +80,11 @@ namespace System.Web
StringBuilder builder = new StringBuilder ("<html>\n<title>");
builder.Append ("Error"); //FIXME
builder.AppendFormat ("</title><body bgcolor=\"white\">" +
- "<h1><font color=\"red\">Server error in '{0}' " +
- "application</font></h1><hr>\n",
+ "<h1><font color=\"red\">Error in '{0}' " +
+ "Application</font></h1><hr>\n",
HttpRuntime.AppDomainAppVirtualPath);
- builder.AppendFormat ("<h2><font color=\"maroon\"><i>{0}</i></font></h2>\n", Message);
+ builder.AppendFormat ("<h2><font color=\"maroon\"><i>{0}</i></font></h2>\n", "Error"); //FIXME
builder.AppendFormat ("<b>Description: </b>{0}\n<p>\n", "Error processing request.");
builder.AppendFormat ("<b>Error Message: </b>{0}\n<p>\n", HtmlEncode (this.Message));
builder.AppendFormat ("<b>Stack Trace: </b>");
diff --git a/mcs/class/System.Web/System.Web/HttpMethodNotAllowedHandler.cs b/mcs/class/System.Web/System.Web/HttpMethodNotAllowedHandler.cs
index c13b14f74c2..e89a6082509 100644
--- a/mcs/class/System.Web/System.Web/HttpMethodNotAllowedHandler.cs
+++ b/mcs/class/System.Web/System.Web/HttpMethodNotAllowedHandler.cs
@@ -13,11 +13,15 @@ namespace System.Web
{
public void ProcessRequest (HttpContext context)
{
- throw new HttpException (405, "Method not allowed");
+ throw new HttpException (405, "Forbidden");
}
- public bool IsReusable {
- get { return true; }
+
+ public bool IsReusable
+ {
+ get {
+ return true;
+ }
}
}
}
diff --git a/mcs/class/System.Web/System.Web/HttpRequest.cs b/mcs/class/System.Web/System.Web/HttpRequest.cs
index 4365c73d0e0..d5bfd23c573 100644
--- a/mcs/class/System.Web/System.Web/HttpRequest.cs
+++ b/mcs/class/System.Web/System.Web/HttpRequest.cs
@@ -504,11 +504,6 @@ namespace System.Web {
get {
if (null == _sFilePath && null != _WorkerRequest) {
_sFilePath = _WorkerRequest.GetFilePath();
- try {
- _sFilePath = UrlUtils.Reduce (_sFilePath);
- } catch (Exception e) {
- throw new HttpException (403, "Forbidden");
- }
}
return _sFilePath;
@@ -719,9 +714,8 @@ namespace System.Web {
if (rewritten)
_sPathTranslated = _WorkerRequest.GetFilePathTranslated ();
- string verifyPath = _WorkerRequest.MapPath (FilePath);
if (null == _sPathTranslated)
- _sPathTranslated = verifyPath;
+ _sPathTranslated = _WorkerRequest.MapPath (FilePath);
}
return _sPathTranslated;
diff --git a/mcs/class/System.Web/System.Web/HttpResponse.cs b/mcs/class/System.Web/System.Web/HttpResponse.cs
index 5439c3c873e..63a3d8553da 100644
--- a/mcs/class/System.Web/System.Web/HttpResponse.cs
+++ b/mcs/class/System.Web/System.Web/HttpResponse.cs
@@ -34,7 +34,6 @@ namespace System.Web
bool _bBuffering;
bool _bHeadersSent;
bool _bFlushing;
- bool filtered;
long _lContentLength;
int _iStatusCode;
@@ -127,8 +126,6 @@ namespace System.Web
{
if (null != _Writer)
_Writer.FilterData (true);
-
- filtered = true;
}
[MonoTODO("We need to add cache headers also")]
@@ -675,12 +672,10 @@ namespace System.Web
}
try {
- if (_bClientDisconnected)
- return;
-
- long length = _Writer.BufferSize;
- if (!_bHeadersSent && !_bSuppressHeaders) {
+ long length;
+ if (!_bHeadersSent && !_bSuppressHeaders && !_bClientDisconnected) {
if (bFinish) {
+ length = _Writer.BufferSize;
if (length == 0 && _lContentLength == 0)
_sContentType = null;
@@ -709,23 +704,10 @@ namespace System.Web
}
}
- length = _Writer.BufferSize;
SendHeaders ();
}
}
- if (!filtered) {
- _Writer.FilterData (false);
- length = _Writer.BufferSize;
- }
-
- if (length == 0) {
- _WorkerRequest.FlushResponse (bFinish);
- if (!bFinish)
- _Writer.Clear ();
- return;
- }
-
if (!_bSuppressContent && Request.HttpMethod == "HEAD")
_bSuppressContent = true;
diff --git a/mcs/class/System.Web/System.Web/HttpRuntime.cs b/mcs/class/System.Web/System.Web/HttpRuntime.cs
index d3ce2a67101..1c337df5ed6 100644
--- a/mcs/class/System.Web/System.Web/HttpRuntime.cs
+++ b/mcs/class/System.Web/System.Web/HttpRuntime.cs
@@ -139,9 +139,6 @@ namespace System.Web {
context.Response.ClearHeaders ();
if (!(error is HttpException)) {
error = new HttpException (String.Empty, error);
- context.Response.StatusCode = 500;
- } else {
- context.Response.StatusCode = ((HttpException) error).GetHttpCode ();
}
context.Response.Write (((HttpException) error).GetHtmlErrorMessage ());
context.Response.FinalFlush ();
diff --git a/mcs/class/System.Web/System.Web/HttpServerUtility.cs b/mcs/class/System.Web/System.Web/HttpServerUtility.cs
index 4c7caf5435e..8df03fb6173 100644
--- a/mcs/class/System.Web/System.Web/HttpServerUtility.cs
+++ b/mcs/class/System.Web/System.Web/HttpServerUtility.cs
@@ -161,8 +161,8 @@ namespace System.Web
int qmark = path.IndexOf ('?');
string query;
if (qmark != -1) {
- query = path.Substring (qmark + 1);
path = path.Substring (0, qmark);
+ query = path.Substring (qmark + 1);
} else {
query = "";
}
diff --git a/mcs/class/System.Web/System.Web/MimeTypes.cs b/mcs/class/System.Web/System.Web/MimeTypes.cs
index dbd153aab24..ff267d853c1 100644
--- a/mcs/class/System.Web/System.Web/MimeTypes.cs
+++ b/mcs/class/System.Web/System.Web/MimeTypes.cs
@@ -304,7 +304,6 @@ namespace System.Web
mimeTypes.Add ("roff", "application/x-troff");
mimeTypes.Add ("rp ", "image/vnd.rn-realpix");
mimeTypes.Add ("rpm", "audio/x-pn-realaudio-plugin");
- mimeTypes.Add ("rss", "text/xml");
mimeTypes.Add ("rt", "text/richtext");
mimeTypes.Add ("rtf", "text/richtext");
mimeTypes.Add ("rtx", "text/richtext");
diff --git a/mcs/class/System.Web/System.Web/StaticFileHandler.cs b/mcs/class/System.Web/System.Web/StaticFileHandler.cs
index cea1c2916ba..463e9fd2e72 100644
--- a/mcs/class/System.Web/System.Web/StaticFileHandler.cs
+++ b/mcs/class/System.Web/System.Web/StaticFileHandler.cs
@@ -28,26 +28,12 @@ namespace System.Web
return;
}
- string strHeader = request.Headers ["If-Modified-Since"];
+ DateTime lastWT = fi.LastWriteTime;
try {
- if (strHeader != null) {
- DateTime dtIfModifiedSince = DateTime.ParseExact (strHeader, "r", null);
- DateTime ftime = fi.LastWriteTime.ToUniversalTime ();
- if (ftime <= dtIfModifiedSince) {
- response.StatusCode = 304;
- return;
- }
- }
- } catch { }
-
- try {
- DateTime lastWT = fi.LastWriteTime.ToUniversalTime ();
- response.AddHeader ("Last-Modified", lastWT.ToString ("r"));
-
response.WriteFile (fileName);
response.ContentType = MimeTypes.GetMimeType (fileName);
} catch (Exception e) {
- throw new HttpException (403, "Forbidden");
+ throw new HttpException (401, "Forbidden");
}
}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/AxHost.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/AxHost.cs
index 9d9f14a9fec..086b709a7dc 100644
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/AxHost.cs
+++ b/mcs/class/System.Windows.Forms/System.Windows.Forms/AxHost.cs
@@ -32,6 +32,9 @@ namespace System.Windows.Forms {
protected AxHost(string clsid,int flags){
}
+
+
+
/// --- public Properties ---
/// Properties supporting .NET framework, only. Not stubbed out:
public bool EditMode {
@@ -169,7 +172,7 @@ namespace System.Windows.Forms {
[MonoTODO]
//FIXME
- public new virtual bool RightToLeft {
+ public virtual bool RightToLeft {
get {
throw new NotImplementedException ();
}
@@ -454,6 +457,47 @@ namespace System.Windows.Forms {
base.WndProc(ref m);
}
+ /// --- events ---
+
+ //[MonoToDo]
+ //public event EventHandler BackColorChanged;
+ //public new event EventHandler BackgroundImageChanged;
+ //public new event EventHandler BindingContextChanged;
+ //public new event UICuesEventHandler ChangeUICues;
+ //public new event EventHandler Click;
+ //public new event EventHandler ContextMenuChanged;
+ //public new event EventHandler CursorChanged;
+ //public new event EventHandler DoubleClick;
+ //public new event DragEventHandler DragDrop;
+ //public new event DragEventHandler DragEnter;
+ //public new event EventHandler DragLeave;
+ //public new event DragEventHandler DragOver;
+ //public new event EventHandler EnabledChanged;
+ //public new event EventHandler FontChanged;
+ //public new event EventHandler ForeColorChanged;
+ //public new event GiveFeedbackEventHandler GiveFeedback;
+ //public new event HelpEventHandler HelpRequested;
+ //public new event EventHandler ImeModeChanged;
+ //public new event KeyEventHandler KeyDown;
+ //public new event KeyPressEventHandler KeyPress;
+ //public new event KeyEventHandler KeyUp;
+ //public new event LayoutEventHandler Layout;
+ //public new event MouseEventHandler MouseDown;
+ //public new event EventHandler MouseEnter;
+ //public new event EventHandler MouseHover;
+ //public new event EventHandler MouseLeave;
+ //public new event MouseEventHandler MouseMove;
+ //public new event MouseEventHandler MouseUp;
+ //public new event MouseEventHandler MouseWheel;
+ //public new event PaintEventHandler Paint;
+ //public new event QueryAccessibilityHelpEventHandler QueryAccessibilityHelp;
+ //public new event QueryContinueDragEventHandler QueryContinueDrag;
+ //public new event EventHandler RightToLeftChanged;
+ //public new event EventHandler StyleChanged;
+ //public new event EventHandler TabIndexChanged;
+ //public new event EventHandler TabStopChanged;
+ //public new event EventHandler TextChanged;
+ public event CancelEventHandler Validating;
/// --- public delegates ---
//[Serializable]
protected delegate void AboutBoxDelegate();
@@ -567,6 +611,12 @@ namespace System.Windows.Forms {
}
}
+ AccessibleObject AccessibilityObject {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
//protected bool RenderRightToLeft{
//}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/Button.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/Button.cs
index 13f92abf3b2..fccc4cd8150 100644
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/Button.cs
+++ b/mcs/class/System.Windows.Forms/System.Windows.Forms/Button.cs
@@ -128,7 +128,7 @@ namespace System.Windows.Forms {
// base.OnMouseLeave(mevent);
//}
- internal override void ButtonPaint (PaintEventArgs pevent) {
+ protected override void OnPaint (PaintEventArgs pevent) {
Rectangle paintBounds = ClientRectangle;
Bitmap bmp = new Bitmap( paintBounds.Width, paintBounds.Height,pevent.Graphics);
@@ -277,7 +277,15 @@ namespace System.Windows.Forms {
}
protected override void WndProc (ref Message m) {
- base.WndProc (ref m);
+ switch (m.Msg) {
+ case Msg.WM_DRAWITEM: {
+ m.Result = (IntPtr)1;
+ }
+ break;
+ default:
+ base.WndProc (ref m);
+ break;
+ }
}
/// --- Button events ---
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ButtonBase.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/ButtonBase.cs
index e76c18f652f..746bfe2a71f 100644
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ButtonBase.cs
+++ b/mcs/class/System.Windows.Forms/System.Windows.Forms/ButtonBase.cs
@@ -218,13 +218,9 @@ namespace System.Windows.Forms {
base.OnMouseUp (mevent);
}
- internal virtual void ButtonPaint (PaintEventArgs pevent) {
- }
-
protected override void OnPaint (PaintEventArgs pevent)
{
base.OnPaint (pevent);
- ButtonPaint (pevent);
}
protected override void OnParentChanged (EventArgs e)
@@ -262,22 +258,6 @@ namespace System.Windows.Forms {
}
break;
}
- case Msg.WM_DRAWITEM:
- m.Result = (IntPtr)1;
- break;
- case Msg.WM_PAINT:
- PAINTSTRUCT ps = new PAINTSTRUCT ();
- IntPtr hdc = Win32.BeginPaint (Handle, ref ps);
- Rectangle rc = new Rectangle ();
- rc.X = ps.rcPaint.left;
- rc.Y = ps.rcPaint.top;
- rc.Width = ps.rcPaint.right - ps.rcPaint.left;
- rc.Height = ps.rcPaint.bottom - ps.rcPaint.top;
- PaintEventArgs paintEventArgs = new PaintEventArgs (Graphics.FromHdc (hdc), rc);
- OnPaint (paintEventArgs);
- paintEventArgs.Dispose ();
- Win32.EndPaint (Handle, ref ps);
- break;
default:
base.WndProc (ref m);
break;
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ChangeLog b/mcs/class/System.Windows.Forms/System.Windows.Forms/ChangeLog
index 187b62f2133..eb84e3fc50f 100644
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ChangeLog
+++ b/mcs/class/System.Windows.Forms/System.Windows.Forms/ChangeLog
@@ -1,50 +1,3 @@
-2003-08-26 Alexandre Pigolkine <pigolkine@gmx.de>
- * RadioButton.cs painting code and click logic updated
-
-2003-08-24 Alexandre Pigolkine <pigolkine@gmx.de>
- * CheckBox.cs modified to be compatible with specification
-
-2003-08-24 Duncan Mak <duncan@ximian.com>
-
- * ListControl.cs: Indentation, coding style fixes.
-
-2003-08-24 Duncan Mak <duncan@ximian.com>
-
- Patches from Brian Takita <brian.takita@runbox.com>
-
- * GroupBox.cs (OnPaintBackground): Commented out.
- * ListControl.cs (DataSource): Fixed visibility of property and
- field.
- * MonthCalander.cs: Should match Specs better.
-
-2003-08-24 Alexandre Pigolkine <pigolkine@gmx.de>
- * ControlPaint.cs DrawRadioButton and DrawCheckBox improved
-
-2003-08-22 Alexandre Pigolkine <pigolkine@gmx.de>
- * CheckedListBox.cs
- new keyword added to avoid warnings - Brian Takita
- <brian.takita@runbox.com>
-
- * ComboBox.cs modified SetBoundsCore to keep correct value for Height
- * Control.cs avoid Control creation in Enabled property
-
-2003-08-22 Alexandre Pigolkine <pigolkine@gmx.de>
- * Button.cs
- * ButtonBase.cs
- * CheckBox.cs
- * RadioButton.cs
- modified to be compatible with specification
-
-2003-08-22 Alexandre Pigolkine <pigolkine@gmx.de>
-
- * ComboBox.cs
- * Control.cs modofications for ComboBox sample
-
-2003-08-22 Duncan Mak <duncan@ximian.com>
-
- * ListControl.cs (DataSource): Implementation by Brian Takita
- <brian.takita@runbox.com>.
-
2003-08-12 Aleksey Ryabchuk <ryabchuk@yahoo.com>
* MenuItem.cs : added missing properties, so menu sample app can be compiled
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/CheckBox.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/CheckBox.cs
index 59e2f6e3ee5..1e530d4e329 100644
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/CheckBox.cs
+++ b/mcs/class/System.Windows.Forms/System.Windows.Forms/CheckBox.cs
@@ -141,10 +141,11 @@ namespace System.Windows.Forms {
// --- CheckBox methods ---
- protected override AccessibleObject CreateAccessibilityInstance()
- {
- throw new NotImplementedException ();
- }
+ // I do not think this is part of the spec
+ //protected override AccessibleObject CreateAccessibilityInstance()
+ //{
+ // throw new NotImplementedException ();
+ //}
// [event methods]
@@ -236,7 +237,12 @@ namespace System.Windows.Forms {
}
}
- internal override void ButtonPaint (PaintEventArgs e)
+ protected virtual void OnPaintBackground (PaintEventArgs e)
+ {
+ // just do nothing to avoid flickering
+ }
+
+ protected override void OnPaint (PaintEventArgs e)
{
Rectangle paintBounds = ClientRectangle;
Bitmap bmp = new Bitmap( paintBounds.Width, paintBounds.Height,e.Graphics);
@@ -274,6 +280,18 @@ namespace System.Windows.Forms {
bmp.Dispose();
}
+ protected override void WndProc (ref Message m) {
+ switch (m.Msg) {
+ case Msg.WM_DRAWITEM: {
+ m.Result = (IntPtr)1;
+ }
+ break;
+ default:
+ base.WndProc (ref m);
+ break;
+ }
+ }
+
/// --- CheckBox events ---
public event EventHandler AppearanceChanged;
public event EventHandler CheckedChanged;
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/CheckedListBox.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/CheckedListBox.cs
index 2890e324ebe..ff70135ad1d 100644
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/CheckedListBox.cs
+++ b/mcs/class/System.Windows.Forms/System.Windows.Forms/CheckedListBox.cs
@@ -104,7 +104,7 @@ namespace System.Windows.Forms {
}
[MonoTODO]
- public new CheckedListBox.ObjectCollection Items {
+ public CheckedListBox.ObjectCollection Items {
get {
return (CheckedListBox.ObjectCollection)base.Items;
}
@@ -604,7 +604,7 @@ namespace System.Windows.Forms {
/// </summary>
[MonoTODO]
- public new class ObjectCollection : ListBox.ObjectCollection {
+ public class ObjectCollection : ListBox.ObjectCollection {
/// --- ObjectCollection.constructor ---
[MonoTODO]
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ComboBox.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/ComboBox.cs
index 77a4fe1cf81..555f6cebd90 100644
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ComboBox.cs
+++ b/mcs/class/System.Windows.Forms/System.Windows.Forms/ComboBox.cs
@@ -31,6 +31,7 @@ namespace System.Windows.Forms {
bool sorted;
Image backgroundImage;
ControlStyles controlStyles;
+ string text;
int selectedLength;
string selectedText;
int selectedIndex;
@@ -52,11 +53,12 @@ namespace System.Windows.Forms {
updateing = false;
//controlStyles = null;
drawMode = DrawMode.Normal;
- dropDownStyle = ComboBoxStyle.DropDown;
+ dropDownStyle = ComboBoxStyle.DropDownList;
droppedDown = false;
integralHeight = true;
sorted = false;
backgroundImage = null;
+ text = "";
Items_ = new ComboBox.ObjectCollection(this);
itemHeight_ = 13;
maxDropDownItems = 8;
@@ -422,13 +424,10 @@ namespace System.Windows.Forms {
[MonoTODO]
public override string Text {
get {
- return base.Text;
+ return text;
}
set {
- base.Text = value;
- if (value == null || value == String.Empty) {
- SelectedIndex = -1;
- }
+ text = value;
}
}
@@ -574,12 +573,7 @@ namespace System.Windows.Forms {
//FIXME:
base.OnHandleCreated(e);
populateControl(Items_);
- if (DropDownStyle != ComboBoxStyle.DropDown || Text == String.Empty) {
- if (selectedIndex == -1 && Items.Count != 0) {
- selectedIndex = 0;
- }
- Win32.SendMessage(Handle, (int)ComboBoxMessages.CB_SETCURSEL, selectedIndex, 0);
- }
+ Win32.SendMessage(Handle, (int)ComboBoxMessages.CB_SETCURSEL, selectedIndex, 0);
}
[MonoTODO]
@@ -669,28 +663,7 @@ namespace System.Windows.Forms {
height = DefaultSize.Height;
}
}
- if ( (specified & BoundsSpecified.X) == 0) x = Left;
- if ( (specified & BoundsSpecified.Y) == 0) y = Top;
- if ( (specified & BoundsSpecified.Width) == 0) width = Width;
- //if ( (specified & BoundsSpecified.Height) == 0) height = Height;
-
- if (IsHandleCreated){
- SetWindowPosFlags flags = SetWindowPosFlags.SWP_NOZORDER | SetWindowPosFlags.SWP_FRAMECHANGED | SetWindowPosFlags.SWP_DRAWFRAME;
- Win32.SetWindowPos (Handle, SetWindowPosZOrder.HWND_NOTOPMOST, x, y, width, height, flags);
-
- RECT rect = new RECT();
- Win32.GetWindowRect (Handle, ref rect);
- if( Parent != null) {
- Win32.ScreenToClient(Parent.Handle, ref rect);
- }
- x = rect.left;
- y = rect.top;
- width = rect.right - rect.left;
- height = rect.bottom - rect.top;
- }
-
- UpdateBounds (x, y, width, height);
-
+ base.SetBoundsCore(x,y,width,height,specified);
// FIXME: this is needed, otherwise painting is not correct
if( dropDownStyle == ComboBoxStyle.Simple ) {
Win32.InvalidateRect(Handle, IntPtr.Zero, 0);
@@ -754,18 +727,20 @@ namespace System.Windows.Forms {
else {
switch(m.HiWordWParam) {
case (uint)ComboBoxNotification.CBN_SELCHANGE:
+ //OnSelectedIndexChanged(new EventArgs());
SelectedIndex = Win32.SendMessage(Handle, (int)ComboBoxMessages.CB_GETCURSEL, 0, 0);
m.Result = IntPtr.Zero;
+ //CallControlWndProc(ref m);
break;
default:
+ Console.WriteLine("ComboBox enter default");
+ //CallControlWndProc(ref m);
m.Result = IntPtr.Zero;
+ Console.WriteLine("ComboBox exit default");
break;
}
}
break;
- case Msg.WM_CTLCOLOREDIT :
- CallControlWndProc ( ref m );
- break;
default:
base.WndProc(ref m);
break;
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/Control.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/Control.cs
index d9c23f15874..8ef2903a4bc 100644
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/Control.cs
+++ b/mcs/class/System.Windows.Forms/System.Windows.Forms/Control.cs
@@ -712,14 +712,12 @@ namespace System.Windows.Forms {
//return Win32.IsWindowEnabled (Handle);
}
set {
- if (enabled != value) {
- if (IsHandleCreated) {
- Win32.EnableWindow (Handle, value);
- // FIXME: Disable/enable all children here
- Invalidate ();
- }
- enabled = value;
- }
+ if (enabled != value) {
+ Win32.EnableWindow (Handle, value);
+ enabled = value;
+ // FIXME: Disable/enable all children here
+ Invalidate ();
+ }
}
}
@@ -1095,7 +1093,9 @@ namespace System.Windows.Forms {
//Compact Framework
public virtual string Text {
get {
- if (GetStyle(ControlStyles.CacheText) && IsHandleCreated){
+ // CHECKME: if we really need to provide back current text of real window
+ // or just our copy in text member.
+ if (IsHandleCreated){
int len = Win32.GetWindowTextLengthA (Handle);
// FIXME: len is doubled due to some strange behaviour. (of GetWindowText function ?)
// instead of 10 characters we can get only 9, even if sb.Capacity is 10.
@@ -2842,7 +2842,7 @@ namespace System.Windows.Forms {
//case Msg.WM_CTLCOLORSTATIC:
// if ( !Control.ReflectMessage ( m.LParam, ref m ) )
// CallControlWndProc ( ref m );
- //break;
+ break;
case Msg.WM_NOTIFY:
NMHDR nmhdr = (NMHDR)Marshal.PtrToStructure (m.LParam,
typeof (NMHDR));
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ControlPaint.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/ControlPaint.cs
index 7552506d35b..0ce7671a1dd 100644
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ControlPaint.cs
+++ b/mcs/class/System.Windows.Forms/System.Windows.Forms/ControlPaint.cs
@@ -285,8 +285,24 @@ namespace System.Windows.Forms {
//FIXME:
}
+ [MonoTODO]
public static void DrawCheckBox( Graphics graphics, Rectangle rectangle, ButtonState state) {
- DrawFrameControlHelper (graphics, rectangle, (uint)DrawFrameControl.DFC_BUTTON, (uint)state | (uint)DrawFrameControl.DFCS_BUTTONCHECK);
+ // FIXME: (sometimes) DrawFrameControl paints control not in "desired" position ( DC coordinates transformed or something like this)
+ // so, we paint to the bitmap ( fresh DC, (0,0)) and then DrawImage to requested position
+ Bitmap bmp = new Bitmap(rectangle.Width+1, rectangle.Height+1,graphics);
+ Graphics g = Graphics.FromImage(bmp);
+ // FIXME: fill new context with some color here?
+ IntPtr hdc = g.GetHdc();
+ RECT rc = new RECT();
+ rc.left = 0;
+ rc.top = 0;
+ rc.right = rectangle.Width;
+ rc.bottom = rectangle.Height;
+ int res = Win32.DrawFrameControl( hdc, ref rc, (uint)DrawFrameControl.DFC_BUTTON, (uint)state | (uint)DrawFrameControl.DFCS_BUTTONCHECK);
+ g.ReleaseHdc(hdc);
+ g.Dispose();
+ graphics.DrawImage(bmp, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height);
+ bmp.Dispose();
}
[MonoTODO]
@@ -409,66 +425,23 @@ namespace System.Windows.Forms {
ButtonState state) {
//FIXME:
}
-
- internal static void CopyImageTransparent (IntPtr targetDC, IntPtr sourceDC, Rectangle rectangle, Color transparentColor) {
- // Monochrome mask
- IntPtr maskDC = Win32.CreateCompatibleDC (sourceDC);
- IntPtr maskBmp = Win32.CreateBitmap (rectangle.Width, rectangle.Height, 1, 1, IntPtr.Zero);
- IntPtr oldMaskBmp = Win32.SelectObject (maskDC, maskBmp);
-
- uint oldColor = Win32.SetBkColor (sourceDC, (uint)Win32.RGB (transparentColor));
- Win32.StretchBlt (maskDC, 0, 0, rectangle.Width, rectangle.Height, sourceDC,
- 0, 0, rectangle.Width, rectangle.Height, PatBltTypes.SRCCOPY);
- Win32.SetBkColor (sourceDC, oldColor);
-
- Win32.StretchBlt (targetDC, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height,
- sourceDC, 0, 0, rectangle.Width, rectangle.Height, PatBltTypes.SRCINVERT);
-
- uint oldBkClr = Win32.SetBkColor (targetDC, 0xFFFFFF);
- int oldTextClr = Win32.SetTextColor (targetDC, 0);
- Win32.StretchBlt (targetDC, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height,
- maskDC, 0, 0, rectangle.Width, rectangle.Height, PatBltTypes.SRCAND);
- Win32.SetTextColor (targetDC, oldTextClr);
- Win32.SetBkColor (targetDC, oldBkClr);
-
- Win32.StretchBlt (targetDC, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height,
- sourceDC, 0, 0, rectangle.Width, rectangle.Height, PatBltTypes.SRCINVERT);
-
- Win32.SelectObject (maskDC, oldMaskBmp);
- Win32.DeleteDC (maskDC);
- Win32.DeleteObject (maskBmp);
- }
-
- internal static void DrawFrameControlHelper (Graphics graphics, Rectangle rectangle, uint type, uint state) {
-
- IntPtr targetDC = graphics.GetHdc ();
- Bitmap bmp = new Bitmap (rectangle.Width, rectangle.Height, graphics);
- Graphics g = Graphics.FromImage (bmp);
- IntPtr memDC = g.GetHdc ();
-
+
+ [MonoTODO]
+ public static void DrawRadioButton (Graphics graphics, Rectangle rectangle, ButtonState state) {
+ Bitmap bmp = new Bitmap(rectangle.Width+1, rectangle.Height+1,graphics);
+ Graphics g = Graphics.FromImage(bmp);
+ // FIXME: fill new context with some color here?
+ IntPtr hdc = g.GetHdc();
RECT rc = new RECT();
rc.left = 0;
rc.top = 0;
rc.right = rectangle.Width;
rc.bottom = rectangle.Height;
-
- Color transparentColor = Color.FromArgb (0, 0, 1);
- uint oldBk = Win32.SetBkColor (memDC, (uint)Win32.RGB(transparentColor));
- Win32.ExtTextOut (memDC, 0, 0, ExtTextOutFlags.ETO_OPAQUE, ref rc, 0, 0, IntPtr.Zero);
- Win32.SetBkColor (memDC, oldBk);
-
- int res = Win32.DrawFrameControl( memDC, ref rc, type, state);
-
- CopyImageTransparent (targetDC, memDC, rectangle, transparentColor);
-
- g.ReleaseHdc(memDC);
+ int res = Win32.DrawFrameControl( hdc, ref rc, (uint)DrawFrameControl.DFC_BUTTON, (uint)state | (uint)DrawFrameControl.DFCS_BUTTONRADIO);
+ g.ReleaseHdc(hdc);
g.Dispose();
+ graphics.DrawImage(bmp, rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height);
bmp.Dispose();
- graphics.ReleaseHdc (targetDC);
- }
-
- public static void DrawRadioButton (Graphics graphics, Rectangle rectangle, ButtonState state) {
- DrawFrameControlHelper (graphics, rectangle, (uint)DrawFrameControl.DFC_BUTTON, (uint)state | (uint)DrawFrameControl.DFCS_BUTTONRADIO);
}
[MonoTODO]
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/GroupBox.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/GroupBox.cs
index 0c9f479808e..9fa973fe5bc 100644
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/GroupBox.cs
+++ b/mcs/class/System.Windows.Forms/System.Windows.Forms/GroupBox.cs
@@ -88,6 +88,10 @@ namespace System.Windows.Forms {
Invalidate ( );
}
+ protected virtual void OnPaintBackground (PaintEventArgs e)
+ {
+ }
+
public override string Text {
get { return base.Text; }
set {
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ListControl.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/ListControl.cs
index af4efcd6b59..268b39aba9b 100644
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ListControl.cs
+++ b/mcs/class/System.Windows.Forms/System.Windows.Forms/ListControl.cs
@@ -4,13 +4,11 @@
// Author:
// stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
// Dennis Hayes (dennish@raytek.com)
-// Brian Takita (brian.takita@runbox.com)
// (C) 2002/3 Ximian, Inc
//
using System;
using System.Drawing;
using System.Collections;
-using System.ComponentModel;
using System.Reflection;
namespace System.Windows.Forms {
@@ -19,11 +17,10 @@ namespace System.Windows.Forms {
//
// </summary>
- public abstract class ListControl : Control {
+ public abstract class ListControl : Control {
- internal string DisplayMember_ = String.Empty;
+ protected string DisplayMember_ = String.Empty;
- internal object DataSource_;
//ControlStyles controlStyles;
//
// --- Public Properties
@@ -31,18 +28,10 @@ namespace System.Windows.Forms {
[MonoTODO]
public object DataSource {
get {
- return DataSource_;
+ throw new NotImplementedException ();
}
set {
- if (DataSource_ != value) {
- if ((value is IList) || (value is IListSource)) {
- DataSource_ = value;
- OnDataSourceChanged (new EventArgs ());
-
- } else {
- throw new Exception ("Complex DataBinding accepts as a data source either an IList or an IListSource");
- }
- }
+ //FIXME:
}
}
[MonoTODO]
@@ -51,28 +40,27 @@ namespace System.Windows.Forms {
return DisplayMember_;
}
set {
- if (DisplayMember_ != value) {
+ if( DisplayMember_ != value) {
DisplayMember_ = value;
OnDisplayMemberChanged(new EventArgs());
}
}
}
- internal string getDisplayMemberOfObj (object obj)
- {
+ internal string getDisplayMemberOfObj( object obj) {
string objectString = String.Empty;
Type t = obj.GetType();
-
- if (DisplayMember != String.Empty) {
- if (t != null) {
- PropertyInfo prop = t.GetProperty (DisplayMember);
- if (prop != null)
- objectString = prop.GetValue (obj, null).ToString ();
+ if( DisplayMember != String.Empty) {
+ if( t != null) {
+ PropertyInfo prop = t.GetProperty(DisplayMember);
+ if( prop != null) {
+ objectString = prop.GetValue(obj, null).ToString();
+ }
}
}
- if (objectString == String.Empty)
+ if( objectString == String.Empty) {
objectString = obj.ToString();
-
+ }
return objectString;
}
@@ -82,9 +70,8 @@ namespace System.Windows.Forms {
owner_ = owner;
}
-
public int Compare(object x, object y) {
- return owner_.getDisplayMemberOfObj(x).CompareTo (owner_.getDisplayMemberOfObj (y));
+ return owner_.getDisplayMemberOfObj(x).CompareTo(owner_.getDisplayMemberOfObj(y));
}
}
@@ -116,8 +103,8 @@ namespace System.Windows.Forms {
//
[MonoTODO]
- public string GetItemText (object item)
- {
+ public string GetItemText(object item)
+ {
throw new NotImplementedException ();
}
@@ -133,7 +120,8 @@ namespace System.Windows.Forms {
// --- Protected Constructor
//
[MonoTODO]
- protected ListControl () {
+ protected ListControl()
+ {
}
@@ -151,31 +139,27 @@ namespace System.Windows.Forms {
// --- Protected Methods
//
[MonoTODO]
- protected override bool IsInputKey (Keys keyData)
- {
+ protected override bool IsInputKey(Keys keyData)
+ {
//FIXME:
return base.IsInputKey(keyData);
}
[MonoTODO]
- protected virtual void OnDataSourceChanged (EventArgs e)
- {
+ protected virtual void OnDataSourceChanged(EventArgs e) {
//FIXME:
}
[MonoTODO]
- protected virtual void OnDisplayMemberChanged (EventArgs e)
- {
+ protected virtual void OnDisplayMemberChanged(EventArgs e) {
//FIXME:
}
[MonoTODO]
- protected virtual void OnSelectedIndexChanged (EventArgs e)
- {
+ protected virtual void OnSelectedIndexChanged(EventArgs e) {
//FIXME:
}
[MonoTODO]
- protected virtual void OnSelectedValueChanged (EventArgs e)
- {
+ protected virtual void OnSelectedValueChanged(EventArgs e){
//FIXME:
}
@@ -183,14 +167,14 @@ namespace System.Windows.Forms {
public event EventHandler ValueMemberChanged;
[MonoTODO]
- protected override void OnBindingContextChanged (EventArgs e)
- {
+ protected override void OnBindingContextChanged(EventArgs e)
+ {
//FIXME:
base.OnBindingContextChanged(e);
}
[MonoTODO]
- protected abstract void RefreshItem (int index);
+ protected abstract void RefreshItem(int index);
- }
+ }
}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/MonthCalendar.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/MonthCalendar.cs
index e2caa72a799..ddc8b0b5f2e 100644
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/MonthCalendar.cs
+++ b/mcs/class/System.Windows.Forms/System.Windows.Forms/MonthCalendar.cs
@@ -44,6 +44,50 @@ namespace System.Windows.Forms {
public void RemoveAllAnnuallyBoldedDates() {
//FIXME:
}
+ //[MonoTODO]
+ //public void BringToFront() {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public void CreateControl() {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public void Hide() {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public void Invalidate() {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public void Invalidate(bool b) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public void Invalidate(Rectangle r) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public void Invalidate(Region rg) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public void Invalidate(Rectangle r, bool b) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public void Invalidate(Region rg, bool b) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public void PerformLayout() {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public void PerformLayout(Control ctl, string s) {
+ // throw new NotImplementedException ();
+ //}
[MonoTODO]
public void RemoveAllBoldedDates() {
//FIXME:
@@ -64,6 +108,42 @@ namespace System.Windows.Forms {
public void RemoveMonthlyBoldedDate(DateTime date) {
//FIXME:
}
+ //[MonoTODO]
+ //public void ResetBindings() {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public void ResetImeMode() {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public void ResumeLayout() {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public void ResumeLayout(bool b) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public void Scale(float ft) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public void Scale(float ft, float ft1) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public void Select() {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public void SendToBack() {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public void SetBounds(int i, int i1, int i2, int i3) {
+ // throw new NotImplementedException ();
+ //}
[MonoTODO]
public void SetCalendarDimensions(int x, int y) {
//FIXME:
@@ -76,18 +156,86 @@ namespace System.Windows.Forms {
public void SetSelectionRange(DateTime date1, DateTime date2) {
//FIXME:
}
+ //[MonoTODO]
+ //public void Show() {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public void SuspendLayout() {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public void Update() {
+ // throw new NotImplementedException ();
+ //}
[MonoTODO]
public void UpdateBoldedDates() {
//FIXME:
}
+ //[MonoTODO]
+ //public IAsyncResult BeginInvoke(Delegate dels) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public IAsyncResult BeginInvoke(Delegate dels, object[] objs) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public bool Contains(Control ctl) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public Graphics CreateGraphics() {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public DragDropEffects DoDragDrop(object o, DragDropEffects dde) {
+ // throw new NotImplementedException ();
+ //}
[MonoTODO]
public object EndEnvoke(IAsyncResult asyncResult) {
throw new NotImplementedException ();
}
+ //[MonoTODO]
+ //public static bool Equals(object o, object o1) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public Form FindForm() {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public bool Focus() {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public Control GetChildAtPoint(Point pt) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public IContainerControl GetContainerControl() {
+ // throw new NotImplementedException ();
+ //}
[MonoTODO]
public SelectionRange GetDisplayRange(bool visible) {
throw new NotImplementedException ();
}
+ //[MonoTODO]
+ //public virtual int GetHashCode() {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public object GetLifetimeService() {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public Control GetNextControl(Control ctl, bool b) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public Type GetType() {
+ // throw new NotImplementedException ();
+ //}
[MonoTODO]
public HitTestInfo HitTest(Point point) {
throw new NotImplementedException ();
@@ -96,16 +244,133 @@ namespace System.Windows.Forms {
public HitTestInfo HitTest(int x, int y) {
throw new NotImplementedException ();
}
+ //[MonoTODO]
+ //public virtual object InitializeLifetimeService() {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public object Invoke(Delegate d) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public object Invoke(Delegate d, object[] obj) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public Point PointToClient(Point pt) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public Point PointToScreen(Point pt) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public Rectangle RectangleToClient(Rectangle r) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public Rectangle RectangleToScreen(Rectangle r) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public bool SelectNextControl(Control ctl, bool b, bool b1, bool b2, bool b3) {
+ // throw new NotImplementedException ();
+ //}
[MonoTODO]
public override string ToString() {
//FIXME:
return base.ToString();
}
+ //[MonoTODO]
+ //public virtual ObjRef CreateObjRef(Type reqType) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public virtual bool Equals(object o) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public virtual bool PreProcessMessage(ref Message msg) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public virtual void Refresh() {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public virtual void ResetBackColor() {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public virtual void ResetCursor() {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public virtual void ResetFont() {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public virtual void ResetForeColor() {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public virtual void ResetRightToLeft() {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public virtual void ResetText() {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public virtual void Select(bool b, bool b1) {
+ // throw new NotImplementedException ();
+ //}
//
// --- Public Properties
//
[MonoTODO]
+ public AccessibleObject AccessibilityObject {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+ [MonoTODO]
+ public string AccessibleDefaultActionDescription {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ }
+ }
+ [MonoTODO]
+ public string AccessibleDescription {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ //FIXME:
+ }
+ }
+ //[MonoTODO]
+ //public string AccessibleName {
+ // get {
+ // throw new NotImplementedException ();
+ // }
+ // set {
+ // //FIXME:
+ // }
+ //}
+ [MonoTODO]
+ public AccessibleRole AccessibleRole {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ //FIXME:
+ }
+ }
+ [MonoTODO]
public override bool AllowDrop {
get {
throw new NotImplementedException ();
@@ -169,6 +434,21 @@ namespace System.Windows.Forms {
}
}
[MonoTODO]
+ public int Bottom {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+ [MonoTODO]
+ public Rectangle Bounds {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ //FIXME:
+ }
+ }
+ [MonoTODO]
public Size CalendarDimensions {
get {
throw new NotImplementedException ();
@@ -178,6 +458,127 @@ namespace System.Windows.Forms {
}
}
[MonoTODO]
+ public bool CanFocus {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+ [MonoTODO]
+ public bool CanSelect {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+ [MonoTODO]
+ public bool Capture {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ //FIXME:
+ }
+ }
+ [MonoTODO]
+ public bool CausesValidation {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ //FIXME:
+ }
+ }
+ [MonoTODO]
+ public Rectangle ClientRectangle {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+ [MonoTODO]
+ public Size ClientSize {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ //FIXME:
+ }
+ }
+ [MonoTODO]
+ public string CompanyName {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+ [MonoTODO]
+ public IContainer Container {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+ [MonoTODO]
+ public bool ContainsFocus {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+ [MonoTODO]
+ public override ContextMenu ContextMenu {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ //FIXME:
+ }
+ }
+ [MonoTODO]
+ public Control.ControlCollection Controls {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+ [MonoTODO]
+ public bool Created {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+ [MonoTODO]
+ public override Cursor Cursor {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ //FIXME:
+ }
+ }
+ [MonoTODO]
+ public ControlBindingsCollection DataBindings {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+ [MonoTODO]
+ public override Rectangle DisplayRectangle {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+ [MonoTODO]
+ public bool Disposing {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+ [MonoTODO]
+ public override DockStyle Dock {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ //FIXME:
+ }
+ }
+
+ [MonoTODO]
public Day FirstDayOfWeek {
get {
throw new NotImplementedException ();
@@ -187,6 +588,21 @@ namespace System.Windows.Forms {
}
}
[MonoTODO]
+ public override bool Focused {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+ [MonoTODO]
+ public override Font Font {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ //FIXME:
+ }
+ }
+ [MonoTODO]
public override Color ForeColor {
get {
throw new NotImplementedException ();
@@ -196,6 +612,60 @@ namespace System.Windows.Forms {
}
}
[MonoTODO]
+ public bool HasChildren {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+ [MonoTODO]
+ public int Height {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ //FIXME:
+ }
+ }
+ [MonoTODO]
+ public bool IsAccessible {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ //FIXME:
+ }
+ }
+ [MonoTODO]
+ public bool IsDisposed {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+ [MonoTODO]
+ public bool IsHandleCreated {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+ [MonoTODO]
+ public int Left {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ //FIXME:
+ }
+ }
+ [MonoTODO]
+ public Point Location {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ //FIXME:
+ }
+ }
+ [MonoTODO]
public DateTime MaxDate {
get {
throw new NotImplementedException ();
@@ -232,6 +702,66 @@ namespace System.Windows.Forms {
}
}
[MonoTODO]
+ public string Name {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ //FIXME:
+ }
+ }
+ [MonoTODO]
+ public Control Parent {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ //FIXME:
+ }
+ }
+ [MonoTODO]
+ public string ProductName {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+ [MonoTODO]
+ public string ProductVersion {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+ [MonoTODO]
+ public bool RecreatingHandle {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+ [MonoTODO]
+ public Region Region {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ //FIXME:
+ }
+ }
+ [MonoTODO]
+ public int Right {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+ [MonoTODO]
+ public override RightToLeft RightToLeft {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ //FIXME:
+ }
+ }
+ [MonoTODO]
public int ScrollChange {
get {
throw new NotImplementedException ();
@@ -301,6 +831,51 @@ namespace System.Windows.Forms {
}
}
[MonoTODO]
+ public override ISite Site {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ //FIXME:
+ }
+ }
+ [MonoTODO]
+ public Size Size {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ //FIXME:
+ }
+ }
+ [MonoTODO]
+ public int TabIndex {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ //FIXME:
+ }
+ }
+ [MonoTODO]
+ public bool TabStop {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ //FIXME:
+ }
+ }
+ [MonoTODO]
+ public object Tag {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ //FIXME:
+ }
+ }
+ [MonoTODO]
public override string Text {
get {
//FIXME:
@@ -345,6 +920,21 @@ namespace System.Windows.Forms {
}
}
[MonoTODO]
+ public int Top {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ //FIXME:
+ }
+ }
+ [MonoTODO]
+ public Control TopLevelControl {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+ [MonoTODO]
public Color TrailingForeColor {
get {
throw new NotImplementedException ();
@@ -353,6 +943,24 @@ namespace System.Windows.Forms {
//FIXME:
}
}
+ [MonoTODO]
+ public bool Visible {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ //FIXME:
+ }
+ }
+ [MonoTODO]
+ public int Width {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ //FIXME:
+ }
+ }
//
// --- Protected Methods
@@ -362,10 +970,22 @@ namespace System.Windows.Forms {
//FIXME:
base.CreateHandle();
}
+ //[MonoTODO]
+ //protected bool GetStyle(ControlStyles flag) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected bool GetTopLevel() {
+ // throw new NotImplementedException ();
+ //}
[MonoTODO]
protected override bool IsInputKey(Keys keyData) {
throw new NotImplementedException ();
}
+ //[MonoTODO]
+ //protected object MemberwiseClone() {
+ // throw new NotImplementedException ();
+ //}
[MonoTODO]
protected override void OnBackColorChanged(EventArgs e) {
//FIXME:
@@ -375,6 +995,34 @@ namespace System.Windows.Forms {
//FIXME:
}
[MonoTODO]
+ protected internal virtual bool ProcessKeyMessage(ref Message m) {
+ throw new NotImplementedException ();
+ }
+ //[MonoTODO]
+ //protected ContentAlignment RtlTranslateAlignment(ContentAlignment align) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected HorizontalAlignment RtlTranslateAlignment(HorizontalAlignment align) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected LeftRightAlignment RtlTranslateAlignment(LeftRightAlignment align) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected ContentAlignment RtlTranslateContent(ContentAlignment align) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected HorizontalAlignment RtlTranslateHorizontal(HorizontalAlignment align) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected LeftRightAlignment RtlTranslateLeftRight(LeftRightAlignment align) {
+ // throw new NotImplementedException ();
+ //}
+ [MonoTODO]
protected override void SetBoundsCore(int x, int y, int width, int height, BoundsSpecified specified) {
//FIXME:
}
@@ -386,6 +1034,50 @@ namespace System.Windows.Forms {
{
//FIXME:
}
+ //[MonoTODO]
+ //protected virtual void InitLayout() {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual void OnBackgroundImageChanged(EventArgs e) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual void OnBindingContextChanged(EventArgs e) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual void OnCausesValidationChanged(EventArgs e) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual void OnChangeUICues(UICuesEventArgs e) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual void OnClick(EventArgs e) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual void OnContextMenuChanged(EventArgs e) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual void OnControlAdded(ControlEventArgs e) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual void OnControlRemoved(ControlEventArgs e) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual void OnCreateControl() {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual void OnCursorChanged(EventArgs e) {
+ // throw new NotImplementedException ();
+ //}
[MonoTODO]
protected virtual void OnDateChanged(DateRangeEventArgs drevent) {
//FIXME:
@@ -394,6 +1086,38 @@ namespace System.Windows.Forms {
protected virtual void OnDateSelected(DateRangeEventArgs drevent) {
//FIXME:
}
+ //[MonoTODO]
+ //protected virtual void OnDockChanged(EventArgs e) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual void OnDoubleClick(EventArgs e) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual void OnDragDrop(DragEventArgs drgevent) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual void OnDragEnter(DragEventArgs drgevent) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual void OnDragLeave(EventArgs e) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual void OnDragOver(DragEventArgs drgevent) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual void OnEnabledChanged(EventArgs e) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual void OnEnter(EventArgs e) {
+ // throw new NotImplementedException ();
+ //}
[MonoTODO]
protected override void OnFontChanged(EventArgs e) {
//FIXME:
@@ -402,6 +1126,309 @@ namespace System.Windows.Forms {
protected override void OnForeColorChanged(EventArgs e) {
//FIXME:
}
+ //[MonoTODO]
+ //protected virtual void OnGiveFeedback(GiveFeedbackEventArgs gfbevent) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual void OnGotFocus(EventArgs e) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual void OnHandleDestroyed(EventArgs e) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual void OnHelpRequested(HelpEventArgs hevent) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual void OnImeModeChanged(EventArgs e) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual void OnInvalidated(InvalidateEventArgs e) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual void OnKeyDown(KeyEventArgs e) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual void OnKeyPress(KeyPressEventArgs e) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual void OnKeyUp(KeyEventArgs e) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual void OnLayout(LayoutEventArgs levent) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual void OnLeave(EventArgs e) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual void OnLocationChanged(EventArgs e) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual void OnLostFocus(EventArgs e) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual void OnMouseDown(MouseEventArgs e) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual void OnMouseEnter(EventArgs e) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual void OnMouseHover(EventArgs e) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual void OnMouseLeave(EventArgs e) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual void OnMouseMove(MouseEventArgs e) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual void OnMouseUp(MouseEventArgs e) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual void OnMouseWheel(MouseEventArgs e) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual void OnMove(EventArgs e) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual void OnNotifyMessage(Message m) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual void OnPaint(PaintEventArgs e) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual void OnPaintBackground(PaintEventArgs pevent) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual void OnParentBackColorChanged(EventArgs e) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual void OnParentBackgroundImageChanged(EventArgs e) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual void OnParentBindingContextChanged(EventArgs e) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual void OnParentChanged(EventArgs e) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual void OnParentEnabledChanged(EventArgs e) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual void OnParentFontChanged(EventArgs e) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual void OnParentForeColorChanged(EventArgs e) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual void OnParentRightToLeftChanged(EventArgs e) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual void OnParentVisibleChanged(EventArgs e) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual void OnQueryContinueDrag(QueryContinueDragEventArgs qcdevent) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual void OnResize(EventArgs e) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual void OnRightToLeftChanged(EventArgs e) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual void OnSizeChanged(EventArgs e) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual void OnStyleChanged(EventArgs e) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual void OnSystemColorsChanged(EventArgs e) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual void OnTabIndexChanged(EventArgs e) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual void OnTabStopChanged(EventArgs e) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual void OnTextChanged(EventArgs e) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual void OnValidated(EventArgs e) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual void OnValidating(CancelEventArgs e) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual void OnVisibleChanged(EventArgs e) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual void ScaleCore(float dx,float dy) {
+ // throw new NotImplementedException ();
+ //}
+ // [MonoTODO]
+ // protected virtual void Select(bool b, bool b1)
+ // {
+ // throw new NotImplementedException ();
+ // }
+ //[MonoTODO]
+ //protected virtual void SetClientSizeCore(int x, int y) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual void SetVisibleCore(bool value) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected void AccessibilityNotifyClients(AccessibleEvents accEvent, int i) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected void InvokeGotFocus(Control toInvoke, EventArgs e) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected void InvokeLostFocus(Control toInvoke, EventArgs e) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected void InvokeOnClick(Control toInvoke, EventArgs e) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected void InvokePaint(Control c, PaintEventArgs e) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected void InvokePaintBackground(Control c, PaintEventArgs e) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected void RecreateHandle() {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected void SetStyle(ControlStyles flag, bool value) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected void SetTopLevel(bool value) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected void UpdateBounds() {
+ // throw new NotImplementedException ();
+ //}
+ // [MonoTODO]
+ // protected void UpdateBounds(int x, int y, int width, int height);
+ // {
+ // throw new NotImplementedException ();
+ // }
+ // [MonoTODO]
+ // protected void UpdateBounds(int x, int y, int width, int height, int clientWidth, intclientHeigth);
+ // {
+ // throw new NotImplementedException ();
+ // }
+ //[MonoTODO]
+ //protected void UpdateStyles() {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected void UpdateZOrder() {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual AccessibleObject CreateAccessibilityInstance() {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual ControlCollection CreateControlsInstance() {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual void DefWndProc(ref Message m) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual void DestroyHandle() {
+ // throw new NotImplementedException ();
+ //}
+ [MonoTODO]
+ protected virtual object GetService(Type service) {
+ throw new NotImplementedException ();
+ }
+ //[MonoTODO]
+ //protected virtual bool IsInputChar(char charCode) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual bool ProcessCmdKey(ref Message msg, Keys keyData) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual bool ProcessDialogChar(char charCode) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual bool ProcessDialogKey(Keys keyData) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual bool ProcessKeyEventArgs(ref Message m) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual bool ProcessKeyPreview(ref Message m) {
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual bool ProcessMnemonic(char charCode) {
+ // throw new NotImplementedException ();
+ //}
//
// --- Protected Properties
@@ -425,6 +1452,48 @@ namespace System.Windows.Forms {
return new Size (100, 100);
}
}
+ [MonoTODO]
+ protected bool DesignMode {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+ [MonoTODO]
+ protected bool ResizeRedraw {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ throw new NotImplementedException ();
+ }
+ }
+ [MonoTODO]
+ protected EventHandlerList Events {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+ [MonoTODO]
+ protected bool ShowKeyboardCues {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+ [MonoTODO]
+ protected int FontHeight {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ //FIXME:
+ }
+ }
+ [MonoTODO]
+ protected override bool ShowFocusCues {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
public enum HitArea {
Nowhere = 0,
@@ -446,8 +1515,62 @@ namespace System.Windows.Forms {
//
// --- Public Events
//
+ public event EventHandler BackColorChanged;
+ public event EventHandler BackgroundImageChanged;
+ public event EventHandler BindingContextChanged;
+ public event EventHandler CausesValidationChanged;
+ public event UICuesEventHandler ChangeUICues;
+ public event EventHandler ContextMenuChanged;
+ public event ControlEventHandler ControlAdded;
+ public event ControlEventHandler ControlRemoved;
+ public event EventHandler CursorChanged;
public event DateRangeEventHandler DateChanged;
public event DateRangeEventHandler DateSelected;
+ public event EventHandler DockChanged;
+ public event DragEventHandler DragDrop;
+ public event DragEventHandler DragEnter;
+ public event EventHandler DragLeave;
+ public event DragEventHandler DragOver;
+ public event EventHandler EnabledChanged;
+ public event EventHandler Enter;
+ public event EventHandler FontChanged;
+ public event EventHandler ForeColorChanged;
+ public event GiveFeedbackEventHandler GiveFeedback;
+ public event EventHandler GotFocus;
+ public event EventHandler HandleCreated;
+ public event EventHandler HandleDestroyed;
+ public event HelpEventHandler HelpRequested;
+ public event EventHandler ImeModeChanged;
+ public event InvalidateEventHandler Invalidated;
+ public event KeyEventHandler KeyDown;
+ public event KeyPressEventHandler KeyPress;
+ public event KeyEventHandler KeyUp;
+ public event LayoutEventHandler Layout;
+ public event EventHandler Leave;
+ public event EventHandler LocationChanged;
+ public event EventHandler LostFocus;
+ public event MouseEventHandler MouseDown;
+ public event EventHandler MouseEnter;
+ public event EventHandler MouseHover;
+ public event EventHandler MouseLeave;
+ public event MouseEventHandler MouseMove;
+ public event MouseEventHandler MouseUp;
+ public event MouseEventHandler MouseWheel;
+ public event EventHandler Move;
+ public event EventHandler ParentChanged;
+ public event QueryAccessibilityHelpEventHandler QueryAccessibilityHelp;
+ public event QueryContinueDragEventHandler QueryContinueDrag;
+ public event EventHandler Resize;
+ public event EventHandler RightToLeftChanged;
+ public event EventHandler SizeChanged;
+ public event EventHandler StyleChanged;
+ public event EventHandler SystemColorsChanged;
+ public event EventHandler TabIndexChanged;
+ public event EventHandler TabStopChanged;
+ public event EventHandler TextChanged;
+ public event EventHandler Validated;
+ public event CancelEventHandler Validating;
+ public event EventHandler VisibleChanged;
//
// System.Windows.Forms.MonthCalendar.HitTestInfo.cs
@@ -466,12 +1589,12 @@ namespace System.Windows.Forms {
//
// --- Public Properties
//
- [MonoTODO]
- public MonthCalendar.HitArea HitArea {
- get {
- throw new NotImplementedException ();
- }
- }
+ // [MonoTODO]
+ // public MonthCalendar.HitArea HitArea {
+ // get {
+ // throw new NotImplementedException ();
+ // }
+ // }
[MonoTODO]
public Point Point {
get {
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/RadioButton.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/RadioButton.cs
index 82f7e7f4a15..4d685f2bf28 100644
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/RadioButton.cs
+++ b/mcs/class/System.Windows.Forms/System.Windows.Forms/RadioButton.cs
@@ -90,8 +90,9 @@ namespace System.Windows.Forms {
set {
if ( checked_ != value ) {
checked_ = value;
+
+ updateCheck ( );
OnCheckedChanged ( EventArgs.Empty );
- Invalidate ();
}
}
}
@@ -104,6 +105,7 @@ namespace System.Windows.Forms {
public void PerformClick()
{
+ Checked = !Checked;
OnClick ( EventArgs.Empty );
}
@@ -156,15 +158,20 @@ namespace System.Windows.Forms {
[MonoTODO]
protected override void OnClick(EventArgs e)
{
- if (AutoCheck && !Checked) {
- Checked = true;
- foreach (Control ctr in Parent.Controls) {
- RadioButton rbtn = ctr as RadioButton;
- if (rbtn != null && rbtn != this) {
- rbtn.Checked = false;
- }
- }
+ int res = Win32.SendMessage ( Handle, (int)ButtonMessages.BM_GETCHECK, 0, 0);
+
+ bool check = Checked;
+
+ if ( res == (int) NativeButtonState.BST_CHECKED )
+ check = true;
+ else if ( res == (int) NativeButtonState.BST_UNCHECKED )
+ check = false;
+
+ if ( checked_ != check ) {
+ checked_ = check;
+ OnCheckedChanged ( EventArgs.Empty );
}
+
base.OnClick ( e );
}
@@ -177,11 +184,18 @@ namespace System.Windows.Forms {
protected override void OnHandleCreated(EventArgs e)
{
base.OnHandleCreated ( e );
+ updateCheck ( );
}
+ protected override void OnMouseDown (MouseEventArgs e)
+ {
+ base.OnMouseDown (e);
+ }
+
protected override void OnMouseUp(MouseEventArgs e)
{
- OnClick (EventArgs.Empty);
+ Checked = Checked ? false : true;
+ Invalidate ();
base.OnMouseUp(e);
}
@@ -201,7 +215,14 @@ namespace System.Windows.Forms {
get { return (int) ( Appearance == Appearance.Normal ? 0 : ButtonStyles.BS_PUSHLIKE ); }
}
- internal override void ButtonPaint (PaintEventArgs e)
+ private void updateCheck ( ) {
+ if ( IsHandleCreated )
+ Win32.SendMessage ( Handle, (int) ButtonMessages.BM_SETCHECK,
+ Checked ? (int) NativeButtonState.BST_CHECKED :
+ ( int ) NativeButtonState.BST_UNCHECKED, 0 );
+ }
+
+ protected override void OnPaint (PaintEventArgs e)
{
Rectangle paintBounds = ClientRectangle;
Bitmap bmp = new Bitmap( paintBounds.Width, paintBounds.Height,e.Graphics);
@@ -212,26 +233,11 @@ namespace System.Windows.Forms {
sb.Dispose ();
// FIXME: Width/Heigth of radiobutton are not correct
- int CheckSize = 12;
- Rectangle checkRect = new Rectangle (paintBounds.Left, paintBounds.Top, CheckSize, CheckSize);
- Rectangle textRect = new Rectangle (checkRect.Right + 3, paintBounds.Top, paintBounds.Width - checkRect.Width - 4, paintBounds.Height);
- if (0 != (CheckAlign & (ContentAlignment.BottomLeft | ContentAlignment.BottomCenter | ContentAlignment.BottomRight))) {
- checkRect.Y = paintBounds.Bottom - CheckSize;
- }
- else if(0 != (CheckAlign & (ContentAlignment.MiddleLeft | ContentAlignment.MiddleCenter | ContentAlignment.MiddleRight))) {
- checkRect.Y = paintBounds.Top + paintBounds.Height / 2 - CheckSize / 2;
- }
-
- if (0 != (CheckAlign & (ContentAlignment.TopRight | ContentAlignment.MiddleRight | ContentAlignment.BottomRight))) {
- checkRect.X = paintBounds.Right - CheckSize;
- textRect.X = paintBounds.Left;
- }
- else if(0 != (CheckAlign & (ContentAlignment.TopCenter | ContentAlignment.MiddleCenter | ContentAlignment.BottomCenter))) {
- checkRect.X = paintBounds.Left + paintBounds.Width / 2 - CheckSize / 2;
- textRect.X = paintBounds.Left;
- textRect.Width = paintBounds.Width;
- }
-
+ Rectangle checkRect = new Rectangle(paintBounds.Left,paintBounds.Top,12,12);
+ Rectangle textRect = new Rectangle( checkRect.Right,paintBounds.Top,paintBounds.Width - checkRect.Width - 1,paintBounds.Height);
+ //paintOn.DrawString(Text, Font, SystemBrushes.ControlText, textRect.X, textRect.Y);
+ Win32.DrawText(paintOn, Text, Font, ForeColor, textRect, TextAlign);
+
ButtonState state = ButtonState.Normal;
if (FlatStyle == FlatStyle.Flat) {
state |= ButtonState.Flat;
@@ -243,8 +249,6 @@ namespace System.Windows.Forms {
ControlPaint.DrawRadioButton (paintOn, checkRect, state);
- Win32.DrawText(paintOn, Text, Font, ForeColor, textRect, TextAlign);
-
if (Focused) {
ControlPaint.DrawFocusRectangle (paintOn, textRect);
}
@@ -253,5 +257,17 @@ namespace System.Windows.Forms {
paintOn.Dispose ();
bmp.Dispose();
}
+
+ protected override void WndProc (ref Message m) {
+ switch (m.Msg) {
+ case Msg.WM_DRAWITEM: {
+ m.Result = (IntPtr)1;
+ }
+ break;
+ default:
+ base.WndProc (ref m);
+ break;
+ }
+ }
}
}
diff --git a/mcs/class/System.XML/ChangeLog b/mcs/class/System.XML/ChangeLog
index c4814e1a188..692b1772de0 100644
--- a/mcs/class/System.XML/ChangeLog
+++ b/mcs/class/System.XML/ChangeLog
@@ -1,23 +1,3 @@
-2003-08-24 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
-
- * System.Xml.dll.sources : added XsdParticleValidationState.cs
- and XsdValidatingReader.cs.
- * System.Xml_test.dll.sources : added XsdParticleValidationTests.cs
- and XsdValidatingReaderTests.cs.
-
-2003-08-18 Ben Maurer <bmaurer@users.sourceforge.net>
-
- * System.Xml.dll.sources: add files from Oleg.
-
-2003-08-18 Ben Maurer <bmaurer@users.sourceforge.net>
-
- * System.Xml.dll.source: add System.Xml/HighWaterStack.cs.
-
-2003-08-14 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
-
- * System.Xml.dll.sources: Added Mono.Xml.Xsl.Operation/XslComment.cs
- and Mono.Xml/IHasXmlSchemaInfo.cs
-
2003-08-11 Andreas Nahr <ClassDevelopment@A-SoftTech.com>
* System.Xml.dll.sources: Added Assembly/Locale.cs
diff --git a/mcs/class/System.XML/Mono.Xml.Schema/ChangeLog b/mcs/class/System.XML/Mono.Xml.Schema/ChangeLog
deleted file mode 100644
index 720d364e4ae..00000000000
--- a/mcs/class/System.XML/Mono.Xml.Schema/ChangeLog
+++ /dev/null
@@ -1,4 +0,0 @@
-2003-08-24 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
-
- * XsdValidatingReader.cs,
- XsdParticleValidationState.cs : Initial checkin.
diff --git a/mcs/class/System.XML/Mono.Xml.Schema/XsdParticleValidationState.cs b/mcs/class/System.XML/Mono.Xml.Schema/XsdParticleValidationState.cs
deleted file mode 100644
index 34ccb4bb276..00000000000
--- a/mcs/class/System.XML/Mono.Xml.Schema/XsdParticleValidationState.cs
+++ /dev/null
@@ -1,462 +0,0 @@
-//
-// Mono.Xml.Schema.XsdParticleValidationState.cs
-//
-// Author:
-// Atsushi Enomoto (ginga@kit.hi-ho.ne.jp)
-//
-// (C)2003 Atsushi Enomoto
-//
-using System;
-using System.Collections;
-using System.Xml;
-using System.Xml.Schema;
-
-
-namespace Mono.Xml
-{
- public class XsdValidationStateFactory
- {
- Hashtable table;
-
- public XsdValidationStateFactory ()
- {
- table = new Hashtable ();
- }
-
- public XsdValidationState Get (XmlSchemaObject xsobj)
- {
- XsdValidationState got = table [xsobj] as XsdValidationState;
- if (got == null)
- got = Create (xsobj);
- return got;
- }
-
- public XsdValidationState Create (XmlSchemaObject xsobj)
- {
- string typeName = xsobj.GetType ().Name;
- switch (typeName) {
- case "XmlSchemaElement":
- return AddElement ((XmlSchemaElement) xsobj);
- case "XmlSchemaSequence":
- return AddSequence ((XmlSchemaSequence) xsobj);
- case "XmlSchemaChoice":
- return AddChoice ((XmlSchemaChoice) xsobj);
- case "XmlSchemaAll":
- return AddAll ((XmlSchemaAll) xsobj);
- case "XmlSchemaAny":
- return AddAny ((XmlSchemaAny) xsobj);
- case "EmptyParticle": // Microsoft.NET
- case "XmlSchemaParticleEmpty": // Mono
- return AddEmpty ();
- default:
- throw new NotImplementedException ();
- }
- }
-
- private XsdElementValidationState AddElement (XmlSchemaElement element)
- {
- XsdElementValidationState got = new XsdElementValidationState (element, this);
- table [element] = got;
- return got;
- }
-
- private XsdSequenceValidationState AddSequence (XmlSchemaSequence sequence)
- {
- XsdSequenceValidationState got = new XsdSequenceValidationState (sequence, this);
- table [sequence] = got;
- return got;
- }
-
- private XsdChoiceValidationState AddChoice (XmlSchemaChoice choice)
- {
- XsdChoiceValidationState got = new XsdChoiceValidationState (choice, this);
- table [choice] = got;
- return got;
- }
-
- private XsdAllValidationState AddAll (XmlSchemaAll all)
- {
- XsdAllValidationState got = new XsdAllValidationState (all, this);
- table [all] = got;
- return got;
- }
-
- private XsdAnyValidationState AddAny (XmlSchemaAny any)
- {
- XsdAnyValidationState got = new XsdAnyValidationState (any, this);
- table [any] = got;
- return got;
- }
-
- private XsdEmptyValidationState AddEmpty ()
- {
- return new XsdEmptyValidationState (this);
- }
- }
-
- public abstract class XsdValidationState
- {
- int occured;
- XsdValidationStateFactory factory;
- XmlSchemaElement currentElement;
-
- public XsdValidationState (XsdValidationStateFactory factory)
- {
- this.factory = factory;
- }
-
- // Normally checks MaxOccurs boundary
- public abstract bool EvaluateStartElement (string localName, string ns);
-
- // Normally checks MinOccurs boundary
- public abstract bool EvaluateEndElement ();
-
- public abstract bool Emptiable { get; }
-
- public XmlSchemaDatatype Datatype {
- get {
- XmlSchemaDatatype dt = currentElement.ElementType as XmlSchemaDatatype;
- return dt != null ? dt : ((XmlSchemaType) currentElement.ElementType).Datatype;
- }
- }
-
- public XmlSchemaElement Element {
- get { return currentElement; }
- }
-
- public XsdValidationStateFactory Factory {
- get { return factory; }
- }
-
- public int Occured {
- get { return occured; }
- }
-
- internal void IncrementOccurence ()
- {
- occured++;
- }
-
- internal void SetCurrentElement (XmlSchemaElement element)
- {
- currentElement = element;
- }
-
- internal void SetValidResult (XsdValidationState matched)
- {
- this.currentElement = matched.currentElement;
- }
- }
-
- public class XsdElementValidationState : XsdValidationState
- {
- public XsdElementValidationState (XmlSchemaElement element, XsdValidationStateFactory factory)
- : base (factory)
- {
- this.element = element;
- this.schemaType = element.ElementType as XmlSchemaType;
- this.dataType = element.ElementType as XmlSchemaDatatype;
- name = element.QualifiedName.Name;
- ns = element.QualifiedName.Namespace;
- }
-
- // final fields
- XmlSchemaElement element;
- XmlSchemaType schemaType;
- XmlSchemaDatatype dataType;
- string name;
- string ns;
-
- // Methods
-
- public override bool EvaluateStartElement (string name, string ns)
- {
- if (this.name == name && this.ns == ns) {
- if (Occured >= element.MaxOccurs)
- return false;
-
- IncrementOccurence ();
- SetCurrentElement (element);
- return true;
- } else {
- return false;
- }
- }
-
- public override bool EvaluateEndElement ()
- {
- return (element.MinOccurs <= Occured);
- }
-
- public override bool Emptiable {
- get { return element.MinOccurs <= Occured; }
- }
- }
-
- public class XsdSequenceValidationState : XsdValidationState
- {
- XmlSchemaSequence seq;
- int current = -1;
- XsdValidationState currentAutomata;
-
- public XsdSequenceValidationState (XmlSchemaSequence sequence, XsdValidationStateFactory factory)
- : base (factory)
- {
- seq = sequence;
- }
-
- public override bool EvaluateStartElement (string localName, string ns)
- {
- if (Occured > seq.MaxOccurs)
- return false;
-
- int idx = current < 0 ? 0 : current;
- XsdValidationState xa = currentAutomata;
- if (xa == null)
- xa = Factory.Create (seq.Items [idx]);
- bool increment = false;
-
- while (xa != null) {
- if (!xa.EvaluateStartElement (localName, ns)) {
- if (!xa.Emptiable)
- return false;
- } else {
- if (increment) {
- if (Occured + 1 >= seq.MaxOccurs)
- return false;
- IncrementOccurence ();
- }
- current = idx;
- currentAutomata = xa;
- SetValidResult (currentAutomata);
- return true;
- }
-
- idx++;
- if (seq.Items.Count > idx)
- xa = Factory.Create (seq.Items [idx]);
- else if (current < 0) // started from top
- xa = null;
- else { // started from middle
- idx = 0;
- increment = true;
- xa = (idx < current) ?
- Factory.Create (seq.Items [idx])
- : null;
- }
- }
- return false;
- }
-
- public override bool EvaluateEndElement ()
- {
- if (current < 0)
- return (seq.MinOccurs <= Occured);
-
- // Then we are in the middle of the sequence.
- // Check all following emptiable items.
- if (!Emptiable)
- return false;
-
- return seq.MinOccurs <= Occured + 1;
- }
-
- public override bool Emptiable {
- get {
- if (seq.MinOccurs > Occured + 1)
- return false;
-
- int idx = current;
- XsdValidationState xa = currentAutomata;
- if (xa == null)
- xa = Factory.Create (seq.Items [idx]);
- while (xa != null) {
- if (!xa.Emptiable)
- return false; // cannot omit following items.
- idx++;
- if (seq.Items.Count > idx)
- xa = Factory.Create (seq.Items [idx]);
- else
- xa = null;
- }
- return true;
- }
- }
- }
-
- public class XsdChoiceValidationState : XsdValidationState
- {
- XmlSchemaChoice choice;
- XsdValidationState incomplete;
-
- public XsdChoiceValidationState (XmlSchemaChoice choice, XsdValidationStateFactory factory)
- : base (factory)
- {
- this.choice = choice;
- }
-
- public override bool EvaluateStartElement (string localName, string ns)
- {
- if (incomplete != null) {
- if (incomplete.EvaluateStartElement (localName, ns))
- return true;
- else {
- if (!incomplete.Emptiable)
- return false;
- else
- incomplete = null;
- }
- }
-
- if (Occured >= choice.MaxOccurs)
- return false;
-
- foreach (XmlSchemaObject xsobj in choice.Items) {
- XsdValidationState xa = Factory.Create (xsobj);
- if (xa.EvaluateStartElement (localName, ns)) {
- incomplete = xa;
- this.SetValidResult (xa);
- IncrementOccurence ();
- return true;
- }
- }
-
- return false;
- }
-
- public override bool EvaluateEndElement ()
- {
- return (choice.MinOccurs <= Occured) &&
- (incomplete != null ? incomplete.Emptiable : true);
- }
-
- public override bool Emptiable {
- get {
- return (choice.MinOccurs <= Occured) &&
- (incomplete != null ? incomplete.Emptiable : true);
- }
- }
- }
-
- public class XsdAllValidationState : XsdValidationState
- {
- XmlSchemaAll all;
- ArrayList consumed = new ArrayList ();
- XsdValidationState incomplete;
-
- public XsdAllValidationState (XmlSchemaAll all, XsdValidationStateFactory factory)
- : base (factory)
- {
- this.all = all;
- }
-
- public override bool EvaluateStartElement (string localName, string ns)
- {
- if (Occured > all.MaxOccurs)
- return false;
-
- if (incomplete != null) {
- if (incomplete.EvaluateStartElement (localName, ns))
- return true;
- else {
- if (!incomplete.Emptiable)
- return false;
- else
- incomplete = null;
- }
- }
-
- foreach (XmlSchemaObject xsobj in all.Items) {
- if (consumed.Contains (xsobj))
- return false;
-
- XsdValidationState xa = Factory.Create (xsobj);
- if (xa.EvaluateStartElement (localName, ns)) {
- consumed.Add (xsobj);
- this.SetValidResult (xa);
- return true;
- }
- }
- return false;
- }
-
- public override bool EvaluateEndElement ()
- {
- if (consumed.Count == 0 && all.MinOccurs > 0)
- return false;
-
- // quick check
- if (all.Items.Count == consumed.Count)
- return true;
-
- if (incomplete != null && !incomplete.Emptiable)
- return false;
-
- foreach (XmlSchemaParticle xsobj in all.Items) {
- if (xsobj.MinOccurs > 0 && !consumed.Contains (xsobj))
- return false; // missing item was found
- }
- return false;
- }
-
- public override bool Emptiable {
- get {
- return (all.MinOccurs <= Occured) &&
- (incomplete != null ? incomplete.Emptiable : true);
- }
- }
- }
-
- public class XsdAnyValidationState : XsdValidationState
- {
- public XsdAnyValidationState (XmlSchemaAny any, XsdValidationStateFactory factory)
- : base (factory)
- {
- this.any = any;
- }
-
- // final fields
- XmlSchemaAny any;
-
- // Methods
-
- public override bool EvaluateStartElement (string name, string ns)
- {
- throw new NotImplementedException ();
- }
-
- public override bool EvaluateEndElement ()
- {
- return (any.MinOccurs > Occured);
- }
-
- public override bool Emptiable {
- get { return any.MinOccurs <= Occured; }
- }
- }
-
- public class XsdEmptyValidationState : XsdValidationState
- {
- public XsdEmptyValidationState (XsdValidationStateFactory factory)
- : base (factory)
- {
- }
-
- // Methods
-
- public override bool EvaluateStartElement (string name, string ns)
- {
- return false;
- }
-
- public override bool EvaluateEndElement ()
- {
- return true;
- }
-
- public override bool Emptiable {
- get { return true; }
- }
- }
-
-}
diff --git a/mcs/class/System.XML/Mono.Xml.Schema/XsdValidatingReader.cs b/mcs/class/System.XML/Mono.Xml.Schema/XsdValidatingReader.cs
deleted file mode 100644
index a4f065fbedb..00000000000
--- a/mcs/class/System.XML/Mono.Xml.Schema/XsdValidatingReader.cs
+++ /dev/null
@@ -1,468 +0,0 @@
-//
-// Mono.Xml.Schema.XsdValidatingReader.cs
-//
-// Author:
-// Atsushi Enomoto (ginga@kit.hi-ho.ne.jp)
-//
-// (C)2003 Atsushi Enomoto
-//
-using System;
-using System.Collections;
-using System.Collections.Specialized;
-using System.Text;
-using System.Xml;
-using System.Xml.Schema;
-
-
-namespace Mono.Xml
-{
- public class XsdValidatingReader : XmlReader, IXmlLineInfo, IHasXmlSchemaInfo //, IHasXmlParserContext
- {
- XmlReader reader;
- XmlValidatingReader xvReader;
- bool laxElementValidation = true;
- bool reportNoValidationError;
- XmlSchemaCollection schemas = new XmlSchemaCollection ();
- bool namespaces = true;
-
- XsdValidationState currentValidationState;
-// XsdAttributeValidationStateCollection attributeValidationStates;
- object elementXsiType;
- StringBuilder storedCharacters = new StringBuilder ();
-
- // [int Depth] -> XsdAutomata.
- // Some of them might be missing (See the spec section 5.3).
- Hashtable automataTable = new Hashtable ();
-
- StringCollection defaultAttributes = new StringCollection ();
- int currentDefaultAttribute;
-
- // Property Cache.
- int attributeCount;
-
-#region .ctor
- public XsdValidatingReader (XmlReader reader)
- : this (reader, null)
- {
- }
-
- public XsdValidatingReader (XmlReader reader, XmlReader validatingReader)
- {
- this.reader = reader;
- xvReader = validatingReader as XmlValidatingReader;
- if (xvReader != null) {
- if (xvReader.ValidationType == ValidationType.None)
- reportNoValidationError = true;
- }
- }
-#endregion
-
-// Non-overrides
-
- public bool Namespaces {
- get { return namespaces; }
- set { namespaces = value; }
- }
-
- public XmlReader Reader {
- get { return reader; }
- }
-
- // This should be changed before the first Read() call.
- public XmlSchemaCollection Schemas {
- get { return schemas; }
- }
-
- public object SchemaType {
- get {
- if (ReadState != ReadState.Interactive)
- return null;
-
- switch (NodeType) {
- case XmlNodeType.Element:
- if (elementXsiType != null)
- return elementXsiType;
- else if (currentValidationState != null)
- return currentValidationState.Element.ElementType;
- else
- return null;
- case XmlNodeType.Attribute:
- throw new NotImplementedException ();
- default:
- return null;
- }
- }
- }
-
- // This property is never used in Mono.
- public ValidationType ValidationType {
- get {
- if (reportNoValidationError)
- return ValidationType.None;
- else
- return ValidationType.Schema;
- }
- }
-
- public XmlResolver XmlResolver {
- set { throw new NotImplementedException (); }
- }
-
- // TODO: provide XmlNamespaceManager to ParseValue() if possible
- public object ReadTypedValue ()
- {
- switch (NodeType) {
- case XmlNodeType.Element:
- XmlSchemaDatatype xsDatatype = currentValidationState.Datatype;
- if (xsDatatype != null)
- return xsDatatype.ParseValue (ReadString (), NameTable, null);
- else
- return null;
- case XmlNodeType.Attribute:
- throw new NotImplementedException ();
-// xsDatatype = attributeValidationStates [LocalName, NamespaceURI].Datatype;
-// if (xsDatatype != null)
-// return xsDatatype.ParseValue (Value, NameTable, null);
-// else
-// return null;
- default:
- return null;
- }
- }
-
- public ValidationEventHandler ValidationEventHandler;
-
-// Overrided Properties
-
- public override int AttributeCount {
- get {
- if (NodeType == XmlNodeType.Element)
- return attributeCount;
- else if (IsDefault)
- return 0;
- else
- return reader.AttributeCount;
- }
- }
-
- public override string BaseURI {
- get { return reader.BaseURI; }
- }
-
- // If this class is used to implement XmlValidatingReader,
- // it should be left to DTDValidatingReader. In other cases,
- // it depends on the reader's ability.
- public override bool CanResolveEntity {
- get { return reader.CanResolveEntity; }
- }
-
- public override int Depth {
- get { return reader.Depth; }
- }
-
- public override bool EOF {
- get { return reader.EOF; }
- }
-
- public override bool HasValue {
- get { throw new NotImplementedException (); }
- }
-
- public override bool IsDefault {
- // TODO: handle default node
- get { return false; }
- }
-
- public override bool IsEmptyElement {
- // TODO: consider default attributes
- get { return reader.IsEmptyElement; }
- }
-
- public override string this [int i] {
- get { return GetAttribute (i); }
- }
-
- public override string this [string name] {
- get { return GetAttribute (name); }
- }
-
- public override string this [string localName, string ns] {
- get { return GetAttribute (localName, ns); }
- }
-
- int IXmlLineInfo.LineNumber {
- get { throw new NotImplementedException (); }
- }
-
- int IXmlLineInfo.LinePosition {
- get { throw new NotImplementedException (); }
- }
-
- public override string LocalName {
- // TODO: handle default node
- get { return reader.LocalName; }
- }
-
- public override string Name {
- // TODO: handle default node
- get { return reader.Name; }
- }
-
- public override string NamespaceURI {
- // TODO: handle default node
- get { return reader.NamespaceURI; }
- }
-
- public override XmlNameTable NameTable {
- get { return reader.NameTable; }
- }
-
- public override XmlNodeType NodeType {
- // TODO: handle default node
- get { return reader.NodeType; }
- }
-
- public override string Prefix {
- // TODO: handle default node
- get { return reader.Prefix; }
- }
-
- public override char QuoteChar {
- get { return reader.QuoteChar; }
- }
-
- public override ReadState ReadState {
- get { return reader.ReadState; }
- }
-
- public override string Value {
- // TODO: handle default node
- get { return reader.Value; }
- }
-
- public override string XmlLang {
- get { throw new NotImplementedException (); }
- }
-
- public override XmlSpace XmlSpace {
- get { throw new NotImplementedException (); }
- }
-
- private void HandleError (string error)
- {
- if (reportNoValidationError)
- return;
-
- ValidationEventArgs e = new ValidationEventArgs (
- new XmlSchemaException (error, null), error, XmlSeverityType.Error);
-
- if (this.ValidationEventHandler != null)
- this.ValidationEventHandler (this, e);
- else
-#if NON_MONO_ENV
- this.xvReader.OnValidationEvent (this, e);
-#else
- throw e.Exception;
-#endif
- }
-
- private void ValidateStartElementParticle ()
- {
- if (schemas.Count == 0) // No validation is performed.
- return;
-
- // Creating element automata, if current does not exist.
- if (currentValidationState == null) {
- XmlSchemaElement root = null;
- foreach (XmlSchema target in schemas) {
- XmlSchema matches = target.Schemas [reader.NamespaceURI];
- if (matches != null) {
- root = target.Elements [new XmlQualifiedName (reader.LocalName, reader.NamespaceURI)] as XmlSchemaElement;
- if (root != null) {
- XsdValidationStateFactory factory = new XsdValidationStateFactory ();
- currentValidationState = factory.Create (root);
- }
- else
- HandleError ("Invalid start element. Element declaration for " + reader.LocalName + " is missing.");
- break;
- }
- }
- if (root == null && reader.NamespaceURI != String.Empty)
- HandleError ("Invalid start element. Element declaration for " + reader.LocalName + " is missing.");
- }
-
- if (currentValidationState == null)
- return; // no validation.
-
- if (!currentValidationState.EvaluateStartElement (reader.LocalName, reader.NamespaceURI))
- HandleError ("Invalid start element: " + reader.LocalName);
-
- automataTable [reader.Depth] = currentValidationState;
- XmlSchemaElement el = currentValidationState.Element;
- XmlSchemaComplexType ctype = el.ElementType as XmlSchemaComplexType;
- if (ctype != null && ctype.ContentTypeParticle != null) {
- currentValidationState = currentValidationState.Factory.Create (ctype.ContentTypeParticle);
- }
-
- // TODO: Attribute validation
- }
-
- private void ValidateEndElementParticle ()
- {
- if (currentValidationState != null) {
- if (!currentValidationState.EvaluateEndElement ()) {
- HandleError ("Invalid end element: " + reader.Name);
- }
- }
- currentValidationState = automataTable [reader.Depth] as XsdValidationState;
- automataTable [reader.Depth + 1] = null;
- }
-
- private void ValidateCharacters ()
- {
- // TODO: value context validation here.
- }
-
-// Overrided Methods
-
- public override void Close ()
- {
- reader.Close ();
- }
-
- // MonoTODO
- public override string GetAttribute (int i)
- {
- if (reader.AttributeCount > i)
- reader.GetAttribute (i);
-// else if (defaultAttributes.Count)
- throw new NotImplementedException ();
- }
-
- // MonoTODO
- public override string GetAttribute (string name)
- {
- return reader.GetAttribute (name);
- }
-
- // MonoTODO
- public override string GetAttribute (string localName, string ns)
- {
- return reader.GetAttribute (localName, ns);
- }
-
- // When it is default attribute, does it works?
- bool IXmlLineInfo.HasLineInfo ()
- {
- throw new NotImplementedException ();
- }
-
- // MonoTODO
- public override string LookupNamespace (string prefix)
- {
- return reader.LookupNamespace (prefix);
- }
-
- // MonoTODO
- public override void MoveToAttribute (int i)
- {
- reader.MoveToAttribute (i);
- }
-
- // MonoTODO
- public override bool MoveToAttribute (string name)
- {
- return reader.MoveToAttribute (name);
- }
-
- // MonoTODO
- public override bool MoveToAttribute (string localName, string ns)
- {
- return reader.MoveToAttribute (localName);
- }
-
- public override bool MoveToElement ()
- {
- // TODO: handle default node
- return reader.MoveToElement ();
- }
-
- public override bool MoveToFirstAttribute ()
- {
- // TODO: handle default node
- return reader.MoveToFirstAttribute ();
- }
-
- public override bool MoveToNextAttribute ()
- {
- // TODO: handle default node
- return reader.MoveToNextAttribute ();
- }
-
- public override bool Read ()
- {
- bool result = reader.Read ();
-
- switch (reader.NodeType) {
- case XmlNodeType.Element:
- ValidateStartElementParticle ();
- // TODO: validate xsi:nil, create xsi:type, and so on.
- // TODO: validate attributes
-
- if (reader.IsEmptyElement)
- goto case XmlNodeType.EndElement;
- break;
-
- case XmlNodeType.EndElement:
- ValidateEndElementParticle ();
- // TODO: validate content data type.
- break;
-
- case XmlNodeType.CDATA:
- case XmlNodeType.SignificantWhitespace:
- case XmlNodeType.Text:
- ValidateCharacters ();
- break;
- }
-
- return result;
- }
-
- public override bool ReadAttributeValue ()
- {
- // TODO: handle default node
- return reader.ReadAttributeValue ();
- }
-
-#if NET_1_0
- public override string ReadInnerXml ()
- {
- // MS.NET 1.0 has a serious bug here. It skips validation.
- return reader.ReadInnerXml ();
- }
-
- public override string ReadOuterXml ()
- {
- // MS.NET 1.0 has a serious bug here. It skips validation.
- return reader.ReadOuterXml ();
- }
-#endif
-
- // XmlReader.ReadString() should call derived this.Read().
- public override string ReadString ()
- {
-#if NET_1_0
- return reader.ReadString ();
-#else
- return base.ReadString ();
-#endif
- }
-
- // This class itself does not have this feature.
- public override void ResolveEntity ()
- {
- reader.ResolveEntity ();
- }
- }
-
-}
diff --git a/mcs/class/System.XML/Mono.Xml.XPath/ChangeLog b/mcs/class/System.XML/Mono.Xml.XPath/ChangeLog
index 1c9fae93b30..58bcee375bf 100644
--- a/mcs/class/System.XML/Mono.Xml.XPath/ChangeLog
+++ b/mcs/class/System.XML/Mono.Xml.XPath/ChangeLog
@@ -1,15 +1,3 @@
-2003-08-25 Ben Maurer <bmaurer@users.sourceforge.net>
-
- * DTMXPathNavigator.cs: Allocate valueBuilder on first use.
-
-2003-08-14 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
-
- * DTMXPathDocument.cs,
- DTMXPathDocumentBuilder.cs,
- DTMXPathNavigator.cs :
- - Implemented ID support using XmlValidatingReader.
- - Prefix should be String.Empty even if XmlReader.Prefix is null.
-
2003-07-23 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
* DTMXPathDocumentBuilder.cs :
diff --git a/mcs/class/System.XML/Mono.Xml.XPath/DTMXPathDocument.cs b/mcs/class/System.XML/Mono.Xml.XPath/DTMXPathDocument.cs
index 8498e07791f..67a4c01c13d 100644
--- a/mcs/class/System.XML/Mono.Xml.XPath/DTMXPathDocument.cs
+++ b/mcs/class/System.XML/Mono.Xml.XPath/DTMXPathDocument.cs
@@ -22,36 +22,7 @@ namespace Mono.Xml.XPath
#region ctor.
- public DTMXPathDocument (XmlNameTable nameTable,
- int [] firstChild__,
- int [] parent__,
- int [] firstAttribute__,
- int [] previousSibling__,
- int [] nextSibling__,
- int [] depth__,
- int [] position__,
- XPathNodeType [] nodeType__,
- string [] baseUri__,
- bool [] isEmptyElement__,
- string [] localName__,
- string [] namespaceUri__,
- string [] prefix__,
- string [] value__,
- string [] xmlLang__,
- int [] namespaceNode__,
- object [] schemaType__,
- int [] ownerElement__,
- int [] nextAttribute__,
- string [] attrLocalName__,
- string [] attrPrefix__,
- string [] attrNsUri__,
- string [] attrValue__,
- object [] attrSchemaType__,
- int [] nsDeclaredElement__,
- int [] nextNsNode__,
- string [] nsNodeName__,
- string [] nsNodeUri__,
- Hashtable idTable__)
+ public DTMXPathDocument (XmlNameTable nameTable, int [] firstChild__, int [] parent__, int [] firstAttribute__, int [] previousSibling__, int [] nextSibling__, int [] depth__, int [] position__, XPathNodeType [] nodeType__, string [] baseUri__, bool [] isEmptyElement__, string [] localName__, string [] namespaceUri__, string [] prefix__, string [] value__, string [] xmlLang__, int [] namespaceNode__, object [] schemaType__, int [] ownerElement__, int [] nextAttribute__, string [] attrLocalName__, string [] attrPrefix__, string [] attrNsUri__, string [] attrValue__, object [] attrSchemaType__, int [] nsDeclaredElement__, int [] nextNsNode__, string [] nsNodeName__, string [] nsNodeUri__)
{
firstChild_ = firstChild__;
parent_ = parent__;
@@ -86,8 +57,6 @@ namespace Mono.Xml.XPath
nsNodeName_ = nsNodeName__;
nsNodeUri_ = nsNodeUri__;
- idTable_ = idTable__;
-
this.nameTable = nameTable;
}
@@ -98,7 +67,7 @@ namespace Mono.Xml.XPath
public XPathNavigator CreateNavigator ()
{
if (root == null) {
- root = new DTMXPathNavigator (this, nameTable, firstChild_, parent_, firstAttribute_, previousSibling_, nextSibling_, depth_, position_, nodeType_, baseUri_, isEmptyElement_, localName_, namespaceUri_, prefix_, value_, xmlLang_, namespaceNode_, schemaType_, ownerElement_, nextAttribute_, attrLocalName_, attrPrefix_, attrNsUri_, attrValue_, attrSchemaType_, nsDeclaredElement_, nextNsNode_, nsNodeName_, nsNodeUri_, idTable_);
+ root = new DTMXPathNavigator (this, nameTable, firstChild_, parent_, firstAttribute_, previousSibling_, nextSibling_, depth_, position_, nodeType_, baseUri_, isEmptyElement_, localName_, namespaceUri_, prefix_, value_, xmlLang_, namespaceNode_, schemaType_, ownerElement_, nextAttribute_, attrLocalName_, attrPrefix_, attrNsUri_, attrValue_, attrSchemaType_, nsDeclaredElement_, nextNsNode_, nsNodeName_, nsNodeUri_);
return root;
} else
return root.Clone ();
@@ -147,8 +116,10 @@ namespace Mono.Xml.XPath
string [] nsNodeName_; // NS prefix.
string [] nsNodeUri_; // NS uri.
+ // ID-Key
+ // [string attribute-name] -> idTable
// idTable [string value] -> int nodeId
- readonly Hashtable idTable_;
+ readonly Hashtable idTableTable;
#endregion
diff --git a/mcs/class/System.XML/Mono.Xml.XPath/DTMXPathDocumentBuilder.cs b/mcs/class/System.XML/Mono.Xml.XPath/DTMXPathDocumentBuilder.cs
index a3af4d2317c..4a49e35ba62 100644
--- a/mcs/class/System.XML/Mono.Xml.XPath/DTMXPathDocumentBuilder.cs
+++ b/mcs/class/System.XML/Mono.Xml.XPath/DTMXPathDocumentBuilder.cs
@@ -19,43 +19,29 @@ namespace Mono.Xml.XPath
public class DTMXPathDocumentBuilder
{
public DTMXPathDocumentBuilder (string url)
- : this (url, XmlSpace.None, false)
+ : this (url, XmlSpace.None)
{
}
public DTMXPathDocumentBuilder (string url, XmlSpace space)
- : this (url, space, false)
- {
- }
-
- public DTMXPathDocumentBuilder (string url, XmlSpace space, bool supportID)
- : this (new XmlTextReader (url), space, supportID)
+ : this (new XmlTextReader (url), space)
{
}
public DTMXPathDocumentBuilder (XmlReader reader)
- : this (reader, XmlSpace.None, false)
+ : this (reader, XmlSpace.None)
{
}
public DTMXPathDocumentBuilder (XmlReader reader, XmlSpace space)
- : this (reader, space, false)
- {
- }
-
- public DTMXPathDocumentBuilder (XmlReader reader, XmlSpace space, bool supportID)
{
this.xmlReader = reader;
- if (supportID)
- this.validatingReader = reader as XmlValidatingReader;
this.xmlSpace = xmlSpace;
this.nameTable = reader.NameTable;
Compile ();
}
- bool supportID;
XmlReader xmlReader;
- XmlValidatingReader validatingReader;
XmlSpace xmlSpace;
XmlNameTable nameTable;
int defaultCapacity = 100;
@@ -102,9 +88,6 @@ namespace Mono.Xml.XPath
int [] nextNsNode_ = new int [100];
string [] nsNodeName_ = new string [100];
string [] nsNodeUri_ = new string [100];
-
- // idTable [string value] -> int nodeId
- Hashtable idTable_;
#endregion
int nodeIndex;
@@ -146,15 +129,12 @@ namespace Mono.Xml.XPath
nsDeclaredElement_,
nextNsNode_,
nsNodeName_,
- nsNodeUri_,
- idTable_
+ nsNodeUri_
);
}
public void Compile ()
{
- idTable_ = new Hashtable ();
-
// index 0 is dummy. No node (including Root) is assigned to this index
// So that we can easily compare index != 0 instead of index < 0.
// (Difference between jnz or jbe in 80x86.)
@@ -304,31 +284,20 @@ namespace Mono.Xml.XPath
if (lastNsIndexInCurrent == 0)
namespaceNode_ [nodeIndex] = nsIndex;
this.AddNsNode (nodeIndex,
- (xmlReader.Prefix == null || xmlReader.Prefix == String.Empty) ?
+ xmlReader.Prefix == "" ?
"" : xmlReader.LocalName,
xmlReader.Value);
lastNsIndexInCurrent = nsIndex;
} else {
// add attribute node.
attributeIndex ++;
- this.AddAttribute (nodeIndex, xmlReader.LocalName, xmlReader.NamespaceURI, xmlReader.Prefix != null ? xmlReader.Prefix : String.Empty, xmlReader.Value, null);
+ this.AddAttribute (nodeIndex, xmlReader.LocalName, xmlReader.NamespaceURI, xmlReader.Prefix, xmlReader.Value, null);
if (firstAttributeIndex == 0)
firstAttributeIndex = attributeIndex;
else
nextAttribute_ [attributeIndex - 1] = attributeIndex;
// dummy for "current" attribute.
nextAttribute_ [attributeIndex] = 0;
-
- // Identity infoset
- if (validatingReader != null) {
- XmlSchemaDatatype dt = validatingReader.SchemaType as XmlSchemaDatatype;
- if (dt == null) {
- XmlSchemaType xsType = validatingReader.SchemaType as XmlSchemaType;
- dt = xsType.Datatype;
- }
- if (dt != null && dt.TokenizedType == XmlTokenizedType.ID)
- idTable_.Add (xmlReader.Value, nodeIndex);
- }
}
} while (xmlReader.MoveToNextAttribute ());
xmlReader.MoveToElement ();
diff --git a/mcs/class/System.XML/Mono.Xml.XPath/DTMXPathNavigator.cs b/mcs/class/System.XML/Mono.Xml.XPath/DTMXPathNavigator.cs
index 80f702ce5e8..690c373061e 100644
--- a/mcs/class/System.XML/Mono.Xml.XPath/DTMXPathNavigator.cs
+++ b/mcs/class/System.XML/Mono.Xml.XPath/DTMXPathNavigator.cs
@@ -19,23 +19,7 @@ namespace Mono.Xml.XPath
{
#region Copy of XPathDocument
- public DTMXPathNavigator (DTMXPathDocument document,
- XmlNameTable nameTable,
- int [] firstChild__, int [] parent__,
- int [] firstAttribute__, int [] previousSibling__,
- int [] nextSibling__, int [] depth__,
- int [] position__, XPathNodeType [] nodeType__,
- string [] baseUri__, bool [] isEmptyElement__,
- string [] localName__, string [] namespaceUri__,
- string [] prefix__, string [] value__,
- string [] xmlLang__, int [] namespaceNode__,
- object [] schemaType__, int [] ownerElement__,
- int [] nextAttribute__, string [] attrLocalName__,
- string [] attrPrefix__, string [] attrNsUri__,
- string [] attrValue__, object [] attrSchemaType__,
- int [] nsDeclaredElement__, int [] nextNsNode__,
- string [] nsNodeName__, string [] nsNodeUri__,
- Hashtable idTable__)
+ public DTMXPathNavigator (DTMXPathDocument document, XmlNameTable nameTable, int [] firstChild__, int [] parent__, int [] firstAttribute__, int [] previousSibling__, int [] nextSibling__, int [] depth__, int [] position__, XPathNodeType [] nodeType__, string [] baseUri__, bool [] isEmptyElement__, string [] localName__, string [] namespaceUri__, string [] prefix__, string [] value__, string [] xmlLang__, int [] namespaceNode__, object [] schemaType__, int [] ownerElement__, int [] nextAttribute__, string [] attrLocalName__, string [] attrPrefix__, string [] attrNsUri__, string [] attrValue__, object [] attrSchemaType__, int [] nsDeclaredElement__, int [] nextNsNode__, string [] nsNodeName__, string [] nsNodeUri__)
{
firstChild_ = firstChild__;
parent_ = parent__;
@@ -70,8 +54,6 @@ namespace Mono.Xml.XPath
nsNodeName_ = nsNodeName__;
nsNodeUri_ = nsNodeUri__;
- idTable_ = idTable__;
-
this.nameTable = nameTable;
this.MoveToRoot ();
this.document = document;
@@ -79,17 +61,7 @@ namespace Mono.Xml.XPath
// Copy constructor including position informations.
public DTMXPathNavigator (DTMXPathNavigator org)
- : this (org.document, org.nameTable,
- org.firstChild_, org.parent_, org.firstAttribute_,
- org.previousSibling_, org.nextSibling_, org.depth_,
- org.position_, org.nodeType_, org.baseUri_,
- org.isEmptyElement_, org.localName_, org.namespaceUri_,
- org.prefix_, org.value_, org.xmlLang_,
- org.namespaceNode_, org.schemaType_, org.ownerElement_,
- org.nextAttribute_, org.attrLocalName_, org.attrPrefix_,
- org.attrNsUri_, org.attrValue_, org.attrSchemaType_,
- org.nsDeclaredElement_, org.nextNsNode_, org.nsNodeName_,
- org.nsNodeUri_, org.idTable_)
+ : this (org.document, org.nameTable, org.firstChild_, org.parent_, org.firstAttribute_, org.previousSibling_, org.nextSibling_, org.depth_, org.position_, org.nodeType_, org.baseUri_, org.isEmptyElement_, org.localName_, org.namespaceUri_, org.prefix_, org.value_, org.xmlLang_, org.namespaceNode_, org.schemaType_, org.ownerElement_, org.nextAttribute_, org.attrLocalName_, org.attrPrefix_, org.attrNsUri_, org.attrValue_, org.attrSchemaType_, org.nsDeclaredElement_, org.nextNsNode_, org.nsNodeName_, org.nsNodeUri_)
{
currentIsNode = org.currentIsNode;
currentIsAttr = org.currentIsAttr;
@@ -138,12 +110,10 @@ namespace Mono.Xml.XPath
string [] nsNodeName_; // NS prefix.
string [] nsNodeUri_; // NS uri.
- // ID table
- Hashtable idTable_;
-
- // Key table (considered xsd:keyref for XPath 2.0)
+ // ID-Key (considered xsd:keyref for XPath 2.0)
Hashtable keyRefTable; // [string key-name] -> idTable
// idTable [string value] -> int nodeId
+ // keyname="" for ID
#endregion
bool currentIsNode;
@@ -153,7 +123,7 @@ namespace Mono.Xml.XPath
int currentAttr;
int currentNs;
- StringBuilder valueBuilder;
+ StringBuilder valueBuilder = new StringBuilder ();
#region Ctor
@@ -250,11 +220,6 @@ namespace Mono.Xml.XPath
case XPathNodeType.SignificantWhitespace:
return value_ [currentNode];
}
- if (valueBuilder == null)
- valueBuilder = new StringBuilder ();
- else
- valueBuilder.Length = 0;
-
int iter = firstChild_ [currentNode];
while (iter != 0 && iter < depth_.Length && depth_ [iter] > depth_ [currentNode]) {
switch (nodeType_ [iter]) {
@@ -267,8 +232,9 @@ namespace Mono.Xml.XPath
}
iter++;
}
-
- return valueBuilder.ToString ();
+ string result = valueBuilder.ToString ();
+ valueBuilder.Length = 0;
+ return result;
}
}
@@ -482,19 +448,9 @@ namespace Mono.Xml.XPath
return moveToSpecifiedNamespace (cur, namespaceScope);
}
- // Note that this support is extension to XPathDocument.
- // XPathDocument does not support ID reference.
public override bool MoveToId (string id)
{
-// return MoveToKeyRef ("", id);
- if (idTable_.ContainsKey (id)) {
- currentNode = (int) idTable_ [id];
- currentIsNode = true;
- currentIsAttr = false;
- return true;
- }
- else
- return false;
+ return MoveToKeyRef ("", id);
}
// This is extension for XPath 2.0
diff --git a/mcs/class/System.XML/Mono.Xml.Xsl.Operations/ChangeLog b/mcs/class/System.XML/Mono.Xml.Xsl.Operations/ChangeLog
index 60d5ad284d8..8eed6614f01 100644
--- a/mcs/class/System.XML/Mono.Xml.Xsl.Operations/ChangeLog
+++ b/mcs/class/System.XML/Mono.Xml.Xsl.Operations/ChangeLog
@@ -1,70 +1,3 @@
-2003-08-21 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
-
- * XslVariable.cs : use newly introduced XmlNodeWriter.ctor(false) to
- support for tree fragment, not only for single element.
-
-2003-08-20 Ben Maurer <bmaurer@users.sourceforge.net>
-
- * XslComment.cs, XslMessage.cs, XslProcessingInsturction.cs:
- Ignore element contnet, per spec. (Oleg)
-
-2003-08-19 Ben Maurer <bmaurer@users.sourceforge.net>
-
- * XslNumber.cs: Better support for formatting.
-
-2003-08-19 Ben Maurer <bmaurer@users.sourceforge.net>
-
- * XslNumber.cs: Support for multiple level numbering
-
-2003-08-19 Ben Maurer <bmaurer@users.sourceforge.net>
-
- * XslNumber.cs: Initial support.
-
-2003-08-19 Ben Maurer <bmaurer@users.sourceforge.net>
-
- * XslCopyOf.cs, XslLiteralElement: Use namespace support in Outputter.
-
-2003-08-19 Ben Maurer <bmaurer@users.sourceforge.net>
-
- * XslVariable.cs: sync to API changes.
-
-2003-08-18 Ben Maurer <bmaurer@users.sourceforge.net>
-
- * *.cs: Support for xsl:output. (Oleg)
-
-2003-08-17 Ben Maurer <bmaurer@users.sourceforge.net>
-
- * XslCopyOf.cs: handle default ns
- * XslFallback.cs: implement
- * XslLiteralElement.cs: copy namespaces that were declared.
- * XslTemplateContent.cs: handle ext elements
-
-2003-08-17 Ben Maurer <bmaurer@users.sourceforge.net>
-
- * XslComment.cs, XslTemplateContent.cs: remove dead variables.
-
-2003-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * XslComment.cs: patch by BenM that implements Evaluate.
-
-2003-08-14 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
-
- * XslCallTemplates.cs : Forgot to commit ;-)
-
-2003-08-14 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
-
- * XslApplyTemplates.cs,
- XslCallTemplate.cs : Should accept other than element content such
- as comment and PI.
- * XslNumber.cs : In Compile(), 'value' might not exist. (Think about
- it later if how it should be.)
- * XslTemplateContent.cs : "comment" and "number" support. (I know they
- are still incomplete.)
-
-2003-08-14 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
-
- * Added XslComment.cs.
-
2003-08-05 Ben Maurer <bmaurer@users.sourceforge.net>
* XslVariable.cs: Fix up how variables are evaluated.
diff --git a/mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslApplyTemplates.cs b/mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslApplyTemplates.cs
index 77d514df8c0..08861c0dc7a 100644
--- a/mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslApplyTemplates.cs
+++ b/mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslApplyTemplates.cs
@@ -31,32 +31,22 @@ namespace Mono.Xml.Xsl.Operations {
if (c.Input.MoveToFirstChild ()) {
do {
- switch (c.Input.NodeType) {
- case XPathNodeType.Comment:
- case XPathNodeType.ProcessingInstruction:
- case XPathNodeType.Whitespace:
- continue;
- case XPathNodeType.Element:
- if (c.Input.NamespaceURI != XsltNamespace)
- throw new Exception ("unexptected element"); // TODO: fwd compat
-
- switch (c.Input.LocalName)
- {
- case "with-param":
- withParams.Add (new XslVariableInformation (c));
- break;
-
- case "sort":
- if (select == null)
- select = c.CompileExpression ("*");
- c.AddSort (select, new Sort (c));
- break;
- default:
- throw new Exception ("unexptected element"); // todo forwards compat
- }
- break;
- default:
- throw new Exception ("unexpected node type " + c.Input.NodeType); // todo forwards compat
+ if (c.Input.NamespaceURI != XsltNamespace)
+ throw new Exception ("unexptected element"); // TODO: fwd compat
+
+ switch (c.Input.LocalName)
+ {
+ case "with-param":
+ withParams.Add (new XslVariableInformation (c));
+ break;
+
+ case "sort":
+ if (select == null)
+ select = c.CompileExpression ("*");
+ c.AddSort (select, new Sort (c));
+ break;
+ default:
+ throw new Exception ("unexptected element"); // todo forwards compat
}
} while (c.Input.MoveToNext ());
c.Input.MoveToParent ();
diff --git a/mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslCallTemplate.cs b/mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslCallTemplate.cs
index 5bc4cca8747..26989010d73 100644
--- a/mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslCallTemplate.cs
+++ b/mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslCallTemplate.cs
@@ -28,26 +28,16 @@ namespace Mono.Xml.Xsl.Operations {
if (c.Input.MoveToFirstChild ()) {
do {
- switch (c.Input.NodeType) {
- case XPathNodeType.Comment:
- case XPathNodeType.ProcessingInstruction:
- case XPathNodeType.Whitespace:
- continue;
- case XPathNodeType.Element:
- if (c.Input.NamespaceURI != XsltNamespace)
- throw new Exception ("unexptected element"); // TODO: fwd compat
-
- switch (c.Input.LocalName)
- {
- case "with-param":
- withParams.Add (new XslVariableInformation (c));
- break;
- default:
- throw new Exception ("unexptected element"); // todo forwards compat
- }
- break;
- default:
- throw new Exception ("unexptected node type " + c.Input.NodeType); // TODO: fwd compat
+ if (c.Input.NamespaceURI != XsltNamespace)
+ throw new Exception ("unexptected element"); // TODO: fwd compat
+
+ switch (c.Input.LocalName)
+ {
+ case "with-param":
+ withParams.Add (new XslVariableInformation (c));
+ break;
+ default:
+ throw new Exception ("unexptected element"); // todo forwards compat
}
} while (c.Input.MoveToNext ());
c.Input.MoveToParent ();
diff --git a/mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslComment.cs b/mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslComment.cs
deleted file mode 100644
index defe7cd1242..00000000000
--- a/mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslComment.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-//
-// XslComment.cs
-//
-// Authors:
-// Ben Maurer (bmaurer@users.sourceforge.net)
-// Atsushi Enomoto (ginga@kit.hi-ho.ne.jp)
-//
-// (C) 2003 Ben Maurer
-// (C) 2003 Atsushi Enomoto
-//
-
-using System;
-using System.Collections;
-using System.IO;
-using System.Xml;
-using System.Xml.XPath;
-using System.Xml.Xsl;
-
-namespace Mono.Xml.Xsl.Operations {
- public class XslComment : XslCompiledElement {
- bool disableOutputEscaping = false;
- XslOperation value;
-
- public XslComment (Compiler c) : base (c) {}
-
- protected override void Compile (Compiler c)
- {
- if (c.Input.MoveToFirstChild ()) {
- value = c.CompileTemplateContent ();
- c.Input.MoveToParent ();
- }
- }
-
- public override void Evaluate (XslTransformProcessor p)
- {
- StringWriter s = new StringWriter ();
- Outputter outputter = new TextOutputter(s, true);
- p.PushOutput (outputter);
- value.Evaluate (p);
- p.PopOutput ();
-
- p.Out.WriteComment (s.ToString ());
- }
- }
-}
diff --git a/mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslCopyOf.cs b/mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslCopyOf.cs
index 3fc6d785956..cace0871d22 100644
--- a/mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslCopyOf.cs
+++ b/mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslCopyOf.cs
@@ -25,22 +25,22 @@ namespace Mono.Xml.Xsl.Operations {
select = c.CompileExpression (c.GetAttribute ("select"));
}
- void CopyNode (Outputter outputter, XPathNavigator nav)
+ void CopyNode (XmlWriter w, XPathNavigator nav)
{
switch (nav.NodeType) {
case XPathNodeType.Root:
XPathNodeIterator itr = nav.SelectChildren (XPathNodeType.All);
while (itr.MoveNext ())
- CopyNode (outputter, itr.Current);
+ CopyNode (w, itr.Current);
break;
case XPathNodeType.Element:
- outputter.WriteStartElement (nav.Prefix, nav.LocalName, nav.NamespaceURI);
+ w.WriteStartElement (nav.Prefix, nav.LocalName, nav.NamespaceURI);
if (nav.MoveToFirstNamespace (XPathNamespaceScope.Local))
{
do {
- outputter.WriteNamespaceDecl (nav.Name, nav.Value);
+ w.WriteAttributeString ("xmlns", nav.Name, null, nav.Value);
} while (nav.MoveToNextNamespace (XPathNamespaceScope.Local));
nav.MoveToParent ();
}
@@ -48,33 +48,33 @@ namespace Mono.Xml.Xsl.Operations {
if (nav.MoveToFirstAttribute())
{
do {
- outputter.WriteStartAttribute (nav.Prefix, nav.LocalName, nav.NamespaceURI);
- outputter.WriteString (nav.Value);
- outputter.WriteEndAttribute ();
+ w.WriteStartAttribute (nav.Prefix, nav.LocalName, nav.NamespaceURI);
+ w.WriteString (nav.Value);
+ w.WriteEndAttribute ();
} while (nav.MoveToNextAttribute ());
nav.MoveToParent();
}
if (nav.MoveToFirstChild ()) {
do {
- CopyNode (outputter, nav);
+ CopyNode (w, nav);
} while (nav.MoveToNext ());
nav.MoveToParent ();
}
- outputter.WriteEndElement ();
+ w.WriteEndElement ();
break;
case XPathNodeType.Whitespace:
case XPathNodeType.SignificantWhitespace:
case XPathNodeType.Text:
- outputter.WriteString (nav.Value);
+ w.WriteString (nav.Value);
break;
case XPathNodeType.ProcessingInstruction:
- outputter.WriteProcessingInstruction (nav.Name, nav.Value);
+ w.WriteProcessingInstruction (nav.Name, nav.Value);
break;
case XPathNodeType.Comment:
- outputter.WriteComment (nav.Value);
+ w.WriteComment (nav.Value);
break;
}
}
diff --git a/mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslFallback.cs b/mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslFallback.cs
index 01ff98fcfb6..a46a8dde98d 100644
--- a/mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslFallback.cs
+++ b/mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslFallback.cs
@@ -31,7 +31,7 @@ namespace Mono.Xml.Xsl.Operations {
public override void Evaluate (XslTransformProcessor p)
{
- children.Evaluate (p);
+ throw new NotImplementedException ();
}
}
}
diff --git a/mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslLiteralElement.cs b/mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslLiteralElement.cs
index d515a24c098..ca568b75cc1 100644
--- a/mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslLiteralElement.cs
+++ b/mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslLiteralElement.cs
@@ -21,7 +21,6 @@ namespace Mono.Xml.Xsl.Operations {
string localname, prefix, nsUri;
ArrayList attrs = new ArrayList ();
XmlQualifiedName [] useAttributeSets;
- Hashtable nsDecls;
public XslLiteralElement (Compiler c) : base (c) {}
@@ -50,7 +49,6 @@ namespace Mono.Xml.Xsl.Operations {
this.nsUri = c.Input.NamespaceURI;
this.localname = c.Input.LocalName;
this.useAttributeSets = c.ParseQNameListAttribute ("use-attribute-sets", XsltNamespace);
- this.nsDecls = c.GetNamespacesToCopy ();
if (c.Input.MoveToFirstAttribute ())
{
@@ -71,9 +69,6 @@ namespace Mono.Xml.Xsl.Operations {
{
p.Out.WriteStartElement (prefix, localname, nsUri);
- foreach (DictionaryEntry de in nsDecls)
- p.Out.WriteNamespaceDecl ((string)de.Key, (string)de.Value);
-
foreach (XslLiteralAttribute a in attrs)
a.Evaluate (p);
diff --git a/mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslMessage.cs b/mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslMessage.cs
index a0e90bc86d8..50f2c6ae6a8 100644
--- a/mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslMessage.cs
+++ b/mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslMessage.cs
@@ -34,7 +34,7 @@ namespace Mono.Xml.Xsl.Operations {
public override void Evaluate (XslTransformProcessor p)
{
if (children != null) {
- p.PushOutput (new TextOutputter(Console.Error, true));
+ p.PushOutput (new XmlTextWriter (Console.Error));
children.Evaluate (p);
p.PopOutput ();
}
diff --git a/mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslNumber.cs b/mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslNumber.cs
index 2d96204deb2..25fd81b7439 100644
--- a/mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslNumber.cs
+++ b/mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslNumber.cs
@@ -14,7 +14,6 @@ using System.Collections;
using System.Xml;
using System.Xml.XPath;
using System.Xml.Xsl;
-using System.Text;
namespace Mono.Xml.Xsl.Operations {
public class XslNumber : XslCompiledElement {
@@ -65,7 +64,7 @@ namespace Mono.Xml.Xsl.Operations {
from = c.CompilePattern (c.GetAttribute ("from"));
value = c.CompileExpression (c.GetAttribute ("value"));
- if (value != null && value.ReturnType != XPathResultType.Number && value.ReturnType != XPathResultType.Any)
+ if (value.ReturnType != XPathResultType.Number && value.ReturnType != XPathResultType.Any)
throw new Exception ("The expression for attribute 'value' must return a number");
format = c.ParseAvtAttribute ("format");
@@ -115,304 +114,36 @@ namespace Mono.Xml.Xsl.Operations {
switch (this.level) {
case XslNumberingLevel.Single:
- return nf.Format (NumberSingle (p));
+ throw new NotImplementedException ();
case XslNumberingLevel.Multiple:
- return nf.Format (NumberMultiple (p));
+ throw new NotImplementedException ();
case XslNumberingLevel.Any:
- return nf.Format (NumberAny (p));
+ throw new NotImplementedException ();
default:
throw new Exception ("Should not get here");
}
}
- int [] NumberMultiple (XslTransformProcessor p)
- {
- ArrayList nums = new ArrayList ();
- XPathNavigator n = p.CurrentNode.Clone ();
-
- bool foundFrom = false;
-
- do {
- if (MatchesFrom (n, p)) {
- foundFrom = true;
- break;
- }
-
- if (MatchesCount (n, p)) {
- int i = 1;
- while (n.MoveToPrevious ()) {
- if (MatchesCount (n, p)) i++;
- }
- nums.Add (i);
- }
- } while (n.MoveToParent ());
-
- if (!foundFrom) return new int [0];
-
- int [] ret = new int [nums.Count];
- int pos = nums.Count;
- foreach (int num in nums)
- ret [--pos] = num;
-
- return ret;
- }
- int NumberAny (XslTransformProcessor p)
- {
- int i = 0;
- XPathNavigator n = p.CurrentNode.Clone ();
- do {
- do {
- if (MatchesCount (n, p)) i++;
- if (MatchesFrom (n, p)) return i;
- } while (n.MoveToPrevious ());
- } while (n.MoveToParent ());
- return 0;
- }
- int NumberSingle (XslTransformProcessor p)
- {
- XPathNavigator n = p.CurrentNode.Clone ();
-
- while (!MatchesCount (n, p)) {
- if (from != null && MatchesFrom (n, p))
- return 0;
-
- if (!n.MoveToParent ())
- return 0;
- }
-
- if (from != null) {
- XPathNavigator tmp = n.Clone ();
- if (MatchesFrom (tmp, p))
- // Was not desc of closest matches from
- return 0;
-
- bool found = false;
- while (tmp.MoveToParent ())
- if (MatchesFrom (tmp, p)) {
- found = true; break;
- }
- if (!found)
- // not desc of matches from
- return 0;
- }
-
- int i = 1;
-
- while (n.MoveToPrevious ()) {
- if (MatchesCount (n, p)) i++;
- }
-
- return i;
- }
-
- bool MatchesCount (XPathNavigator item, XslTransformProcessor p)
- {
- if (count == null)
- return item.LocalName == p.CurrentNode.LocalName &&
- item.NamespaceURI == p.CurrentNode.NamespaceURI;
- else
- return item.Matches (count);
- }
-
- bool MatchesFrom (XPathNavigator item, XslTransformProcessor p)
- {
- if (from == null)
- return item.NodeType == XPathNodeType.Root;
- else
- return item.Matches (from);
- }
-
class XslNumberFormatter {
- string firstSep = "", lastSep = "";
- ArrayList fmtList = new ArrayList ();
-
public XslNumberFormatter (string format, string lang, string letterValue, char groupingSeparator, int groupingSize)
{
- // We dont do any i18n now, so we ignore lang and letterValue.
- if (format == null || format == "")
- fmtList.Add (FormatItem.GetItem (null, "1", groupingSeparator, groupingSize));
- else {
- NumberFormatterScanner s = new NumberFormatterScanner (format);
-
- string sep, itm;
-
- sep = s.Advance (false);
- itm = s.Advance (true);
-
- if (itm == null) {
- lastSep = sep;
- fmtList.Add (FormatItem.GetItem (null, "1", groupingSeparator, groupingSize));
- } else {
- firstSep = sep;
- sep = null;
-
- while (itm != null) {
- fmtList.Add (FormatItem.GetItem (sep, itm, groupingSeparator, groupingSize));
- sep = s.Advance (false);
- itm = s.Advance (true);
- }
-
- lastSep = sep;
- }
- }
+ throw new NotImplementedException ();
+ }
+
+ public int NumbersNeeded {
+ get { throw new NotImplementedException (); }
}
// return the format for a single value, ie, if using Single or Any
public string Format (int value)
{
- StringBuilder b = new StringBuilder ();
- if (firstSep != null) b.Append (firstSep);
- ((FormatItem)fmtList [0]).Format (b, value);
- if (lastSep != null) b.Append (lastSep);
-
- return b.ToString ();
+ throw new NotImplementedException ();
}
// format for an array of numbers.
public string Format (int [] values)
{
- StringBuilder b = new StringBuilder ();
- if (firstSep != null) b.Append (firstSep);
-
- int i = 0;
- foreach (int v in values) {
- FormatItem itm = (FormatItem)fmtList [i];
- if (i > 0) b.Append (itm.sep);
- itm.Format (b, v);
-
- if (++i == fmtList.Count)
- i--;
- }
-
- if (lastSep != null) b.Append (lastSep);
-
- return b.ToString ();
- }
-
- class NumberFormatterScanner {
- int pos = 0, len;
- string fmt;
-
- public NumberFormatterScanner (string fmt) {
- this.fmt = fmt;
- len = fmt.Length;
- }
-
- public string Advance (bool alphaNum)
- {
- int start = pos;
- while ((pos < len) && (char.IsLetterOrDigit (fmt, pos) == alphaNum))
- pos++;
-
- if (pos == start)
- return null;
- else
- return fmt.Substring (start, pos - start);
- }
- }
-
- abstract class FormatItem {
- public readonly string sep;
- public FormatItem (string sep)
- {
- this.sep = sep;
- }
-
- public abstract void Format (StringBuilder b, int num);
-
- public static FormatItem GetItem (string sep, string item, char gpSep, int gpSize)
- {
- switch (item [0])
- {
- case '0': case '1':
- return new DigitItem (sep, item.Length, gpSep, gpSize);
- case 'a':
- return new AlphaItem (sep, false);
- case 'A':
- return new AlphaItem (sep, true);
- case 'i':
- return new RomanItem (sep, false);
- case 'I':
- return new RomanItem (sep, true);
-
- default:
- throw new Exception ();
- }
- }
- }
-
- class AlphaItem : FormatItem {
- bool uc;
- static readonly char [] ucl = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};
- static readonly char [] lcl = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'};
-
- public AlphaItem (string sep, bool uc) : base (sep)
- {
- this.uc = uc;
- }
-
- public override void Format (StringBuilder b, int num)
- {
- alphaSeq (b, num, uc ? ucl : lcl);
- }
-
- static void alphaSeq (StringBuilder b, int n, char [] alphabet) {
- if (n > alphabet.Length)
- alphaSeq (b, (n-1) / alphabet.Length, alphabet);
- b.Append (alphabet [(n-1) % alphabet.Length]);
- }
- }
-
- class RomanItem : FormatItem {
- bool uc;
- public RomanItem (string sep, bool uc) : base (sep)
- {
- this.uc = uc;
- }
- static readonly string [] ucrDigits =
- { "M", "CM", "D", "CD", "C", "XC", "L", "XL", "X", "IX", "V", "IV", "I" };
- static readonly string [] lcrDigits =
- { "m", "cm", "d", "cd", "c", "xc", "l", "xl", "x", "ix", "v", "iv", "i" };
- static readonly int [] decValues =
- {1000, 900 , 500, 400 , 100, 90 , 50 , 40 , 10 , 9 , 5 , 4 , 1 };
-
- public override void Format (StringBuilder b, int num)
- {
- if (num < 1 || num > 4999) {
- b.Append (num);
- return;
- }
-
- for (int i = 0; i < decValues.Length; i++) {
- while (decValues [i] <= num) {
- if (uc)
- b.Append (ucrDigits [i]);
- else
- b.Append (lcrDigits [i]);
-
- num -= decValues [i];
- }
- if (num == 0) break;
- }
- }
- }
-
- class DigitItem : FormatItem {
- System.Globalization.NumberFormatInfo nfi;
-
- public DigitItem (string sep, int len, char gpSep, int gpSize) : base (sep)
- {
- nfi = new System.Globalization.NumberFormatInfo ();
- nfi.NumberDecimalDigits = 0;
- nfi.NumberGroupSizes = new int [] {gpSize};
- nfi.NumberGroupSeparator = gpSep.ToString ();
- // TODO use len to get min number of digits.
- }
-
- public override void Format (StringBuilder b, int num)
- {
- b.Append (num.ToString ("N", nfi));
- }
+ throw new NotImplementedException ();
}
}
}
diff --git a/mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslProcessingInstruction.cs b/mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslProcessingInstruction.cs
index 462f808212a..dbcee1de283 100644
--- a/mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslProcessingInstruction.cs
+++ b/mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslProcessingInstruction.cs
@@ -35,8 +35,9 @@ namespace Mono.Xml.Xsl.Operations {
public override void Evaluate (XslTransformProcessor p)
{
StringWriter s = new StringWriter ();
- Outputter outputter = new TextOutputter(s, true);
- p.PushOutput (outputter);
+ XmlWriter w = new XmlTextWriter (s);
+
+ p.PushOutput (w);
value.Evaluate (p);
p.PopOutput ();
diff --git a/mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslTemplateContent.cs b/mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslTemplateContent.cs
index 9b66c82a174..c9a90078ccf 100644
--- a/mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslTemplateContent.cs
+++ b/mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslTemplateContent.cs
@@ -18,6 +18,7 @@ using System.Xml.Xsl;
namespace Mono.Xml.Xsl.Operations {
public class XslTemplateContent : XslCompiledElement {
ArrayList content = new ArrayList ();
+ ArrayList variables;
bool hasStack;
int stackSize;
@@ -52,8 +53,7 @@ namespace Mono.Xml.Xsl.Operations {
content.Add (new XslChoose (c));
break;
case "comment":
- content.Add (new XslComment (c));
- break;
+ throw new NotImplementedException ();
case "copy":
content.Add (new XslCopy (c));
break;
@@ -76,8 +76,7 @@ namespace Mono.Xml.Xsl.Operations {
content.Add (new XslMessage(c));
break;
case "number":
- content.Add (new XslNumber(c));
- break;
+ throw new NotImplementedException ();
case "processing-instruction":
content.Add (new XslProcessingInstruction(c));
break;
@@ -96,17 +95,7 @@ namespace Mono.Xml.Xsl.Operations {
}
break;
default:
- if (!c.IsExtensionNamespace (n.NamespaceURI))
- content.Add (new XslLiteralElement(c));
- else {
- if (n.MoveToFirstChild ()) {
- do {
- if (n.NamespaceURI == XsltNamespace && n.LocalName == "fallback")
- content.Add (new XslFallback (c));
- } while (n.MoveToNext ());
- n.MoveToParent ();
- }
- }
+ content.Add (new XslLiteralElement(c));
break;
}
break;
diff --git a/mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslVariable.cs b/mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslVariable.cs
index 380a0324bba..e7cbaab37f2 100644
--- a/mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslVariable.cs
+++ b/mcs/class/System.XML/Mono.Xml.Xsl.Operations/XslVariable.cs
@@ -45,10 +45,8 @@ namespace Mono.Xml.Xsl.Operations {
if (select != null) {
return p.Evaluate (select);
} else if (content != null) {
- XmlNodeWriter w = new XmlNodeWriter (false);
- //TODO: which outputter should be used here?
- Outputter outputter = new XmlOutputter(w, p.Outputs);
- p.PushOutput (outputter);
+ XmlNodeWriter w = new XmlNodeWriter ();
+ p.PushOutput (w);
content.Evaluate (p);
p.PopOutput ();
return w.Document.CreateNavigator ().SelectChildren (XPathNodeType.All);
diff --git a/mcs/class/System.XML/Mono.Xml.Xsl/ChangeLog b/mcs/class/System.XML/Mono.Xml.Xsl/ChangeLog
index d0247902d40..ab739d44a70 100644
--- a/mcs/class/System.XML/Mono.Xml.Xsl/ChangeLog
+++ b/mcs/class/System.XML/Mono.Xml.Xsl/ChangeLog
@@ -1,85 +1,3 @@
-2003-08-21 Ben Maurer <bmaurer@users.sourceforge.net>
-
- * XslTransformProcessor.cs: evaluate variables at beginning
- when / is current node.
-
-2003-08-21 Ben Maurer <bmaurer@users.sourceforge.net>
-
- * Compiler.cs, XsltCompiledContext.cs, XslTransformProcessorcs:
- Fix up namespace handeling
-
-2003-08-20 Ben Maurer <bmaurer@users.sourceforge.net>
-
- * Compiler.cs, XslStylesheet.cs, XsltCompiledContext.cs: Stubs for
- format-number.
- * XslDecimalFormat.cs: Stub for decimal-format.
-
-2003-08-20 Ben Maurer <bmaurer@users.sourceforge.net>
-
- * TextOutputter.cs: Add option to ignore element content (Oleg).
-
-2003-08-19 Ben Maurer <bmaurer@users.sourceforge.net>
-
- * Compiler.cs: Really give null for blank avt's
-
-2003-08-19 Ben Maurer <bmaurer@users.sourceforge.net>
-
- * Compiler.cs: Fixed lre/lre04.
-
-2003-08-19 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
-
- * Compiler.cs : Fixed XslNameUtil.FromString() so that unprefixed name
- won't have default namespace. See http://www.w3.org/TR/xslt#qname
-
-2003-08-19 Ben Maurer <bmaurer@users.sourceforge.net>
-
- * XslTransformProcessor.cs: add support for resolving documents.
- * XsltCompiledContext: add support for document () function.
-
-2003-08-19 Ben Maurer <bmaurer@users.sourceforge.net>
-
- * Outputter.cs, TextOutputter.cs, XmlOutputter.cs: Implement some
- of the abstract methods in Outputter, making them call other
- functions with default values, remove impl's in derived classes.
-
-2003-08-19 Ben Maurer <bmaurer@users.sourceforge.net>
-
- * Outputter.cs: s/Close/Done
- * TextOutputter.cs, XmlOutputter.cs: Flush, don't close the backing.
- * XslTransformProcessor.cs: Flush output when popping, pop at end.
-
-2003-08-19 Ben Maurer <bmaurer@users.sourceforge.net>
-
- * Outputter.cs: Add support for namespaces.
-
-2003-08-19 Ben Maurer <bmaurer@users.sourceforge.net>
-
- * Compiler.cs, XslOutput.cs, XslStylesheet.cs,
- XslTransformProcessor.cs: move output logic from XslStylesheet to
- Compiler.
-
-2003-08-18 Ben Maurer <bmaurer@users.sourceforge.net>
-
- * XslOutput.cs: add support for encoding.
-
-2003-08-18 Ben Maurer <bmaurer@users.sourceforge.net>
-
- * *.cs: Support for xsl:output. (Oleg)
-
-2003-08-17 Ben Maurer <bmaurer@users.sourceforge.net>
-
- * Compiler.cs: handle extension and excluded namespaces.
-
-2003-08-17 Ben Maurer <bmaurer@users.sourceforge.net>
-
- * XsltCompiledContext.cs, Compiler.cs: copy the XPathNavigator
- from the stylesheet for correct namespace resolution.
-
-2003-08-14 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
-
- * Compiler.cs : 1) Changed public .ctor() to receive Evidence argument
- introduced in .NET 1.1. 2) XmlResolver object is required for 'res'.
-
2003-08-07 Ben Maurer <bmaurer@users.sourceforge.net>
* XslTransformProcessor.cs: Add a table to detect when an object
diff --git a/mcs/class/System.XML/Mono.Xml.Xsl/Compiler.cs b/mcs/class/System.XML/Mono.Xml.Xsl/Compiler.cs
index 50b0889f188..df22c290aca 100644
--- a/mcs/class/System.XML/Mono.Xml.Xsl/Compiler.cs
+++ b/mcs/class/System.XML/Mono.Xml.Xsl/Compiler.cs
@@ -13,7 +13,6 @@ using System;
using System.CodeDom;
using System.Collections;
using System.Collections.Specialized;
-using System.Security.Policy;
using System.Xml;
using System.Xml.Schema;
using System.Xml.XPath;
@@ -32,10 +31,8 @@ namespace Mono.Xml.Xsl {
ExpressionStore exprStore;
XmlNamespaceManager nsMgr;
ArrayList keys;
- Hashtable outputs;
- Hashtable decimalFormats;
- public CompiledStylesheet (XslStylesheet style, Hashtable globalVariables, Hashtable attrSets, ExpressionStore exprStore, XmlNamespaceManager nsMgr, ArrayList keys, Hashtable outputs, Hashtable decimalFormats)
+ public CompiledStylesheet (XslStylesheet style, Hashtable globalVariables, Hashtable attrSets, ExpressionStore exprStore, XmlNamespaceManager nsMgr, ArrayList keys)
{
this.style = style;
this.globalVariables = globalVariables;
@@ -43,23 +40,12 @@ namespace Mono.Xml.Xsl {
this.exprStore = exprStore;
this.nsMgr = nsMgr;
this.keys = keys;
- this.outputs = outputs;
- this.decimalFormats = decimalFormats;
}
public Hashtable Variables {get{return globalVariables;}}
public XslStylesheet Style { get { return style; }}
public ExpressionStore ExpressionStore {get{return exprStore;}}
public XmlNamespaceManager NamespaceManager {get{return nsMgr;}}
public ArrayList Keys {get { return keys;}}
- public Hashtable Outputs { get { return outputs; }}
-
- public XslDecimalFormat LookupDecimalFormat (QName name)
- {
- XslDecimalFormat ret = decimalFormats [name] as XslDecimalFormat;
- if (ret == null && name == QName.Empty)
- return XslDecimalFormat.Default;
- return ret;
- }
public XslGeneralVariable ResolveVariable (QName name)
{
@@ -90,18 +76,12 @@ namespace Mono.Xml.Xsl {
XmlResolver res;
XslStylesheet rootStyle;
- Hashtable outputs = new Hashtable ();
- public CompiledStylesheet Compile (XPathNavigator nav, XmlResolver res, Evidence evidence)
+ public CompiledStylesheet Compile (XPathNavigator nav, XmlResolver res)
{
this.res = res;
- if (res == null)
- this.res = new XmlUrlResolver ();
-
if (!nav.MoveToFirstChild ()) throw new Exception ("WTF?");
- outputs [""] = new XslOutput ("");
-
while (nav.NodeType != XPathNodeType.Element) nav.MoveToNext();
PushInputDocument (nav);
@@ -114,7 +94,7 @@ namespace Mono.Xml.Xsl {
}
this.rootStyle = new XslStylesheet (this);
- return new CompiledStylesheet (rootStyle, globalVariables, attrSets, exprStore, nsMgr, keys, outputs, decimalFormats);
+ return new CompiledStylesheet (rootStyle, globalVariables, attrSets, exprStore, nsMgr, keys);
}
#region Input
@@ -239,7 +219,7 @@ namespace Mono.Xml.Xsl {
public XslAvt ParseAvt (string s)
{
- if (s == null || s == string.Empty) return null;
+ if (s == null) return null;
return new XslAvt (s, this);
}
@@ -312,74 +292,6 @@ namespace Mono.Xml.Xsl {
}
public VariableScope CurrentVariableScope { get { return curVarScope; }}
#endregion
-
-#region Scope (version, {excluded, extension} namespaces)
- [MonoTODO ("This will work, but is *very* slow")]
- public bool IsExtensionNamespace (string nsUri)
- {
- if (nsUri == XsltNamespace) return true;
-
- XPathNavigator nav = Input.Clone ();
- XPathNavigator nsScope = nav.Clone ();
- do {
- bool isXslt = nav.NamespaceURI == XsltNamespace;
- nsScope.MoveTo (nav);
- if (nav.MoveToFirstAttribute ()) {
- do {
- if (nav.LocalName == "extension-element-prefixes" &&
- nav.NamespaceURI == (isXslt ? String.Empty : XsltNamespace))
- {
-
- foreach (string ns in nav.Value.Split (' '))
- if (nsScope.GetNamespace (ns == "#default" ? "" : ns) == nsUri)
- return true;
- }
- } while (nav.MoveToNextAttribute ());
- nav.MoveToParent ();
- }
- } while (nav.MoveToParent ());
-
- return false;
- }
-
- public Hashtable GetNamespacesToCopy ()
- {
- Hashtable ret = new Hashtable ();
-
- XPathNavigator nav = Input.Clone ();
- XPathNavigator nsScope = nav.Clone ();
-
- if (nav.MoveToFirstNamespace (XPathNamespaceScope.ExcludeXml)) {
- do {
- if (nav.Value != XsltNamespace && !ret.Contains (nav.Name))
- ret.Add (nav.Name, nav.Value);
- } while (nav.MoveToNextNamespace (XPathNamespaceScope.ExcludeXml));
- nav.MoveToParent ();
- }
-
- do {
- bool isXslt = nav.NamespaceURI == XsltNamespace;
- nsScope.MoveTo (nav);
-
- if (nav.MoveToFirstAttribute()) {
- do {
- if ((nav.LocalName == "extension-element-prefixes" || nav.LocalName == "exclude-result-prefixes") &&
- nav.NamespaceURI == (isXslt ? String.Empty : XsltNamespace))
- {
- foreach (string ns in nav.Value.Split (' ')) {
- if (ret [ns] == nsScope.GetNamespace (ns == "#default" ? "" : ns))
- ret.Remove (ns);
- }
- }
- } while (nav.MoveToNextAttribute ());
- nav.MoveToParent();
- }
- } while (nav.MoveToParent ());
-
- return ret;
- }
-#endregion
-
#region Key
ArrayList keys = new ArrayList ();
@@ -388,32 +300,6 @@ namespace Mono.Xml.Xsl {
keys.Add (key);
}
#endregion
-
-#region Decimal Format
- Hashtable decimalFormats = new Hashtable ();
-
- public void CompileDecimalFormat ()
- {
- QName nm = ParseQNameAttribute ("name");
-
- if (decimalFormats.Contains (nm))
- ((XslDecimalFormat)decimalFormats [nm]).CheckSameAs (this);
- else
- decimalFormats [nm] = new XslDecimalFormat (this);
- }
-#endregion
-
- public void CompileOutput ()
- {
- XPathNavigator n = Input;
- string uri = n.GetAttribute ("href", "");
- XslOutput output = outputs [uri] as XslOutput;
- if (output == null) {
- output = new XslOutput (uri);
- outputs.Add (uri, output);
- }
- output.Fill (n);
- }
}
public class VariableScope {
@@ -456,6 +342,7 @@ namespace Mono.Xml.Xsl {
if (v.IsEvaluated (p))
return v;
}
+
return null;
}
}
@@ -550,17 +437,10 @@ namespace Mono.Xml.Xsl {
Hashtable exprToVarCtx = new Hashtable ();
Hashtable exprToSorts = new Hashtable ();
- Hashtable exprToDocument = new Hashtable ();
public void AddExpression (XPathExpression e, Compiler c)
{
exprToVarCtx [e] = c.CurrentVariableScope;
-
- XPathNavigator nsScope = c.Input.Clone ();
- if (nsScope.NodeType == XPathNodeType.Attribute)
- nsScope.MoveToParent ();
-
- exprToDocument [e] = nsScope;
}
public void AddSort (XPathExpression e, Sort s)
@@ -578,7 +458,7 @@ namespace Mono.Xml.Xsl {
{
XPathExpression expr = e.Clone ();
- expr.SetContext (new XsltCompiledContext (p, (VariableScope)exprToVarCtx [e], (XPathNavigator)exprToDocument [e]));
+ expr.SetContext (new XsltCompiledContext (p, (VariableScope)exprToVarCtx [e]));
if (exprToSorts.Contains (e))
{
foreach (Sort s in (ArrayList)exprToSorts [e])
@@ -594,10 +474,9 @@ namespace Mono.Xml.Xsl {
{
int colon = name.IndexOf (':');
if (colon > 0)
- return new QName (name.Substring (colon+ 1), current.GetNamespace (name.Substring (0, colon)));
+ return new QName (name.Substring (colon, name.Length - colon), current.GetNamespace (name.Substring (0, colon)));
else if (colon < 0)
- // Default namespace is not used for unprefixed names.
- return new QName (name, "");
+ return new QName (name, current.GetNamespace (""));
else
throw new ArgumentException ("Invalid name: " + name);
}
@@ -606,10 +485,9 @@ namespace Mono.Xml.Xsl {
{
int colon = name.IndexOf (':');
if (colon > 0)
- return new QName (name.Substring (colon + 1), ctx.LookupNamespace (name.Substring (0, colon)));
+ return new QName (name.Substring (colon, name.Length - colon), ctx.LookupNamespace (name.Substring (0, colon)));
else if (colon < 0)
- // Default namespace is not used for unprefixed names.
- return new QName (name, "");
+ return new QName (name, ctx.LookupNamespace (""));
else
throw new ArgumentException ("Invalid name: " + name);
}
diff --git a/mcs/class/System.XML/Mono.Xml.Xsl/Outputter.cs b/mcs/class/System.XML/Mono.Xml.Xsl/Outputter.cs
deleted file mode 100644
index 108d29084f2..00000000000
--- a/mcs/class/System.XML/Mono.Xml.Xsl/Outputter.cs
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// Outputter.cs
-//
-// Authors:
-// Oleg Tkachenko (oleg@tkachenko.com)
-//
-// (C) 2003 Oleg Tkachenko
-//
-
-using System;
-
-namespace Mono.Xml.Xsl {
- /// <summary>
- /// Abstract XSLT outputter.
- /// Implementations of this class outputs result tree according output method.
- /// </summary>
- public abstract class Outputter {
- public abstract void WriteStartDocument();
- public abstract void WriteEndDocument();
-
- public void WriteStartElement(string localName, string nsURI)
- {
- WriteStartElement (null, localName, nsURI);
- }
-
- public abstract void WriteStartElement(string prefix, string localName, string nsURI);
- public abstract void WriteEndElement();
-
- public void WriteAttributeString(string localName, string value)
- {
- WriteAttributeString ("", localName, "", value);
- }
-
- public abstract void WriteAttributeString(string prefix, string localName, string nsURI, string value);
- public void WriteNamespaceDecl (string prefix, string nsUri)
- {
- if (prefix == String.Empty)
- WriteAttributeString ("", "xmlns", "", nsUri);
- else
- WriteAttributeString ("xmlns", prefix, null, nsUri);
- }
-
- public void WriteStartAttribute(string localName, string nsURI)
- {
- WriteStartAttribute (null, localName, nsURI);
- }
-
- public abstract void WriteStartAttribute(string prefix, string localName, string nsURI);
- public abstract void WriteEndAttribute();
-
- public abstract void WriteComment(string text);
-
- public abstract void WriteProcessingInstruction(string name, string text);
-
- public abstract void WriteString(string text);
- public abstract void WriteRaw(string data);
-
- public abstract void Done ();
- }
-}
diff --git a/mcs/class/System.XML/Mono.Xml.Xsl/TextOutputter.cs b/mcs/class/System.XML/Mono.Xml.Xsl/TextOutputter.cs
deleted file mode 100644
index dd2a18b4036..00000000000
--- a/mcs/class/System.XML/Mono.Xml.Xsl/TextOutputter.cs
+++ /dev/null
@@ -1,74 +0,0 @@
-//
-// TextOutputter.cs
-//
-// Authors:
-// Oleg Tkachenko (oleg@tkachenko.com)
-//
-// (C) 2003 Oleg Tkachenko
-//
-
-using System;
-using System.Xml;
-using System.IO;
-
-namespace Mono.Xml.Xsl {
- /// <summary>
- /// Outputter implementation for text output method
- /// </summary>
- public class TextOutputter : Outputter {
- private TextWriter _writer;
- //Current output depth
- private int _depth;
- //Ignore nested text nodes
- private bool _ignoreNestedText;
- //Attribute value is being outputted flag
- private bool _inAttribute;
-
- public TextOutputter(TextWriter w, bool ignoreNestedText) {
- _writer = w;
- _ignoreNestedText = ignoreNestedText;
- }
-
- public override void WriteStartDocument() {}
-
- public override void WriteEndDocument() {}
-
- public override void WriteStartElement(string prefix, string localName, string nsURI) {
- if (_ignoreNestedText) _depth++;
- }
-
- public override void WriteEndElement() {
- if (_ignoreNestedText) _depth--;
- }
-
- public override void WriteAttributeString(string prefix, string localName, string nsURI, string value) {}
-
- public override void WriteStartAttribute(string prefix, string localName, string nsURI) {
- _inAttribute = true;
- }
-
- public override void WriteEndAttribute() {
- _inAttribute = false;
- }
-
- public override void WriteComment(string text) {}
-
- public override void WriteProcessingInstruction(string name, string text) {}
-
- public override void WriteString(string text) {
- WriteImpl(text);
- }
-
- public override void WriteRaw(string data) {
- WriteImpl(data);
- }
-
- private void WriteImpl(string text) {
- if ((!_ignoreNestedText || _depth==0) && !_inAttribute) _writer.Write(text);
- }
-
- public override void Done () {
- _writer.Flush ();
- }
- }
-}
diff --git a/mcs/class/System.XML/Mono.Xml.Xsl/XmlOutputter.cs b/mcs/class/System.XML/Mono.Xml.Xsl/XmlOutputter.cs
deleted file mode 100644
index 81403ee91b6..00000000000
--- a/mcs/class/System.XML/Mono.Xml.Xsl/XmlOutputter.cs
+++ /dev/null
@@ -1,86 +0,0 @@
-//
-// XmlOutputter.cs
-//
-// Authors:
-// Oleg Tkachenko (oleg@tkachenko.com)
-//
-// (C) 2003 Oleg Tkachenko
-//
-
-using System;
-using System.Xml;
-using System.IO;
-using System.Collections;
-
-namespace Mono.Xml.Xsl {
- /// <summary>
- /// Outputter implementation for XML output method
- /// </summary>
- public class XmlOutputter : Outputter {
- private XmlWriter _writer;
- private Hashtable _outputs;
- private XslOutput _currentOutput;
-
- public XmlOutputter(XmlWriter w, Hashtable o) {
- _writer = w;
- _outputs = o;
- _currentOutput = (XslOutput)o[String.Empty];
- }
-
- public XmlOutputter(TextWriter w, Hashtable o)
- : this(new XmlTextWriter(w), o) {}
-
- public override void WriteStartDocument() {
- if (_currentOutput != null && _currentOutput.OmitXmlDeclaration)
- return;
- if (_currentOutput == null || _currentOutput.Standalone == null)
- _writer.WriteStartDocument();
- else
- _writer.WriteStartDocument(_currentOutput.Standalone == "yes");
- }
-
- public override void WriteEndDocument() {
- _writer.WriteEndDocument();
- }
-
- public override void WriteStartElement(string prefix, string localName, string nsURI) {
- _writer.WriteStartElement(prefix, localName, nsURI);
- }
-
- public override void WriteEndElement() {
- _writer.WriteEndElement();
- }
-
- public override void WriteAttributeString(string prefix, string localName, string nsURI, string value) {
- _writer.WriteAttributeString(prefix, localName, nsURI, value);
- }
-
- public override void WriteStartAttribute(string prefix, string localName, string nsURI) {
- _writer.WriteStartAttribute(prefix, localName, nsURI);
- }
-
- public override void WriteEndAttribute() {
- _writer.WriteEndAttribute();
- }
-
- public override void WriteComment(string text) {
- _writer.WriteComment(text);
- }
-
- public override void WriteProcessingInstruction(string name, string text) {
- _writer.WriteProcessingInstruction(name, text);
- }
-
- public override void WriteString(string text) {
- _writer.WriteString(text);
- }
-
- public override void WriteRaw(string data) {
- _writer.WriteRaw(data);
- }
-
- public override void Done () {
- _writer.Flush ();
- }
- }
-}
diff --git a/mcs/class/System.XML/Mono.Xml.Xsl/XslDecimalFormat.cs b/mcs/class/System.XML/Mono.Xml.Xsl/XslDecimalFormat.cs
deleted file mode 100644
index 7f8186208fa..00000000000
--- a/mcs/class/System.XML/Mono.Xml.Xsl/XslDecimalFormat.cs
+++ /dev/null
@@ -1,90 +0,0 @@
-//
-// XslDecimalFormat.cs
-//
-// Authors:
-// Ben Maurer (bmaurer@users.sourceforge.net)
-//
-// (C) 2003 Ben Maurer
-//
-
-using System;
-using System.Collections;
-using System.Globalization;
-using System.Xml;
-using System.Xml.XPath;
-using System.Xml.Xsl;
-
-using QName = System.Xml.XmlQualifiedName;
-
-namespace Mono.Xml.Xsl {
- public class XslDecimalFormat {
-
- NumberFormatInfo info = new NumberFormatInfo ();
- char digit = '#', zeroDigit = '0', patternSeparator = ';';
-
- public static readonly XslDecimalFormat Default = new XslDecimalFormat ();
-
- XslDecimalFormat () {} // Default ctor for default info.
- public XslDecimalFormat (Compiler c)
- {
- XPathNavigator n = c.Input;
- if (n.MoveToFirstAttribute ()) {
- do {
- if (n.NamespaceURI != Compiler.XsltNamespace)
- continue;
-
- switch (n.LocalName) {
- case "name": break; // already handled
- case "decimal-separator":
- info.NumberDecimalSeparator = n.Value;
- break;
-
- case "grouping-separator":
- info.NumberGroupSeparator = n.Value;
- break;
-
- case "infinity":
- info.PositiveInfinitySymbol = n.Value;
- break;
- case "minus-sign":
- info.NegativeSign = n.Value;
- break;
- case "NaN":
- info.NaNSymbol = n.Value;
- break;
- case "percent":
- info.PercentSymbol = n.Value;
- break;
- case "per-mille":
- info.PerMilleSymbol = n.Value;
- break;
- case "zero-digit":
- digit = n.Value [0];
- break;
- case "digit":
- zeroDigit = n.Value [0];
- break;
- case "pattern-separator":
- patternSeparator = n.Value [0];
- break;
- }
- } while (n.MoveToNextAttribute ());
- n.MoveToParent ();
-
- info.NegativeInfinitySymbol = info.NegativeSign + info.PositiveInfinitySymbol;
- }
- }
-
- // check that the data in c is the same as this one, as we
- // must do, per the spec.
- public void CheckSameAs (Compiler c)
- {
- throw new NotImplementedException ();
- }
-
- public string FormatNumber (double number, string pattern)
- {
- throw new NotImplementedException ();
- }
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.XML/Mono.Xml.Xsl/XslOutput.cs b/mcs/class/System.XML/Mono.Xml.Xsl/XslOutput.cs
index d204e645848..1db059cc5da 100644
--- a/mcs/class/System.XML/Mono.Xml.Xsl/XslOutput.cs
+++ b/mcs/class/System.XML/Mono.Xml.Xsl/XslOutput.cs
@@ -4,11 +4,9 @@
// Authors:
// Ben Maurer (bmaurer@users.sourceforge.net)
// Atsushi Enomoto (ginga@kit.hi-ho.ne.jp)
-// Oleg Tkachenko (oleg@tkachenko.com)
//
// (C) 2003 Ben Maurer
// (C) 2003 Atsushi Enomoto
-// (C) 2003 Oleg Tkachenko
//
using System;
@@ -17,28 +15,18 @@ using System.Collections;
using System.Xml;
using System.Xml.Schema;
using System.Xml.XPath;
-using System.Xml.Xsl;
-using System.Text;
+using System.Xml.Xsl;
namespace Mono.Xml.Xsl
{
using QName = System.Xml.XmlQualifiedName;
- public enum OutputMethod {
- XML,
- HTML,
- Text,
- Custom,
- Unknown
- }
-
public class XslOutput // also usable for xsl:result-document
{
string uri;
- QName customMethod;
- OutputMethod method = OutputMethod.Unknown;
+ QName method;
string version;
- Encoding encoding = System.Text.Encoding.UTF8;
+ string encoding;
bool omitXmlDeclaration;
string standalone;
string doctypePublic;
@@ -60,14 +48,15 @@ namespace Mono.Xml.Xsl
this.uri = uri;
}
- public OutputMethod Method { get { return method; }}
- public QName CustomMethod { get { return customMethod; }}
+ public QName Method {
+ get { return method; }
+ }
public string Version {
get { return version; }
}
- public Encoding Encoding {
+ public string Encoding {
get { return encoding; }
}
@@ -139,59 +128,39 @@ namespace Mono.Xml.Xsl
// cdSectsList.AddRange (XslNameUtil.ParseQNames (att, nav));
att = nav.GetAttribute ("method", "");
-
- if (att != String.Empty) {
- switch (att) {
- case "xml":
- method = OutputMethod.XML;
- break;
- case "html":
- method = OutputMethod.HTML;
- break;
- case "text":
- method = OutputMethod.Text;
- break;
- default:
- method = OutputMethod.Custom;
- customMethod = XslNameUtil.FromString (att, nav);
- if (customMethod.Namespace == String.Empty)
- //TODO: how to get current line number and position?
- throw new XsltCompileException(new ArgumentException("Invalid output method value: '" + att +
- "'. It must be either 'xml' or 'html' or 'text' or QName."), nav.BaseURI, 1, 1);
- break;
- }
- }
+ if (att != null)
+ this.method = XslNameUtil.FromString (att, nav);
att = nav.GetAttribute ("version", "");
- if (att != String.Empty)
+ if (att != null)
this.version = att;
att = nav.GetAttribute ("encoding", "");
- if (att != String.Empty)
- this.encoding = System.Text.Encoding.GetEncoding (att);
+ if (att != null)
+ this.encoding = att;
att = nav.GetAttribute ("standalone", "");
- if (att != String.Empty)
+ if (att != null)
this.standalone = att;
att = nav.GetAttribute ("doctype-public", "");
- if (att != String.Empty)
+ if (att != null)
this.doctypePublic = att;
att = nav.GetAttribute ("doctype-system", "");
- if (att != String.Empty)
+ if (att != null)
this.doctypeSystem = att;
att = nav.GetAttribute ("media-type", "");
- if (att != String.Empty)
+ if (att != null)
this.mediaType = att;
att = nav.GetAttribute ("omit-xml-declaration", "");
- if (att != String.Empty)
+ if (att != null)
this.omitXmlDeclaration = att == "yes";
att = nav.GetAttribute ("indent", "");
- if (att != String.Empty)
+ if (att != null)
this.indent = att == "yes";
}
}
diff --git a/mcs/class/System.XML/Mono.Xml.Xsl/XslStylesheet.cs b/mcs/class/System.XML/Mono.Xml.Xsl/XslStylesheet.cs
index e4e62902027..a49934222c5 100644
--- a/mcs/class/System.XML/Mono.Xml.Xsl/XslStylesheet.cs
+++ b/mcs/class/System.XML/Mono.Xml.Xsl/XslStylesheet.cs
@@ -38,9 +38,13 @@ namespace Mono.Xml.Xsl {
Hashtable spaceControls = new Hashtable ();
// [string stylesheet-prefix]=>string result-prefix
Hashtable namespaceAliases = new Hashtable ();
+ // [QName]=>XslDecimalFormat
+ Hashtable decimalFormats = new Hashtable ();
// [QName]=>XmlSpace
Hashtable parameters = new Hashtable ();
+ // [string href]=>XslOutput
+ Hashtable outputs = new Hashtable ();
MSXslScriptManager msScripts = new MSXslScriptManager ();
XslTemplateTable templates;
@@ -76,11 +80,19 @@ namespace Mono.Xml.Xsl {
public Hashtable NamespaceAliases {
get { return namespaceAliases; }
}
-
+
+ public Hashtable DecimalFormats {
+ get { return decimalFormats; }
+ }
+
public Hashtable Parameters {
get { return parameters; }
}
+ public Hashtable Outputs {
+ get { return outputs; }
+ }
+
public MSXslScriptManager ScriptManager{
get { return msScripts; }
}
@@ -165,11 +177,13 @@ namespace Mono.Xml.Xsl {
break;
case "output":
- c.CompileOutput ();
- break;
-
- case "decimal-format":
- c.CompileDecimalFormat ();
+ string uri = n.GetAttribute ("href", "");
+ XslOutput output = outputs [uri] as XslOutput;
+ if (output == null) {
+ output = new XslOutput (uri);
+ outputs.Add (uri, output);
+ }
+ output.Fill (n);
break;
case "template":
diff --git a/mcs/class/System.XML/Mono.Xml.Xsl/XslTransformProcessor.cs b/mcs/class/System.XML/Mono.Xml.Xsl/XslTransformProcessor.cs
index 670f0f4f6d7..afa69f01fe4 100644
--- a/mcs/class/System.XML/Mono.Xml.Xsl/XslTransformProcessor.cs
+++ b/mcs/class/System.XML/Mono.Xml.Xsl/XslTransformProcessor.cs
@@ -20,8 +20,7 @@ using Mono.Xml.Xsl.Operations;
using QName = System.Xml.XmlQualifiedName;
namespace Mono.Xml.Xsl {
- public class XslTransformProcessor
- {
+ public class XslTransformProcessor {
CompiledStylesheet compiledStyle;
XslStylesheet style;
@@ -42,30 +41,21 @@ namespace Mono.Xml.Xsl {
this.style = style.Style;
}
- public void Process (XPathNavigator root, Outputter outputtter, XsltArgumentList args, XmlResolver resolver)
+ public void Process (XPathNavigator root, XmlWriter output, XsltArgumentList args, XmlResolver resolver)
{
- this.args = args;
- this.root = root;
- this.resolver = resolver != null ? resolver : new XmlUrlResolver ();
-
- PushNodeset (root.Select ("."));
-
foreach (XslGlobalVariable v in CompiledStyle.Variables.Values) {
- if (args != null && v is XslGlobalParam) {
+ if (v is XslGlobalParam) {
object p = args.GetParam(v.Name.Name, v.Name.Namespace);
if (p != null)
((XslGlobalParam)v).Override (this, p);
- else
- v.Evaluate (this);
}
- v.Evaluate (this);
}
- PopNodeset ();
-
- this.PushOutput (outputtter);
+ this.args = args;
+ this.root = root;
+ this.resolver = resolver != null ? resolver : new XmlUrlResolver ();
+ this.outputStack.Push (output);
this.ApplyTemplates (root.Select ("."), QName.Empty, null);
- this.PopOutput ();
}
public XsltContext Context { get { return ctx; }}
@@ -74,49 +64,22 @@ namespace Mono.Xml.Xsl {
#region Document Resolution
public XmlResolver Resolver {get{return resolver;}}
-
- Hashtable docCache;
-
- public XPathNavigator GetDocument (Uri uri)
- {
- XPathNavigator result;
-
- if (docCache != null) {
- result = docCache [uri] as XPathNavigator;
- if (result != null)
- return result.Clone();
- } else {
- docCache = new Hashtable();
- }
-
- XmlReader rdr = new XmlTextReader (uri.ToString(), (Stream) resolver.GetEntity (uri, null, null));
- result = new XPathDocument (rdr).CreateNavigator ();
- rdr.Close ();
-
- docCache [uri] = result.Clone ();
- return result;
- }
-
#endregion
#region Output
Stack outputStack = new Stack ();
- public Outputter Out { get { return (Outputter)outputStack.Peek(); }}
+ public XmlWriter Out { get { return (XmlWriter)outputStack.Peek(); }}
- public void PushOutput (Outputter newOutput)
+ public void PushOutput (XmlWriter newOutput)
{
this.outputStack.Push (newOutput);
}
- public Outputter PopOutput ()
+ public XmlWriter PopOutput ()
{
- Outputter ret = (Outputter)this.outputStack.Pop ();
- ret.Done ();
- return ret;
+ return (XmlWriter)this.outputStack.Pop ();
}
-
- public Hashtable Outputs { get { return compiledStyle.Outputs; }}
#endregion
#region Templates -- Apply/Call
diff --git a/mcs/class/System.XML/Mono.Xml.Xsl/XsltCompiledContext.cs b/mcs/class/System.XML/Mono.Xml.Xsl/XsltCompiledContext.cs
index 3cfe9d3872e..905f4cc7892 100644
--- a/mcs/class/System.XML/Mono.Xml.Xsl/XsltCompiledContext.cs
+++ b/mcs/class/System.XML/Mono.Xml.Xsl/XsltCompiledContext.cs
@@ -45,15 +45,13 @@ namespace Mono.Xml.Xsl {
XslTransformProcessor p;
VariableScope v;
- XPathNavigator doc;
public XslTransformProcessor Processor { get { return p; }}
- public XsltCompiledContext (XslTransformProcessor p, VariableScope v, XPathNavigator doc)
+ public XsltCompiledContext (XslTransformProcessor p, VariableScope v)
{
this.p = p;
this.v = v;
- this.doc = doc;
}
public override string DefaultNamespace { get { return String.Empty; }}
@@ -64,7 +62,7 @@ namespace Mono.Xml.Xsl {
if (prefix == "" || prefix == null)
return "";
- return this.doc.GetNamespace (prefix);
+ return p.CompiledStyle.NamespaceManager.LookupNamespace (prefix);
}
public override IXsltContextFunction ResolveFunction (string prefix, string name, XPathResultType[] argTypes)
@@ -153,36 +151,18 @@ namespace Mono.Xml.Xsl {
public override System.Xml.Xsl.IXsltContextVariable ResolveVariable(string prefix, string name)
{
- QName varName = new QName (name, LookupNamespace (prefix));
-
if (v != null) {
- XslGeneralVariable var = v.Resolve (p, varName);
+ XslGeneralVariable var = v.Resolve (p, new QName (name));
if (var != null)
return var;
}
- return p.CompiledStyle.ResolveVariable (varName);
+ return p.CompiledStyle.ResolveVariable (new QName (name));
}
public override int CompareDocument (string baseUri, string nextBaseUri) { throw new NotImplementedException (); }
public override bool PreserveWhitespace (XPathNavigator nav) { throw new NotImplementedException (); }
public override bool Whitespace { get { throw new NotImplementedException (); }}
- public string BaseUri { get { return doc.BaseURI; }}
- public XPathNavigator Stylesheet {
- get {
- XPathNavigator ret = doc.Clone ();
- ret.MoveToRoot ();
- return ret;
- }
- }
-
- public XPathNavigator GetDocument (Uri uri)
- {
- if (uri.ToString () == string.Empty)
- return Stylesheet;
-
- return p.GetDocument (uri);
- }
}
@@ -302,59 +282,7 @@ namespace Mono.Xml.Xsl.Functions {
public override object Invoke (XsltCompiledContext xsltContext, object [] args, XPathNavigator docContext)
{
- string baseUri = null;
- if (args.Length == 2) {
- XPathNodeIterator it = (XPathNodeIterator) args [1];
- if (it.MoveNext())
- baseUri = it.Current.BaseURI;
- else
- baseUri = VoidBaseUriFlag;
- }
-
- if (args [0] is XPathNodeIterator)
- return GetDocument (xsltContext, (XPathNodeIterator)args [0], baseUri);
- else
- return GetDocument (xsltContext, args [0].ToString (), baseUri);
- }
-
- static string VoidBaseUriFlag = "&^)(*&%*^$&$VOID!BASE!URI!";
-
- Uri Resolve (string thisUri, string baseUri, XslTransformProcessor p)
- {
- Debug.WriteLine ("THIS: " + thisUri);
- Debug.WriteLine ("BASE: " + baseUri);
- XmlResolver r = p.Resolver;
-
- Uri uriBase = null;
- if (! object.ReferenceEquals (baseUri, VoidBaseUriFlag))
- uriBase = r.ResolveUri (null, baseUri);
-
- return r.ResolveUri (uriBase, thisUri);
- }
-
- XPathNodeIterator GetDocument (XsltCompiledContext xsltContext, XPathNodeIterator itr, string baseUri)
- {
- ArrayList list = new ArrayList ();
- Hashtable got = new Hashtable ();
-
- while (itr.MoveNext()) {
- Uri uri = Resolve (itr.Current.Value, baseUri != null ? baseUri : itr.Current.BaseURI, xsltContext.Processor);
- if (!got.ContainsKey (uri)) {
- got.Add (uri, null);
- list.Add (xsltContext.GetDocument (uri));
- }
- }
-
- return new EnumeratorIterator (list.GetEnumerator (), xsltContext);
- }
-
- XPathNodeIterator GetDocument (XsltCompiledContext xsltContext, string arg0, string baseUri)
- {
- return new SelfIterator (
- xsltContext.GetDocument (
- Resolve (arg0, baseUri != null ? baseUri : xsltContext.BaseUri, xsltContext.Processor)
- )
- , null);
+ throw new NotImplementedException ();
}
}
@@ -398,14 +326,7 @@ namespace Mono.Xml.Xsl.Functions {
public override object Invoke (XsltCompiledContext xsltContext, object [] args, XPathNavigator docContext)
{
- double d = (double)args [0];
- string s = (string)args [1];
- QName nm = QName.Empty;
-
- if (args.Length == 3)
- nm = XslNameUtil.FromString ((string)args [0], xsltContext);
-
- return xsltContext.Processor.CompiledStyle.LookupDecimalFormat (nm).FormatNumber (d, s);
+ throw new NotImplementedException ();
}
}
diff --git a/mcs/class/System.XML/Mono.Xml/ChangeLog b/mcs/class/System.XML/Mono.Xml/ChangeLog
index 40090f278a3..117d7b178e3 100644
--- a/mcs/class/System.XML/Mono.Xml/ChangeLog
+++ b/mcs/class/System.XML/Mono.Xml/ChangeLog
@@ -1,11 +1,3 @@
-2003-08-21 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
-
- * XmlNodeWriter.cs : Extended to support for non-document entity.
-
-2003-08-14 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
-
- * added IHasXmlSchemaInfo.cs.
-
2003-08-07 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
* added IHasXmlParserContext.cs.
diff --git a/mcs/class/System.XML/Mono.Xml/IHasXmlSchemaInfo.cs b/mcs/class/System.XML/Mono.Xml/IHasXmlSchemaInfo.cs
deleted file mode 100644
index 547ededd193..00000000000
--- a/mcs/class/System.XML/Mono.Xml/IHasXmlSchemaInfo.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// Mono.Xml.IHasXmlSchemaInfo.cs
-//
-// Author:
-// Atsushi Enomoto (ginga@kit.hi-ho.ne.jp)
-//
-// (C) 2003 Atsushi Enomoto
-//
-// This interface is used to support XmlSchema type information.
-//
-using System.Xml;
-
-namespace Mono.Xml
-{
- public interface IHasXmlSchemaInfo
- {
- object SchemaType { get; }
- }
-}
diff --git a/mcs/class/System.XML/Mono.Xml/XmlNodeWriter.cs b/mcs/class/System.XML/Mono.Xml/XmlNodeWriter.cs
index 1ace8f9c7cd..4caebe0da0c 100644
--- a/mcs/class/System.XML/Mono.Xml/XmlNodeWriter.cs
+++ b/mcs/class/System.XML/Mono.Xml/XmlNodeWriter.cs
@@ -18,12 +18,12 @@ namespace Mono.Xml
}
// It should be public after some tests are done :-)
- public XmlNodeWriter (bool isDocumentEntity)
+ private XmlNodeWriter (bool isDocumentEntity)
{
doc = new XmlDocument ();
state = XmlNodeType.None;
this.isDocumentEntity = isDocumentEntity;
- if (!isDocumentEntity)
+ if (isDocumentEntity)
current = fragment = doc.CreateDocumentFragment ();
}
@@ -46,7 +46,7 @@ namespace Mono.Xml
// Properties
public XmlNode Document {
- get { return isDocumentEntity ? (XmlNode)doc : (XmlNode)fragment; }
+ get { return isDocumentEntity ? (XmlNode)fragment : (XmlNode)doc; }
}
public override WriteState WriteState {
@@ -113,7 +113,7 @@ namespace Mono.Xml
throw new InvalidOperationException (String.Format ("Current state is not acceptable for {0}.", n.NodeType));
if (state != XmlNodeType.Element)
- Document.AppendChild (n);
+ doc.AppendChild (n);
else if (attribute != null)
attribute.AppendChild (n);
else
@@ -198,7 +198,7 @@ namespace Mono.Xml
XmlElement el = doc.CreateElement (prefix, name, ns);
if (current == null) {
- Document.AppendChild (el);
+ doc.AppendChild (el);
state = XmlNodeType.Element;
} else {
current.AppendChild (el);
@@ -229,10 +229,10 @@ namespace Mono.Xml
if (!forceFull && current.FirstChild == null)
((XmlElement) current).IsEmpty = true;
- if (isDocumentEntity && current.ParentNode == doc)
+ if (current.ParentNode == doc)
state = XmlNodeType.EndElement;
else
- current = current.ParentNode;
+ current = current.ParentNode as XmlElement;
}
// StartAttribute
diff --git a/mcs/class/System.XML/System.Xml.XPath/ChangeLog b/mcs/class/System.XML/System.Xml.XPath/ChangeLog
index f59aa74fc25..7e067222af7 100644
--- a/mcs/class/System.XML/System.Xml.XPath/ChangeLog
+++ b/mcs/class/System.XML/System.Xml.XPath/ChangeLog
@@ -1,10 +1,3 @@
-2003-08-25 Ben Maurer <bmaurer@users.sourceforge.net>
-
- * XPathNavigator.cs: "Smart" behavior in Matches. Nice 8x speed
- improvement in the method (5ms/call -> .7 ms / call) measured by
- monodoc's rendering of N:System.
- * Expression.cs: Utility methods to support above.
-
2003-08-13 Piers Haken <piersh@friskit.com>
* Iterator.cs:
diff --git a/mcs/class/System.XML/System.Xml.XPath/Expression.cs b/mcs/class/System.XML/System.Xml.XPath/Expression.cs
index 0c13a183131..2e9eaa3b27f 100644
--- a/mcs/class/System.XML/System.Xml.XPath/Expression.cs
+++ b/mcs/class/System.XML/System.Xml.XPath/Expression.cs
@@ -42,8 +42,6 @@ namespace System.Xml.XPath
#else
public override XPathExpression Clone () { return new CompiledExpression (this); }
#endif
-
- public Expression ExpressionNode { get { return _expr; }}
public override void SetContext (XmlNamespaceManager nsManager)
{
@@ -1120,7 +1118,6 @@ namespace System.Xml.XPath
_expr = expr;
_pred = pred;
}
- internal Expression LeftHandSide {get{return _expr;}}
public override String ToString () { return "(" + _expr.ToString () + ")[" + _pred.ToString () + "]"; }
public override object Evaluate (BaseIterator iter)
{
diff --git a/mcs/class/System.XML/System.Xml.XPath/XPathNavigator.cs b/mcs/class/System.XML/System.Xml.XPath/XPathNavigator.cs
index a41c6ae164e..602171b7807 100644
--- a/mcs/class/System.XML/System.Xml.XPath/XPathNavigator.cs
+++ b/mcs/class/System.XML/System.Xml.XPath/XPathNavigator.cs
@@ -245,22 +245,6 @@ namespace System.Xml.XPath
[MonoTODO] // optimize...
public virtual bool Matches (XPathExpression expr)
{
- Expression e = ((CompiledExpression)expr).ExpressionNode;
-
- if (e is NodeTest)
- return ((NodeTest)e).Match (((CompiledExpression)expr).NamespaceManager, this);
- if (e is ExprFilter) {
- do {
- e = ((ExprFilter)e).LeftHandSide;
- } while (e is ExprFilter);
-
- if (e is NodeTest && !((NodeTest)e).Match (((CompiledExpression)expr).NamespaceManager, this))
- return false;
- }
-
- //e = ((CompiledExpression)expr).ExpressionNode;
- //Console.WriteLine ("Didnt filter : " + e.GetType ().ToString () + " " + e.ToString ());
-
XPathNodeIterator nodes = Select (expr);
while (nodes.MoveNext ()) {
diff --git a/mcs/class/System.XML/System.Xml.Xsl/ChangeLog b/mcs/class/System.XML/System.Xml.Xsl/ChangeLog
index 0984f6a1402..07204aeda8d 100644
--- a/mcs/class/System.XML/System.Xml.Xsl/ChangeLog
+++ b/mcs/class/System.XML/System.Xml.Xsl/ChangeLog
@@ -1,37 +1,3 @@
-2003-08-21 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * XslTransform.cs: commented out Cleanup () because of bug #47776.
-
-2003-08-21 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * Multiplexer.cs: fixed infinite recursion bug.
-
-2003-08-20 Ben Maurer <bmaurer@users.sourceforge.net>
-
- * ManagedXslTransform.cs: sync API (Oleg).
-
-2003-08-19 Ben Maurer <bmaurer@users.sourceforge.net>
-
- * ManagedXslTransform.cs: sync to API changes.
-
-2003-08-18 Ben Maurer <bmaurer@users.sourceforge.net>
-
- * ManagedXslTransform.cs, XslTransformImpl.cs: Add support for
- encoding.
-
-2003-08-18 Ben Maurer <bmaurer@users.sourceforge.net>
-
- * *.cs: Support for xsl:output. (Oleg)
-
-2003-08-17 Ben Maurer <bmaurer@users.sourceforge.net>
-
- * XslTransformImpl.cs: close XmlTextWriter when we create it.
-
-2003-08-14 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
-
- * XslTransformImpl.cs, XslTransform.cs, Multiplexer.cs,
- ManagedXslTransform.cs : Added Evidence args introduced in .NET 1.1.
-
2003-08-11 Andreas Nahr <ClassDevelopment@A-SoftTech.com>
* XsltCompileException.cs: Fixed/ Implemented rest
diff --git a/mcs/class/System.XML/System.Xml.Xsl/ManagedXslTransform.cs b/mcs/class/System.XML/System.Xml.Xsl/ManagedXslTransform.cs
index bdd5a71980f..898e3681441 100644
--- a/mcs/class/System.XML/System.Xml.Xsl/ManagedXslTransform.cs
+++ b/mcs/class/System.XML/System.Xml.Xsl/ManagedXslTransform.cs
@@ -10,7 +10,6 @@
using System;
using System.Collections;
using System.IO;
-using System.Security.Policy;
using System.Text;
using System.Xml.XPath;
using Mono.Xml.Xsl;
@@ -21,50 +20,14 @@ namespace System.Xml.Xsl {
CompiledStylesheet s;
- public override void Load (XPathNavigator stylesheet, XmlResolver resolver, Evidence evidence)
+ public override void Load (XPathNavigator stylesheet, XmlResolver resolver)
{
- s = new Compiler ().Compile (stylesheet, resolver, evidence);
+ s = new Compiler ().Compile (stylesheet, resolver);
}
public override void Transform (XPathNavigator input, XsltArgumentList args, XmlWriter output, XmlResolver resolver)
{
- Outputter outputter = new XmlOutputter(output, s.Outputs);
- bool wroteStartDocument = false;
- if (output.WriteState == WriteState.Start) {
- outputter.WriteStartDocument ();
- wroteStartDocument = true;
- }
- new XslTransformProcessor (s).Process (input, outputter, args, resolver);
- if (wroteStartDocument)
- outputter.WriteEndDocument ();
- }
-
- public override void Transform (XPathNavigator input, XsltArgumentList args, TextWriter output, XmlResolver resolver) {
- XslOutput xslOutput = (XslOutput)s.Outputs[String.Empty];
- switch (xslOutput.Method) {
- case OutputMethod.Unknown: // TODO: handle xml vs html
- case OutputMethod.XML:
- XmlWriter w = new XmlTextWriter(output);
- Transform(input, args, w, resolver);
- w.Close ();
- break;
- case OutputMethod.HTML:
- throw new NotImplementedException("HTML output method is not implemented yet.");
- case OutputMethod.Text:
- new XslTransformProcessor (s).Process (input, new TextOutputter(output, false), args, resolver);
- break;
- case OutputMethod.Custom:
- throw new NotImplementedException("Custom output method is not implemented yet.");
- }
- }
-
- public override void Transform (XPathNavigator input, XsltArgumentList args, Stream output, XmlResolver resolver)
- {
- XslOutput xslOutput = (XslOutput)s.Outputs[String.Empty];
- if (xslOutput == null)
- Transform (input, args, new StreamWriter (output), resolver);
- else
- Transform (input, args, new StreamWriter (output, xslOutput.Encoding), resolver);
+ new XslTransformProcessor (s).Process (input, output, args, resolver);
}
}
}
diff --git a/mcs/class/System.XML/System.Xml.Xsl/Multiplexer.cs b/mcs/class/System.XML/System.Xml.Xsl/Multiplexer.cs
index 41dcb5cf6fe..f2648f6db66 100644
--- a/mcs/class/System.XML/System.Xml.Xsl/Multiplexer.cs
+++ b/mcs/class/System.XML/System.Xml.Xsl/Multiplexer.cs
@@ -13,7 +13,6 @@ using System.Collections;
using System.IO;
using System.Text;
using System.Runtime.InteropServices;
-using System.Security.Policy;
using System.Xml.XPath;
namespace System.Xml.Xsl {
@@ -76,7 +75,7 @@ namespace System.Xml.Xsl {
public void Transform(XPathNavigator input, XsltArgumentList args, TextWriter output)
{
- impl.Transform (input, args, output, xmlResolver);
+ impl.Transform (input, args, new XmlTextWriter (output), xmlResolver);
}
public void Transform (string inputfile, string outputfile)
@@ -96,81 +95,34 @@ namespace System.Xml.Xsl {
impl.Load (url, resolver);
}
-#if NET_1_1
- [Obsolete("You should pass evidence.", false)]
-#endif
public void Load (XmlReader stylesheet)
{
- Load (stylesheet, null, null);
+ Load (stylesheet, null);
}
-#if NET_1_1
- [Obsolete("You should pass evidence.", false)]
-#endif
public void Load (XmlReader stylesheet, XmlResolver resolver)
{
- Load (stylesheet, resolver, null);
+ impl.Load (stylesheet, resolver);
}
-#if NET_1_1
- [Obsolete("You should pass evidence.", false)]
-#endif
public void Load (XPathNavigator stylesheet)
{
- Load (stylesheet, null, null);
+ Load (stylesheet, null);
}
-#if NET_1_1
- [Obsolete("You should pass evidence.", false)]
-#endif
public void Load (XPathNavigator stylesheet, XmlResolver resolver)
{
- Load (stylesheet, resolver, null);
+ impl.Load (stylesheet, resolver);
}
-#if NET_1_1
- [Obsolete("You should pass evidence.", false)]
-#endif
public void Load (IXPathNavigable stylesheet)
{
Load (stylesheet.CreateNavigator(), null);
}
-#if NET_1_1
- [Obsolete("You should pass evidence.", false)]
-#endif
public void Load (IXPathNavigable stylesheet, XmlResolver resolver)
{
Load (stylesheet.CreateNavigator(), resolver);
}
-
- // Introduced in .NET 1.1
-#if NET_1_1
- public void Load (IXPathNavigable stylesheet, XmlResolver resolver, Evidence evidence)
-#else
- internal void Load (IXPathNavigable stylesheet, XmlResolver resolver, Evidence evidence)
-#endif
- {
- impl.Load (stylesheet.CreateNavigator(), resolver, evidence);
- }
-
-#if NET_1_1
- public void Load (XPathNavigator stylesheet, XmlResolver resolver, Evidence evidence)
-#else
- internal void Load (XPathNavigator stylesheet, XmlResolver resolver, Evidence evidence)
-#endif
- {
- impl.Load (stylesheet, resolver, evidence);
- }
-
-#if NET_1_1
- public void Load (XmlReader stylesheet, XmlResolver resolver, Evidence evidence)
-#else
- internal void Load (XmlReader stylesheet, XmlResolver resolver, Evidence evidence)
-#endif
- {
- impl.Load (stylesheet, resolver, null);
- }
-
}
}
diff --git a/mcs/class/System.XML/System.Xml.Xsl/XslTransform.cs b/mcs/class/System.XML/System.Xml.Xsl/XslTransform.cs
index 92e1406a666..a884d5f29da 100644
--- a/mcs/class/System.XML/System.Xml.Xsl/XslTransform.cs
+++ b/mcs/class/System.XML/System.Xml.Xsl/XslTransform.cs
@@ -14,7 +14,6 @@
using System;
using System.Collections;
using System.IO;
-using System.Security.Policy;
using System.Text;
using System.Runtime.InteropServices;
using System.Xml.XPath;
@@ -65,7 +64,7 @@ namespace System.Xml.Xsl
throw new XmlException ("Error creating stylesheet");
}
- public override void Load (XmlReader stylesheet, XmlResolver resolver, Evidence evidence)
+ public override void Load (XmlReader stylesheet, XmlResolver resolver)
{
FreeStylesheetIfNeeded ();
// Create a document for the stylesheet
@@ -83,7 +82,7 @@ namespace System.Xml.Xsl
throw new XmlException ("Error creating stylesheet");
}
- public override void Load (XPathNavigator stylesheet, XmlResolver resolver, Evidence evidence)
+ public override void Load (XPathNavigator stylesheet, XmlResolver resolver)
{
FreeStylesheetIfNeeded ();
StringWriter sr = new UTF8StringWriter ();
@@ -202,8 +201,8 @@ namespace System.Xml.Xsl
static void Cleanup ()
{
- //xsltCleanupGlobals ();
- //xmlCleanupParser ();
+ xsltCleanupGlobals ();
+ xmlCleanupParser ();
}
static string GetStringFromDocument (IntPtr doc, IntPtr stylesheet)
@@ -279,10 +278,6 @@ namespace System.Xml.Xsl
output.WriteRaw (writer.GetStringBuilder ().ToString ());
output.Flush ();
}
- public override void Transform (XPathNavigator input, XsltArgumentList args, TextWriter output, XmlResolver resolver)
- {
- Transform(input, args, new XmlTextWriter(output), resolver);
- }
public override void Transform(string inputfile, string outputfile, XmlResolver resolver)
{
diff --git a/mcs/class/System.XML/System.Xml.Xsl/XslTransformImpl.cs b/mcs/class/System.XML/System.Xml.Xsl/XslTransformImpl.cs
index 3754792c092..d9f9573265e 100644
--- a/mcs/class/System.XML/System.Xml.Xsl/XslTransformImpl.cs
+++ b/mcs/class/System.XML/System.Xml.Xsl/XslTransformImpl.cs
@@ -10,7 +10,6 @@
using System;
using System.Collections;
using System.IO;
-using System.Security.Policy;
using System.Text;
using System.Xml.XPath;
@@ -20,27 +19,22 @@ namespace System.Xml.Xsl {
public virtual void Load (string url, XmlResolver resolver)
{
- Load (new XPathDocument (url).CreateNavigator (), resolver, null);
+ Load (new XPathDocument (url).CreateNavigator (), resolver);
}
- public virtual void Load (XmlReader stylesheet, XmlResolver resolver, Evidence evidence)
+ public virtual void Load (XmlReader stylesheet, XmlResolver resolver)
{
- Load (new XPathDocument (stylesheet).CreateNavigator (), resolver, evidence);
+ Load (new XPathDocument (stylesheet).CreateNavigator (), resolver);
}
- public abstract void Load (XPathNavigator stylesheet, XmlResolver resolver, Evidence evidence);
+ public abstract void Load (XPathNavigator stylesheet, XmlResolver resolver);
public abstract void Transform (XPathNavigator input, XsltArgumentList args, XmlWriter output, XmlResolver resolver);
- public abstract void Transform (XPathNavigator input, XsltArgumentList args, TextWriter output, XmlResolver resolver);
- public virtual void Transform (XPathNavigator input, XsltArgumentList args, Stream output, XmlResolver resolver)
- {
- Transform (input, args, new StreamWriter (output), resolver);
- }
public virtual void Transform (string inputfile, string outputfile, XmlResolver resolver)
{
- using (Stream s = new FileStream (outputfile, FileMode.Create, FileAccess.ReadWrite)) {
- Transform(new XPathDocument (inputfile).CreateNavigator (), null, s, resolver);
+ using (FileStream fs = new FileStream (outputfile, FileMode.Create, FileAccess.ReadWrite)) {
+ Transform(new XPathDocument (inputfile).CreateNavigator (), null, new XmlTextWriter (fs, null), resolver);
}
}
}
diff --git a/mcs/class/System.XML/System.Xml.dll.sources b/mcs/class/System.XML/System.Xml.dll.sources
index 24a5283a304..29d7e1bd9c0 100755
--- a/mcs/class/System.XML/System.Xml.dll.sources
+++ b/mcs/class/System.XML/System.Xml.dll.sources
@@ -1,7 +1,5 @@
Assembly/AssemblyInfo.cs
Assembly/Locale.cs
-Mono.Xml.Schema/XsdParticleValidationState.cs
-Mono.Xml.Schema/XsdValidatingReader.cs
Mono.Xml.XPath/DTMXPathDocument.cs
Mono.Xml.XPath/DTMXPathDocumentBuilder.cs
Mono.Xml.XPath/DTMXPathNavigator.cs
@@ -11,7 +9,6 @@ Mono.Xml.Xsl.Operations/XslAttribute.cs
Mono.Xml.Xsl.Operations/XslAvt.cs
Mono.Xml.Xsl.Operations/XslCallTemplate.cs
Mono.Xml.Xsl.Operations/XslChoose.cs
-Mono.Xml.Xsl.Operations/XslComment.cs
Mono.Xml.Xsl.Operations/XslCompiledElement.cs
Mono.Xml.Xsl.Operations/XslCopy.cs
Mono.Xml.Xsl.Operations/XslCopyOf.cs
@@ -28,14 +25,10 @@ Mono.Xml.Xsl.Operations/XslTemplateContent.cs
Mono.Xml.Xsl.Operations/XslText.cs
Mono.Xml.Xsl.Operations/XslValueOf.cs
Mono.Xml.Xsl.Operations/XslVariable.cs
-Mono.Xml.Xsl/XmlOutputter.cs
-Mono.Xml.Xsl/Outputter.cs
-Mono.Xml.Xsl/TextOutputter.cs
Mono.Xml.Xsl/Compiler.cs
Mono.Xml.Xsl/Debug.cs
Mono.Xml.Xsl/MSXslScriptManager.cs
Mono.Xml.Xsl/XslAttributeSet.cs
-Mono.Xml.Xsl/XslDecimalFormat.cs
Mono.Xml.Xsl/XslKey.cs
Mono.Xml.Xsl/XslOutput.cs
Mono.Xml.Xsl/XslStylesheet.cs
@@ -43,7 +36,6 @@ Mono.Xml.Xsl/XslTemplate.cs
Mono.Xml.Xsl/XslTransformProcessor.cs
Mono.Xml.Xsl/XsltCompiledContext.cs
Mono.Xml/IHasXmlParserContext.cs
-Mono.Xml/IHasXmlSchemaInfo.cs
Mono.Xml/XmlNodeWriter.cs
System.Xml/IHasXmlNode.cs
System.Xml/DTDAutomata.cs
diff --git a/mcs/class/System.XML/System.Xml/ChangeLog b/mcs/class/System.XML/System.Xml/ChangeLog
index 7843d3a65a2..68f30d3843c 100644
--- a/mcs/class/System.XML/System.Xml/ChangeLog
+++ b/mcs/class/System.XML/System.Xml/ChangeLog
@@ -1,62 +1,3 @@
-2003-08-24 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
-
- * XmlValidatingReader.cs : Implemented SchemaType. Added support for
- ValidationType.Schema. Added support for XmlResolver. Fixed
- ReadTypedValue() not to consume EndElement.
-
-2003-08-19 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
-
- * XmlDocumentNavigator.cs : Fixed MoveToFirstNamespace() that arose
- infinite loop.
- * XmlNamespaceManager.cs : Renamed AtomStrEq to AtomicStringEquals.
- Commented out Console.Error.WriteLine().
- * XmlUrlResolver.cs : Fixed ResolveUri() and GetEntity() to support
- escape and unescape for relative URI string.
-
-2003-08-19 Ben Maurer <bmaurer@users.sourceforge.net>
-
- * XmlParserContext.cs: Make each context inherit next.
-
-2003-08-18 Ben Maurer <bmaurer@users.sourceforge.net>
-
- * XmlChar.cs (IsWhitespace): Spare enumerator allocation.
- * XmlTextWriter.cs (WriteWhitespace): Enumerators are very high in
- fat, use low-fat loops instead. Even better, call the function
- inside XmlChar for code reuse.
- * HighWaterStack.cs (added): New class that acts like a Stack, but
- helps with memory allocation.
- * XmlNamespaceManager.cs, XmlParserContext.cs: Rewrote to use
- HighWaterStack.
- * XmlTextReader.cs: Remove orderedAttributesEnumerator variable,
- use a variable that stores the position in the ArrayList.
-
-2003-08-18 Ben Maurer <bmaurer@users.sourceforge.net>
-
- * XmlTextWriter.cs: Begin diet. String.Format has too much
- saturated fat, lets replace with the fat-free .Write ()
- calls. Effects best seen when Paolo's StreamWriter patch is
- applied.
-
-2003-08-14 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
-
- * XmlNodeReader.cs : Fixed ReadAttributeValue() that might result in
- vanishing current node.
-
-2003-08-14 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
-
- * DTDValidatingReader.cs : Added SchemaType.
- Read() Assures to return to element.
- * DTDObjectModel.cs : Removed DTDEntityDeclaration.BaseURI.
- * XmlReader.cs : ReadString() should be virtual in NET_1_1.
- * XmlTextReader.cs : 1) Depth should consider Attribute and its values.
- Introduced insideAttribute field to support them.
- 2) ReadAttributeValue() should consider empty string.
- * XmlValidatingReader.cs :
- Fixed several properties which premised as if it was already read.
- Encoding and Namespaces now throws NotSupportedException for other
- than XmlTextReader.
- Implemented ReadTypedValue() based on IHasXmlSchemaInfo.SchemaType.
-
2003-08-10 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
* XmlInputStream.cs : Reverted CanSeek as to return false anyway.
diff --git a/mcs/class/System.XML/System.Xml/DTDObjectModel.cs b/mcs/class/System.XML/System.Xml/DTDObjectModel.cs
index c1148eca533..1d0419cad4c 100644
--- a/mcs/class/System.XML/System.Xml/DTDObjectModel.cs
+++ b/mcs/class/System.XML/System.Xml/DTDObjectModel.cs
@@ -747,6 +747,7 @@ namespace Mono.Xml
public string Name;
public string PublicId;
public string SystemId;
+ public string BaseURI;
public string LiteralValue;
public bool LoadFailed;
diff --git a/mcs/class/System.XML/System.Xml/DTDValidatingReader.cs b/mcs/class/System.XML/System.Xml/DTDValidatingReader.cs
index 23e27df9f84..c4d5520637d 100644
--- a/mcs/class/System.XML/System.Xml/DTDValidatingReader.cs
+++ b/mcs/class/System.XML/System.Xml/DTDValidatingReader.cs
@@ -8,7 +8,7 @@ using System.Xml.Schema;
namespace Mono.Xml
{
- public class DTDValidatingReader : XmlReader, IXmlLineInfo, IHasXmlParserContext, IHasXmlSchemaInfo
+ public class DTDValidatingReader : XmlReader, IXmlLineInfo, IHasXmlParserContext
{
public DTDValidatingReader (XmlReader reader)
: this (reader, null)
@@ -520,7 +520,6 @@ namespace Mono.Xml
}
break;
}
- MoveToElement ();
return true;
}
@@ -969,16 +968,6 @@ namespace Mono.Xml
}
}
- public object SchemaType {
- get {
- if (currentElement == null)
- return null;
- DTDAttributeDefinition def =
- DTD.AttListDecls [currentElement] [currentAttribute];
- return def.Datatype;
- }
- }
-
char [] whitespaceChars = new char [] {' '};
private string FilterNormalization (string attrName, string rawValue)
{
diff --git a/mcs/class/System.XML/System.Xml/XmlChar.cs b/mcs/class/System.XML/System.Xml/XmlChar.cs
index faf6ef8b245..52bb5537fbd 100644
--- a/mcs/class/System.XML/System.Xml/XmlChar.cs
+++ b/mcs/class/System.XML/System.Xml/XmlChar.cs
@@ -19,9 +19,9 @@ namespace System.Xml
internal static bool IsWhitespace (string str)
{
- for (int i = 0; i < str.Length; i++)
- if (!IsWhitespace (str [i])) return false;
-
+ foreach (char c in str)
+ if (!IsWhitespace (c))
+ return false;
return true;
}
diff --git a/mcs/class/System.XML/System.Xml/XmlDocumentNavigator.cs b/mcs/class/System.XML/System.Xml/XmlDocumentNavigator.cs
index 71799f35173..aa2dff117bc 100644
--- a/mcs/class/System.XML/System.Xml/XmlDocumentNavigator.cs
+++ b/mcs/class/System.XML/System.Xml/XmlDocumentNavigator.cs
@@ -300,7 +300,7 @@ namespace System.Xml
}
if (namespaceScope == XPathNamespaceScope.Local)
return false;
- el = el.ParentNode as XmlElement;
+ el = node.ParentNode as XmlElement;
} while (el != null);
}
diff --git a/mcs/class/System.XML/System.Xml/XmlNodeReader.cs b/mcs/class/System.XML/System.Xml/XmlNodeReader.cs
index f77a2875e10..6336174eece 100755
--- a/mcs/class/System.XML/System.Xml/XmlNodeReader.cs
+++ b/mcs/class/System.XML/System.Xml/XmlNodeReader.cs
@@ -276,10 +276,7 @@ namespace System.Xml
if (current == null)
return String.Empty;
- if (current.NodeType == XmlNodeType.Attribute)
- return current.Prefix != String.Empty ? current.Prefix : null;
- else
- return current.Prefix;
+ return current.Prefix;
}
}
@@ -784,10 +781,8 @@ namespace System.Xml
}
if (current.NodeType == XmlNodeType.Attribute) {
- if (current.FirstChild == null)
- return false;
current = current.FirstChild;
- return true;
+ return current != null;
} else if (current.ParentNode.NodeType == XmlNodeType.Attribute) {
if (current.NextSibling == null)
return false;
diff --git a/mcs/class/System.XML/System.Xml/XmlReader.cs b/mcs/class/System.XML/System.Xml/XmlReader.cs
index acfa455ccfb..b7cbf7368ce 100644
--- a/mcs/class/System.XML/System.Xml/XmlReader.cs
+++ b/mcs/class/System.XML/System.Xml/XmlReader.cs
@@ -397,14 +397,7 @@ namespace System.Xml
Read ();
}
-#if NET_1_0
public abstract string ReadString ();
-#else
- public virtual string ReadString ()
- {
- return ReadStringInternal ();
- }
-#endif
internal string ReadStringInternal ()
{
diff --git a/mcs/class/System.XML/System.Xml/XmlTextReader.cs b/mcs/class/System.XML/System.Xml/XmlTextReader.cs
index 4fd2f05cf27..8c16f275b2e 100644
--- a/mcs/class/System.XML/System.Xml/XmlTextReader.cs
+++ b/mcs/class/System.XML/System.Xml/XmlTextReader.cs
@@ -16,9 +16,6 @@
// Some thought needs to be given to performance. There's too many
// strings being allocated.
//
-// If current node is on an Attribute, Prefix might be null, and
-// in several fields which uses XmlReader, it should be considered.
-//
using System;
using System.Collections;
@@ -102,6 +99,7 @@ namespace System.Xml
{
}
+ [MonoTODO("TODO as same as private XmlTextReader(TextReader, XmlNodeType, XmlParserContext)")]
public XmlTextReader (string xmlFragment, XmlNodeType fragType, XmlParserContext context)
: this (context != null ? context.BaseURI : String.Empty,
new StringReader (xmlFragment),
@@ -110,6 +108,8 @@ namespace System.Xml
{
}
+ // TODO still remains as described at head of this file,
+ // but it might not be TODO of the constructors...
XmlTextReader (string url, TextReader fragment, XmlNodeType fragType, XmlParserContext context)
{
InitializeContext (url, context, fragment, fragType);
@@ -132,10 +132,6 @@ namespace System.Xml
public override int Depth
{
get {
- if (NodeType == XmlNodeType.Attribute)
- return elementDepth + 1;
- else if (insideAttribute)
- return elementDepth + 2; // inside attribute value.
return elementDepth;
}
}
@@ -390,11 +386,13 @@ namespace System.Xml
if (attributes == null || orderedAttributes.Count < i || i < 0)
throw new ArgumentOutOfRangeException ("attribute index out of range.");
- if (orderedAttributesPos == -1) {
+ if (orderedAttributesEnumerator == null) {
SaveProperties ();
}
- orderedAttributesPos = i;
+ orderedAttributesEnumerator = orderedAttributes.GetEnumerator ();
+ for (int n=0; n<=i; n++)
+ orderedAttributesEnumerator.MoveNext();
string name = orderedAttributes [i] as string;
string value = attributes [name] as string;
@@ -405,7 +403,6 @@ namespace System.Xml
value, // value
false // clearAttributes
);
- insideAttribute = true;
attributeValuePos = 0;
}
@@ -417,15 +414,17 @@ namespace System.Xml
if (attributes == null)
return false;
- if (orderedAttributesPos == -1) {
+ if (orderedAttributesEnumerator == null) {
SaveProperties ();
}
- for (orderedAttributesPos = 0; orderedAttributesPos < orderedAttributes.Count; orderedAttributesPos++)
- if (name == orderedAttributes [orderedAttributesPos] as string) {
+ orderedAttributesEnumerator = orderedAttributes.GetEnumerator ();
+ while (orderedAttributesEnumerator.MoveNext ()) {
+ if(name == orderedAttributesEnumerator.Current as string) {
match = true;
break;
}
+ }
if (match) {
string value = attributes [name] as string;
@@ -436,7 +435,6 @@ namespace System.Xml
value, // value
false // clearAttributes
);
- insideAttribute = true;
attributeValuePos = 0;
}
@@ -459,11 +457,10 @@ namespace System.Xml
public override bool MoveToElement ()
{
- if (orderedAttributesPos != -1) {
- orderedAttributesPos = -1;
+ if (orderedAttributesEnumerator != null) {
+ orderedAttributesEnumerator = null;
if (isPropertySaved)
RestoreProperties ();
- insideAttribute = false;
return true;
}
@@ -481,12 +478,13 @@ namespace System.Xml
if (attributes == null)
return false;
- if (orderedAttributesPos == -1)
+ if (orderedAttributesEnumerator == null) {
SaveProperties ();
+ orderedAttributesEnumerator = orderedAttributes.GetEnumerator ();
+ }
-
- if (++orderedAttributesPos < orderedAttributes.Count) {
- string name = orderedAttributes [orderedAttributesPos] as string;
+ if (orderedAttributesEnumerator.MoveNext ()) {
+ string name = orderedAttributesEnumerator.Current as string;
string value = attributes [name] as string;
SetProperties (
XmlNodeType.Attribute, // nodeType
@@ -495,7 +493,6 @@ namespace System.Xml
value, // value
false // clearAttributes
);
- insideAttribute = true;
attributeValuePos = 0;
return true;
}
@@ -508,7 +505,6 @@ namespace System.Xml
bool more = false;
isPropertySaved = false;
readState = ReadState.Interactive;
- insideAttribute = false;
// It was moved from end of ReadStartTag ().
if (depthUp)
@@ -523,7 +519,7 @@ namespace System.Xml
maybeTextDecl--;
if (!more && startNodeType == XmlNodeType.Document && currentState != XmlNodeType.EndElement)
- throw new XmlException ("Document element did not appear.");
+ throw new XmlException ("Document element was not appeared.");
return more;
}
@@ -547,20 +543,9 @@ namespace System.Xml
return false;
// If not started, then initialize attributeString when parsing is at start.
- if (attributeValuePos == 0) {
+ if (attributeValuePos == 0)
attributeString =
value.Substring (1, value.Length - 2);
- // If it has an empty value, this method still returns true.
- if (attributeString.Length == 0) {
- attributeValuePos = -1;
- SetProperties (XmlNodeType.Text,
- "",
- false,
- "",
- false);
- return true;
- }
- }
// It occurs when attribute dully consists of entity reference.
if (attributeValuePos == attributeString.Length)
@@ -764,8 +749,6 @@ namespace System.Xml
private StringBuilder valueBuilder;
private bool valueBuilderAvailable = false;
- private bool insideAttribute;
-
private bool isPropertySaved;
private XmlNodeType saveNodeType;
private string saveName;
@@ -776,7 +759,7 @@ namespace System.Xml
private Hashtable attributes;
private ArrayList orderedAttributes;
- private int orderedAttributesPos = -1;
+ private IEnumerator orderedAttributesEnumerator;
private bool returnEntityReference;
private string entityReferenceName;
@@ -797,7 +780,6 @@ namespace System.Xml
private string attributeString;
private int attributeValuePos;
-
// This should be only referenced(used) by ReadInnerXml(). Kind of flyweight pattern.
private StringBuilder innerXmlBuilder;
@@ -844,7 +826,7 @@ namespace System.Xml
attributes = new Hashtable ();
attributeString = String.Empty;
orderedAttributes = new ArrayList ();
- orderedAttributesPos = -1;
+ orderedAttributesEnumerator = null;
returnEntityReference = false;
entityReferenceName = String.Empty;
@@ -922,7 +904,6 @@ namespace System.Xml
if (indexOfColon == -1) {
prefix = String.Empty;
-// prefix = nodeType == XmlNodeType.Attribute ? null : String.Empty;
localName = name;
} else {
prefix = name.Substring (0, indexOfColon);
@@ -936,7 +917,6 @@ namespace System.Xml
switch (nodeType) {
case XmlNodeType.Attribute:
if (prefix == string.Empty) namespaceURI = string.Empty;
-// if (prefix == string.Empty || prefix == null) namespaceURI = string.Empty;
else namespaceURI = LookupNamespace (prefix);
if (localName == "xmlns" && prefix == "")
namespaceURI = "http://www.w3.org/2000/xmlns/";
@@ -1007,7 +987,7 @@ namespace System.Xml
orderedAttributes.Clear ();
}
- orderedAttributesPos = -1;
+ orderedAttributesEnumerator = null;
}
private int PeekChar ()
diff --git a/mcs/class/System.XML/System.Xml/XmlTextWriter.cs b/mcs/class/System.XML/System.Xml/XmlTextWriter.cs
index 214aac3a919..d4a5c7e3d6a 100644
--- a/mcs/class/System.XML/System.Xml/XmlTextWriter.cs
+++ b/mcs/class/System.XML/System.Xml/XmlTextWriter.cs
@@ -345,10 +345,8 @@ namespace System.Xml
CheckState ();
CloseStartElement ();
-
- w.Write ("<![CDATA[");
- w.Write (text);
- w.Write ("]]>");
+
+ w.Write("<![CDATA[{0}]]>", text);
}
public override void WriteCharEntity (char ch)
@@ -378,9 +376,7 @@ namespace System.Xml
CheckState ();
CloseStartElement ();
- w.Write ("<!--");
- w.Write (text);
- w.Write ("-->");
+ w.Write ("<!--{0}-->", text);
}
public override void WriteDocType (string name, string pubid, string sysid, string subset)
@@ -391,27 +387,14 @@ namespace System.Xml
w.Write ("<!DOCTYPE ");
w.Write (name);
if (pubid != null) {
- w.Write (" PUBLIC ");
- w.Write (quoteChar);
- w.Write (pubid);
- w.Write (quoteChar);
-
- w.Write (quoteChar);
- w.Write (sysid);
- w.Write (quoteChar);
+ w.Write (String.Format (" PUBLIC {0}{1}{0} {0}{2}{0}", quoteChar, pubid, sysid));
} else if (sysid != null) {
- w.Write (" SYSTEM ");
- w.Write (quoteChar);
- w.Write (sysid);
- w.Write (quoteChar);
+ w.Write (String.Format (" SYSTEM {0}{1}{0}", quoteChar, sysid));
}
- if (subset != null) {
- w.Write ('[');
- w.Write (subset);
- w.Write (']');
- }
-
+ if (subset != null)
+ w.Write ("[" + subset + "]");
+
w.Write('>');
}
@@ -435,7 +418,7 @@ namespace System.Xml
((XmlTextWriterOpenElement)openElements.Peek()).XmlSpace = xmlSpace;
}
- w.Write (quoteChar);
+ w.Write ("{0}", quoteChar);
openAttribute = false;
@@ -477,20 +460,15 @@ namespace System.Xml
if (openStartElement) {
if (openAttribute)
WriteEndAttribute ();
- if (fullEndElement) {
- w.Write ("></");
- w.Write (((XmlTextWriterOpenElement)openElements.Peek ()).Name);
- w.Write ('>');
- } else
+ if (fullEndElement)
+ w.Write ("></{0}>", ((XmlTextWriterOpenElement)openElements.Peek ()).Name);
+ else
w.Write (" />");
openElements.Pop ();
openStartElement = false;
} else {
- w.Write (indentFormatting);
- w.Write ("</");
- w.Write (openElements.Pop ());
- w.Write ('>');
+ w.Write ("{0}</{1}>", indentFormatting, openElements.Pop ());
}
namespaceManager.PopScope();
@@ -541,12 +519,7 @@ namespace System.Xml
CheckState ();
CloseStartElement ();
- w.Write (indentFormatting);
- w.Write ("<?");
- w.Write (name);
- w.Write (' ');
- w.Write (text);
- w.Write ("?>");
+ w.Write ("{0}<?{1} {2}?>", indentFormatting, name, text);
}
[MonoTODO]
@@ -559,9 +532,8 @@ namespace System.Xml
if (!openAttribute)
CloseStartElement ();
- w.Write (namespaceManager.LookupPrefix (ns));
- w.Write (':');
- w.Write (localName);
+ string prefix = namespaceManager.LookupPrefix (ns);
+ w.Write ("{0}:{1}", prefix, localName);
}
public override void WriteRaw (string data)
@@ -633,11 +605,7 @@ namespace System.Xml
// writtenAttributes.Contains (formatPrefix + localName))
// return;
- w.Write (formatSpace);
- w.Write (formatPrefix);
- w.Write (localName);
- w.Write ('=');
- w.Write (quoteChar);
+ w.Write ("{0}{1}{2}={3}", formatSpace, formatPrefix, localName, quoteChar);
if (checkMultipleAttributes)
writtenAttributes.Add (formatPrefix + localName, formatPrefix + localName);
@@ -714,16 +682,16 @@ namespace System.Xml
if (prefix == null)
prefix = String.Empty;
- string formatName = localName;
+ string formatPrefix = "";
- if (ns != null && prefix != String.Empty)
- formatName = prefix + ":" + localName;
-
- w.Write (indentFormatting);
- w.Write ('<');
- w.Write (formatName);
+ if(ns != null) {
+ if (prefix != String.Empty)
+ formatPrefix = prefix + ":";
+ }
+
+ w.Write ("{0}<{1}{2}", indentFormatting, formatPrefix, localName);
- openElements.Push (new XmlTextWriterOpenElement (formatName));
+ openElements.Push (new XmlTextWriterOpenElement (formatPrefix + localName));
ws = WriteState.Element;
openStartElement = true;
openElementNS = ns;
@@ -821,8 +789,10 @@ namespace System.Xml
public override void WriteWhitespace (string ws)
{
- if (!XmlChar.IsWhitespace (ws))
- throw new ArgumentException ("Invalid Whitespace");
+ foreach (char c in ws) {
+ if ((c != ' ') && (c != '\t') && (c != '\r') && (c != '\n'))
+ throw new ArgumentException ();
+ }
CheckState ();
diff --git a/mcs/class/System.XML/System.Xml/XmlUrlResolver.cs b/mcs/class/System.XML/System.Xml/XmlUrlResolver.cs
index 5311643ffc4..1bd2dedb340 100755
--- a/mcs/class/System.XML/System.Xml/XmlUrlResolver.cs
+++ b/mcs/class/System.XML/System.Xml/XmlUrlResolver.cs
@@ -39,17 +39,17 @@ namespace System.Xml
}
// Methods
- [MonoTODO("Uri must be absolute.")]
+ [MonoTODO("Use Credentials; Uri must be absolute.")]
public override object GetEntity (Uri absoluteUri, string role, Type ofObjectToReturn)
{
if (absoluteUri.Scheme == "file")
- return new FileStream (UnescapeRelativeUriBody (absoluteUri.LocalPath), FileMode.Open, FileAccess.Read, FileShare.Read);
+ return new FileStream (absoluteUri.LocalPath, FileMode.Open, FileAccess.Read, FileShare.Read);
// (MS documentation says) parameter role isn't used yet.
Stream s = null;
using (s) {
WebClient wc = new WebClient ();
- wc.Credentials = credential;
+// wc.Credentials = credential;
s = wc.OpenRead (absoluteUri.ToString ());
if (s.GetType ().IsSubclassOf (ofObjectToReturn))
return s;
@@ -71,31 +71,17 @@ namespace System.Xml
// extraneous "/a" is required because current Uri stuff
// seems ignorant of difference between "." and "./".
// I'd be appleciate if it is fixed with better solution.
- return new Uri (new Uri (Path.GetFullPath ("./a")), EscapeRelativeUriBody (relativeUri));
+ return new Uri (new Uri (Path.GetFullPath ("./a")), relativeUri);
}
+ // Do not expect relativeUri.Length > 2.
+// if (relativeUri.IndexOf ("://") >= 0)
+// return new Uri (relativeUri);
+
if (relativeUri == null)
return baseUri;
- return new Uri (baseUri, EscapeRelativeUriBody (relativeUri));
- }
-
- private string EscapeRelativeUriBody (string src)
- {
- return src.Replace ("<", "%3C")
- .Replace (">", "%3E")
- .Replace ("#", "%23")
- .Replace ("%", "%25")
- .Replace ("\"", "%22");
- }
-
- private string UnescapeRelativeUriBody (string src)
- {
- return src.Replace ("%3C", "<")
- .Replace ("%3E", ">")
- .Replace ("%23", "#")
- .Replace ("%25", "%")
- .Replace ("%22", "\"");
+ return new Uri (baseUri, relativeUri);
}
}
}
diff --git a/mcs/class/System.XML/System.Xml/XmlValidatingReader.cs b/mcs/class/System.XML/System.Xml/XmlValidatingReader.cs
index c31cfd1e21d..d800d0e1be6 100644
--- a/mcs/class/System.XML/System.Xml/XmlValidatingReader.cs
+++ b/mcs/class/System.XML/System.Xml/XmlValidatingReader.cs
@@ -21,28 +21,24 @@ namespace System.Xml {
EntityHandling entityHandling;
XmlReader sourceReader;
- XmlTextReader xmlTextReader;
XmlReader validatingReader;
XmlResolver resolver;
- bool specifiedResolver;
ValidationType validationType;
XmlSchemaCollection schemas;
DTDValidatingReader dtdReader;
- IHasXmlSchemaInfo schemaInfo;
- StringBuilder storedCharacters;
#endregion // Fields
#region Constructors
+ [MonoTODO]
public XmlValidatingReader (XmlReader reader)
+ : base ()
{
this.sourceReader = reader;
- this.xmlTextReader = reader as XmlTextReader;
entityHandling = EntityHandling.ExpandEntities;
validationType = ValidationType.Auto;
schemas = new XmlSchemaCollection ();
- storedCharacters = new StringBuilder ();
}
public XmlValidatingReader (Stream xmlFragment, XmlNodeType fragType, XmlParserContext context)
@@ -60,29 +56,27 @@ namespace System.Xml {
#region Properties
public override int AttributeCount {
+ [MonoTODO]
get { return validatingReader == null ? 0 : validatingReader.AttributeCount; }
}
public override string BaseURI {
+ [MonoTODO]
get { return validatingReader == null ? sourceReader.BaseURI : validatingReader.BaseURI; }
}
- // This property for this class always return true.
public override bool CanResolveEntity {
- get { return true; }
+ get { return validatingReader == null ? false : validatingReader.CanResolveEntity; }
}
public override int Depth {
+ [MonoTODO]
get { return validatingReader == null ? 0 : validatingReader.Depth; }
}
public Encoding Encoding {
- get {
- if (xmlTextReader != null)
- return xmlTextReader.Encoding;
- else
- throw new NotSupportedException ("Encoding is supported only for XmlTextReader.");
- }
+ [MonoTODO]
+ get { throw new NotImplementedException (); }
}
public EntityHandling EntityHandling {
@@ -91,35 +85,38 @@ namespace System.Xml {
}
public override bool EOF {
+ [MonoTODO]
get { return validatingReader == null ? false : validatingReader.EOF; }
}
public override bool HasValue {
+ [MonoTODO]
get { return validatingReader == null ? false : validatingReader.HasValue; }
}
public override bool IsDefault {
+ [MonoTODO]
get { return validatingReader == null ? false : validatingReader.IsDefault; }
}
public override bool IsEmptyElement {
+ [MonoTODO]
get { return validatingReader == null ? false : validatingReader.IsEmptyElement; }
}
public override string this [int i] {
- get {
- if (validatingReader == null)
- throw new IndexOutOfRangeException ("Reader is not started.");
- return validatingReader [i];
- }
+ [MonoTODO]
+ get { return validatingReader [i]; }
}
public override string this [string name] {
- get { return validatingReader == null ? null : validatingReader [name]; }
+ [MonoTODO]
+ get { return validatingReader == null ? String.Empty : validatingReader [name]; }
}
public override string this [string localName, string namespaceName] {
- get { return validatingReader == null ? null : validatingReader [localName, namespaceName]; }
+ [MonoTODO]
+ get { return validatingReader == null ? String.Empty : validatingReader [localName, namespaceName]; }
}
int IXmlLineInfo.LineNumber {
@@ -137,73 +134,66 @@ namespace System.Xml {
}
public override string LocalName {
- get {
- if (validatingReader == null)
- return String.Empty;
- else if (Namespaces)
- return validatingReader.LocalName;
- else
- return validatingReader.Name;
- }
+ [MonoTODO]
+ get { return validatingReader == null ? String.Empty : validatingReader.LocalName; }
}
public override string Name {
+ [MonoTODO]
get { return validatingReader == null ? String.Empty : validatingReader.Name; }
}
+ [MonoTODO]
public bool Namespaces {
get {
- if (xmlTextReader != null)
- return xmlTextReader.Namespaces;
+ XmlTextReader xtr = sourceReader as XmlTextReader;
+ if (xtr != null)
+ return xtr.Namespaces;
else
- return true;
+ throw new NotImplementedException ();
}
set {
- if (ReadState != ReadState.Initial)
- throw new InvalidOperationException ("Namespaces have to be set before reading.");
-
- if (xmlTextReader != null)
- xmlTextReader.Namespaces = value;
+ XmlTextReader xtr = sourceReader as XmlTextReader;
+ if (xtr != null)
+ xtr.Namespaces = value;
else
- throw new NotSupportedException ("Property 'Namespaces' is supported only for XmlTextReader.");
+ throw new NotImplementedException ();
}
}
public override string NamespaceURI {
- get {
- if (validatingReader == null)
- return String.Empty;
- else if (Namespaces)
- return validatingReader.NamespaceURI;
- else
- return String.Empty;
- }
+ [MonoTODO]
+ get { return validatingReader == null ? String.Empty : validatingReader.NamespaceURI; }
}
public override XmlNameTable NameTable {
- get { return validatingReader == null ? sourceReader.NameTable : validatingReader.NameTable; }
+ [MonoTODO]
+ get { return validatingReader == null ? null : validatingReader.NameTable; }
}
public override XmlNodeType NodeType {
+ [MonoTODO]
get { return validatingReader == null ? XmlNodeType.None : validatingReader.NodeType; }
}
- public override string Prefix {
+ public override string Prefix {
[MonoTODO]
get { return validatingReader == null ? String.Empty : validatingReader.Prefix; }
}
public override char QuoteChar {
- get { return validatingReader == null ? sourceReader.QuoteChar : validatingReader.QuoteChar; }
+ [MonoTODO]
+ get { return validatingReader == null ? '"' : validatingReader.QuoteChar; }
}
+ [MonoTODO ("confirm which reader should be returned.")]
public XmlReader Reader {
get { return sourceReader; }
}
public override ReadState ReadState {
[MonoTODO]
- get {
+ get {
if (validatingReader == null)
return ReadState.Initial;
return validatingReader.ReadState;
@@ -215,7 +205,8 @@ namespace System.Xml {
}
public object SchemaType {
- get { return schemaInfo.SchemaType; }
+ [MonoTODO]
+ get { throw new NotImplementedException (); }
}
[MonoTODO]
@@ -228,9 +219,9 @@ namespace System.Xml {
case ValidationType.Auto:
case ValidationType.DTD:
case ValidationType.None:
- case ValidationType.Schema:
validationType = value;
break;
+ case ValidationType.Schema:
case ValidationType.XDR:
throw new NotImplementedException ();
}
@@ -238,23 +229,25 @@ namespace System.Xml {
}
public override string Value {
+ [MonoTODO]
get { return validatingReader == null ? String.Empty : validatingReader.Value; }
}
public override string XmlLang {
+ [MonoTODO]
get { return validatingReader == null ? String.Empty : validatingReader.XmlLang; }
}
public XmlResolver XmlResolver {
+ [MonoTODO]
set {
- specifiedResolver = true;
resolver = value;
- XsdValidatingReader xsvr = validatingReader as XsdValidatingReader;
- if (xsvr != null)
- xsvr.XmlResolver = value;
DTDValidatingReader dvr = validatingReader as DTDValidatingReader;
if (dvr != null)
dvr.XmlResolver = value;
+// XmlSchemaValidatingReader xsvr = validatingReader as XmlSchemaValidatingReader;
+// if (xsvr != null)
+// xsvr.XmlResolver = value;
}
}
@@ -267,27 +260,28 @@ namespace System.Xml {
#region Methods
+ [MonoTODO]
public override void Close ()
{
- if (validatingReader == null)
- sourceReader.Close ();
- else
- validatingReader.Close ();
+ validatingReader.Close ();
}
+ [MonoTODO]
public override string GetAttribute (int i)
{
- return this [i];
+ return validatingReader.GetAttribute (i);
}
+ [MonoTODO]
public override string GetAttribute (string name)
{
- return this [name];
+ return validatingReader.GetAttribute (name);
}
+ [MonoTODO]
public override string GetAttribute (string localName, string namespaceName)
{
- return this [localName, namespaceName];
+ return validatingReader.GetAttribute (localName, namespaceName);
}
internal XmlParserContext GetInternalParserContext ()
@@ -302,54 +296,45 @@ namespace System.Xml {
return info != null ? info.HasLineInfo () : false;
}
+ [MonoTODO]
public override string LookupNamespace (string prefix)
{
- if (validatingReader != null)
- return sourceReader.LookupNamespace (prefix);
- else
- return validatingReader.LookupNamespace (prefix);
+ return validatingReader.LookupNamespace (prefix);
}
+ [MonoTODO]
public override void MoveToAttribute (int i)
{
- if (validatingReader == null)
- throw new IndexOutOfRangeException ("Reader is not started.");
- else
- validatingReader.MoveToAttribute (i);
+ validatingReader.MoveToAttribute (i);
}
+ [MonoTODO]
public override bool MoveToAttribute (string name)
{
- if (validatingReader == null)
- return false;
return validatingReader.MoveToAttribute (name);
}
+ [MonoTODO]
public override bool MoveToAttribute (string localName, string namespaceName)
{
- if (validatingReader == null)
- return false;
return validatingReader.MoveToAttribute (localName, namespaceName);
}
+ [MonoTODO]
public override bool MoveToElement ()
{
- if (validatingReader == null)
- return false;
return validatingReader.MoveToElement ();
}
+ [MonoTODO]
public override bool MoveToFirstAttribute ()
{
- if (validatingReader == null)
- return false;
return validatingReader.MoveToFirstAttribute ();
}
+ [MonoTODO]
public override bool MoveToNextAttribute ()
{
- if (validatingReader == null)
- return false;
return validatingReader.MoveToNextAttribute ();
}
@@ -366,102 +351,48 @@ namespace System.Xml {
goto case ValidationType.DTD;
case ValidationType.DTD:
validatingReader = dtdReader = new DTDValidatingReader (sourceReader, this);
- if (specifiedResolver)
- dtdReader.XmlResolver = resolver;
break;
case ValidationType.Schema:
- dtdReader = new DTDValidatingReader (sourceReader, this);
- XsdValidatingReader xsvr = new XsdValidatingReader (dtdReader, this);
- foreach (XmlSchema schema in Schemas)
- xsvr.Schemas.Add (schema);
- validatingReader = xsvr;
- if (specifiedResolver) {
- xsvr.XmlResolver = resolver;
- dtdReader.XmlResolver = resolver;
- }
- break;
+// dtdReader = new DTDValidatingReader (sourceReader, this);
+// validatingReader = new XmlSchemaValidatingReader (dtdReader, this);
+// break;
case ValidationType.XDR:
throw new NotImplementedException ();
}
- schemaInfo = validatingReader as IHasXmlSchemaInfo;
}
return validatingReader.Read ();
}
+ [MonoTODO]
public override bool ReadAttributeValue ()
{
- if (validatingReader == null)
- return false;
return validatingReader.ReadAttributeValue ();
}
#if NET_1_0
- // LAMESPEC: MS.NET 1.0 has critical bug here.
- // After calling these methods, validation does no more work!
[MonoTODO]
public override string ReadInnerXml ()
{
- if (validatingReader == null)
- return "";
return validatingReader.ReadInnerXml ();
}
[MonoTODO]
public override string ReadOuterXml ()
{
- if (validatingReader == null)
- return "";
return validatingReader.ReadOuterXml ();
}
#endif
[MonoTODO]
-#if NET_1_0
- public override string ReadString ()
- {
- return base.ReadStringInternal ();
- }
-#else
public override string ReadString ()
{
- return base.ReadString ();
+ return validatingReader.ReadString ();
}
-#endif
+ [MonoTODO]
public object ReadTypedValue ()
{
- if (dtdReader == null)
- return null;
- XmlSchemaDatatype dt = schemaInfo.SchemaType as XmlSchemaDatatype;
- if (dt == null)
- return null;
- switch (NodeType) {
- case XmlNodeType.Element:
- if (IsEmptyElement)
- return null;
-
- storedCharacters.Length = 0;
- bool loop = true;
- do {
- Read ();
- switch (NodeType) {
- case XmlNodeType.SignificantWhitespace:
- case XmlNodeType.Text:
- case XmlNodeType.CDATA:
- storedCharacters.Append (Value);
- break;
- case XmlNodeType.Comment:
- break;
- default:
- loop = false;
- break;
- }
- } while (loop && !EOF);
- return dt.ParseValue (storedCharacters.ToString (), NameTable, dtdReader.ParserContext.NamespaceManager);
- case XmlNodeType.Attribute:
- return dt.ParseValue (Value, NameTable, dtdReader.ParserContext.NamespaceManager);
- }
- return null;
+ throw new NotImplementedException ();
}
public override void ResolveEntity ()
diff --git a/mcs/class/System.XML/System.Xml_test.dll.sources b/mcs/class/System.XML/System.Xml_test.dll.sources
index 998c6064aee..258a1448761 100644
--- a/mcs/class/System.XML/System.Xml_test.dll.sources
+++ b/mcs/class/System.XML/System.Xml_test.dll.sources
@@ -24,8 +24,6 @@ System.Xml/XmlUrlResolverTests.cs
System.Xml/XmlValidatingReaderTests.cs
System.Xml/XmlWhiteSpaceTests.cs
System.Xml/XmlWriterTests.cs
-System.Xml/XsdParticleValidationTests.cs
-System.Xml/XsdValidatingReaderTests.cs
System.Xml.Schema/XmlSchemaTests.cs
System.Xml.Serialization/XmlSerializerTests.cs
System.Xml.Serialization/XmlSerializerTestClasses.cs
diff --git a/mcs/class/System.XML/Test/System.Xml/ChangeLog b/mcs/class/System.XML/Test/System.Xml/ChangeLog
index b101614713e..d086d7c8591 100644
--- a/mcs/class/System.XML/Test/System.Xml/ChangeLog
+++ b/mcs/class/System.XML/Test/System.Xml/ChangeLog
@@ -1,18 +1,3 @@
-2003-08-24 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
-
- * XmlAttributeTests.cs : Added DefaultAttributeRemoval() and
- EmptyStringHasTextNode().
- * XmlElementTests.cs : Added RemoveDoesNotRemoveDefaultAttributes().
- * XmlReaderCommonTests.cs : Added overroaded AssertNodeValues() and
- ReadAttributeValue().
- * XmlTextReaderTests.cs :
- Added NotAllowedCharRef() and ExpandParameterEntity().
- Also added but ignored tests: UndeclaredEntityInIntSubsetOnlyXml()
- and UndeclaredEntityInStandaloneXml().
- * XmlValidatingReaderTests.cs : TestAttributeDefaultContribution()
- refactory.
- * Added XsdParticleValidationTests.cs and XsdValidatingReaderTests.cs.
-
2003-08-05 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
* XmlReaderCommonTests.cs : Its XmlValidatingReader.EntityHandling
diff --git a/mcs/class/System.XML/Test/System.Xml/XmlAttributeTests.cs b/mcs/class/System.XML/Test/System.Xml/XmlAttributeTests.cs
index 929351cf0a7..188bcd19d14 100644
--- a/mcs/class/System.XML/Test/System.Xml/XmlAttributeTests.cs
+++ b/mcs/class/System.XML/Test/System.Xml/XmlAttributeTests.cs
@@ -225,7 +225,7 @@ namespace MonoTests.System.Xml
doc.DocumentElement.LastChild.Attributes.SetNamedItem (attr);
AssertNotNull (doc.GetElementById ("id1"));
XmlElement elem2 = doc.GetElementById ("id2");
- // MS.NET BUG: it doesn't remove replaced attribute with SetNamedItem!
+ // MS.NET BUG: it doesn't removes replaced attribute with SetNamedItem!
// AssertNull (elem2);
// AssertEquals ("2", elem2.GetAttribute ("bar"));
// elem2.RemoveAttribute ("foo");
@@ -258,51 +258,5 @@ namespace MonoTests.System.Xml
AssertNull (doc.GetElementById ("id2"));
AssertNull (doc.GetElementById ("id3"));
}
-
- int removeAllStep;
- [Test]
- public void DefaultAttributeRemoval ()
- {
- XmlDocument doc = new XmlDocument ();
- doc.LoadXml ("<!DOCTYPE root [<!ELEMENT root (#PCDATA)><!ATTLIST root foo CDATA 'foo-def'>]><root></root>");
- doc.NodeInserted += new XmlNodeChangedEventHandler (OnInsert);
- doc.NodeChanged += new XmlNodeChangedEventHandler (OnChange);
- doc.NodeRemoved += new XmlNodeChangedEventHandler (OnRemove);
- doc.DocumentElement.RemoveAll ();
- }
-
- private void OnInsert (object o, XmlNodeChangedEventArgs e)
- {
- if (removeAllStep == 1)
- AssertEquals (XmlNodeType.Text, e.Node.NodeType);
- else if (removeAllStep == 2) {
- AssertEquals ("foo", e.Node.Name);
- Assert (! ((XmlAttribute) e.Node).Specified);
- }
- else
- Fail ();
- removeAllStep++;
- }
- private void OnChange (object o, XmlNodeChangedEventArgs e)
- {
- Fail ("Should not be called.");
- }
- private void OnRemove (object o, XmlNodeChangedEventArgs e)
- {
- AssertEquals (0, removeAllStep);
- AssertEquals ("foo", e.Node.Name);
- removeAllStep++;
- }
-
- [Test]
- public void EmptyStringHasTextNode ()
- {
- doc.LoadXml ("<root attr=''/>");
- XmlAttribute attr = doc.DocumentElement.GetAttributeNode ("attr");
- AssertNotNull (attr);
- AssertEquals (1, attr.ChildNodes.Count);
- AssertEquals (XmlNodeType.Text, attr.ChildNodes [0].NodeType);
- AssertEquals (String.Empty, attr.ChildNodes [0].Value);
- }
}
}
diff --git a/mcs/class/System.XML/Test/System.Xml/XmlElementTests.cs b/mcs/class/System.XML/Test/System.Xml/XmlElementTests.cs
index ed9b3ea6fb4..419ccc17d48 100644
--- a/mcs/class/System.XML/Test/System.Xml/XmlElementTests.cs
+++ b/mcs/class/System.XML/Test/System.Xml/XmlElementTests.cs
@@ -244,23 +244,6 @@ namespace MonoTests.System.Xml
}
[Test]
- public void RemoveDoesNotRemoveDefaultAttributes ()
- {
- string dtd = "<!DOCTYPE root [<!ELEMENT root EMPTY><!ATTLIST root foo CDATA 'def' bar CDATA #IMPLIED>]>";
- string xml = dtd + "<root bar='baz' />";
- XmlValidatingReader xvr = new XmlValidatingReader (xml, XmlNodeType.Document, null);
- document.Load (xvr);
- AssertNotNull (document.DocumentElement);
- AssertEquals (2, document.DocumentElement.Attributes.Count);
- AssertEquals ("baz", document.DocumentElement.GetAttribute ("bar"));
- AssertEquals ("def", document.DocumentElement.GetAttribute ("foo"));
- document.DocumentElement.RemoveAll ();
- AssertEquals (1, document.DocumentElement.Attributes.Count);
- AssertEquals ("def", document.DocumentElement.GetAttribute ("foo"));
- AssertEquals (String.Empty, document.DocumentElement.GetAttribute ("bar"));
- }
-
- [Test]
public void SetAttributeNode ()
{
XmlDocument xmlDoc = new XmlDocument ();
diff --git a/mcs/class/System.XML/Test/System.Xml/XmlReaderCommonTests.cs b/mcs/class/System.XML/Test/System.Xml/XmlReaderCommonTests.cs
index a3e8d530302..909329c19f6 100644
--- a/mcs/class/System.XML/Test/System.Xml/XmlReaderCommonTests.cs
+++ b/mcs/class/System.XML/Test/System.Xml/XmlReaderCommonTests.cs
@@ -76,24 +76,8 @@ namespace MonoTests.System.Xml
string value,
int attributeCount)
{
- AssertNodeValues (xmlReader, nodeType, depth, isEmptyElement, name, prefix, localName, namespaceURI, value, value != String.Empty, attributeCount, attributeCount > 0);
- }
-
- private void AssertNodeValues (
- XmlReader xmlReader,
- XmlNodeType nodeType,
- int depth,
- bool isEmptyElement,
- string name,
- string prefix,
- string localName,
- string namespaceURI,
- string value,
- bool hasValue,
- int attributeCount,
- bool hasAttributes)
- {
AssertEquals ("NodeType", nodeType, xmlReader.NodeType);
+ AssertEquals ("Depth", depth, xmlReader.Depth);
AssertEquals ("IsEmptyElement", isEmptyElement, xmlReader.IsEmptyElement);
AssertEquals ("name", name, xmlReader.Name);
@@ -104,13 +88,11 @@ namespace MonoTests.System.Xml
AssertEquals ("namespaceURI", namespaceURI, xmlReader.NamespaceURI);
- AssertEquals ("Depth", depth, xmlReader.Depth);
-
- AssertEquals ("hasValue", hasValue, xmlReader.HasValue);
+ AssertEquals ("hasValue", (value != String.Empty), xmlReader.HasValue);
AssertEquals ("Value", value, xmlReader.Value);
- AssertEquals ("hasAttributes", hasAttributes, xmlReader.HasAttributes);
+ AssertEquals ("hasAttributes", attributeCount > 0, xmlReader.HasAttributes);
AssertEquals ("attributeCount", attributeCount, xmlReader.AttributeCount);
}
@@ -152,15 +134,15 @@ namespace MonoTests.System.Xml
xtr = new XmlTextReader (new StringReader (xml));
method (xtr);
- xtr = new XmlTextReader (new StringReader (xml));
- XmlValidatingReader xvr = new XmlValidatingReader (xtr);
- xvr.EntityHandling = EntityHandling.ExpandCharEntities;
- method (xvr);
-
document.XmlResolver = null;
document.LoadXml (xml);
xnr = new XmlNodeReader (document);
method (xnr);
+
+ xtr = new XmlTextReader (new StringReader (xml));
+ XmlValidatingReader xvr = new XmlValidatingReader (xtr);
+ xvr.EntityHandling = EntityHandling.ExpandCharEntities;
+ method (xvr);
}
@@ -215,29 +197,6 @@ namespace MonoTests.System.Xml
}
[Test]
- public void ReadAttributeValue ()
- {
- RunTest ("<root attr=''/>", new TestMethod (ReadAttributeValue));
- }
-
- public void ReadAttributeValue (XmlReader reader)
- {
- reader.Read (); // root
- Assert (reader.MoveToFirstAttribute ());
- // It looks like that MS.NET shows AttributeCount and
- // HasAttributes as the same as element node!
- this.AssertNodeValues (reader, XmlNodeType.Attribute,
- 1, false, "attr", "", "attr", "", "", true, 1, true);
- Assert (reader.ReadAttributeValue ());
- // MS.NET XmlNodeReader fails. Its Prefix returns "" instead of null.
- this.AssertNodeValues (reader, XmlNodeType.Text,
- 2, false, "", null, "", null, "", true, 1, true);
- reader.MoveToElement ();
- this.AssertNodeValues (reader, XmlNodeType.Element,
- 0, true, "root", "", "root", "", "", false, 1, true);
- }
-
- [Test]
public void ReadEmptyElement ()
{
RunTest (xml2, new TestMethod (ReadEmptyElement));
@@ -1233,7 +1192,7 @@ namespace MonoTests.System.Xml
Assert (xmlReader.Read ());
AssertEquals ("1.0", xmlReader ["version"]);
AssertEquals ("1.0", xmlReader.GetAttribute ("version"));
- // .NET 1.1 BUG. XmlTextReader returns null, while XmlNodeReader returns "".
+ // XmlTextReader returns null, while XmlNodeReader returns "".
AssertEquals (null, xmlReader ["encoding"]);
AssertEquals (null, xmlReader.GetAttribute ("encoding"));
AssertEquals ("no", xmlReader ["standalone"]);
diff --git a/mcs/class/System.XML/Test/System.Xml/XmlTextReaderTests.cs b/mcs/class/System.XML/Test/System.Xml/XmlTextReaderTests.cs
index 47a452faff4..1b270705e25 100644
--- a/mcs/class/System.XML/Test/System.Xml/XmlTextReaderTests.cs
+++ b/mcs/class/System.XML/Test/System.Xml/XmlTextReaderTests.cs
@@ -458,188 +458,188 @@ namespace MonoTests.System.Xml
AssertEquals ("initial.NodeType", XmlNodeType.None, reader.NodeType);
}
- [Test]
- public void EntityReference ()
- {
- string xml = "<foo>&bar;</foo>";
- XmlReader xmlReader = new XmlTextReader (new StringReader (xml));
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 0, //depth
- false, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 0 // attributeCount
- );
-
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.EntityReference, // nodeType
- 1, //depth
- false, // isEmptyElement
- "bar", // name
- String.Empty, // prefix
- "bar", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 0 // attributeCount
- );
-
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.EndElement, // nodeType
- 0, //depth
- false, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 0 // attributeCount
- );
-
- AssertEndDocument (xmlReader);
- }
-
- [Test]
- public void EntityReferenceInsideText ()
- {
- string xml = "<foo>bar&baz;quux</foo>";
- XmlReader xmlReader = new XmlTextReader (new StringReader (xml));
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 0, //depth
- false, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 0 // attributeCount
- );
-
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.Text, // nodeType
- 1, //depth
- false, // isEmptyElement
- String.Empty, // name
- String.Empty, // prefix
- String.Empty, // localName
- String.Empty, // namespaceURI
- "bar", // value
- 0 // attributeCount
- );
-
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.EntityReference, // nodeType
- 1, //depth
- false, // isEmptyElement
- "baz", // name
- String.Empty, // prefix
- "baz", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 0 // attributeCount
- );
-
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.Text, // nodeType
- 1, //depth
- false, // isEmptyElement
- String.Empty, // name
- String.Empty, // prefix
- String.Empty, // localName
- String.Empty, // namespaceURI
- "quux", // value
- 0 // attributeCount
- );
-
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.EndElement, // nodeType
- 0, //depth
- false, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 0 // attributeCount
- );
-
- AssertEndDocument (xmlReader);
- }
-
- [Test]
- [ExpectedException (typeof (XmlException))]
- public void XmlDeclAfterWhitespace ()
- {
- XmlTextReader xtr = new XmlTextReader (
- " <?xml version='1.0' ?><root />",
- XmlNodeType.Document,
- null);
- xtr.Read (); // ws
- xtr.Read (); // not-wf xmldecl
- }
-
- [Test]
- [ExpectedException (typeof (XmlException))]
- public void XmlDeclAfterComment ()
- {
- XmlTextReader xtr = new XmlTextReader (
- "<!-- comment --><?xml version='1.0' ?><root />",
- XmlNodeType.Document,
- null);
- xtr.Read (); // comment
- xtr.Read (); // not-wf xmldecl
- }
-
- [Test]
- [ExpectedException (typeof (XmlException))]
- public void XmlDeclAfterProcessingInstruction ()
- {
- XmlTextReader xtr = new XmlTextReader (
- "<?myPI let it go ?><?xml version='1.0' ?><root />",
- XmlNodeType.Document,
- null);
- xtr.Read (); // PI
- xtr.Read (); // not-wf xmldecl
- }
-
- [Test]
- [ExpectedException (typeof (XmlException))]
- public void StartsFromEndElement ()
- {
- XmlTextReader xtr = new XmlTextReader (
- "</root>",
- XmlNodeType.Document,
- null);
- xtr.Read ();
- }
-
- [Test]
- public void ReadAsElementContent ()
- {
- XmlTextReader xtr = new XmlTextReader (
- "<foo /><bar />", XmlNodeType.Element, null);
- xtr.Read ();
- }
-
- [Test]
- public void ReadAsAttributeContent ()
- {
- XmlTextReader xtr = new XmlTextReader (
- "test", XmlNodeType.Attribute, null);
- xtr.Read ();
- }
+ [Test]
+ public void EntityReference ()
+ {
+ string xml = "<foo>&bar;</foo>";
+ XmlReader xmlReader = new XmlTextReader (new StringReader (xml));
+ AssertNode (
+ xmlReader, // xmlReader
+ XmlNodeType.Element, // nodeType
+ 0, //depth
+ false, // isEmptyElement
+ "foo", // name
+ String.Empty, // prefix
+ "foo", // localName
+ String.Empty, // namespaceURI
+ String.Empty, // value
+ 0 // attributeCount
+ );
+
+ AssertNode (
+ xmlReader, // xmlReader
+ XmlNodeType.EntityReference, // nodeType
+ 1, //depth
+ false, // isEmptyElement
+ "bar", // name
+ String.Empty, // prefix
+ "bar", // localName
+ String.Empty, // namespaceURI
+ String.Empty, // value
+ 0 // attributeCount
+ );
+
+ AssertNode (
+ xmlReader, // xmlReader
+ XmlNodeType.EndElement, // nodeType
+ 0, //depth
+ false, // isEmptyElement
+ "foo", // name
+ String.Empty, // prefix
+ "foo", // localName
+ String.Empty, // namespaceURI
+ String.Empty, // value
+ 0 // attributeCount
+ );
+
+ AssertEndDocument (xmlReader);
+ }
+
+ [Test]
+ public void EntityReferenceInsideText ()
+ {
+ string xml = "<foo>bar&baz;quux</foo>";
+ XmlReader xmlReader = new XmlTextReader (new StringReader (xml));
+ AssertNode (
+ xmlReader, // xmlReader
+ XmlNodeType.Element, // nodeType
+ 0, //depth
+ false, // isEmptyElement
+ "foo", // name
+ String.Empty, // prefix
+ "foo", // localName
+ String.Empty, // namespaceURI
+ String.Empty, // value
+ 0 // attributeCount
+ );
+
+ AssertNode (
+ xmlReader, // xmlReader
+ XmlNodeType.Text, // nodeType
+ 1, //depth
+ false, // isEmptyElement
+ String.Empty, // name
+ String.Empty, // prefix
+ String.Empty, // localName
+ String.Empty, // namespaceURI
+ "bar", // value
+ 0 // attributeCount
+ );
+
+ AssertNode (
+ xmlReader, // xmlReader
+ XmlNodeType.EntityReference, // nodeType
+ 1, //depth
+ false, // isEmptyElement
+ "baz", // name
+ String.Empty, // prefix
+ "baz", // localName
+ String.Empty, // namespaceURI
+ String.Empty, // value
+ 0 // attributeCount
+ );
+
+ AssertNode (
+ xmlReader, // xmlReader
+ XmlNodeType.Text, // nodeType
+ 1, //depth
+ false, // isEmptyElement
+ String.Empty, // name
+ String.Empty, // prefix
+ String.Empty, // localName
+ String.Empty, // namespaceURI
+ "quux", // value
+ 0 // attributeCount
+ );
+
+ AssertNode (
+ xmlReader, // xmlReader
+ XmlNodeType.EndElement, // nodeType
+ 0, //depth
+ false, // isEmptyElement
+ "foo", // name
+ String.Empty, // prefix
+ "foo", // localName
+ String.Empty, // namespaceURI
+ String.Empty, // value
+ 0 // attributeCount
+ );
+
+ AssertEndDocument (xmlReader);
+ }
+
+ [Test]
+ [ExpectedException (typeof (XmlException))]
+ public void XmlDeclAfterWhitespace ()
+ {
+ XmlTextReader xtr = new XmlTextReader (
+ " <?xml version='1.0' ?><root />",
+ XmlNodeType.Document,
+ null);
+ xtr.Read (); // ws
+ xtr.Read (); // not-wf xmldecl
+ }
+
+ [Test]
+ [ExpectedException (typeof (XmlException))]
+ public void XmlDeclAfterComment ()
+ {
+ XmlTextReader xtr = new XmlTextReader (
+ "<!-- comment --><?xml version='1.0' ?><root />",
+ XmlNodeType.Document,
+ null);
+ xtr.Read (); // comment
+ xtr.Read (); // not-wf xmldecl
+ }
+
+ [Test]
+ [ExpectedException (typeof (XmlException))]
+ public void XmlDeclAfterProcessingInstruction ()
+ {
+ XmlTextReader xtr = new XmlTextReader (
+ "<?myPI let it go ?><?xml version='1.0' ?><root />",
+ XmlNodeType.Document,
+ null);
+ xtr.Read (); // PI
+ xtr.Read (); // not-wf xmldecl
+ }
+
+ [Test]
+ [ExpectedException (typeof (XmlException))]
+ public void StartsFromEndElement ()
+ {
+ XmlTextReader xtr = new XmlTextReader (
+ "</root>",
+ XmlNodeType.Document,
+ null);
+ xtr.Read ();
+ }
+
+ [Test]
+ public void ReadAsElementContent ()
+ {
+ XmlTextReader xtr = new XmlTextReader (
+ "<foo /><bar />", XmlNodeType.Element, null);
+ xtr.Read ();
+ }
+
+ [Test]
+ public void ReadAsAttributeContent ()
+ {
+ XmlTextReader xtr = new XmlTextReader (
+ "test", XmlNodeType.Attribute, null);
+ xtr.Read ();
+ }
[Test]
public void ExternalDocument ()
@@ -647,58 +647,5 @@ namespace MonoTests.System.Xml
XmlDocument doc = new XmlDocument ();
doc.Load ("XmlFiles/nested-dtd-test.xml");
}
-
- // MS.NET 1.0 fails this test.
- [Test]
- [ExpectedException (typeof (XmlException))]
- public void NotAllowedCharRef ()
- {
- string xml = "<root>&#0;</root>";
- XmlTextReader xtr = new XmlTextReader (xml, XmlNodeType.Document, null);
- xtr.Read ();
- xtr.Read ();
- }
-
- [Test]
- [ExpectedException (typeof (XmlException))]
- [Ignore ("MS.NET 1.0 fails this test. The related spec is XML rec. 4.1")]
- public void UndeclaredEntityInIntSubsetOnlyXml ()
- {
- string ent2 = "<!ENTITY ent2 '<foo/><foo/>'>]>";
- string dtd = "<!DOCTYPE root[<!ELEMENT root (#PCDATA|foo)*>" + ent2;
- string xml = dtd + "<root>&ent;&ent2;</root>";
- XmlTextReader xtr = new XmlTextReader (xml, XmlNodeType.Document, null);
- while (!xtr.EOF)
- xtr.Read ();
- }
-
- [Test]
- [ExpectedException (typeof (XmlException))]
- [Ignore ("MS.NET 1.0 fails this test. The related spec is XML rec. 4.1")]
- public void UndeclaredEntityInStandaloneXml ()
- {
- string ent2 = "<!ENTITY ent2 '<foo/><foo/>'>]>";
- string dtd = "<!DOCTYPE root[<!ELEMENT root (#PCDATA|foo)*>" + ent2;
- string xml = "<?xml version='1.0' standalone='yes' ?>"
- + dtd + "<root>&ent;</root>";
- XmlTextReader xtr = new XmlTextReader (xml, XmlNodeType.Document, null);
- while (!xtr.EOF)
- xtr.Read ();
- }
-
- [Test]
- public void ExpandParameterEntity ()
- {
- string ent = "<!ENTITY foo \"foo-def\">";
- string pe = "<!ENTITY % pe '" + ent + "'>";
- string eldecl = "<!ELEMENT root ANY>";
- string dtd = "<!DOCTYPE root[" + eldecl + pe + "%pe;]>";
- string xml = dtd + "<root/>";
- XmlDocument doc = new XmlDocument ();
- doc.LoadXml (xml);
- XmlEntity foo = doc.DocumentType.Entities.GetNamedItem ("foo") as XmlEntity;
- AssertNotNull (foo);
- AssertEquals ("foo-def", foo.InnerText);
- }
}
}
diff --git a/mcs/class/System.XML/Test/System.Xml/XmlValidatingReaderTests.cs b/mcs/class/System.XML/Test/System.Xml/XmlValidatingReaderTests.cs
index fc76383d39b..efd6bdf0fe8 100644
--- a/mcs/class/System.XML/Test/System.Xml/XmlValidatingReaderTests.cs
+++ b/mcs/class/System.XML/Test/System.Xml/XmlValidatingReaderTests.cs
@@ -347,23 +347,12 @@ namespace MonoTests.System.Xml
string intSubset = "<!ELEMENT root EMPTY><!ATTLIST root foo CDATA 'foo-def' bar CDATA 'bar-def'>";
string dtd = "<!DOCTYPE root [" + intSubset + "]>";
string xml = dtd + "<root />";
-
dvr = PrepareXmlReader (xml);
dvr.ValidationType = ValidationType.DTD;
- this.TestAttributeDefaultContributionInternal (dvr);
-
- dvr = PrepareXmlReader (xml);
- dvr.ValidationType = ValidationType.None;
- this.TestAttributeDefaultContributionInternal (dvr);
- }
-
- private void TestAttributeDefaultContributionInternal (XmlReader dvr)
- {
dvr.Read (); // DTD
dvr.Read ();
AssertEquals (XmlNodeType.Element, dvr.NodeType);
AssertEquals ("root", dvr.Name);
- AssertEquals (2, dvr.AttributeCount);
// foo
Assert (dvr.MoveToFirstAttribute ());
AssertEquals ("foo", dvr.Name);
@@ -384,6 +373,36 @@ namespace MonoTests.System.Xml
AssertEquals (XmlNodeType.Text, dvr.NodeType);
AssertEquals ("", dvr.Name);
AssertEquals ("bar-def", dvr.Value);
+
+ // ValidationType = None
+
+ dvr = PrepareXmlReader (xml);
+ dvr.ValidationType = ValidationType.None;
+ dvr.Read (); // DTD
+ dvr.Read ();
+ AssertEquals (XmlNodeType.Element, dvr.NodeType);
+ AssertEquals ("root", dvr.Name);
+ // foo
+ Assert (dvr.MoveToFirstAttribute ());
+ AssertEquals ("foo", dvr.Name);
+ AssertNotNull (dvr ["foo"]);
+ AssertNotNull (dvr ["bar"]);
+ AssertEquals ("foo-def", dvr.Value);
+ Assert (dvr.ReadAttributeValue ());
+ AssertEquals (XmlNodeType.Text, dvr.NodeType);
+ AssertEquals ("", dvr.Name);
+ AssertEquals ("foo-def", dvr.Value);
+ // bar
+ Assert (dvr.MoveToNextAttribute ());
+ AssertEquals ("bar", dvr.Name);
+ AssertEquals ("bar-def", dvr.Value);
+ AssertNotNull (dvr ["foo"]);
+ AssertNotNull (dvr ["bar"]);
+ AssertEquals ("bar", dvr.Name);
+ Assert (dvr.ReadAttributeValue ());
+ AssertEquals (XmlNodeType.Text, dvr.NodeType);
+ AssertEquals ("", dvr.Name);
+ AssertEquals ("bar-def", dvr.Value);
}
[Test]
diff --git a/mcs/class/System.XML/Test/System.Xml/XsdParticleValidationTests.cs b/mcs/class/System.XML/Test/System.Xml/XsdParticleValidationTests.cs
deleted file mode 100644
index f6462e28197..00000000000
--- a/mcs/class/System.XML/Test/System.Xml/XsdParticleValidationTests.cs
+++ /dev/null
@@ -1,219 +0,0 @@
-//
-// MonoTests.System.Xml.XsdParticleValidationTests.cs
-//
-// Author:
-// Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
-//
-// (C)2003 Atsushi Enomoto
-//
-using System;
-using System.Xml;
-using System.Xml.Schema;
-using NUnit.Framework;
-
-namespace MonoTests.System.Xml
-{
-// using XmlValidatingReader = XmlTextReader;
-
- [TestFixture]
- public class XsdValidatingReaderTests : Assertion
- {
- XmlSchema schema;
- XmlReader xr;
- XmlValidatingReader xvr;
-
- private void PrepareReader1 (string xsdUrl, string xml)
- {
- schema = XmlSchema.Read (new XmlTextReader ("XmlFiles/XsdValidation/" + xsdUrl), null);
- xr = new XmlTextReader (xml, XmlNodeType.Document, null);
- xvr = new XmlValidatingReader (xr);
- xvr.Schemas.Add (schema);
-// xvr = xr as XmlValidatingReader;
- }
-
- [Test]
- public void ValidateRootElementOnlyValid ()
- {
- PrepareReader1 ("1.xsd", "<root xmlns='urn:foo' />");
- xvr.Read ();
- }
-
- [Test]
- [ExpectedException (typeof (XmlSchemaException))]
- public void ValidateRootElementOnlyInvalid ()
- {
- PrepareReader1 ("1.xsd", "<invalid xmlns='urn:foo' />");
- xvr.Read ();
- }
-
- [Test]
- [ExpectedException (typeof (XmlSchemaException))]
- public void ValidateRootElementOnlyInvalid2 ()
- {
- PrepareReader1 ("1.xsd", "<root xmlns='urn:foo'><invalid_child/></root>");
- xvr.Read ();
- xvr.Read ();
- }
-
- [Test]
- public void ValidateElementContainsElementValid1 ()
- {
- PrepareReader1 ("2.xsd", "<root xmlns='urn:foo'><child/></root>");
- while (!xvr.EOF)
- xvr.Read ();
- }
-
- [Test]
- public void ValidateElementContainsElementValid2 ()
- {
- PrepareReader1 ("2.xsd", "<root xmlns='urn:foo'><child/><child/></root>");
- while (!xvr.EOF)
- xvr.Read ();
- }
-
- [Test]
- [ExpectedException (typeof (XmlSchemaException))]
- public void ValidateElementContainsElementInvalid1 ()
- {
- PrepareReader1 ("2.xsd", "<root xmlns='urn:foo'></root>");
- while (!xvr.EOF)
- xvr.Read ();
- }
-
- [Test]
- [ExpectedException (typeof (XmlSchemaException))]
- public void ValidateElementContainsElementInvalid2 ()
- {
- PrepareReader1 ("2.xsd", "<root xmlns='urn:foo'><child/><child/><child/></root>");
- while (!xvr.EOF)
- xvr.Read ();
- }
-
- [Test]
- public void ValidateSequenceValid ()
- {
- PrepareReader1 ("3.xsd", "<root xmlns='urn:foo'><child1/><child2/></root>");
- while (!xvr.EOF)
- xvr.Read ();
-
- PrepareReader1 ("3.xsd", "<root xmlns='urn:foo'><child1/><child2/><child1/><child2/></root>");
- while (!xvr.EOF)
- xvr.Read ();
- }
-
- [Test]
- [ExpectedException (typeof (XmlSchemaException))]
- public void ValidateSequenceInvalid1 ()
- {
- PrepareReader1 ("3.xsd", "<root xmlns='urn:foo'></root>");
- while (!xvr.EOF)
- xvr.Read ();
- }
-
- [Test]
- [ExpectedException (typeof (XmlSchemaException))]
- public void ValidateSequenceInvalid2 ()
- {
- PrepareReader1 ("3.xsd", "<root xmlns='urn:foo'><child1/></root>");
- while (!xvr.EOF)
- xvr.Read ();
- }
-
- [Test]
- [ExpectedException (typeof (XmlSchemaException))]
- public void ValidateSequenceInvalid3 ()
- {
- PrepareReader1 ("3.xsd", "<root xmlns='urn:foo'><child1/><child2/><child1/></root>");
- while (!xvr.EOF)
- xvr.Read ();
- }
-
- [Test]
- [ExpectedException (typeof (XmlSchemaException))]
- public void ValidateSequenceInvalid4 ()
- {
- PrepareReader1 ("3.xsd", "<root xmlns='urn:foo'><child1/><child2/><child1/><child2/><child1/></root>");
- while (!xvr.EOF)
- xvr.Read ();
- }
-
- [Test]
- [ExpectedException (typeof (XmlSchemaException))]
- public void ValidateSequenceInvalid5 ()
- {
- PrepareReader1 ("3.xsd", "<root xmlns='urn:foo'><child1/><child2/><child1/><child2/><child1/><child2/></root>");
- while (!xvr.EOF)
- xvr.Read ();
- }
-
- [Test]
- public void ValidateChoiceValid ()
- {
- PrepareReader1 ("4.xsd", "<root xmlns='urn:foo'><child1/></root>");
- while (!xvr.EOF)
- xvr.Read ();
-
- PrepareReader1 ("4.xsd", "<root xmlns='urn:foo'><child2/></root>");
- while (!xvr.EOF)
- xvr.Read ();
-
- PrepareReader1 ("4.xsd", "<root xmlns='urn:foo'><child1/><child2/></root>");
- while (!xvr.EOF)
- xvr.Read ();
-
- PrepareReader1 ("4.xsd", "<root xmlns='urn:foo'><child2/><child2/></root>");
- while (!xvr.EOF)
- xvr.Read ();
-
- PrepareReader1 ("4.xsd", "<root xmlns='urn:foo'><child2/><child2/><child2/><child2/></root>");
- while (!xvr.EOF)
- xvr.Read ();
-
- PrepareReader1 ("4.xsd", "<root xmlns='urn:foo'><child2/><child2/><child1/></root>");
- while (!xvr.EOF)
- xvr.Read ();
-
- PrepareReader1 ("4.xsd", "<root xmlns='urn:foo'></root>");
- while (!xvr.EOF)
- xvr.Read ();
-
- }
-
- [Test]
- [ExpectedException (typeof (XmlSchemaException))]
- public void ValidateChoiceInvalid1 ()
- {
- PrepareReader1 ("4.xsd", "<root xmlns='urn:foo'><child1/><child1/><child1/></root>");
- while (!xvr.EOF)
- xvr.Read ();
- }
-
- [Test]
- [ExpectedException (typeof (XmlSchemaException))]
- public void ValidateChoiceInvalid2 ()
- {
- PrepareReader1 ("3.xsd", "<root xmlns='urn:foo'><child2/><child2/><child2/><child2/><child2/></root>");
- while (!xvr.EOF)
- xvr.Read ();
- }
-
- [Test]
- [ExpectedException (typeof (XmlSchemaException))]
- public void ValidateChoiceInvalid3 ()
- {
- PrepareReader1 ("3.xsd", "<root xmlns='urn:foo'><child2/><child2/><child2/><child1/></root>");
- while (!xvr.EOF)
- xvr.Read ();
- }
-
- [Test]
- [ExpectedException (typeof (XmlSchemaException))]
- public void ValidateChoiceInvalid4 ()
- {
- PrepareReader1 ("3.xsd", "<root xmlns='urn:foo'><child1/><child2/><child2/><child2/></root>");
- while (!xvr.EOF)
- xvr.Read ();
- }
-
- }
-}
diff --git a/mcs/class/System.XML/Test/System.Xml/XsdValidatingReaderTests.cs b/mcs/class/System.XML/Test/System.Xml/XsdValidatingReaderTests.cs
deleted file mode 100644
index 4c7313bbf0b..00000000000
--- a/mcs/class/System.XML/Test/System.Xml/XsdValidatingReaderTests.cs
+++ /dev/null
@@ -1,184 +0,0 @@
-//
-// MonoTests.System.Xml.XsdValidatingReaderTests.cs
-//
-// Author:
-// Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
-//
-// (C)2003 Atsushi Enomoto
-//
-using System;
-using System.Xml;
-using System.Xml.Schema;
-using NUnit.Framework;
-
-namespace MonoTests.System.Xml
-{
- [TestFixture]
- public class XsdValidationTests : Assertion
- {
- public XsdValidationTests ()
- {
- }
-
- XmlReader xtr;
- XmlValidatingReader xvr;
-
- private XmlValidatingReader PrepareXmlReader (string xml)
- {
- XmlReader reader = new XmlTextReader (xml, XmlNodeType.Document, null);
-// XmlDocument doc = new XmlDocument ();
-// doc.LoadXml (xml);
-// XmlReader reader = new XmlNodeReader (doc);
-
- return new XmlValidatingReader (reader);
- }
-
- [Test]
- public void TestEmptySchema ()
- {
- string xml = "<root/>";
- xvr = PrepareXmlReader (xml);
- xvr.ValidationType = ValidationType.Schema;
- xvr.Read (); // Is is missing schema component.
- }
-
- [Test]
- public void TestSimpleValidation ()
- {
- string xml = "<root/>";
- xvr = PrepareXmlReader (xml);
- AssertEquals (ValidationType.Auto, xvr.ValidationType);
- XmlSchema schema = new XmlSchema ();
- XmlSchemaElement elem = new XmlSchemaElement ();
- elem.Name = "root";
- schema.Items.Add (elem);
- xvr.Schemas.Add (schema);
- xvr.Read (); // root
- AssertEquals (ValidationType.Auto, xvr.ValidationType);
- xvr.Read (); // EOF
-
- xml = "<hoge/>";
- xvr = PrepareXmlReader (xml);
- xvr.Schemas.Add (schema);
- try {
- xvr.Read ();
- Fail ();
- } catch (XmlSchemaException) {
- }
-
- xml = "<hoge xmlns='urn:foo' />";
- xvr = PrepareXmlReader (xml);
- xvr.Schemas.Add (schema);
- try {
- xvr.Read ();
- Fail ();
- } catch (XmlSchemaException) {
- }
- }
-
- [Test]
- public void TestReadTypedValueSimple ()
- {
- string xml = "<root>12</root>";
- XmlSchema schema = new XmlSchema ();
- XmlSchemaElement elem = new XmlSchemaElement ();
- elem.Name = "root";
- elem.SchemaTypeName = new XmlQualifiedName ("integer", XmlSchema.Namespace);
- schema.Items.Add (elem);
-
- // Lap 1:
-
- xvr = PrepareXmlReader (xml);
- xvr.Schemas.Add (schema);
- // Read directly from root.
- object o = xvr.ReadTypedValue ();
- AssertEquals (ReadState.Initial, xvr.ReadState);
- AssertNull (o);
-
- xvr.Read (); // element root
- AssertEquals (XmlNodeType.Element, xvr.NodeType);
- o = xvr.ReadTypedValue (); // read "12"
- AssertEquals (XmlNodeType.EndElement, xvr.NodeType);
- AssertNotNull (o);
- AssertEquals (typeof (decimal), o.GetType ());
- decimal n = (decimal) o;
- AssertEquals (12, n);
- Assert (!xvr.EOF);
- AssertEquals ("root", xvr.Name);
- AssertNull (xvr.SchemaType); // EndElement's type
-
- // Lap 2:
-
- xvr = PrepareXmlReader (xml);
- xvr.Schemas.Add (schema);
- xvr.Read (); // root
- XmlSchemaDatatype dt = xvr.SchemaType as XmlSchemaDatatype;
- AssertNotNull (dt);
- AssertEquals (typeof (decimal), dt.ValueType);
- AssertEquals (XmlTokenizedType.None, dt.TokenizedType);
- xvr.Read (); // text "12"
- AssertNull (xvr.SchemaType);
- o = xvr.ReadTypedValue ();
- // ReadTypedValue is different from ReadString().
- AssertNull (o);
- }
-
- [Test]
- public void TestNamespacesFalse ()
- {
- // This tests if Namespaces=false is specified, then
- // the reader's NamespaceURI should be always string.Empty and
- // validation should be done against such schema that has target ns as "".
- string xml = "<x:root xmlns:x='urn:foo' />";
- xvr = PrepareXmlReader (xml);
- xvr.Namespaces = false;
- AssertEquals (ValidationType.Auto, xvr.ValidationType);
- XmlSchema schema = new XmlSchema ();
- schema.TargetNamespace = "urn:foo";
- XmlSchemaElement elem = new XmlSchemaElement ();
- elem.Name = "root";
- schema.Items.Add (elem);
- xvr.Schemas.Add (schema);
- xvr.Read (); // root
- Assert (!xvr.Namespaces);
- AssertEquals ("x:root", xvr.Name);
- // LocalName may contain colons.
- AssertEquals ("x:root", xvr.LocalName);
- // NamespaceURI is not supplied.
- AssertEquals ("", xvr.NamespaceURI);
- }
-
- [Test]
- public void TestReadTypedAttributeValue ()
- {
- string xml = "<root attr='12'></root>";
- XmlSchema schema = new XmlSchema ();
- XmlSchemaElement elem = new XmlSchemaElement ();
- elem.Name = "root";
- XmlSchemaComplexType ct = new XmlSchemaComplexType ();
- XmlSchemaAttribute attr = new XmlSchemaAttribute ();
- attr.Name = "attr";
- attr.SchemaTypeName = new XmlQualifiedName ("int", XmlSchema.Namespace);
- ct.Attributes.Add (attr);
- elem.SchemaType = ct;
- schema.Items.Add (elem);
-
- xvr = PrepareXmlReader (xml);
- xvr.Schemas.Add (schema);
- xvr.Read ();
- AssertEquals ("root", xvr.Name);
- Assert (xvr.MoveToNextAttribute ()); // attr
- AssertEquals ("attr", xvr.Name);
- XmlSchemaDatatype dt = xvr.SchemaType as XmlSchemaDatatype;
- AssertNotNull (dt);
- AssertEquals (typeof (int), dt.ValueType);
- AssertEquals (XmlTokenizedType.None, dt.TokenizedType);
- object o = xvr.ReadTypedValue ();
- AssertEquals (XmlNodeType.Attribute, xvr.NodeType);
- AssertEquals (typeof (int), o.GetType ());
- int n = (int) o;
- AssertEquals (12, n);
- Assert (xvr.ReadAttributeValue ()); // can read = seems not proceed.
- }
- }
-}
diff --git a/mcs/class/System.XML/Test/XmlFiles/XsdValidation/1.xsd b/mcs/class/System.XML/Test/XmlFiles/XsdValidation/1.xsd
deleted file mode 100644
index 3716d11faaf..00000000000
--- a/mcs/class/System.XML/Test/XmlFiles/XsdValidation/1.xsd
+++ /dev/null
@@ -1,7 +0,0 @@
-<xs:schema
- xmlns:xs='http://www.w3.org/2001/XMLSchema'
- targetNamespace="urn:foo">
-
-<xs:element name="root" type="xs:string" />
-
-</xs:schema>
diff --git a/mcs/class/System.XML/Test/XmlFiles/XsdValidation/2.xsd b/mcs/class/System.XML/Test/XmlFiles/XsdValidation/2.xsd
deleted file mode 100644
index fb14218655e..00000000000
--- a/mcs/class/System.XML/Test/XmlFiles/XsdValidation/2.xsd
+++ /dev/null
@@ -1,15 +0,0 @@
-<xs:schema
- elementFormDefault="qualified"
- xmlns:xs='http://www.w3.org/2001/XMLSchema'
- xmlns="urn:foo"
- targetNamespace="urn:foo">
-
-<xs:element name="root">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="child" minOccurs="1" maxOccurs="2" />
- </xs:sequence>
- </xs:complexType>
-</xs:element>
-
-</xs:schema>
diff --git a/mcs/class/System.XML/Test/XmlFiles/XsdValidation/3.xsd b/mcs/class/System.XML/Test/XmlFiles/XsdValidation/3.xsd
deleted file mode 100644
index f382bc698a5..00000000000
--- a/mcs/class/System.XML/Test/XmlFiles/XsdValidation/3.xsd
+++ /dev/null
@@ -1,16 +0,0 @@
-<xs:schema
- elementFormDefault="qualified"
- xmlns:xs='http://www.w3.org/2001/XMLSchema'
- xmlns="urn:foo"
- targetNamespace="urn:foo">
-
-<xs:element name="root">
- <xs:complexType>
- <xs:sequence maxOccurs="2">
- <xs:element name="child1" />
- <xs:element name="child2" />
- </xs:sequence>
- </xs:complexType>
-</xs:element>
-
-</xs:schema>
diff --git a/mcs/class/System.XML/Test/XmlFiles/XsdValidation/4.xsd b/mcs/class/System.XML/Test/XmlFiles/XsdValidation/4.xsd
deleted file mode 100644
index 246544a644f..00000000000
--- a/mcs/class/System.XML/Test/XmlFiles/XsdValidation/4.xsd
+++ /dev/null
@@ -1,16 +0,0 @@
-<xs:schema
- elementFormDefault="qualified"
- xmlns:xs='http://www.w3.org/2001/XMLSchema'
- xmlns="urn:foo"
- targetNamespace="urn:foo">
-
-<xs:element name="root">
- <xs:complexType>
- <xs:choice minOccurs="0" maxOccurs="2">
- <xs:element name="child1" />
- <xs:element name="child2" maxOccurs="2" />
- </xs:choice>
- </xs:complexType>
-</xs:element>
-
-</xs:schema>
diff --git a/mcs/class/System.XML/Test/XmlFiles/XsdValidation/ChangeLog b/mcs/class/System.XML/Test/XmlFiles/XsdValidation/ChangeLog
deleted file mode 100644
index 87951fe167f..00000000000
--- a/mcs/class/System.XML/Test/XmlFiles/XsdValidation/ChangeLog
+++ /dev/null
@@ -1,3 +0,0 @@
-2003-08-24 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
-
- * 1.xsd, 2.xsd, 3.xsd, 4.xsd : Initial checkin.
diff --git a/mcs/class/System/Microsoft.CSharp/CSharpCodeGenerator.cs b/mcs/class/System/Microsoft.CSharp/CSharpCodeGenerator.cs
index 2386c51e91f..ab1f346e3f5 100644
--- a/mcs/class/System/Microsoft.CSharp/CSharpCodeGenerator.cs
+++ b/mcs/class/System/Microsoft.CSharp/CSharpCodeGenerator.cs
@@ -202,11 +202,8 @@ namespace Mono.CSharp
protected override void GenerateMethodReferenceExpression( CodeMethodReferenceExpression expression )
{
- if (expression.TargetObject != null)
- {
- GenerateExpression( expression.TargetObject );
- Output.Write( '.' );
- };
+ GenerateExpression( expression.TargetObject );
+ Output.Write( '.' );
Output.Write( GetSafeName (expression.MethodName) );
}
@@ -274,7 +271,6 @@ namespace Mono.CSharp
{
Output.Write( "throw " );
GenerateExpression( statement.ToThrow );
- Output.WriteLine(";");
}
protected override void GenerateComment( CodeComment comment )
@@ -501,10 +497,7 @@ namespace Mono.CSharp
MemberAttributes attributes = method.Attributes;
- if (method.PrivateImplementationType == null)
- {
- OutputMemberAccessModifier( attributes );
- };
+ OutputMemberAccessModifier( attributes );
OutputMemberScopeModifier( attributes );
OutputType( method.ReturnType );
@@ -522,7 +515,7 @@ namespace Mono.CSharp
OutputParameters( method.Parameters );
output.Write( ')' );
- if ( (attributes & MemberAttributes.ScopeMask) == MemberAttributes.Abstract || declaration.IsInterface)
+ if ( (attributes & MemberAttributes.ScopeMask) == MemberAttributes.Abstract )
output.WriteLine( ';' );
else {
output.WriteLine( " {" );
@@ -545,50 +538,30 @@ namespace Mono.CSharp
OutputMemberAccessModifier( attributes );
OutputMemberScopeModifier( attributes );
- if (property.Name == "Item")
- {
- // indexer
-
- OutputTypeNamePair( property.Type, "this");
- output.Write("[");
- OutputParameters(property.Parameters);
- output.Write("]");
- }
- else
- {
- OutputTypeNamePair( property.Type, GetSafeName (property.Name));
- }
+ OutputTypeNamePair( property.Type, GetSafeName (property.Name));
output.WriteLine (" {");
++Indent;
- if (declaration.IsInterface)
+ if (property.HasGet)
{
- if (property.HasGet) output.WriteLine("get; ");
- if (property.HasSet) output.WriteLine("set; ");
- }
- else
- {
- if (property.HasGet)
- {
- output.WriteLine ("get {");
- ++Indent;
-
- GenerateStatements (property.GetStatements);
+ output.WriteLine ("get {");
+ ++Indent;
- --Indent;
- output.WriteLine ("}");
- }
+ GenerateStatements (property.GetStatements);
- if (property.HasSet)
- {
- output.WriteLine ("set {");
- ++Indent;
+ --Indent;
+ output.WriteLine ("}");
+ }
+
+ if (property.HasSet)
+ {
+ output.WriteLine ("set {");
+ ++Indent;
- GenerateStatements (property.SetStatements);
+ GenerateStatements (property.SetStatements);
- --Indent;
- output.WriteLine ("}");
- }
+ --Indent;
+ output.WriteLine ("}");
}
--Indent;
@@ -601,36 +574,7 @@ namespace Mono.CSharp
OutputMemberAccessModifier (constructor.Attributes);
Output.Write (GetSafeName (CurrentTypeName) + " (");
OutputParameters (constructor.Parameters);
- Output.Write (") ");
- if (constructor.ChainedConstructorArgs.Count > 0)
- {
- Output.Write(": this(");
- bool first = true;
- foreach (CodeExpression ex in constructor.ChainedConstructorArgs)
- {
- if (!first)
- Output.Write(", ");
- first = false;
- GenerateExpression(ex);
- }
-
- Output.Write(") ");
- };
- if (constructor.BaseConstructorArgs.Count > 0)
- {
- Output.Write(": base(");
- bool first = true;
- foreach (CodeExpression ex in constructor.BaseConstructorArgs)
- {
- if (!first)
- Output.Write(", ");
- first = false;
- GenerateExpression(ex);
- }
-
- Output.Write(") ");
- };
- Output.WriteLine ("{");
+ Output.WriteLine (") {");
Indent++;
GenerateStatements (constructor.Statements);
Indent--;
diff --git a/mcs/class/System/Microsoft.CSharp/ChangeLog b/mcs/class/System/Microsoft.CSharp/ChangeLog
index a4262284ac4..3910d47b9f9 100644
--- a/mcs/class/System/Microsoft.CSharp/ChangeLog
+++ b/mcs/class/System/Microsoft.CSharp/ChangeLog
@@ -1,20 +1,3 @@
-2003-08-15 Jaroslaw Kowalski <jarek@atm.com.pl>
-
- * CSharpCodeGenerator.cs:
-
- - fixed support for method references where target
- object is null
- - fixed CodeThrowExceptionStatement
- - disabled member access modifiers for private method
- implementations
- - disabled generation of empty method body for interface
- declarations
- - disabled generation of empty property accessor bodies
- in interface declarations
- - added support for indexers (properties named "Item")
- - added support for chained constructor arguments and
- base constructor arguments
-
2003-08-05 Lluis Sanchez Gual <lluis@ximian.com>
* CSharpCodeGenerator.cs: Added method GetSafeName() that checks if
diff --git a/mcs/class/System/System.CodeDom/ChangeLog b/mcs/class/System/System.CodeDom/ChangeLog
index dd4757d1e8c..772703f02d7 100644
--- a/mcs/class/System/System.CodeDom/ChangeLog
+++ b/mcs/class/System/System.CodeDom/ChangeLog
@@ -1,10 +1,3 @@
-2003-08-15 Jaroslaw Kowalski <jarek@atm.com.pl>
-
- * CodeTypeDeclaration.cs:
-
- - TypeAttributes of CodeTypeDeclaration now defaults to
- TypeAttributes.Public (same as MS implementation)
-
2003-04-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* CodeEventReferenceExpression.cs: fixed typo that prevented event
diff --git a/mcs/class/System/System.CodeDom/CodeTypeDeclaration.cs b/mcs/class/System/System.CodeDom/CodeTypeDeclaration.cs
index ab119e30d0e..be0fdc70cff 100755
--- a/mcs/class/System/System.CodeDom/CodeTypeDeclaration.cs
+++ b/mcs/class/System/System.CodeDom/CodeTypeDeclaration.cs
@@ -21,7 +21,7 @@ namespace System.CodeDom
{
private CodeTypeReferenceCollection baseTypes;
private CodeTypeMemberCollection members;
- private TypeAttributes typeAttributes = TypeAttributes.Public;
+ private TypeAttributes typeAttributes;
private bool isEnum;
private bool isStruct;
diff --git a/mcs/class/System/System.Net.Sockets/ChangeLog b/mcs/class/System/System.Net.Sockets/ChangeLog
index efead7ffba8..2138e9a8607 100644
--- a/mcs/class/System/System.Net.Sockets/ChangeLog
+++ b/mcs/class/System/System.Net.Sockets/ChangeLog
@@ -1,8 +1,3 @@
-2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * TcpListener.cs: various fixes to make the new tests pass. Closes
- bug #47848.
-
2003-08-10 Miguel de Icaza <miguel@ximian.com>
* UdpClient.cs (Receive): Fix Bug 45633; We should do a blocking
diff --git a/mcs/class/System/System.Net.Sockets/TcpListener.cs b/mcs/class/System/System.Net.Sockets/TcpListener.cs
index 40e3f7f6877..0a6e598b314 100755
--- a/mcs/class/System/System.Net.Sockets/TcpListener.cs
+++ b/mcs/class/System/System.Net.Sockets/TcpListener.cs
@@ -1,14 +1,13 @@
// System.Net.Sockets.TcpListener.cs
//
-// Authors:
+// Author:
// Phillip Pearson (pp@myelin.co.nz)
-// Gonzalo Paniagua Javier (gonzalo@ximian.com)
//
// Copyright (C) 2001, Phillip Pearson
// http://www.myelin.co.nz
//
-// (c) 2003 Ximian, Inc. (http://www.ximian.com)
-//
+
+// NB: This is untested (probably buggy) code - take care using it
using System;
using System.Net;
@@ -23,21 +22,18 @@ namespace System.Net.Sockets
{
// private data
- bool active;
- Socket server;
- EndPoint savedEP;
+ private bool active;
+ private Socket server;
// constructor
/// <summary>
/// Some code that is shared between the constructors.
/// </summary>
- private void Init (AddressFamily family, EndPoint ep)
+ private void Init (AddressFamily family)
{
active = false;
- savedEP = ep;
server = new Socket(family, SocketType.Stream, ProtocolType.Tcp);
- server.Bind (ep);
}
/// <summary>
@@ -45,15 +41,10 @@ namespace System.Net.Sockets
/// </summary>
/// <param name="port">The port to listen on, e.g. 80 if you
/// are a web server</param>
-#if NET_1_1
- [Obsolete ("Use TcpListener (IPAddress address, int port) instead")]
-#endif
public TcpListener (int port)
{
- if (port < 0 || port > 65535)
- throw new ArgumentOutOfRangeException ("port");
-
- Init (AddressFamily.InterNetwork, new IPEndPoint (IPAddress.Any, port));
+ Init(AddressFamily.InterNetwork);
+ server.Bind(new IPEndPoint(IPAddress.Any, port));
}
/// <summary>
@@ -62,10 +53,8 @@ namespace System.Net.Sockets
/// <param name="local_end_point">The endpoint</param>
public TcpListener (IPEndPoint local_end_point)
{
- if (local_end_point == null)
- throw new ArgumentNullException ("local_end_point");
-
- Init (local_end_point.AddressFamily, local_end_point);
+ Init(local_end_point.AddressFamily);
+ server.Bind(local_end_point);
}
/// <summary>
@@ -76,13 +65,8 @@ namespace System.Net.Sockets
/// <param name="port">The port to listen on</param>
public TcpListener (IPAddress listen_ip, int port)
{
- if (listen_ip == null)
- throw new ArgumentNullException ("listen_ip");
-
- if (port < 0 || port > 65535)
- throw new ArgumentOutOfRangeException ("port");
-
- Init (listen_ip.AddressFamily, new IPEndPoint(listen_ip, port));
+ Init(listen_ip.AddressFamily);
+ server.Bind(new IPEndPoint(listen_ip, port));
}
@@ -102,7 +86,7 @@ namespace System.Net.Sockets
/// </summary>
public EndPoint LocalEndpoint
{
- get { return savedEP; }
+ get { return server.LocalEndPoint; }
}
/// <summary>
@@ -118,13 +102,9 @@ namespace System.Net.Sockets
/// <summary>
/// Accepts a pending connection
- /// </summary>
/// <returns>A Socket object for the new connection</returns>
public Socket AcceptSocket ()
{
- if (!active)
- throw new InvalidOperationException ("Socket is not listening");
-
return server.Accept();
}
@@ -135,9 +115,6 @@ namespace System.Net.Sockets
/// object made from the new socket.</returns>
public TcpClient AcceptTcpClient ()
{
- if (!active)
- throw new InvalidOperationException ("Socket is not listening");
-
TcpClient client = new TcpClient();
// use internal method SetTcpClient to make a
// client with the specified socket
@@ -150,8 +127,9 @@ namespace System.Net.Sockets
/// </summary>
~TcpListener ()
{
- if (active)
+ if (active == true) {
Stop();
+ }
}
/// <returns>
@@ -160,9 +138,6 @@ namespace System.Net.Sockets
/// </returns>
public bool Pending ()
{
- if (!active)
- throw new InvalidOperationException ("Socket is not listening");
-
return server.Poll(1000, SelectMode.SelectRead);
}
@@ -172,9 +147,6 @@ namespace System.Net.Sockets
[MonoTODO]
public void Start ()
{
- if (active)
- return;
-
server.Listen(5); // According to the
// man page some BSD
// and BSD-derived
@@ -191,10 +163,7 @@ namespace System.Net.Sockets
/// </summary>
public void Stop ()
{
- if (active)
- server.Close ();
-
- Init (AddressFamily.InterNetwork, savedEP);
+ server.Close();
}
}
diff --git a/mcs/class/System/System.Net/ChangeLog b/mcs/class/System/System.Net/ChangeLog
index 35484015d46..b0ac96a71c1 100644
--- a/mcs/class/System/System.Net/ChangeLog
+++ b/mcs/class/System/System.Net/ChangeLog
@@ -1,7 +1,3 @@
-2003-08-14 Nick Drochak <ndrochak@gol.com>
-
- * WebRequest.cs: Check lower case string since that is what we will add.
-
2003-08-04 Jerome Laban <jlaban@wanadoo.fr>
* IPHostEntry.cs: Default contructor must not initialize members.
diff --git a/mcs/class/System/System.Net/WebRequest.cs b/mcs/class/System/System.Net/WebRequest.cs
index 394654af3ce..93efc666455 100644
--- a/mcs/class/System/System.Net/WebRequest.cs
+++ b/mcs/class/System/System.Net/WebRequest.cs
@@ -156,10 +156,9 @@ namespace System.Net
throw new ArgumentNullException("creator");
lock (prefixes.SyncRoot) {
- string lowerCasePrefix = prefix.ToLower ();
- if (prefixes.Contains (lowerCasePrefix))
+ if (prefixes.Contains (prefix))
return false;
- prefixes.Add (lowerCasePrefix, creator);
+ prefixes.Add (prefix.ToLower (), creator);
}
return true;
}
diff --git a/mcs/class/System/Test/System.Net.Sockets/ChangeLog b/mcs/class/System/Test/System.Net.Sockets/ChangeLog
index 2874e2ab05a..d839c3d14e3 100644
--- a/mcs/class/System/Test/System.Net.Sockets/ChangeLog
+++ b/mcs/class/System/Test/System.Net.Sockets/ChangeLog
@@ -1,7 +1,3 @@
-2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * TcpListenerTest.cs: added more tests.
-
2003-07-16 Peter Williams <peter@newton.cx>
* TcpListenerTest.cs: Initialize outSock to null to
diff --git a/mcs/class/System/Test/System.Net.Sockets/TcpListenerTest.cs b/mcs/class/System/Test/System.Net.Sockets/TcpListenerTest.cs
index 08142b98448..76ff745d737 100755
--- a/mcs/class/System/Test/System.Net.Sockets/TcpListenerTest.cs
+++ b/mcs/class/System/Test/System.Net.Sockets/TcpListenerTest.cs
@@ -3,11 +3,9 @@
// Authors:
// Phillip Pearson (pp@myelin.co.nz)
// Martin Willemoes Hansen (mwh@sysrq.dk)
-// Gonzalo Paniagua Javier (gonzalo@ximian.com)
//
// (C) Copyright 2001 Phillip Pearson (http://www.myelin.co.nz)
// (C) Copyright 2003 Martin Willemoes Hansen (mwh@sysrq.dk)
-// (c) 2003 Ximian, Inc. (http://www.ximian.com)
//
using System;
@@ -15,157 +13,71 @@ using System.Net;
using System.Net.Sockets;
using NUnit.Framework;
-namespace MonoTests.System.Net.Sockets
-{
+namespace MonoTests.System.Net.Sockets {
+
+ /// <summary>
+ /// Tests System.Net.Sockets.TcpListener
+ /// </summary>
[TestFixture]
- public class TcpListenerTest : Assertion
- {
+ public class TcpListenerTest {
+
+ /// <summary>
+ /// Tests the TcpListener object
+ /// (from System.Net.Sockets)
+ /// </summary>
[Test]
- public void TcpListener ()
+ public void TcpListener()
{
// listen with a new listener (IPv4 is the default)
- TcpListener inListener = new TcpListener (1234);
+ TcpListener inListener = new TcpListener(1234);
inListener.Start();
// connect to it from a new socket
- IPHostEntry hostent = Dns.GetHostByAddress (IPAddress.Loopback);
+ IPHostEntry hostent = Dns.GetHostByAddress("127.0.0.1");
Socket outSock = null;
- foreach (IPAddress address in hostent.AddressList) {
- if (address.AddressFamily == AddressFamily.InterNetwork) {
- /// Only keep IPv4 addresses, our Server is in IPv4 only mode.
- outSock = new Socket (address.AddressFamily, SocketType.Stream,
+ foreach(IPAddress address in hostent.AddressList) {
+ if(address.AddressFamily == AddressFamily.InterNetwork) {
+ /// Only keep IPv4 addresses, our Server is in IPv4 only mode.
+ outSock = new Socket(address.AddressFamily, SocketType.Stream,
ProtocolType.IP);
- IPEndPoint remote = new IPEndPoint (address, 1234);
- outSock.Connect (remote);
+ IPEndPoint remote = new IPEndPoint(address, 1234);
+ outSock.Connect(remote);
break;
- }
+ }
}
// make sure the connection arrives
- Assert (inListener.Pending ());
- Socket inSock = inListener.AcceptSocket ();
+ Assertion.Assert(inListener.Pending());
+ Socket inSock = inListener.AcceptSocket();
// now send some data and see if it comes out the other end
const int len = 1024;
- byte[] outBuf = new Byte [len];
+ byte[] outBuf = new Byte[len];
for (int i=0; i<len; i++)
- outBuf [i] = (byte) (i % 256);
+ {
+ outBuf[i] = (byte)(i % 256);
+ }
- outSock.Send (outBuf, 0, len, 0);
+ outSock.Send(outBuf, 0, len, 0);
byte[] inBuf = new Byte[len];
- int ret = inSock.Receive (inBuf, 0, len, 0);
+ int ret = inSock.Receive(inBuf, 0, len, 0);
// let's see if it arrived OK
- Assert(ret != 0);
+ Assertion.Assert(ret != 0);
for (int i=0; i<len; i++)
- Assert (inBuf[i] == outBuf [i]);
-
- // tidy up after ourselves
- inSock.Close ();
-
- inListener.Stop ();
- }
-
- [Test]
- public void CtorInt1 ()
- {
- int nex = 0;
- try { new TcpListener (-1); } catch { nex++; }
- new TcpListener (0);
- new TcpListener (65535);
- try { new TcpListener (65536); } catch { nex++; }
- try { new TcpListener (100000); } catch { nex++; }
- Assert (nex == 3);
- }
-
- [Test]
- [ExpectedException (typeof (ArgumentNullException))]
- public void CtorIPEndPoint ()
- {
- new TcpListener (null);
- }
-
- [Test]
- [ExpectedException (typeof (ArgumentNullException))]
- public void CtorIPAddressInt1 ()
- {
- new TcpListener (null, 100000);
- }
-
- [Test]
- [ExpectedException (typeof (ArgumentOutOfRangeException))]
- public void CtorIPAddressInt2 ()
- {
- new TcpListener (IPAddress.Any, 100000);
- }
-
- class MyListener : TcpListener
- {
- public MyListener ()
- : base (IPAddress.Loopback, 5000)
- {
- }
-
- public Socket GetSocket ()
{
- return Server;
- }
-
- public bool IsActive {
- get { return Active; }
- }
- }
-
- [Test]
- public void PreStartStatus ()
- {
- MyListener listener = new MyListener ();
- AssertEquals ("#01", false, listener.IsActive);
- Assert ("#02", null != listener.GetSocket ());
- try {
- listener.AcceptSocket ();
- Fail ("Exception not thrown");
- } catch (InvalidOperationException) {
- }
-
- try {
- listener.AcceptTcpClient ();
- Fail ("Exception not thrown");
- } catch (InvalidOperationException) {
+ Assertion.Assert(inBuf[i] == outBuf[i]);
}
- try {
- listener.Pending ();
- Fail ("Exception not thrown");
- } catch (InvalidOperationException) {
- }
-
- listener.Stop ();
- }
- [Test]
- public void PostStartStatus ()
- {
- MyListener listener = new MyListener ();
- listener.Start ();
- AssertEquals ("#01", true, listener.IsActive);
- Assert ("#02", null != listener.GetSocket ());
-
- Socket sock = listener.GetSocket ();
- listener.Start (); // Start called twice
- AssertEquals ("#03", true, listener.IsActive);
- Assert ("#04", null != listener.GetSocket ());
-
- AssertEquals ("#05", false, listener.Pending ());
+ // tidy up after ourselves
+ inSock.Close();
- listener.Stop ();
- AssertEquals ("#06", false, listener.IsActive);
- Assert ("#07", null != listener.GetSocket ());
- Assert ("#08", sock != listener.GetSocket ());
+ inListener.Stop();
}
}
}
diff --git a/mcs/class/System/Test/System/ChangeLog b/mcs/class/System/Test/System/ChangeLog
index ba06081be12..7427bb64021 100644
--- a/mcs/class/System/Test/System/ChangeLog
+++ b/mcs/class/System/Test/System/ChangeLog
@@ -1,8 +1,3 @@
-2003-08-18 Nick Drochak <ndrochak@gol.com>
-
- * UriBuilderTest.cs: Separated tests into NUnit v2 style. Need to track
- down a test failure.
-
2003-05-07 Ben Maurer <bmaurer@users.sourceforge.net>
* UriTest.cs: added tests for UNIX file paths.
diff --git a/mcs/class/System/Test/System/UriBuilderTest.cs b/mcs/class/System/Test/System/UriBuilderTest.cs
index 1a0ed43b88a..d9451c5f58b 100644
--- a/mcs/class/System/Test/System/UriBuilderTest.cs
+++ b/mcs/class/System/Test/System/UriBuilderTest.cs
@@ -61,26 +61,24 @@ namespace MonoTests.System
}
[Test]
- [ExpectedException (typeof (ArgumentOutOfRangeException))]
- public void BadPort1 ()
+ public void Port ()
{
- b.Port = -12345;
- }
-
- [Test]
- [ExpectedException (typeof (ArgumentOutOfRangeException))]
- public void BadPort2 ()
- {
- b.Port = 123456789;
- }
-
- [Test]
- [ExpectedException (typeof (ArgumentOutOfRangeException))]
- public void BadPort3 ()
- {
- b.Port = -1;
+ try {
+ b.Port = -12345;
+ Assertion.Fail ("#1 should've failed, illegal port.");
+ } catch (ArgumentOutOfRangeException) {}
+ try {
+ b.Port = 123456789;
+ Assertion.Fail ("#2 should've failed, illegal port.");
+ } catch (ArgumentOutOfRangeException) {}
+ try {
+ b.Port = -1;
+ Assertion.AssertEquals ("#3", -1, b.Port);
+ } catch (ArgumentOutOfRangeException) {
+ Assertion.Fail ("#4: spec should allow -1 as value.");
+ }
}
-
+
[Test]
public void Query ()
{
diff --git a/mcs/class/corlib/ChangeLog b/mcs/class/corlib/ChangeLog
index 77005b49f4a..337b7ae46c7 100644
--- a/mcs/class/corlib/ChangeLog
+++ b/mcs/class/corlib/ChangeLog
@@ -1,11 +1,3 @@
-2003-08-20 Duncan Mak <duncan@ximian.com>
-
- * corlib_test.dll.sources: Added DictionaryBaseTest.cs
-
-2003-08-19 Nick Drochak <ndrochak@gol.com>
-
- * Makefile: Turn on debug for the corlib tests on .NET.
-
2003-08-06 Andreas Nahr <ClassDevelopment@A-SoftTech.com>
* corlib.dll.sources: added quite some files
diff --git a/mcs/class/corlib/Makefile b/mcs/class/corlib/Makefile
index 00d1110d520..835cccf732b 100644
--- a/mcs/class/corlib/Makefile
+++ b/mcs/class/corlib/Makefile
@@ -54,7 +54,7 @@ plattest_excludes = corlib_plattest.dll.excludes
plattest_response = $(depsdir)/$(plattestlib).response
plattest_makefrag = $(depsdir)/$(plattestlib).makefrag
plattest_stampfile = $(depsdir)/$(plattestlib).stamp
-plattest_flags = /debug+ /debug:full /nowarn:0618 /nowarn:0672 /r:$(PLATFORM_CORLIB) /r:$(topdir)/class/lib/NUnit.Framework.dll
+plattest_flags = /nowarn:0618 /nowarn:0672 /r:$(PLATFORM_CORLIB) /r:$(topdir)/class/lib/NUnit.Framework.dll
# Here, we make all.
diff --git a/mcs/class/corlib/System.Collections/CaseInsensitiveHashCodeProvider.cs b/mcs/class/corlib/System.Collections/CaseInsensitiveHashCodeProvider.cs
index 46e78113dba..1909d4aaa13 100644
--- a/mcs/class/corlib/System.Collections/CaseInsensitiveHashCodeProvider.cs
+++ b/mcs/class/corlib/System.Collections/CaseInsensitiveHashCodeProvider.cs
@@ -75,10 +75,15 @@ namespace System.Collections {
int h = 0;
char c;
- int length = str.Length;
- for (int i = 0;i<length;i++) {
- c = Char.ToLower (str [i]);
- h = h * 31 + c;
+ if (str.Length > 0) {
+ for (int i = 0;i<str.Length;i++) {
+ c = str [i];
+
+ if (Char.IsLetter (c))
+ c = Char.ToLower (c);
+
+ h = h * 31 + c;
+ }
}
return h;
diff --git a/mcs/class/corlib/System.Collections/ChangeLog b/mcs/class/corlib/System.Collections/ChangeLog
index 2f1b8c5daa6..488261b15ff 100644
--- a/mcs/class/corlib/System.Collections/ChangeLog
+++ b/mcs/class/corlib/System.Collections/ChangeLog
@@ -1,29 +1,3 @@
-2003-08-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * CaseInsensitiveHashCodeProvider.cs: small speed improvement.
-
-2003-08-21 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * Stack.cs: patch by JoergR@voelcker.com (Joerg Rosenkranz) that fixes
- bug #47789.
-
-2003-08-20 Duncan Mak <duncan@ximian.com>
-
- * Hashtable.cs (PutImpl): Fix my previous checkin, see details
- posted on bug #47692.
-
- I really hope I don't mess up this time, because, if I do again,
- it will be really embarrassing.
-
-2003-08-17 Duncan Mak <duncan@ximian.com>
-
- * Hashtable.cs (PutImpl): Patch from Luca Barbieri <lb@lb.ods.org>.
- Currently Hashtable.PutImpl has an incorrect test which causes the
- key chain search to terminate as soon as a free slot is found,
- causing key duplication.
-
- This fixes bug #47692.
-
2003-08-11 Duncan Mak <duncan@ximian.com>
* DictionaryBase.cs: Applied patch from Carlos Barcenilla
diff --git a/mcs/class/corlib/System.Collections/Hashtable.cs b/mcs/class/corlib/System.Collections/Hashtable.cs
index 24ba9cf3614..84922aa954a 100644
--- a/mcs/class/corlib/System.Collections/Hashtable.cs
+++ b/mcs/class/corlib/System.Collections/Hashtable.cs
@@ -598,12 +598,12 @@ namespace System.Collections {
if (freeIndx == -1
&& entry.key == KeyMarker.Removed
- && (entry.hashMix & CHAIN_MARKER) != 0)
+ && (entry.hashMix & CHAIN_MARKER)!= 0)
freeIndx = indx;
if (entry.key == null ||
(entry.key == KeyMarker.Removed
- && (entry.hashMix & CHAIN_MARKER) == 0)) {
+ && (entry.hashMix & CHAIN_MARKER)!= 0)) {
if (freeIndx == -1)
freeIndx = indx;
diff --git a/mcs/class/corlib/System.Collections/Stack.cs b/mcs/class/corlib/System.Collections/Stack.cs
index 5bf866d1ddc..0a65a818cf7 100644
--- a/mcs/class/corlib/System.Collections/Stack.cs
+++ b/mcs/class/corlib/System.Collections/Stack.cs
@@ -166,7 +166,6 @@ namespace System.Collections {
public virtual object Clone() {
Stack stack = new Stack (contents);
stack.current = current;
- stack.count = count;
return stack;
}
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Activation/AppDomainLevelActivator.cs b/mcs/class/corlib/System.Runtime.Remoting.Activation/AppDomainLevelActivator.cs
index 8d4bd41aec7..e47464f12c7 100644
--- a/mcs/class/corlib/System.Runtime.Remoting.Activation/AppDomainLevelActivator.cs
+++ b/mcs/class/corlib/System.Runtime.Remoting.Activation/AppDomainLevelActivator.cs
@@ -11,7 +11,7 @@ using System.Runtime.Remoting.Messaging;
namespace System.Runtime.Remoting.Activation
{
- internal class AppDomainLevelActivator: IActivator
+ public class AppDomainLevelActivator: IActivator
{
string _activationUrl;
IActivator _next;
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Activation/ChangeLog b/mcs/class/corlib/System.Runtime.Remoting.Activation/ChangeLog
index 1714aa34685..0d36c020dca 100644
--- a/mcs/class/corlib/System.Runtime.Remoting.Activation/ChangeLog
+++ b/mcs/class/corlib/System.Runtime.Remoting.Activation/ChangeLog
@@ -1,9 +1,3 @@
-2003-08-14 Lluis Sanchez Gual <lluis@ximian.com>
-
- * AppDomainLevelActivator.cs, ConstructionLevelActivator.cs,
- ContextLevelActivator.cs, RemoteActivationAttribute.cs,
- RemoteActivator.cs: Changed class from public to internal.
-
2003-03-21 Lluis Sanchez Gual <lluis@ideary.com>
* ActivationServices.cs: Added the method Activate that performs the forwards the
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Activation/ConstructionLevelActivator.cs b/mcs/class/corlib/System.Runtime.Remoting.Activation/ConstructionLevelActivator.cs
index 789f54d1772..c8009e56a57 100644
--- a/mcs/class/corlib/System.Runtime.Remoting.Activation/ConstructionLevelActivator.cs
+++ b/mcs/class/corlib/System.Runtime.Remoting.Activation/ConstructionLevelActivator.cs
@@ -12,7 +12,7 @@ using System.Runtime.Remoting.Messaging;
namespace System.Runtime.Remoting.Activation
{
[Serializable]
- internal class ConstructionLevelActivator: IActivator
+ public class ConstructionLevelActivator: IActivator
{
IActivator _next;
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Activation/ContextLevelActivator.cs b/mcs/class/corlib/System.Runtime.Remoting.Activation/ContextLevelActivator.cs
index b5b9fc8305e..52cf269c4a7 100644
--- a/mcs/class/corlib/System.Runtime.Remoting.Activation/ContextLevelActivator.cs
+++ b/mcs/class/corlib/System.Runtime.Remoting.Activation/ContextLevelActivator.cs
@@ -13,7 +13,7 @@ using System.Runtime.Remoting.Contexts;
namespace System.Runtime.Remoting.Activation
{
[Serializable]
- internal class ContextLevelActivator: IActivator
+ public class ContextLevelActivator: IActivator
{
IActivator _next;
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Activation/RemoteActivationAttribute.cs b/mcs/class/corlib/System.Runtime.Remoting.Activation/RemoteActivationAttribute.cs
index 9ecf8710f59..c2aaca25028 100644
--- a/mcs/class/corlib/System.Runtime.Remoting.Activation/RemoteActivationAttribute.cs
+++ b/mcs/class/corlib/System.Runtime.Remoting.Activation/RemoteActivationAttribute.cs
@@ -13,7 +13,7 @@ using System.Collections;
namespace System.Runtime.Remoting.Activation
{
- internal class RemoteActivationAttribute: Attribute, IContextAttribute
+ public class RemoteActivationAttribute: Attribute, IContextAttribute
{
// This activation attribute is used when creating a client activated
// CBO in the server. This attribute will enforce the creation of
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Activation/RemoteActivator.cs b/mcs/class/corlib/System.Runtime.Remoting.Activation/RemoteActivator.cs
index c8b62818e4d..c426dddf093 100644
--- a/mcs/class/corlib/System.Runtime.Remoting.Activation/RemoteActivator.cs
+++ b/mcs/class/corlib/System.Runtime.Remoting.Activation/RemoteActivator.cs
@@ -6,14 +6,14 @@
// (C) 2002, Lluis Sanchez Gual
//
-using System;
+using System;
using System.Runtime.Remoting.Lifetime;
-using System.Runtime.Remoting.Messaging;
-
-namespace System.Runtime.Remoting.Activation
-{
- internal class RemoteActivator: MarshalByRefObject, IActivator
- {
+using System.Runtime.Remoting.Messaging;
+
+namespace System.Runtime.Remoting.Activation
+{
+ public class RemoteActivator: MarshalByRefObject, IActivator
+ {
public IConstructionReturnMessage Activate (IConstructionCallMessage msg)
{
if (!RemotingConfiguration.IsActivationAllowed (msg.ActivationType))
@@ -28,28 +28,28 @@ namespace System.Runtime.Remoting.Activation
ObjRef objref = RemotingServices.Marshal (newObject);
return new ConstructionResponse (objref, null, msg);
}
-
- public override Object InitializeLifetimeService()
- {
- ILease lease = (ILease)base.InitializeLifetimeService();
- if (lease.CurrentState == LeaseState.Initial)
- {
- lease.InitialLeaseTime = TimeSpan.FromMinutes(30);
- lease.SponsorshipTimeout = TimeSpan.FromMinutes(1);
- lease.RenewOnCallTime = TimeSpan.FromMinutes(10);
- }
- return lease;
- }
-
- public ActivatorLevel Level
+
+ public override Object InitializeLifetimeService()
+ {
+ ILease lease = (ILease)base.InitializeLifetimeService();
+ if (lease.CurrentState == LeaseState.Initial)
+ {
+ lease.InitialLeaseTime = TimeSpan.FromMinutes(30);
+ lease.SponsorshipTimeout = TimeSpan.FromMinutes(1);
+ lease.RenewOnCallTime = TimeSpan.FromMinutes(10);
+ }
+ return lease;
+ }
+
+ public ActivatorLevel Level
{
get { throw new NotSupportedException (); }
}
- public IActivator NextActivator
+ public IActivator NextActivator
{
get { throw new NotSupportedException (); }
set { throw new NotSupportedException (); }
}
- }
-}
+ }
+}
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Channels/ChangeLog b/mcs/class/corlib/System.Runtime.Remoting.Channels/ChangeLog
index fade3650e88..d2b105ef318 100644
--- a/mcs/class/corlib/System.Runtime.Remoting.Channels/ChangeLog
+++ b/mcs/class/corlib/System.Runtime.Remoting.Channels/ChangeLog
@@ -1,12 +1,3 @@
-2003-08-25 Lluis Sanchez Gual <lluis@ximian.com>
-
- * ClientChannelSinkStack.cs: Implemented DispatchException.
-
-2003-08-14 Lluis Sanchez Gual <lluis@ximian.com>
-
- * ChannelServices.cs: Set call context info for the incoming
- remote call, and restore the context after the call.
-
2003-07-28 Duncan Mak <duncan@ximian.com>
* TransportHeaders.cs: Added Serializable attribute.
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Channels/ChannelServices.cs b/mcs/class/corlib/System.Runtime.Remoting.Channels/ChannelServices.cs
index 1f7d093d4da..85241218590 100644
--- a/mcs/class/corlib/System.Runtime.Remoting.Channels/ChannelServices.cs
+++ b/mcs/class/corlib/System.Runtime.Remoting.Channels/ChannelServices.cs
@@ -190,20 +190,7 @@ namespace System.Runtime.Remoting.Channels
if (identity == null) return new ReturnMessage (new RemotingException ("No receiver for uri " + call.Uri), (IMethodCallMessage) msg);
RemotingServices.SetMessageTargetIdentity (msg, identity);
-
- if (call.LogicalCallContext != null)
- CallContext.SetCurrentCallContext (call.LogicalCallContext);
-
- try
- {
- IMessage response = _crossContextSink.SyncProcessMessage (msg);
- response.Properties ["__CallContext"] = CallContext.CreateLogicalCallContext ();
- return response;
- }
- finally
- {
- CallContext.ResetCurrentCallContext ();
- }
+ return _crossContextSink.SyncProcessMessage (msg);
}
public static void UnregisterChannel (IChannel chnl)
@@ -215,9 +202,12 @@ namespace System.Runtime.Remoting.Channels
registeredChannels.Remove ((object) chnl);
+/*
+ FIXME: uncomment when Thread.Abort works for windows.
IChannelReceiver chnlReceiver = chnl as IChannelReceiver;
if(chnlReceiver != null)
chnlReceiver.StopListening(null);
+ */
}
internal static object [] GetCurrentChannelInfo ()
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Channels/ClientChannelSinkStack.cs b/mcs/class/corlib/System.Runtime.Remoting.Channels/ClientChannelSinkStack.cs
index b5573a4457f..5f431bf340c 100644
--- a/mcs/class/corlib/System.Runtime.Remoting.Channels/ClientChannelSinkStack.cs
+++ b/mcs/class/corlib/System.Runtime.Remoting.Channels/ClientChannelSinkStack.cs
@@ -44,9 +44,10 @@ namespace System.Runtime.Remoting.Channels
// after its own processing
}
+ [MonoTODO]
public void DispatchException (Exception e)
{
- DispatchReplyMessage (new ReturnMessage (e, null));
+ throw new NotImplementedException ();
}
public void DispatchReplyMessage (IMessage msg)
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Lifetime/ChangeLog b/mcs/class/corlib/System.Runtime.Remoting.Lifetime/ChangeLog
index 5eda5611fdf..b6f049e3a60 100644
--- a/mcs/class/corlib/System.Runtime.Remoting.Lifetime/ChangeLog
+++ b/mcs/class/corlib/System.Runtime.Remoting.Lifetime/ChangeLog
@@ -1,7 +1,3 @@
-2003-08-14 Lluis Sanchez Gual <lluis@ximian.com>
-
- * ClientSponsor.cs: Implemented.
-
2003-03-03 Lluis Sanchez Gual <lluis@ideary.com>
* LeaseManager.cs: Added method for removing an object from the lease manager.
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Lifetime/ClientSponsor.cs b/mcs/class/corlib/System.Runtime.Remoting.Lifetime/ClientSponsor.cs
index 0105e51c3cc..c6400477f75 100644
--- a/mcs/class/corlib/System.Runtime.Remoting.Lifetime/ClientSponsor.cs
+++ b/mcs/class/corlib/System.Runtime.Remoting.Lifetime/ClientSponsor.cs
@@ -2,13 +2,11 @@
// System.Runtime.Remoting.Lifetime.ClientSponsor.cs
//
// Author: Duncan Mak (duncan@ximian.com)
-// Lluis Sanchez Gual (lluis@ximian.com)
//
// 2002 (C) Copyright. Ximian, Inc.
//
using System;
-using System.Collections;
using System.Runtime.Remoting.Lifetime;
namespace System.Runtime.Remoting.Lifetime {
@@ -16,7 +14,6 @@ namespace System.Runtime.Remoting.Lifetime {
public class ClientSponsor : MarshalByRefObject, ISponsor
{
TimeSpan renewal_time;
- ArrayList registered_objects = new ArrayList ();
public ClientSponsor ()
{
@@ -38,47 +35,39 @@ namespace System.Runtime.Remoting.Lifetime {
}
}
+ [MonoTODO]
public void Close ()
{
- foreach (MarshalByRefObject obj in registered_objects)
- {
- ILease lease = obj.GetLifetimeService () as ILease;
- lease.Unregister (this);
- }
- registered_objects.Clear ();
}
+ [MonoTODO]
~ClientSponsor ()
{
- Close ();
+ throw new NotImplementedException ();
}
+ [MonoTODO]
public override object InitializeLifetimeService ()
{
- return base.InitializeLifetimeService ();
+ throw new NotImplementedException ();
}
+ [MonoTODO]
public bool Register (MarshalByRefObject obj)
{
- if (registered_objects.Contains (obj)) return false;
- ILease lease = obj.GetLifetimeService () as ILease;
- if (lease == null) return false;
- lease.Register (this);
- registered_objects.Add (obj);
- return true;
+ throw new NotImplementedException ();
}
+ [MonoTODO]
public TimeSpan Renewal (ILease lease)
{
- return renewal_time;
+ throw new NotImplementedException ();
}
+ [MonoTODO]
public void Unregister (MarshalByRefObject obj)
{
- if (!registered_objects.Contains (obj)) return;
- ILease lease = obj.GetLifetimeService () as ILease;
- lease.Unregister (this);
- registered_objects.Remove (obj);
+ throw new NotImplementedException ();
}
}
}
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Messaging/AsyncResult.cs b/mcs/class/corlib/System.Runtime.Remoting.Messaging/AsyncResult.cs
index d403f72b6d4..4ab128170ba 100644
--- a/mcs/class/corlib/System.Runtime.Remoting.Messaging/AsyncResult.cs
+++ b/mcs/class/corlib/System.Runtime.Remoting.Messaging/AsyncResult.cs
@@ -25,11 +25,7 @@ public class AsyncResult : IAsyncResult, IMessageSink {
bool sync_completed;
bool completed;
bool endinvoke_called;
- object[] out_args;
- object ret_val;
- Exception exception;
IMessageCtrl message_ctrl;
- IMessage reply_message;
public virtual object AsyncState
{
@@ -88,9 +84,10 @@ public class AsyncResult : IAsyncResult, IMessageSink {
throw new NotSupportedException ();
}
+ [MonoTODO]
public virtual IMessage GetReplyMessage()
{
- return reply_message;
+ throw new NotImplementedException ();
}
public virtual void SetMessageCtrl (IMessageCtrl mc)
@@ -98,21 +95,8 @@ public class AsyncResult : IAsyncResult, IMessageSink {
message_ctrl = mc;
}
- internal void SetCompletedSynchronously (bool completed)
- {
- sync_completed = completed;
- }
-
- internal IMessage EndInvoke ()
- {
- handle.WaitOne ();
- return reply_message;
- }
-
public virtual IMessage SyncProcessMessage (IMessage msg)
{
- reply_message = msg;
-
completed = true;
NativeEventCalls.SetEvent_internal (handle.Handle);
// TODO: invoke callback
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Messaging/CADMessages.cs b/mcs/class/corlib/System.Runtime.Remoting.Messaging/CADMessages.cs
index 88a2441d13f..8373fd26ffd 100755
--- a/mcs/class/corlib/System.Runtime.Remoting.Messaging/CADMessages.cs
+++ b/mcs/class/corlib/System.Runtime.Remoting.Messaging/CADMessages.cs
@@ -78,11 +78,18 @@ namespace System.Runtime.Remoting.Messaging {
// We can ignore marshalling for string and primitive types
private static bool IsPossibleToIgnoreMarshal (object obj) {
+ // until this is more tested, we disable it....
+ return false;
+
+/* if (obj is string)
+ return true;
+
Type objType = obj.GetType();
if (objType.IsPrimitive || objType == typeof(void))
return true;
return false;
+*/
}
// Checks an argument if it's possible to pass without marshalling and
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Messaging/CallContext.cs b/mcs/class/corlib/System.Runtime.Remoting.Messaging/CallContext.cs
index 1d1d7a7f3c5..b3b1dee70ad 100644
--- a/mcs/class/corlib/System.Runtime.Remoting.Messaging/CallContext.cs
+++ b/mcs/class/corlib/System.Runtime.Remoting.Messaging/CallContext.cs
@@ -2,18 +2,16 @@
// System.Runtime.Remoting.Messaging.CallContext.cs
//
// Author: Jaime Anguiano Olarra (jaime@gnome.org)
-// Lluis Sanchez Gual (lluis@ximian.com)
//
// (c) 2002, Jaime Anguiano Olarra
//
+// FIXME: This is just a skeleton for practical purposes.
///<summary>
///Provides several properties that come with the execution code path.
///This class is sealed.
///</summary>
using System;
-using System.Threading;
-using System.Collections;
namespace System.Runtime.Remoting.Messaging
{
@@ -22,77 +20,34 @@ namespace System.Runtime.Remoting.Messaging
public sealed class CallContext
{
// public methods
+ [MonoTODO]
public static void FreeNamedDataSlot (string name)
{
- Datastore.Remove (name);
+ throw new NotImplementedException ();
}
+ [MonoTODO]
public static object GetData (string name)
{
- return Datastore [name];
+ throw new NotImplementedException ();
}
+ [MonoTODO]
public static Header[] GetHeaders ()
{
- return (Header[]) Datastore ["__Headers"];
+ throw new NotImplementedException ();
}
+ [MonoTODO]
public static void SetData (string name, object data)
{
- Datastore [name] = data;
+ throw new NotImplementedException ();
}
+ [MonoTODO]
public static void SetHeaders (Header[] headers)
{
- Datastore ["__Headers"] = headers;
+ throw new NotImplementedException ();
}
-
- internal static LogicalCallContext CreateLogicalCallContext ()
- {
- LocalDataStoreSlot ds = Thread.GetNamedDataSlot ("__CallContext");
- Hashtable res = (Hashtable) Thread.GetData (ds);
-
- LogicalCallContext ctx = new LogicalCallContext();
- if (res == null) return ctx;
-
- foreach (DictionaryEntry entry in res)
- if (entry.Value is ILogicalThreadAffinative)
- ctx.SetData ((string)entry.Key, entry.Value);
-
- return ctx;
- }
-
- internal static void SetCurrentCallContext (LogicalCallContext ctx)
- {
- Hashtable data = ctx.Datastore;
- if (data == null) return;
-
- data.Clear ();
- foreach (DictionaryEntry entry in data)
- SetData ((string)entry.Key, entry.Value);
- }
-
- internal static void ResetCurrentCallContext ()
- {
- LocalDataStoreSlot ds = Thread.GetNamedDataSlot ("__CallContext");
- Thread.SetData (ds, null);
- }
-
- private static Hashtable Datastore
- {
- get {
- LocalDataStoreSlot ds = Thread.GetNamedDataSlot ("__CallContext");
- Hashtable res = (Hashtable) Thread.GetData (ds);
- if (res == null) {
- res = new Hashtable ();
- Thread.SetData (ds, res);
- }
- return res;
- }
- }
- }
-
- public interface ILogicalThreadAffinative
- {
}
}
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Messaging/ChangeLog b/mcs/class/corlib/System.Runtime.Remoting.Messaging/ChangeLog
index 4ce24e95fd3..633a1d2e1aa 100644
--- a/mcs/class/corlib/System.Runtime.Remoting.Messaging/ChangeLog
+++ b/mcs/class/corlib/System.Runtime.Remoting.Messaging/ChangeLog
@@ -1,33 +1,3 @@
-2003-08-25 Lluis Sanchez Gual <lluis@ximian.com>
-
- * AsyncResult.cs: Added method EndInvoke(). Fixed SyncProcessMessage().
- * CallContext.cs: Clean current logical context before setting the new
- values form LogicalCallContext (SetCurrentCallContext).
- * MonoMethodMessage.cs: Added new CallType field and enum.
- * StackBuilderSink.cs: Improved error message.
-
-2003-08-20 Lluis Sanchez Gual <lluis@ximian.com>
-
- * MethodCall.cs: Changed exception text to match MS.NET (more or less).
- * AsyncResult.cs: Added new fields to store async calls results.
-
-2003-08-17 Lluis Sanchez Gual <lluis@ximian.com>
-
- * MethodCall.cs: Throw the right exception if the target object is not
- found when resolving the target method.
-
-2003-08-17 Lluis Sanchez Gual <lluis@ximian.com>
-
- * CallContext.cs: Fixed bug #47686.
-
-2003-08-14 Lluis Sanchez Gual <lluis@ximian.com>
-
- * CADMessages.cs: Enabled smuggeling of primitive type parameters (as suggested
- by Patrik).
- * CallContext.cs: Impplemented.
- * LogicalCallContext.cs: Implemented.
- * MonoMethodMessage.cs: Added setter for LogicalCallContext property.
-
2003-07-25 Lluis Sanchez Gual <lluis@ximian.com>
* ArgInfo.cs: Use Type.IsByRef to check if a parameter is a ref or
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Messaging/LogicalCallContext.cs b/mcs/class/corlib/System.Runtime.Remoting.Messaging/LogicalCallContext.cs
index 686764f781c..a9e44a0ca4b 100644
--- a/mcs/class/corlib/System.Runtime.Remoting.Messaging/LogicalCallContext.cs
+++ b/mcs/class/corlib/System.Runtime.Remoting.Messaging/LogicalCallContext.cs
@@ -1,112 +1,43 @@
-//
-// System.Runtime.Remoting.Messaging.LogicalCallContext.cs
-//
-// Author:
-// Dan Lewis (dihlewis@yahoo.co.uk)
-// Lluis Sanchez Gual (lluis@ximian.com)
-//
-// 2002 (C) Copyright. Ximian, Inc.
-//
-
-using System.Collections;
-using System.Runtime.Serialization;
-
-namespace System.Runtime.Remoting.Messaging {
-
- [MonoTODO]
+//
+// System.Runtime.Remoting.Messaging.LogicalCallContext.cs
+//
+// Author:
+// Dan Lewis (dihlewis@yahoo.co.uk)
+//
+// (C) 2002
+//
+// Stubbed.
+//
+
+using System.Runtime.Serialization;
+
+namespace System.Runtime.Remoting.Messaging {
+
+ [MonoTODO]
[Serializable]
- public sealed class LogicalCallContext : ISerializable, ICloneable
- {
- Hashtable _data;
- CallContextRemotingData _remotingData = new CallContextRemotingData();
-
- internal LogicalCallContext ()
- {
- }
-
- internal LogicalCallContext (SerializationInfo info, StreamingContext context)
- {
- foreach (SerializationEntry entry in info)
- {
- if (entry.Name == "__RemotingData")
- _remotingData = (CallContextRemotingData) entry.Value;
- else
- SetData (entry.Name, entry.Value);
- }
- }
-
- public bool HasInfo
- {
- get
- {
- return (_data != null && _data.Count > 0);
- }
- }
-
- public void FreeNamedDataSlot (string name)
- {
- if (_data != null)
- _data.Remove (name);
- }
-
- public object GetData (string name)
- {
- if (_data != null) return _data [name];
- else return null;
- }
-
- public void GetObjectData (SerializationInfo info, StreamingContext context)
- {
- info.AddValue ("__RemotingData", _remotingData);
- if (_data != null)
- {
- foreach (DictionaryEntry de in _data)
- info.AddValue ((string)de.Key, de.Value);
- }
- }
-
- public void SetData (string name, object data)
- {
- if (_data == null) _data = new Hashtable ();
- _data [name] = data;
- }
-
- public object Clone ()
- {
- LogicalCallContext nc = new LogicalCallContext ();
- nc._remotingData = (CallContextRemotingData) _remotingData.Clone ();
- if (_data != null)
- {
- nc._data = new Hashtable ();
- foreach (DictionaryEntry de in _data)
- nc._data [de.Key] = de.Value;
- }
- return nc;
- }
-
- internal Hashtable Datastore
- {
- get { return _data; }
- }
- }
-
- [Serializable]
- internal class CallContextRemotingData : ICloneable
- {
- string _logicalCallID;
-
- public string LogicalCallID
- {
- get { return _logicalCallID; }
- set { _logicalCallID = value; }
- }
-
- public object Clone ()
- {
- CallContextRemotingData data = new CallContextRemotingData ();
- data._logicalCallID = _logicalCallID;
- return data;
- }
-}
-}
-
+ public sealed class LogicalCallContext : ISerializable, ICloneable {
+
+ internal LogicalCallContext () {}
+
+ public bool HasInfo {
+ get { return false; }
+ }
+
+ public void FreeNamedDataSlot (string name) {
+ }
+
+ public object GetData (string name) {
+ return null;
+ }
+
+ public void GetObjectData (SerializationInfo info, StreamingContext context) {
+ }
+
+ public void SetData (string name, object data) {
+ }
+
+ public object Clone () {
+ return null;
+ }
+ }
+}
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Messaging/MethodCall.cs b/mcs/class/corlib/System.Runtime.Remoting.Messaging/MethodCall.cs
index 545f63b8fd3..5ace8cd6573 100644
--- a/mcs/class/corlib/System.Runtime.Remoting.Messaging/MethodCall.cs
+++ b/mcs/class/corlib/System.Runtime.Remoting.Messaging/MethodCall.cs
@@ -264,7 +264,6 @@ namespace System.Runtime.Remoting.Messaging {
if (_uri != null)
{
Type type = RemotingServices.GetServerTypeForUri (_uri);
- if (type == null) throw new RemotingException ("Requested service not found. No receiver for uri " + _uri);
if (CanCastTo (_typeName, type))
{
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Messaging/MonoMethodMessage.cs b/mcs/class/corlib/System.Runtime.Remoting.Messaging/MonoMethodMessage.cs
index ed841084cee..48856e53bd6 100644
--- a/mcs/class/corlib/System.Runtime.Remoting.Messaging/MonoMethodMessage.cs
+++ b/mcs/class/corlib/System.Runtime.Remoting.Messaging/MonoMethodMessage.cs
@@ -34,8 +34,6 @@ namespace System.Runtime.Remoting.Messaging {
AsyncResult asyncResult;
- CallType call_type;
-
string uri;
MethodCallDictionary properties;
@@ -78,9 +76,6 @@ namespace System.Runtime.Remoting.Messaging {
public int ArgCount {
get {
- if (CallType == CallType.EndInvoke)
- return -1;
-
if (null == args)
return 0;
@@ -104,10 +99,6 @@ namespace System.Runtime.Remoting.Messaging {
get {
return ctx;
}
-
- set {
- ctx = value;
- }
}
public MethodBase MethodBase {
@@ -174,9 +165,6 @@ namespace System.Runtime.Remoting.Messaging {
public int InArgCount {
get {
- if (CallType == CallType.EndInvoke)
- return -1;
-
if (null == args)
return 0;
@@ -319,25 +307,5 @@ namespace System.Runtime.Remoting.Messaging {
{
get { return asyncResult; }
}
-
- internal CallType CallType
- {
- get
- {
- // FIXME: ideally, the OneWay type would be set by the runtime
-
- if (call_type == CallType.Sync && RemotingServices.IsOneWay (method))
- call_type = CallType.OneWay;
- return call_type;
- }
- }
}
}
-
-internal enum CallType: int
-{
- Sync = 0,
- BeginInvoke = 1,
- EndInvoke = 2,
- OneWay = 3
-}
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Messaging/StackBuilderSink.cs b/mcs/class/corlib/System.Runtime.Remoting.Messaging/StackBuilderSink.cs
index 96a4d2f2b3b..56a57b1d937 100644
--- a/mcs/class/corlib/System.Runtime.Remoting.Messaging/StackBuilderSink.cs
+++ b/mcs/class/corlib/System.Runtime.Remoting.Messaging/StackBuilderSink.cs
@@ -57,7 +57,7 @@ namespace System.Runtime.Remoting.Messaging
if (pt.IsByRef) pt = pt.GetElementType ();
if (pval != null && !pt.IsInstanceOfType (pval))
- throw new RemotingException ("Cannot cast argument " + pi.Position + " of type '" + pval.GetType().AssemblyQualifiedName +
+ throw new RemotingException ("Cannot cast argument of type '" + pval.GetType().AssemblyQualifiedName +
"' to type '" + pt.AssemblyQualifiedName + "'");
}
}
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Proxies/ChangeLog b/mcs/class/corlib/System.Runtime.Remoting.Proxies/ChangeLog
index 9f85697f82b..31404bbf867 100644
--- a/mcs/class/corlib/System.Runtime.Remoting.Proxies/ChangeLog
+++ b/mcs/class/corlib/System.Runtime.Remoting.Proxies/ChangeLog
@@ -1,18 +1,3 @@
-2003-08-25 Lluis Sanchez Gual <lluis@ximian.com>
-
- * RemotingProxy.cs: Use CallType property to check the type of
- the message.
-
-2003-08-24 Vladimir Vukicevic <vladimir@pobox.com>
-
- * RealProxy.cs, RemotingProxy.cs: move the LogicalCallContext
- setup/restoration into RealProxy's PrivateInvoke, so that custom
- RealProxy's get a LogicalCallContext.
-
-2003-08-14 Lluis Sanchez Gual <lluis@ximian.com>
-
- * RemotingProxy.cs: On invoke, set the LogicalCallContext of the message.
-
2003-07-28 Duncan Mak <duncan@ximian.com>
* RealProxy.cs (GetProxiedType): Removed 'virtual' keyword.
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Proxies/RealProxy.cs b/mcs/class/corlib/System.Runtime.Remoting.Proxies/RealProxy.cs
index 969680f3a2b..756a816339e 100644
--- a/mcs/class/corlib/System.Runtime.Remoting.Proxies/RealProxy.cs
+++ b/mcs/class/corlib/System.Runtime.Remoting.Proxies/RealProxy.cs
@@ -86,14 +86,8 @@ namespace System.Runtime.Remoting.Proxies
internal static object PrivateInvoke (RealProxy rp, IMessage msg, out Exception exc,
out object [] out_args)
{
- MonoMethodMessage mMsg = (MonoMethodMessage) msg;
- mMsg.LogicalCallContext = CallContext.CreateLogicalCallContext();
-
IMethodReturnMessage res_msg = (IMethodReturnMessage)rp.Invoke (msg);
- if (res_msg.LogicalCallContext != null)
- CallContext.SetCurrentCallContext (res_msg.LogicalCallContext);
-
exc = res_msg.Exception;
out_args = res_msg.OutArgs;
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Proxies/RemotingProxy.cs b/mcs/class/corlib/System.Runtime.Remoting.Proxies/RemotingProxy.cs
index 73efcda9209..f8beeba6268 100644
--- a/mcs/class/corlib/System.Runtime.Remoting.Proxies/RemotingProxy.cs
+++ b/mcs/class/corlib/System.Runtime.Remoting.Proxies/RemotingProxy.cs
@@ -48,9 +48,6 @@ namespace System.Runtime.Remoting.Proxies
{
MonoMethodMessage mMsg = (MonoMethodMessage) request;
- if (mMsg.CallType == CallType.EndInvoke)
- return mMsg.AsyncResult.EndInvoke ();
-
if (mMsg.MethodBase.IsConstructor)
return ActivateRemoteObject (mMsg);
@@ -74,16 +71,15 @@ namespace System.Runtime.Remoting.Proxies
else
sink = _sink;
- if (mMsg.CallType == CallType.Sync)
- response = sink.SyncProcessMessage (request);
- else
+ if (RemotingServices.IsAsyncMessage (request))
{
AsyncResult ares = ((MonoMethodMessage)request).AsyncResult;
IMessageCtrl mctrl = sink.AsyncProcessMessage (request, ares);
if (ares != null) ares.SetMessageCtrl (mctrl);
response = new ReturnMessage (null, new object[0], 0, null, mMsg);
}
-
+ else
+ response = sink.SyncProcessMessage (request);
_objectIdentity.NotifyClientDynamicSinks (false, request, true, false);
if (!(response is IConstructionReturnMessage))
diff --git a/mcs/class/corlib/System.Runtime.Remoting/ChangeLog b/mcs/class/corlib/System.Runtime.Remoting/ChangeLog
index b16fbf2fe3f..7d396aa832d 100755
--- a/mcs/class/corlib/System.Runtime.Remoting/ChangeLog
+++ b/mcs/class/corlib/System.Runtime.Remoting/ChangeLog
@@ -1,13 +1,3 @@
-2003-08-25 Lluis Sanchez Gual <lluis@ximian.com>
-
- * RemotingServices.cs: Some small fixes.
-
-2003-08-14 Lluis Sanchez Gual <lluis@ximian.com>
-
- * ObjRef.cs: Implemented IsFromThisProcess().
- * RemotingServices.cs: Implemented methods GetLifetimeService and
- GetEnvoyChainForProxy. Stubbed LogRemotingStage.
-
2003-07-29 Lluis Sanchez Gual <lluis@ximian.com>
* RemotingServices.cs: GetObjectUri(): For client proxies, return
diff --git a/mcs/class/corlib/System.Runtime.Remoting/ObjRef.cs b/mcs/class/corlib/System.Runtime.Remoting/ObjRef.cs
index 19f59839eb0..ec12d5710b4 100644
--- a/mcs/class/corlib/System.Runtime.Remoting/ObjRef.cs
+++ b/mcs/class/corlib/System.Runtime.Remoting/ObjRef.cs
@@ -47,7 +47,7 @@ namespace System.Runtime.Remoting {
flags = o.flags;
if (unmarshalAsProxy) flags |= MarshalledObjectRef;
}
-
+
public ObjRef (MarshalByRefObject mbr, Type type)
{
if (mbr == null)
@@ -130,7 +130,7 @@ namespace System.Runtime.Remoting {
return false;
}
- internal bool IsReferenceToWellKnow
+ public bool IsReferenceToWellKnow
{
get { return (flags & WellKnowObjectRef) > 0; }
}
@@ -199,18 +199,11 @@ namespace System.Runtime.Remoting {
return identity.IsFromThisAppDomain;
}
+ [MonoTODO]
public bool IsFromThisProcess ()
{
- foreach (object data in channel_info.ChannelData)
- {
- if (data is CrossAppDomainData)
- {
- string refProcId = ((CrossAppDomainData)data).ProcessID;
- return (refProcId == RemotingConfiguration.ProcessId);
- }
- }
-
- return true;
+ // as yet we do not consider this optimization
+ return false;
}
internal void UpdateChannelInfo()
diff --git a/mcs/class/corlib/System.Runtime.Remoting/RemotingServices.cs b/mcs/class/corlib/System.Runtime.Remoting/RemotingServices.cs
index 8db9eb22b9c..b3dbef05a62 100644
--- a/mcs/class/corlib/System.Runtime.Remoting/RemotingServices.cs
+++ b/mcs/class/corlib/System.Runtime.Remoting/RemotingServices.cs
@@ -211,7 +211,7 @@ namespace System.Runtime.Remoting
}
else
{
- ClientActivatedIdentity identity = GetIdentityForUri (uri) as ClientActivatedIdentity;
+ ClientActivatedIdentity identity = uri_hash [uri] as ClientActivatedIdentity;
if (identity == null || obj != identity.GetServerObject())
CreateClientActivatedServerIdentity (obj, requested_type, uri);
}
@@ -258,25 +258,6 @@ namespace System.Runtime.Remoting
else return ident.CreateObjRef(null);
}
- public static object GetLifetimeService (MarshalByRefObject obj)
- {
- if (obj == null) return null;
- return obj.GetLifetimeService ();
- }
-
- public static IMessageSink GetEnvoyChainForProxy (MarshalByRefObject obj)
- {
- if (IsTransparentProxy(obj))
- return ((ClientIdentity)GetRealProxy (obj).ObjectIdentity).EnvoySink;
- else
- throw new ArgumentException ("obj must be a proxy","obj");
- }
-
- public static void LogRemotingStage (int stage)
- {
- throw new NotImplementedException ();
- }
-
[MonoTODO]
public static string GetSessionIdForMethodMessage(IMethodMessage msg)
{
@@ -486,7 +467,7 @@ namespace System.Runtime.Remoting
internal static object GetProxyForRemoteObject (ObjRef objref, Type classToProxy)
{
- ClientActivatedIdentity identity = GetIdentityForUri (objref.URI) as ClientActivatedIdentity;
+ ClientActivatedIdentity identity = uri_hash [objref.URI] as ClientActivatedIdentity;
if (identity != null) return identity.GetServerObject ();
else return GetRemoteObject (objref, classToProxy);
}
@@ -525,10 +506,7 @@ namespace System.Runtime.Remoting
internal static void DisposeIdentity (ServerIdentity ident)
{
- lock (uri_hash)
- {
- uri_hash.Remove (ident.ObjectUri);
- }
+ uri_hash.Remove (ident.ObjectUri);
}
internal static Identity GetMessageTargetIdentity (IMessage msg)
diff --git a/mcs/class/corlib/System.Security.Cryptography/ChangeLog b/mcs/class/corlib/System.Security.Cryptography/ChangeLog
index e90342090b7..87edf0a8360 100644
--- a/mcs/class/corlib/System.Security.Cryptography/ChangeLog
+++ b/mcs/class/corlib/System.Security.Cryptography/ChangeLog
@@ -1,8 +1,3 @@
-2003-08-24 Sebastien Pouliot <spouliot@videotron.ca>
-
- * SymmetricAlgorithm.cs: Fixed IV length exception for stream ciphers
- (e.g. RC4) which don't uses IV. This needs more tests for small IV...
-
2003-08-09 Sebastien Pouliot <spouliot@videotron.ca>
* SymmetricAlgorithm.cs: Re-introduced Lluis patch for PaddingMode.None
diff --git a/mcs/class/corlib/System.Security.Cryptography/SymmetricAlgorithm.cs b/mcs/class/corlib/System.Security.Cryptography/SymmetricAlgorithm.cs
index 7795d819121..578227afd51 100755
--- a/mcs/class/corlib/System.Security.Cryptography/SymmetricAlgorithm.cs
+++ b/mcs/class/corlib/System.Security.Cryptography/SymmetricAlgorithm.cs
@@ -381,7 +381,7 @@ namespace System.Security.Cryptography {
if (KeySizes.IsLegalKeySize (this.LegalBlockSizesValue, value))
this.BlockSizeValue = value;
else
- throw new CryptographicException ("block size not supported by algorithm");
+ throw new CryptographicException("block size not supported by algorithm");
}
}
@@ -392,7 +392,7 @@ namespace System.Security.Cryptography {
get { return this.FeedbackSizeValue; }
set {
if (value > this.BlockSizeValue)
- throw new CryptographicException ("feedback size larger than block size");
+ throw new CryptographicException("feedback size larger than block size");
else
this.FeedbackSizeValue = value;
}
@@ -404,18 +404,19 @@ namespace System.Security.Cryptography {
public virtual byte[] IV {
get {
if (this.IVValue == null)
- GenerateIV ();
+ GenerateIV();
return this.IVValue;
}
set {
if (value == null)
- throw new ArgumentNullException ("value");
- // compare bytes with bits
- if ((value.Length << 3) > this.BlockSizeValue)
- throw new CryptographicException ("IV length can't be greater than block size");
+ throw new ArgumentNullException ("tried setting initial vector to null");
+
+ if (value.Length * 8 != this.BlockSizeValue)
+ throw new CryptographicException ("IV length must match block size");
- this.IVValue = (byte[]) value.Clone ();
+ this.IVValue = new byte [value.Length];
+ Array.Copy (value, 0, this.IVValue, 0, value.Length);
}
}
@@ -425,21 +426,20 @@ namespace System.Security.Cryptography {
public virtual byte[] Key {
get {
if (this.KeyValue == null)
- GenerateKey ();
+ GenerateKey();
return this.KeyValue;
}
set {
if (value == null)
- throw new ArgumentNullException ("value");
- // compare bytes with bits
- int length = (value.Length << 3);
+ throw new ArgumentNullException ("tried setting key to null");
- if (!KeySizes.IsLegalKeySize (this.LegalKeySizesValue, length))
+ if (!KeySizes.IsLegalKeySize (this.LegalKeySizesValue, value.Length * 8))
throw new CryptographicException ("key size not supported by algorithm");
- this.KeySizeValue = length;
- this.KeyValue = (byte[]) value.Clone ();
+ this.KeySizeValue = value.Length * 8;
+ this.KeyValue = new byte [value.Length];
+ Array.Copy (value, 0, this.KeyValue, 0, value.Length);
}
}
@@ -477,7 +477,7 @@ namespace System.Security.Cryptography {
public virtual CipherMode Mode {
get { return this.ModeValue; }
set {
- if (Enum.IsDefined (ModeValue.GetType (), value))
+ if (Enum.IsDefined( ModeValue.GetType (), value))
this.ModeValue = value;
else
throw new CryptographicException ("padding mode not available");
diff --git a/mcs/class/corlib/System.Text/ChangeLog b/mcs/class/corlib/System.Text/ChangeLog
index 0f62468ef02..aa69f6a9989 100755
--- a/mcs/class/corlib/System.Text/ChangeLog
+++ b/mcs/class/corlib/System.Text/ChangeLog
@@ -1,11 +1,3 @@
-2003-08-21 Ben Maurer <bmaurer@users.sourceforge.net>
-
- * StringBuilder.cs
- (AppendFormat) Use FormatHelper in System.String to avoid
- allocating an extra StringBuilder.
- (Append string, int, int), (Append char, int): Both were
- allocating extra strings.
-
2003-06-05 Nick Drochak <ndrochak@gol.com>
* UTF8Encoding.cs: Cleanups according to class status page
diff --git a/mcs/class/corlib/System.Text/StringBuilder.cs b/mcs/class/corlib/System.Text/StringBuilder.cs
index cd769bc77e2..09196a5ddbf 100644
--- a/mcs/class/corlib/System.Text/StringBuilder.cs
+++ b/mcs/class/corlib/System.Text/StringBuilder.cs
@@ -258,7 +258,7 @@ namespace System.Text {
return Replace( oldValue, newValue, 0, sLength );
}
- public StringBuilder Replace( string oldValue, string newValue, int startIndex, int count ) {
+ public StringBuilder Replace( string oldValue, string newValue, int startIndex, int count ) {
string startString = this.ToString();
StringBuilder newStringB = new StringBuilder();
@@ -430,21 +430,9 @@ namespace System.Text {
public StringBuilder Append( char value, int repeatCount ) {
if( repeatCount < 0 ) {
throw new ArgumentOutOfRangeException();
- }
-
- if( sLength + repeatCount > sCapacity ) {
- // Need more capacity, double the capacity StringBuilder
- // and make sure we have at least enough for the value
- // if that's going to go over double.
-
- Capacity = repeatCount + ( sCapacity + sCapacity);
- }
-
- for (int i = 0; i < repeatCount; i++)
- sString [sLength++] = value;
-
- thestring = null;
- return this;
+ }
+
+ return Append( new String( value, repeatCount) );
}
public StringBuilder Append( char[] value, int startIndex, int charCount ) {
@@ -472,44 +460,41 @@ namespace System.Text {
if( (count < 0 || startIndex < 0) ||
( startIndex + count > value.Length ) ) {
throw new ArgumentOutOfRangeException();
- }
-
- int new_size = sLength + count;
- if (new_size > sCapacity)
- Capacity = count + sCapacity * 2;
-
- value.CopyTo (startIndex, sString, sLength, count);
- sLength = new_size;
- thestring = null;
- return this;
+ }
+
+ return Append (value.Substring (startIndex, count));
}
public StringBuilder AppendFormat (string format, object arg0 )
{
- return AppendFormat (null, format, new object [] { arg0 });
+ string result = String.Format (format, arg0);
+ return Append (result);
}
public StringBuilder AppendFormat (string format, params object[] args )
{
- return AppendFormat (null, format, args);
+ string result = String.Format (format, args);
+ return Append (result);
}
public StringBuilder AppendFormat (IFormatProvider provider,
string format,
params object[] args)
{
- String.FormatHelper (this, provider, format, args);
- return this;
+ string result = String.Format (provider, format, args);
+ return Append (result);
}
public StringBuilder AppendFormat (string format, object arg0, object arg1 )
{
- return AppendFormat (null, format, new object [] { arg0, arg1 });
+ string result = String.Format (format, arg0, arg1);
+ return Append (result);
}
public StringBuilder AppendFormat (string format, object arg0, object arg1, object arg2 )
{
- return AppendFormat (null, format, new object [] { arg0, arg1, arg2 });
+ string result = String.Format (format, arg0, arg1, arg2);
+ return Append (result);
}
/* The Insert Functions */
diff --git a/mcs/class/corlib/System.Threading/ChangeLog b/mcs/class/corlib/System.Threading/ChangeLog
index 1242777b10d..8a94a0f256a 100644
--- a/mcs/class/corlib/System.Threading/ChangeLog
+++ b/mcs/class/corlib/System.Threading/ChangeLog
@@ -1,14 +1,3 @@
-
-Wed Aug 20 12:01:36 CEST 2003 Paolo Molaro <lupus@ximian.com>
-
- * Thread.cs: put all the fields at the start and add
- more fields needed by the runtime.
-
-2003-08-14 Lluis Sanchez Gual <lluis@ximian.com>
-
- * Thread.cs: SetData() method: use Hashtable.Contains to check
- if a dataslot has been allocated (value could be null).
-
2003-07-23 Duncan Mak <duncan@ximian.com>
* WaitHandle.cs (CheckDisposed): This method is not in the public
diff --git a/mcs/class/corlib/System.Threading/Thread.cs b/mcs/class/corlib/System.Threading/Thread.cs
index 5a6526c7b1f..b04cc1ada65 100755
--- a/mcs/class/corlib/System.Threading/Thread.cs
+++ b/mcs/class/corlib/System.Threading/Thread.cs
@@ -34,12 +34,6 @@ namespace System.Threading
private IntPtr start_notify;
private IntPtr stack_ptr;
private IntPtr static_data;
- private IntPtr jit_data;
- private IntPtr lock_data;
-
- private ThreadStart threadstart;
- private string thread_name=null;
-
public static Context CurrentContext {
get {
@@ -180,7 +174,7 @@ namespace System.Threading
object data) {
Hashtable slothash=GetTLSSlotHash();
- if(slothash.Contains(slot)) {
+ if(slothash[slot]!=null) {
slothash.Remove(slot);
}
@@ -221,6 +215,8 @@ namespace System.Threading
[MethodImplAttribute(MethodImplOptions.InternalCall)]
private extern IntPtr Thread_internal(ThreadStart start);
+ private ThreadStart threadstart;
+
public Thread(ThreadStart start) {
if(start==null) {
throw new ArgumentNullException("Null ThreadStart");
@@ -323,6 +319,8 @@ namespace System.Threading
}
}
+ private string thread_name=null;
+
public string Name {
get {
return(thread_name);
diff --git a/mcs/class/corlib/System/Array.cs b/mcs/class/corlib/System/Array.cs
index 1cbddf49dc8..c7379af5006 100644
--- a/mcs/class/corlib/System/Array.cs
+++ b/mcs/class/corlib/System/Array.cs
@@ -49,13 +49,9 @@ namespace System
// IList interface
object IList.this [int index] {
get {
- if (unchecked ((uint) index) >= unchecked ((uint) Length))
- throw new ArgumentOutOfRangeException ("index");
return GetValueImpl (index);
}
set {
- if (unchecked ((uint) index) >= unchecked ((uint) Length))
- throw new ArgumentOutOfRangeException ("index");
SetValueImpl (value, index);
}
}
@@ -130,11 +126,9 @@ namespace System
[MethodImplAttribute(MethodImplOptions.InternalCall)]
public extern void SetValue (object value, int[] idxs);
- /* CAUTION! No bounds checking! */
[MethodImplAttribute(MethodImplOptions.InternalCall)]
internal extern object GetValueImpl (int pos);
- /* CAUTION! No bounds checking! */
[MethodImplAttribute(MethodImplOptions.InternalCall)]
internal extern void SetValueImpl (object value, int pos);
diff --git a/mcs/class/corlib/System/ChangeLog b/mcs/class/corlib/System/ChangeLog
index 4db0128a5b5..d89e960f4d8 100644
--- a/mcs/class/corlib/System/ChangeLog
+++ b/mcs/class/corlib/System/ChangeLog
@@ -1,26 +1,3 @@
-2003-08-26 Ben Maurer <bmaurer@users.sourceforge.net>
-
- * Exception.cs: Add ClassInterface attr. Implement TargetSite and
- Source. Remove MonoTODO attributes (class is 100% done). Also
- passes all Rotor tests for Exception!
-
-2003-08-26 Ben Maurer <bmaurer@users.sourceforge.net>
-
- * Enum.cs: Remove [MonoTODO]'s that had been completed.
-
-2003-08-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * String.cs: fixed bug #47802.
-
-2003-08-21 Ben Maurer <bmaurer@users.sourceforge.net>
-
- * String.cs: Created method FormatHelper that does formatting,
- using a StringBuilder.
-
-2003-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * Array.cs: patch by lb@lb.ods.org that fixes bug #47707.
-
2003-08-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* Delegate.cs: CreteDelegate (Type, MethodInfo) only supports static
diff --git a/mcs/class/corlib/System/Enum.cs b/mcs/class/corlib/System/Enum.cs
index b3406b506a5..8e05d5e5d5b 100644
--- a/mcs/class/corlib/System/Enum.cs
+++ b/mcs/class/corlib/System/Enum.cs
@@ -362,6 +362,7 @@ namespace System {
return ToString (format, null);
}
+ [MonoTODO]
public string ToString (String format, IFormatProvider provider)
{
// provider is not used for Enums
@@ -619,6 +620,7 @@ namespace System {
return retVal;
}
+ [MonoTODO]
public static string Format (Type enumType, object value, string format)
{
if (null == enumType)
diff --git a/mcs/class/corlib/System/Exception.cs b/mcs/class/corlib/System/Exception.cs
index 42bd49f8267..9e9d563c846 100644
--- a/mcs/class/corlib/System/Exception.cs
+++ b/mcs/class/corlib/System/Exception.cs
@@ -8,15 +8,14 @@
// (C) Ximian, Inc. http://www.ximian.com
//
-using System.Runtime.InteropServices;
using System.Runtime.Serialization;
using System.Reflection;
-using System.Diagnostics;
namespace System {
[Serializable]
- [ClassInterface (ClassInterfaceType.AutoDual)]
+ // [ClassInterface (ClassInterfaceType.AutoDual)] (no implementation yet)
+ [MonoTODO]
public class Exception : ISerializable
{
IntPtr [] trace_ips;
@@ -109,16 +108,14 @@ namespace System {
}
}
+ [MonoTODO]
public virtual string Source
{
get
{
- if (source == null) {
- StackTrace st = new StackTrace (this, true);
- if (st.FrameCount > 0)
- source = st.GetFrame (0).GetMethod ().DeclaringType.Assembly.GetName ().Name;
- }
-
+ // TODO: if source is null, we must return
+ // the name of the assembly where the error
+ // originated.
return source;
}
@@ -136,14 +133,12 @@ namespace System {
}
}
+ [MonoTODO]
public MethodBase TargetSite
{
get
{
- StackTrace st = new StackTrace (this, true);
- if (st.FrameCount > 0)
- return st.GetFrame (0).GetMethod ();
-
+ // TODO: Implement this.
return null;
}
}
diff --git a/mcs/class/corlib/System/String.cs b/mcs/class/corlib/System/String.cs
index c4f705c084e..95cf5c70614 100644
--- a/mcs/class/corlib/System/String.cs
+++ b/mcs/class/corlib/System/String.cs
@@ -114,7 +114,7 @@ namespace System {
}
public String[] Split(char[] separator, int count) {
- if (null == separator || separator.Length == 0) {
+ if (null == separator) {
separator = WhiteChars;
}
@@ -566,15 +566,11 @@ namespace System {
}
public static string Format (IFormatProvider provider, string format, params object[] args) {
- StringBuilder b = new StringBuilder ();
- FormatHelper (b, provider, format, args);
- return b.ToString ();
- }
-
- internal static void FormatHelper (StringBuilder result, IFormatProvider provider, string format, params object[] args) {
if (format == null || args == null)
throw new ArgumentNullException ();
-
+
+ StringBuilder result = new StringBuilder ();
+
int ptr = 0;
int start = ptr;
while (ptr < format.length) {
@@ -642,6 +638,8 @@ namespace System {
if (start < format.length)
result.Append (format.Substring (start));
+
+ return result.ToString ();
}
public static String Copy (String str) {
diff --git a/mcs/class/corlib/Test/System.Diagnostics/ChangeLog b/mcs/class/corlib/Test/System.Diagnostics/ChangeLog
index 75a3b306872..94239863b35 100644
--- a/mcs/class/corlib/Test/System.Diagnostics/ChangeLog
+++ b/mcs/class/corlib/Test/System.Diagnostics/ChangeLog
@@ -1,8 +1,3 @@
-2003-08-19 Nick Drochak <ndrochak@gol.com>
-
- * StackFrameTest.cs: Isolate test failure by making tests finer
- grained.
-
2003-07-01 Zoltan Varga <vargaz@freemail.hu>
* StackFrameTest.cs (TestGetMethod): Remove test for method name, since
diff --git a/mcs/class/corlib/Test/System.Diagnostics/StackFrameTest.cs b/mcs/class/corlib/Test/System.Diagnostics/StackFrameTest.cs
index ab612c51f36..c8a77d778f9 100644
--- a/mcs/class/corlib/Test/System.Diagnostics/StackFrameTest.cs
+++ b/mcs/class/corlib/Test/System.Diagnostics/StackFrameTest.cs
@@ -132,13 +132,10 @@ namespace MonoTests.System.Diagnostics {
/// <summary>
/// Tests whether getting file name works.
/// </summary>
- public void TestGetFileName1() {
+ public void TestGetFileName() {
AssertNull("File name (1)",
frame1.GetFileName());
- }
-
- public void TestGetFileName2() {
Assert("File name (2) " + frame2.GetFileName()
+ " ends with StackFrameTest.cs",
frame2.GetFileName().EndsWith("StackFrameTest.cs"));
diff --git a/mcs/class/corlib/Test/System/ArrayTest.cs b/mcs/class/corlib/Test/System/ArrayTest.cs
index c14d43f0775..5f0f85e752c 100644
--- a/mcs/class/corlib/Test/System/ArrayTest.cs
+++ b/mcs/class/corlib/Test/System/ArrayTest.cs
@@ -26,14 +26,6 @@ namespace MonoTests.System
}
}
- class BClass : AClass
- {
- }
-
- class CClass : AClass
- {
- }
-
struct AStruct
{
public string s;
@@ -552,21 +544,6 @@ public class ArrayTest : Assertion
}
Assert("#E79", !errorThrown);
}
-
- {
- // bug #38812
- bool errorThrown = false;
- try {
- CClass[] src = new CClass [] { new CClass () };
- BClass[] dest = new BClass [1];
-
- src.CopyTo (dest, 0);
-
- } catch (ArrayTypeMismatchException) {
- errorThrown = true;
- }
- Assert("#E80", errorThrown);
- }
}
[Test]
diff --git a/mcs/class/corlib/Test/System/ChangeLog b/mcs/class/corlib/Test/System/ChangeLog
index 56f821d8210..3484ec73dfc 100644
--- a/mcs/class/corlib/Test/System/ChangeLog
+++ b/mcs/class/corlib/Test/System/ChangeLog
@@ -1,11 +1,3 @@
-2003-08-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * StringTest.cs: added a couple of tests for Split. See bug #47802.
-
-2003-08-21 Zoltan Varga <vargaz@freemail.hu>
-
- * ArrayTest.cs: Added regression test for #38812.
-
2003-08-10 Miguel de Icaza <miguel@ximian.com>
* ArrayTest.cs: New test from Thong (Tum) Nguyen.
diff --git a/mcs/class/corlib/Test/System/StringTest.cs b/mcs/class/corlib/Test/System/StringTest.cs
index 29726616e61..f7599888ef8 100644
--- a/mcs/class/corlib/Test/System/StringTest.cs
+++ b/mcs/class/corlib/Test/System/StringTest.cs
@@ -944,16 +944,6 @@ public class StringTest : Assertion
AssertEquals("Zero split", 0, chunks.Length);
}
- [Test]
- public void MoreSplit ()
- {
- string test = "123 456 789";
- string [] st = test.Split ();
- AssertEquals ("#01", "123", st [0]);
- st = test.Split (null);
- AssertEquals ("#02", "123", st [0]);
- }
-
public void TestStartsWith() {
string s1 = "original";
diff --git a/mcs/class/corlib/corlib_test.dll.sources b/mcs/class/corlib/corlib_test.dll.sources
index 28e13e70eb3..0039ca30698 100755
--- a/mcs/class/corlib/corlib_test.dll.sources
+++ b/mcs/class/corlib/corlib_test.dll.sources
@@ -53,7 +53,6 @@ System.Collections/CaseInsensitiveComparerTest.cs
System.Collections/CaseInsensitiveHashCodeProviderTest.cs
System.Collections/CollectionBaseTest.cs
System.Collections/ComparerTest.cs
-System.Collections/DictionaryBaseTest.cs
System.Collections/DictionaryEntryTest.cs
System.Collections/HashtableTest.cs
System.Collections/QueueTest.cs
diff --git a/mcs/gmcs/AssemblyInfo.cs b/mcs/gmcs/AssemblyInfo.cs
index 19fca65f4d4..60c2d35431d 100644
--- a/mcs/gmcs/AssemblyInfo.cs
+++ b/mcs/gmcs/AssemblyInfo.cs
@@ -1,7 +1,7 @@
using System.Reflection;
using System.Runtime.CompilerServices;
-[assembly: AssemblyVersion("0.26")]
+[assembly: AssemblyVersion("0.25.99")]
[assembly: AssemblyTitle ("Mono C# Compiler")]
[assembly: AssemblyDescription ("Mono C# Compiler with Generics")]
[assembly: AssemblyCopyright ("2001, 2002, 2003 Ximian, Inc.")]
diff --git a/mcs/gmcs/ChangeLog b/mcs/gmcs/ChangeLog
index 297c122429e..88ab7258240 100755
--- a/mcs/gmcs/ChangeLog
+++ b/mcs/gmcs/ChangeLog
@@ -1,139 +1,3 @@
-2003-08-26 Martin Baulig <martin@ximian.com>
-
- * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
- resolving aliases; fixes #47927.
-
-2003-08-26 Martin Baulig <martin@ximian.com>
-
- * statement.cs (Using.DoResolve): This is internally emitting a
- try/finally clause, so we need to set ec.NeedExplicitReturn if we
- do not always return. Fixes #47681.
-
-2003-08-26 Martin Baulig <martin@ximian.com>
-
- * decl.cs (MemberCore): Moved WarningNotHiding(),
- Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
- into MemberBase.
- (AdditionResult): Make this nested in DeclSpace.
- (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
- argument; call NamespaceEntry.Define() unless we're nested in a
- class or struct.
-
- * namespace.cs (Namespace.DefineName): New public function. This
- is called from DeclSpace's .ctor to add
- (Namespace.Lookup): Include DeclSpaces in the lookup.
-
- * class.cs (Operator): Derive from MemberBase, not MemberCore.
-
- * const.cs (Const): Derive from MemberBase, not MemberCore.
-
-2003-08-25 Martin Baulig <martin@ximian.com>
-
- * convert.cs (Convert.ExplicitReferenceConversion): When
- converting from an interface type to a class, unbox if the target
- type is a struct type. Fixes #47822.
-
-2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
- #47854.
-
-2003-08-22 Martin Baulig <martin@ximian.com>
-
- * class.cs (TypeManager.DefineType): When defining a nested type,
- call DefineType() on our parent; fixes #47801.
-
-2003-08-22 Martin Baulig <martin@ximian.com>
-
- * class.cs (MethodData.Define): While checking if a method is an
- interface implementation, improve the test a bit more to fix #47654.
-
-2003-08-22 Martin Baulig <martin@ximian.com>
-
- * expression.cs (Probe.DoResolve): Check whether `expr' resolved
- correctly; fixes #47722.
-
-2003-08-22 Martin Baulig <martin@ximian.com>
-
- * expression.cs (UnaryMutator.ResolveVariable): If the target is a
- LocalVariableReference, ensure it's not read-only. Fixes #47536.
-
- * statement.cs (Fixed.DoResolve): Make all variables read-only.
-
-2003-08-22 Martin Baulig <martin@ximian.com>
-
- * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
- can only be assigned in static constructors. Fixes #47161.
-
-2003-08-22 Martin Baulig <martin@ximian.com>
-
- Rewrote and improved the flow analysis code.
-
- * flowbranching.cs (FlowBranching): Make this class abstract.
- (FlowBranching.CreateBranching): New static function to create a
- new flow branching.
- (FlowBranchingBlock, FlowBranchingException): New classes.
- (FlowBranching.UsageVector.Type): New public readonly field.
- (FlowBranching.UsageVector.Breaks): Removed the setter.
- (FlowBranching.UsageVector.Returns): Removed the setter.
- (FlowBranching.UsageVector): Added Break(), Return(),
- NeverReachable() and Throw() methods to modify the reachability.
- (FlowBranching.UsageVector.MergeChildren): Removed, this is now
- done by FlowBranching.Merge().
- (FlowBranching.UsageVector.MergeChild): New method; merges the
- merge result into the current vector.
- (FlowBranching.Merge): New abstract method to merge a branching.
-
-2003-08-12 Martin Baulig <martin@ximian.com>
-
- * expression.cs (Indirection.CacheTemporaries): Create the
- LocalTemporary with the pointer type, not its element type.
-
-2003-08-10 Miguel de Icaza <miguel@ximian.com>
-
- * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
- token was a keyword or not.
-
- Add `error' options where an IDENTIFIER was expected; Provide
- CheckToken and CheckIdentifierToken convenience error reporting
- functions.
-
- Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
-
- * decl.cs: Rename `NamespaceEntry Namespace' public field into
- NameSpaceEntry NameSpaceEntry.
-
- (LookupInterfaceOrClass): Avoid creating a full qualified name
- from namespace and name: avoid doing lookups when we know the
- namespace is non-existant. Use new Tree.LookupByNamespace which
- looks up DeclSpaces based on their namespace, name pair.
-
- * driver.cs: Provide a new `parser verbose' to display the
- exception thrown during parsing. This is turned off by default
- now, so the output of a failure from mcs is more graceful.
-
- * namespace.cs: Track all the namespaces defined in a hashtable
- for quick lookup.
-
- (IsNamespace): New method
-
-2003-08-09 Miguel de Icaza <miguel@ximian.com>
-
- * namespace.cs: Remove redundant call; Avoid using MakeFQN when
- we know that we need to concatenate (full typename can never be
- null).
-
- * class.cs: ditto.
-
- * statement.cs: Use a bitfield; Do not initialize to null things
- which are done by the constructor by default.
-
- * cs-parser.jay: bug fix, parameter was 4, not 3.
-
- * expression.cs: Just use the property;
-
- * statement.cs: No need for GetVariableInfo method.
-
2003-08-08 Martin Baulig <martin@ximian.com>
* flowanalysis.cs (FlowReturns): This is now nested in the
diff --git a/mcs/gmcs/Makefile b/mcs/gmcs/Makefile
index 56cd632fa44..d16d330b492 100644
--- a/mcs/gmcs/Makefile
+++ b/mcs/gmcs/Makefile
@@ -86,9 +86,5 @@ mcs2.exe: gmcs.exe
mcs3.exe: mcs2.exe
$(TIME) $(RUNTIME) ./mcs2.exe $(USE_MCS_FLAGS) /target:exe /out:$@ $(all_sources)
-ctest:
- -rm mcs2.exe mcs3.exe
- make btest USE_MCS_FLAGS=
-
response:
echo $(all_sources) > res
diff --git a/mcs/gmcs/class.cs b/mcs/gmcs/class.cs
index f3e394b8a13..c80cb78877c 100755
--- a/mcs/gmcs/class.cs
+++ b/mcs/gmcs/class.cs
@@ -134,8 +134,8 @@ namespace Mono.CSharp {
//
public string IndexerName;
- public TypeContainer (NamespaceEntry ns, TypeContainer parent, string name, Location l)
- : base (ns, parent, name, l)
+ public TypeContainer (TypeContainer parent, string name, Location l)
+ : base (parent, name, l)
{
string n;
types = new ArrayList ();
@@ -810,6 +810,7 @@ namespace Mono.CSharp {
TypeAttributes type_attributes = TypeAttr;
+ // if (parent_builder is ModuleBuilder) {
if (IsTopLevel){
if (TypeManager.NamespaceClash (Name, Location))
return null;
@@ -819,7 +820,7 @@ namespace Mono.CSharp {
Name, type_attributes, parent, ifaces);
} else {
- TypeBuilder builder = Parent.DefineType ();
+ TypeBuilder builder = Parent.TypeBuilder;
TypeBuilder = builder.DefineNestedType (
Basename, type_attributes, parent, ifaces);
}
@@ -904,7 +905,7 @@ namespace Mono.CSharp {
if (idx < 0){
if (RootContext.WarningLevel >= 4){
if ((mc.ModFlags & Modifiers.NEW) != 0)
- Warning_KeywordNewNotRequired (mc.Location, mc);
+ Warning_KewywordNewNotRequired (mc.Location, mc);
}
} else if (mc is MethodCore)
((MethodCore) mc).OverridesSomething = true;
@@ -1048,7 +1049,7 @@ namespace Mono.CSharp {
Type ptype = null;
Type t = pclass.TypeBuilder.BaseType;
while ((t != null) && (ptype == null)) {
- pname = t.FullName + "." + Basename;
+ pname = MakeFQN (t.FullName, Basename);
ptype = RootContext.LookupType (this, pname, true, Location.Null);
t = t.BaseType;
}
@@ -1643,7 +1644,7 @@ namespace Mono.CSharp {
mi.ReflectedType.Name + "." + mi.Name + "'");
}
- public void Warning_KeywordNewNotRequired (Location l, MemberCore mc)
+ public void Warning_KewywordNewNotRequired (Location l, MemberCore mc)
{
Report.Warning (
109, l, "The member " + MakeName (mc.Name) + " does not hide an " +
@@ -2112,8 +2113,8 @@ namespace Mono.CSharp {
Modifiers.SEALED |
Modifiers.UNSAFE;
- public Class (NamespaceEntry ns, TypeContainer parent, string name, int mod, Attributes attrs, Location l)
- : base (ns, parent, name, l)
+ public Class (TypeContainer parent, string name, int mod, Attributes attrs, Location l)
+ : base (parent, name, l)
{
int accmods;
@@ -2149,8 +2150,8 @@ namespace Mono.CSharp {
Modifiers.UNSAFE |
Modifiers.PRIVATE;
- public Struct (NamespaceEntry ns, TypeContainer parent, string name, int mod, Attributes attrs, Location l)
- : base (ns, parent, name, l)
+ public Struct (TypeContainer parent, string name, int mod, Attributes attrs, Location l)
+ : base (parent, name, l)
{
int accmods;
@@ -2198,7 +2199,7 @@ namespace Mono.CSharp {
public MethodCore (Expression type, int mod, int allowed_mod, string name,
Attributes attrs, Parameters parameters, Location loc)
- : base (type, mod, allowed_mod, Modifiers.PRIVATE, name, attrs, loc)
+ : base (type, mod, allowed_mod, name, attrs, loc)
{
Parameters = parameters;
}
@@ -3209,21 +3210,14 @@ namespace Mono.CSharp {
Modifiers.Error_InvalidModifier (Location, "public, virtual or abstract");
implementing = null;
}
- } else if ((flags & MethodAttributes.MemberAccessMask) != MethodAttributes.Public){
- if (TypeManager.IsInterfaceType (implementing.DeclaringType)){
- //
- // If this is an interface method implementation,
- // check for public accessibility
- //
- implementing = null;
- } else if ((flags & MethodAttributes.MemberAccessMask) == MethodAttributes.Private){
- // We may never be private.
- implementing = null;
- } else if ((modifiers & Modifiers.OVERRIDE) == 0){
- //
- // We may be protected if we're overriding something.
- //
- implementing = null;
+ } else {
+ //
+ // If this is an interface method implementation,
+ // check for public accessibility
+ //
+ if ((flags & MethodAttributes.MemberAccessMask) != MethodAttributes.Public){
+ if (TypeManager.IsInterfaceType (implementing.DeclaringType))
+ implementing = null;
}
}
@@ -3498,12 +3492,12 @@ namespace Mono.CSharp {
//
// The constructor is only exposed to our children
//
- protected MemberBase (Expression type, int mod, int allowed_mod, int def_mod, string name,
+ protected MemberBase (Expression type, int mod, int allowed_mod, string name,
Attributes attrs, Location loc)
: base (name, loc)
{
Type = type;
- ModFlags = Modifiers.Check (allowed_mod, mod, def_mod, loc);
+ ModFlags = Modifiers.Check (allowed_mod, mod, Modifiers.PRIVATE, loc);
OptAttributes = attrs;
}
@@ -3521,153 +3515,6 @@ namespace Mono.CSharp {
return true;
}
- protected void WarningNotHiding (TypeContainer parent)
- {
- Report.Warning (
- 109, Location,
- "The member " + parent.MakeName (Name) + " does not hide an " +
- "inherited member. The keyword new is not required");
-
- }
-
- void Error_CannotChangeAccessModifiers (TypeContainer parent, MethodInfo parent_method,
- string name)
- {
- //
- // FIXME: report the old/new permissions?
- //
- Report.Error (
- 507, Location, parent.MakeName (Name) +
- ": can't change the access modifiers when overriding inherited " +
- "member `" + name + "'");
- }
-
- //
- // Performs various checks on the MethodInfo `mb' regarding the modifier flags
- // that have been defined.
- //
- // `name' is the user visible name for reporting errors (this is used to
- // provide the right name regarding method names and properties)
- //
- protected bool CheckMethodAgainstBase (TypeContainer parent, MethodAttributes my_attrs,
- MethodInfo mb, string name)
- {
- bool ok = true;
-
- if ((ModFlags & Modifiers.OVERRIDE) != 0){
- if (!(mb.IsAbstract || mb.IsVirtual)){
- Report.Error (
- 506, Location, parent.MakeName (Name) +
- ": cannot override inherited member `" +
- name + "' because it is not " +
- "virtual, abstract or override");
- ok = false;
- }
-
- // Now we check that the overriden method is not final
-
- if (mb.IsFinal) {
- // This happens when implementing interface methods.
- if (mb.IsHideBySig && mb.IsVirtual) {
- Report.Error (
- 506, Location, parent.MakeName (Name) +
- ": cannot override inherited member `" +
- name + "' because it is not " +
- "virtual, abstract or override");
- } else
- Report.Error (239, Location, parent.MakeName (Name) + " : cannot " +
- "override inherited member `" + name +
- "' because it is sealed.");
- ok = false;
- }
- //
- // Check that the permissions are not being changed
- //
- MethodAttributes thisp = my_attrs & MethodAttributes.MemberAccessMask;
- MethodAttributes parentp = mb.Attributes & MethodAttributes.MemberAccessMask;
-
- //
- // special case for "protected internal"
- //
-
- if ((parentp & MethodAttributes.FamORAssem) == MethodAttributes.FamORAssem){
- //
- // when overriding protected internal, the method can be declared
- // protected internal only within the same assembly
- //
-
- if ((thisp & MethodAttributes.FamORAssem) == MethodAttributes.FamORAssem){
- if (parent.TypeBuilder.Assembly != mb.DeclaringType.Assembly){
- //
- // assemblies differ - report an error
- //
-
- Error_CannotChangeAccessModifiers (parent, mb, name);
- ok = false;
- } else if (thisp != parentp) {
- //
- // same assembly, but other attributes differ - report an error
- //
-
- Error_CannotChangeAccessModifiers (parent, mb, name);
- ok = false;
- };
- } else if ((thisp & MethodAttributes.Family) != MethodAttributes.Family) {
- //
- // if it's not "protected internal", it must be "protected"
- //
-
- Error_CannotChangeAccessModifiers (parent, mb, name);
- ok = false;
- } else if (parent.TypeBuilder.Assembly == mb.DeclaringType.Assembly) {
- //
- // protected within the same assembly - an error
- //
- Error_CannotChangeAccessModifiers (parent, mb, name);
- ok = false;
- } else if ((thisp & ~(MethodAttributes.Family | MethodAttributes.FamORAssem)) !=
- (parentp & ~(MethodAttributes.Family | MethodAttributes.FamORAssem))) {
- //
- // protected ok, but other attributes differ - report an error
- //
- Error_CannotChangeAccessModifiers (parent, mb, name);
- ok = false;
- }
- } else {
- if (thisp != parentp){
- Error_CannotChangeAccessModifiers (parent, mb, name);
- ok = false;
- }
- }
- }
-
- if (mb.IsVirtual || mb.IsAbstract){
- if ((ModFlags & (Modifiers.NEW | Modifiers.OVERRIDE)) == 0){
- if (Name != "Finalize"){
- Report.Warning (
- 114, 2, Location, parent.MakeName (Name) +
- " hides inherited member `" + name +
- "'. To make the current member override that " +
- "implementation, add the override keyword, " +
- "otherwise use the new keyword");
- ModFlags |= Modifiers.NEW;
- }
- }
- } else {
- if ((ModFlags & (Modifiers.NEW | Modifiers.OVERRIDE)) == 0){
- if (Name != "Finalize"){
- Report.Warning (
- 108, 1, Location, "The keyword new is required on " +
- parent.MakeName (Name) + " because it hides " +
- "inherited member `" + name + "'");
- ModFlags |= Modifiers.NEW;
- }
- }
- }
-
- return ok;
- }
-
protected virtual bool CheckParameters (TypeContainer container, Type [] parameters)
{
bool error = false;
@@ -3807,7 +3654,7 @@ namespace Mono.CSharp {
//
protected FieldBase (Expression type, int mod, int allowed_mod, string name,
object init, Attributes attrs, Location loc)
- : base (type, mod, allowed_mod, Modifiers.PRIVATE, name, attrs, loc)
+ : base (type, mod, allowed_mod, name, attrs, loc)
{
this.init = init;
}
@@ -4758,7 +4605,7 @@ namespace Mono.CSharp {
}
}
- public class Operator : MemberBase {
+ public class Operator : MemberCore {
const int AllowedModifiers =
Modifiers.PUBLIC |
@@ -4813,24 +4660,27 @@ namespace Mono.CSharp {
public readonly Expression FirstArgType, SecondArgType;
public readonly string FirstArgName, SecondArgName;
public Block Block;
+ public Attributes OptAttributes;
public MethodBuilder OperatorMethodBuilder;
public string MethodName;
public Method OperatorMethod;
- public Operator (OpType type, Expression ret_type, int mod_flags,
+ public Operator (OpType type, Expression ret_type, int flags,
Expression arg1type, string arg1name,
Expression arg2type, string arg2name,
Block block, Attributes attrs, Location loc)
- : base (ret_type, mod_flags, AllowedModifiers, Modifiers.PUBLIC, "", attrs, loc)
+ : base ("", loc)
{
OperatorType = type;
ReturnType = ret_type;
+ ModFlags = Modifiers.Check (AllowedModifiers, flags, Modifiers.PUBLIC, loc);
FirstArgType = arg1type;
FirstArgName = arg1name;
SecondArgType = arg2type;
SecondArgName = arg2name;
Block = block;
+ OptAttributes = attrs;
}
string Prototype (TypeContainer container)
diff --git a/mcs/gmcs/codegen.cs b/mcs/gmcs/codegen.cs
index df4a0f40552..7293f99df5a 100755
--- a/mcs/gmcs/codegen.cs
+++ b/mcs/gmcs/codegen.cs
@@ -392,7 +392,7 @@ namespace Mono.CSharp {
// </summary>
public FlowBranching StartFlowBranching (FlowBranching.BranchingType type, Location loc)
{
- FlowBranching cfb = FlowBranching.CreateBranching (CurrentBranching, type, null, loc);
+ FlowBranching cfb = new FlowBranching (CurrentBranching, type, null, loc);
FlowStack.Push (cfb);
@@ -412,7 +412,7 @@ namespace Mono.CSharp {
else
type = FlowBranching.BranchingType.Block;
- cfb = FlowBranching.CreateBranching (CurrentBranching, type, block, block.StartLocation);
+ cfb = new FlowBranching (CurrentBranching, type, block, block.StartLocation);
FlowStack.Push (cfb);
@@ -456,8 +456,7 @@ namespace Mono.CSharp {
bool old_do_flow_analysis = DoFlowAnalysis;
DoFlowAnalysis = true;
- FlowBranching cfb = FlowBranching.CreateBranching (
- null, FlowBranching.BranchingType.Block, block, loc);
+ FlowBranching cfb = new FlowBranching (block, loc);
FlowStack.Push (cfb);
if (!block.Resolve (this)) {
diff --git a/mcs/gmcs/const.cs b/mcs/gmcs/const.cs
index fc7a29f6727..4f54d70e887 100755
--- a/mcs/gmcs/const.cs
+++ b/mcs/gmcs/const.cs
@@ -24,9 +24,10 @@ namespace Mono.CSharp {
using System.Reflection.Emit;
using System.Collections;
- public class Const : MemberBase {
+ public class Const : MemberCore {
public Expression ConstantType;
public Expression Expr;
+ public Attributes OptAttributes;
public FieldBuilder FieldBuilder;
EmitContext const_ec;
@@ -44,11 +45,13 @@ namespace Mono.CSharp {
public Const (Expression constant_type, string name, Expression expr, int mod_flags,
Attributes attrs, Location loc)
- : base (constant_type, mod_flags, AllowedModifiers, Modifiers.PRIVATE, name, attrs, loc)
+ : base (name, loc)
{
ConstantType = constant_type;
Name = name;
Expr = expr;
+ ModFlags = Modifiers.Check (AllowedModifiers, mod_flags, Modifiers.PRIVATE, loc);
+ OptAttributes = attrs;
}
public FieldAttributes FieldAttr {
@@ -95,7 +98,7 @@ namespace Mono.CSharp {
if (ptype != null) {
MemberList list = TypeContainer.FindMembers (
ptype, MemberTypes.Field, BindingFlags.Public,
- System.Type.FilterName, Name);
+ Type.FilterName, Name);
if (list.Count == 0)
if ((ModFlags & Modifiers.NEW) != 0)
diff --git a/mcs/gmcs/convert.cs b/mcs/gmcs/convert.cs
index bd04bc23620..b6dfab95c44 100644
--- a/mcs/gmcs/convert.cs
+++ b/mcs/gmcs/convert.cs
@@ -1514,14 +1514,10 @@ namespace Mono.CSharp {
// sealed, or provided T implements S.
//
if (source_type.IsInterface) {
- if (!target_type.IsSealed || TypeManager.ImplementsInterface (target_type, source_type)) {
- if (target_type.IsClass)
- return new ClassCast (source, target_type);
- else
- return new UnboxCast (source, target_type);
- }
-
- return null;
+ if (!target_type.IsSealed || TypeManager.ImplementsInterface (target_type, source_type))
+ return new ClassCast (source, target_type);
+ else
+ return null;
}
// From an array type S with an element type Se to an array type T with an
diff --git a/mcs/gmcs/cs-parser.jay b/mcs/gmcs/cs-parser.jay
index e0b93ec7525..b6d36d0b5a2 100755
--- a/mcs/gmcs/cs-parser.jay
+++ b/mcs/gmcs/cs-parser.jay
@@ -98,7 +98,6 @@ namespace Mono.CSharp
/*
*These are the C# keywords
*/
-%token FIRST_KEYWORD
%token ABSTRACT
%token AS
%token ADD
@@ -188,8 +187,6 @@ namespace Mono.CSharp
%token GET "get"
%token SET "set"
-%left LAST_KEYWORD
-
/* C# single character operators/punctuation. */
%token OPEN_BRACE "{"
%token CLOSE_BRACE "}"
@@ -313,10 +310,7 @@ using_alias_directive
: USING IDENTIFIER ASSIGN
namespace_or_type_name SEMICOLON
{
- current_namespace.UsingAlias ((string) $2, (Expression) $4, lexer.Location);
- }
- | USING error {
- CheckIdentifierToken (yyToken);
+ current_namespace.UsingAlias ((string) $2, (string) $4, lexer.Location);
}
;
@@ -347,7 +341,7 @@ namespace_declaration
+ " Expected class, delegate, enum, interface, or struct");
}
- current_namespace = RootContext.Tree.RecordNamespace (current_namespace, file, (string) $3, lexer.Location);
+ current_namespace = RootContext.Tree.RecordNamespace (current_namespace, file, (string) $3);
}
namespace_body opt_semicolon
{
@@ -439,10 +433,10 @@ type_declaration
//
// Enable this when we have handled all errors, because this acts as a generic fallback
//
-// | error {
-// Console.WriteLine ("Token=" + yyToken);
-// Report.Error (1518, lexer.Location, "Expected class, struct, interface, enum or delegate");
-// }
+ | error {
+ Console.WriteLine ("Token=" + yyToken);
+ Report.Error (1518, lexer.Location, "Expected class, struct, interface, enum or delegate");
+ }
;
//
@@ -676,9 +670,10 @@ struct_declaration
Struct new_struct;
string full_struct_name = MakeName ((string) $4);
- new_struct = new Struct (current_namespace, current_container, full_struct_name,
- (int) $2, (Attributes) $1, lexer.Location);
+ new_struct = new Struct (current_container, full_struct_name, (int) $2,
+ (Attributes) $1, lexer.Location);
current_container = new_struct;
+ current_container.Namespace = current_namespace;
RootContext.Tree.RecordDecl (full_struct_name, new_struct);
}
opt_class_base
@@ -694,9 +689,6 @@ struct_declaration
CheckDef (current_container.AddStruct (new_struct), new_struct.Name, new_struct.Location);
$$ = new_struct;
}
- | opt_attributes opt_modifiers STRUCT error {
- CheckIdentifierToken (yyToken);
- }
;
struct_body
@@ -983,13 +975,6 @@ fixed_parameter
{
$$ = new Parameter ((Expression) $3, (string) $4, (Parameter.Modifier) $2, (Attributes) $1);
}
- | opt_attributes
- opt_parameter_modifier
- type
- error {
- CheckIdentifierToken (yyToken);
- $$ = null;
- }
;
opt_parameter_modifier
@@ -1008,10 +993,6 @@ parameter_array
$$ = new Parameter ((Expression) $3, (string) $4, Parameter.Modifier.PARAMS, (Attributes) $1);
note ("type must be a single-dimension array type");
}
- | opt_attributes PARAMS type error {
- CheckIdentifierToken (yyToken);
- $$ = null;
- }
;
member_name
@@ -1140,13 +1121,14 @@ interface_declaration
Interface new_interface;
string full_interface_name = MakeName ((string) $4);
- new_interface = new Interface (current_namespace, current_container, full_interface_name,
- (int) $2, (Attributes) $1, lexer.Location);
+ new_interface = new Interface (current_container, full_interface_name, (int) $2,
+ (Attributes) $1, lexer.Location);
if (current_interface != null) {
Location l = lexer.Location;
Report.Error (-2, l, "Internal compiler error: interface inside interface");
}
current_interface = new_interface;
+ new_interface.Namespace = current_namespace;
RootContext.Tree.RecordDecl (full_interface_name, new_interface);
}
opt_interface_base
@@ -1161,9 +1143,6 @@ interface_declaration
CheckDef (current_container.AddInterface (new_interface),
new_interface.Name, new_interface.Location);
}
- | opt_attributes opt_modifiers INTERFACE error {
- CheckIdentifierToken (yyToken);
- }
;
opt_interface_base
@@ -1273,12 +1252,6 @@ interface_property_declaration
(gs & 1) == 1, (gs & 2) == 2, (Attributes) $1,
lexer.Location);
}
- | opt_attributes
- opt_new
- type error {
- CheckIdentifierToken (yyToken);
- $$ = null;
- }
;
interface_accesors
@@ -1296,10 +1269,6 @@ interface_event_declaration
$$ = new InterfaceEvent ((Expression) $4, (string) $5, (bool) $2, (Attributes) $1,
lexer.Location);
}
- | opt_attributes opt_new EVENT type error {
- CheckIdentifierToken (yyToken);
- $$ = null;
- }
;
interface_indexer_declaration
@@ -1757,8 +1726,8 @@ enum_declaration
Location enum_location = lexer.Location;
string full_name = MakeName ((string) $4);
- Enum e = new Enum (current_namespace, current_container, (Expression) $5, (int) $2,
- full_name, (Attributes) $1, enum_location);
+ Enum e = new Enum (current_container, (Expression) $5, (int) $2, full_name,
+ (Attributes) $1, enum_location);
foreach (VariableDeclaration ev in (ArrayList) $6) {
Location loc = (Location) ev.Location;
@@ -1769,6 +1738,8 @@ enum_declaration
ev.identifier, loc);
}
+ e.Namespace = current_namespace;
+
CheckDef (current_container.AddEnum (e), full_name, enum_location);
RootContext.Tree.RecordDecl (full_name, e);
@@ -1835,10 +1806,11 @@ delegate_declaration
SEMICOLON
{
Location l = lexer.Location;
- Delegate del = new Delegate (current_namespace, current_container, (Expression) $4,
- (int) $2, MakeName ((string) $5), (Parameters) $7,
+ Delegate del = new Delegate (current_container, (Expression) $4, (int) $2,
+ MakeName ((string) $5), (Parameters) $7,
(Attributes) $1, l);
+ del.Namespace = current_namespace;
CheckDef (current_container.AddDelegate (del), del.Name, l);
}
| opt_attributes
@@ -1851,10 +1823,11 @@ delegate_declaration
{
Location l = lexer.Location;
Delegate del = new Delegate (
- current_namespace, current_container,
+ current_container,
TypeManager.system_void_expr, (int) $2, MakeName ((string) $5),
(Parameters) $7, (Attributes) $1, l);
+ del.Namespace = current_namespace;
CheckDef (current_container.AddDelegate (del), del.Name, l);
}
;
@@ -2173,9 +2146,6 @@ argument_list
list.Add ($3);
$$ = list;
}
- | argument_list error {
- CheckToken (1026, yyToken, ", or ) expected");
- }
;
argument
@@ -2444,7 +2414,7 @@ anonymous_method_expression
Report.Error (-213, lexer.Location, "Anonymous methods are only supported in V2");
$$ = null;
} else
- $$ = new AnonymousMethod ((Parameters) $2, (Block) $4, lexer.Location);
+ $$ = new AnonymousMethod ((Parameters) $2, (Block) $3, lexer.Location);
current_local_parameters = (Parameters) oob_stack.Pop ();
}
;
@@ -2825,9 +2795,10 @@ class_declaration
name = MakeName ((string) $4);
- new_class = new Class (current_namespace, current_container, name, (int) $2,
+ new_class = new Class (current_container, name, (int) $2,
(Attributes) $1, lexer.Location);
current_container = new_class;
+ current_container.Namespace = current_namespace;
RootContext.Tree.RecordDecl (name, new_class);
}
opt_type_parameter_list
@@ -4004,7 +3975,7 @@ void Error_ExpectingTypeName (Location l, Expression expr)
string
MakeName (string class_name)
{
- string ns = current_namespace.FullName;
+ string ns = current_namespace.Name;
string container_name = current_container.Name;
if (container_name == ""){
@@ -4021,13 +3992,13 @@ MakeName (string class_name)
// in the current declaration space
// </summary>
void
-CheckDef (DeclSpace.AdditionResult result, string name, Location l)
+CheckDef (AdditionResult result, string name, Location l)
{
- if (result == DeclSpace.AdditionResult.Success)
+ if (result == AdditionResult.Success)
return;
switch (result){
- case DeclSpace.AdditionResult.NameExists:
+ case AdditionResult.NameExists:
Report.Error (102, l, "The container `" + current_container.Name +
"' already contains a definition for `"+
name + "'");
@@ -4038,22 +4009,22 @@ CheckDef (DeclSpace.AdditionResult result, string name, Location l)
// This is handled only for static Constructors, because
// in reality we handle these by the semantic analysis later
//
- case DeclSpace.AdditionResult.MethodExists:
+ case AdditionResult.MethodExists:
Report.Error (
111, l, "Class `"+current_container.Name+
"' already defines a member called '" +
name + "' with the same parameter types (more than one default constructor)");
break;
- case DeclSpace.AdditionResult.EnclosingClash:
+ case AdditionResult.EnclosingClash:
Report.Error (542, l, "Member names cannot be the same as their enclosing type");
break;
- case DeclSpace.AdditionResult.NotAConstructor:
+ case AdditionResult.NotAConstructor:
Report.Error (1520, l, "Class, struct, or interface method must have a return type");
break;
- case DeclSpace.AdditionResult.Error:
+ case AdditionResult.Error:
// Error has already been reported.
break;
}
@@ -4064,7 +4035,7 @@ CheckDef (bool result, string name, Location l)
{
if (result)
return;
- CheckDef (DeclSpace.AdditionResult.NameExists, name, l);
+ CheckDef (AdditionResult.NameExists, name, l);
}
Expression DecomposeQI (string name, Location loc)
@@ -4257,11 +4228,11 @@ public Tokenizer Lexer {
public CSharpParser (SeekableStreamReader reader, SourceFile file, ArrayList defines)
{
- current_namespace = new NamespaceEntry (null, file, null, Location.Null);
+ current_namespace = new NamespaceEntry (null, file, null);
this.name = file.Name;
this.file = file;
current_container = RootContext.Tree.Types;
- current_container.NamespaceEntry = current_namespace;
+ current_container.Namespace = current_namespace;
oob_stack = new Stack ();
switch_stack = new Stack ();
@@ -4281,26 +4252,10 @@ public void parse ()
// Please do not remove this, it is used during debugging
// of the grammar
//
+ Report.Error (-25, lexer.Location, ": Parsing error ");
Console.WriteLine (e);
- Report.Error (-25, lexer.Location, "Parsing error");
- if (Driver.parser_verbose)
- Console.WriteLine (e);
}
}
-void CheckToken (int error, int yyToken, string msg)
-{
- if (yyToken >= Token.FIRST_KEYWORD && yyToken <= Token.LAST_KEYWORD){
- Report.Error (error, lexer.Location, String.Format ("{0}: `{1}' is a keyword", msg, yyName [yyToken].ToLower ()));
- return;
- }
- Report.Error (error, lexer.Location, msg);
-}
-
-void CheckIdentifierToken (int yyToken)
-{
- CheckToken (1041, yyToken, "Identifier expected");
-}
-
/* end end end */
}
diff --git a/mcs/gmcs/decl.cs b/mcs/gmcs/decl.cs
index 9cc7b9f6240..f59b592399a 100755
--- a/mcs/gmcs/decl.cs
+++ b/mcs/gmcs/decl.cs
@@ -43,6 +43,153 @@ namespace Mono.CSharp {
Location = loc;
}
+ protected void WarningNotHiding (TypeContainer parent)
+ {
+ Report.Warning (
+ 109, Location,
+ "The member " + parent.MakeName (Name) + " does not hide an " +
+ "inherited member. The keyword new is not required");
+
+ }
+
+ void Error_CannotChangeAccessModifiers (TypeContainer parent, MethodInfo parent_method,
+ string name)
+ {
+ //
+ // FIXME: report the old/new permissions?
+ //
+ Report.Error (
+ 507, Location, parent.MakeName (Name) +
+ ": can't change the access modifiers when overriding inherited " +
+ "member `" + name + "'");
+ }
+
+ //
+ // Performs various checks on the MethodInfo `mb' regarding the modifier flags
+ // that have been defined.
+ //
+ // `name' is the user visible name for reporting errors (this is used to
+ // provide the right name regarding method names and properties)
+ //
+ protected bool CheckMethodAgainstBase (TypeContainer parent, MethodAttributes my_attrs,
+ MethodInfo mb, string name)
+ {
+ bool ok = true;
+
+ if ((ModFlags & Modifiers.OVERRIDE) != 0){
+ if (!(mb.IsAbstract || mb.IsVirtual)){
+ Report.Error (
+ 506, Location, parent.MakeName (Name) +
+ ": cannot override inherited member `" +
+ name + "' because it is not " +
+ "virtual, abstract or override");
+ ok = false;
+ }
+
+ // Now we check that the overriden method is not final
+
+ if (mb.IsFinal) {
+ // This happens when implementing interface methods.
+ if (mb.IsHideBySig && mb.IsVirtual) {
+ Report.Error (
+ 506, Location, parent.MakeName (Name) +
+ ": cannot override inherited member `" +
+ name + "' because it is not " +
+ "virtual, abstract or override");
+ } else
+ Report.Error (239, Location, parent.MakeName (Name) + " : cannot " +
+ "override inherited member `" + name +
+ "' because it is sealed.");
+ ok = false;
+ }
+ //
+ // Check that the permissions are not being changed
+ //
+ MethodAttributes thisp = my_attrs & MethodAttributes.MemberAccessMask;
+ MethodAttributes parentp = mb.Attributes & MethodAttributes.MemberAccessMask;
+
+ //
+ // special case for "protected internal"
+ //
+
+ if ((parentp & MethodAttributes.FamORAssem) == MethodAttributes.FamORAssem){
+ //
+ // when overriding protected internal, the method can be declared
+ // protected internal only within the same assembly
+ //
+
+ if ((thisp & MethodAttributes.FamORAssem) == MethodAttributes.FamORAssem){
+ if (parent.TypeBuilder.Assembly != mb.DeclaringType.Assembly){
+ //
+ // assemblies differ - report an error
+ //
+
+ Error_CannotChangeAccessModifiers (parent, mb, name);
+ ok = false;
+ } else if (thisp != parentp) {
+ //
+ // same assembly, but other attributes differ - report an error
+ //
+
+ Error_CannotChangeAccessModifiers (parent, mb, name);
+ ok = false;
+ };
+ } else if ((thisp & MethodAttributes.Family) != MethodAttributes.Family) {
+ //
+ // if it's not "protected internal", it must be "protected"
+ //
+
+ Error_CannotChangeAccessModifiers (parent, mb, name);
+ ok = false;
+ } else if (parent.TypeBuilder.Assembly == mb.DeclaringType.Assembly) {
+ //
+ // protected within the same assembly - an error
+ //
+ Error_CannotChangeAccessModifiers (parent, mb, name);
+ ok = false;
+ } else if ((thisp & ~(MethodAttributes.Family | MethodAttributes.FamORAssem)) !=
+ (parentp & ~(MethodAttributes.Family | MethodAttributes.FamORAssem))) {
+ //
+ // protected ok, but other attributes differ - report an error
+ //
+ Error_CannotChangeAccessModifiers (parent, mb, name);
+ ok = false;
+ }
+ } else {
+ if (thisp != parentp){
+ Error_CannotChangeAccessModifiers (parent, mb, name);
+ ok = false;
+ }
+ }
+ }
+
+ if (mb.IsVirtual || mb.IsAbstract){
+ if ((ModFlags & (Modifiers.NEW | Modifiers.OVERRIDE)) == 0){
+ if (Name != "Finalize"){
+ Report.Warning (
+ 114, 2, Location, parent.MakeName (Name) +
+ " hides inherited member `" + name +
+ "'. To make the current member override that " +
+ "implementation, add the override keyword, " +
+ "otherwise use the new keyword");
+ ModFlags |= Modifiers.NEW;
+ }
+ }
+ } else {
+ if ((ModFlags & (Modifiers.NEW | Modifiers.OVERRIDE)) == 0){
+ if (Name != "Finalize"){
+ Report.Warning (
+ 108, 1, Location, "The keyword new is required on " +
+ parent.MakeName (Name) + " because it hides " +
+ "inherited member `" + name + "'");
+ ModFlags |= Modifiers.NEW;
+ }
+ }
+ }
+
+ return ok;
+ }
+
public abstract bool Define (TypeContainer parent);
//
@@ -64,6 +211,56 @@ namespace Mono.CSharp {
}
}
+ //
+ // FIXME: This is temporary outside DeclSpace, because I have to fix a bug
+ // in MCS that makes it fail the lookup for the enum
+ //
+
+ /// <summary>
+ /// The result value from adding an declaration into
+ /// a struct or a class
+ /// </summary>
+ public enum AdditionResult {
+ /// <summary>
+ /// The declaration has been successfully
+ /// added to the declation space.
+ /// </summary>
+ Success,
+
+ /// <summary>
+ /// The symbol has already been defined.
+ /// </summary>
+ NameExists,
+
+ /// <summary>
+ /// Returned if the declation being added to the
+ /// name space clashes with its container name.
+ ///
+ /// The only exceptions for this are constructors
+ /// and static constructors
+ /// </summary>
+ EnclosingClash,
+
+ /// <summary>
+ /// Returned if a constructor was created (because syntactically
+ /// it looked like a constructor) but was not (because the name
+ /// of the method is not the same as the container class
+ /// </summary>
+ NotAConstructor,
+
+ /// <summary>
+ /// This is only used by static constructors to emit the
+ /// error 111, but this error for other things really
+ /// happens at another level for other functions.
+ /// </summary>
+ MethodExists,
+
+ /// <summary>
+ /// Some other error.
+ /// </summary>
+ Error
+ }
+
/// <summary>
/// Base class for structs, classes, enumerations and interfaces.
/// </summary>
@@ -88,7 +285,7 @@ namespace Mono.CSharp {
// This is the namespace in which this typecontainer
// was declared. We use this to resolve names.
//
- public NamespaceEntry NamespaceEntry;
+ public NamespaceEntry Namespace;
public Hashtable Cache = new Hashtable ();
@@ -103,64 +300,21 @@ namespace Mono.CSharp {
// Whether we are Generic
//
public bool IsGeneric;
-
+
TypeContainer parent;
- public DeclSpace (NamespaceEntry ns, TypeContainer parent, string name, Location l)
+ public DeclSpace (TypeContainer parent, string name, Location l)
: base (name, l)
{
- NamespaceEntry = ns;
Basename = name.Substring (1 + name.LastIndexOf ('.'));
defined_names = new Hashtable ();
this.parent = parent;
- if ((NamespaceEntry != null) && (parent == RootContext.Tree.Types))
- NamespaceEntry.DefineName (Basename, this);
- }
-
- /// <summary>
- /// The result value from adding an declaration into
- /// a struct or a class
- /// </summary>
- public enum AdditionResult {
- /// <summary>
- /// The declaration has been successfully
- /// added to the declation space.
- /// </summary>
- Success,
-
- /// <summary>
- /// The symbol has already been defined.
- /// </summary>
- NameExists,
-
- /// <summary>
- /// Returned if the declation being added to the
- /// name space clashes with its container name.
- ///
- /// The only exceptions for this are constructors
- /// and static constructors
- /// </summary>
- EnclosingClash,
-
- /// <summary>
- /// Returned if a constructor was created (because syntactically
- /// it looked like a constructor) but was not (because the name
- /// of the method is not the same as the container class
- /// </summary>
- NotAConstructor,
-
- /// <summary>
- /// This is only used by static constructors to emit the
- /// error 111, but this error for other things really
- /// happens at another level for other functions.
- /// </summary>
- MethodExists,
-
- /// <summary>
- /// Some other error.
- /// </summary>
- Error
+ //
+ // We are generic if our parent is generic
+ //
+ if (parent != null)
+ IsGeneric = parent.IsGeneric;
}
/// <summary>
@@ -234,8 +388,8 @@ namespace Mono.CSharp {
/// </summary>
public string LookupAlias (string name)
{
- if (NamespaceEntry != null)
- return NamespaceEntry.LookupAlias (name);
+ if (Namespace != null)
+ return Namespace.LookupAlias (name);
else
return null;
}
@@ -464,49 +618,27 @@ namespace Mono.CSharp {
return false;
}
- static DoubleHash dh = new DoubleHash ();
-
+
Type LookupInterfaceOrClass (string ns, string name, out bool error)
{
DeclSpace parent;
Type t;
- object r;
-
+
error = false;
- if (dh.Lookup (ns, name, out r))
- t = (Type) r;
- else {
- if (ns != ""){
- if (Namespace.IsNamespace (ns)){
- string fullname = (ns != "") ? ns + "." + name : name;
- t = TypeManager.LookupType (fullname);
- } else
- t = null;
- } else
- t = TypeManager.LookupType (name);
- }
-
+ name = MakeFQN (ns, name);
+
+ t = TypeManager.LookupType (name);
if (t != null)
return t;
- //
- // In case we are fed a composite name, normalize it.
- //
- int p = name.LastIndexOf ('.');
- if (p != -1){
- ns = MakeFQN (ns, name.Substring (0, p));
- name = name.Substring (p+1);
- }
-
- parent = RootContext.Tree.LookupByNamespace (ns, name);
+ parent = (DeclSpace) RootContext.Tree.Decls [name];
if (parent == null)
return null;
-
+
t = parent.DefineType ();
- dh.Insert (ns, name, t);
if (t == null){
- Report.Error (146, Location, "Class definition is circular: `" + MakeFQN (ns, name) + "'");
+ Report.Error (146, Location, "Class definition is circular: `"+name+"'");
error = true;
return null;
}
@@ -565,8 +697,8 @@ namespace Mono.CSharp {
//
// Attempt to lookup the class on our namespace and all it's implicit parents
//
- for (NamespaceEntry ns = NamespaceEntry; ns != null; ns = ns.ImplicitParent) {
- t = LookupInterfaceOrClass (ns.FullName, name, out error);
+ for (NamespaceEntry ns = Namespace; ns != null; ns = ns.ImplicitParent) {
+ t = LookupInterfaceOrClass (ns.Name, name, out error);
if (error)
return null;
@@ -589,9 +721,9 @@ namespace Mono.CSharp {
// namespaces
//
- for (NamespaceEntry ns = NamespaceEntry; ns != null; ns = ns.Parent){
+ for (NamespaceEntry ns = Namespace; ns != null; ns = ns.Parent){
- t = LookupInterfaceOrClass (ns.FullName, name, out error);
+ t = LookupInterfaceOrClass (ns.Name, name, out error);
if (error)
return null;
diff --git a/mcs/gmcs/delegate.cs b/mcs/gmcs/delegate.cs
index 35a9e43a0b5..f46b7c87abd 100644
--- a/mcs/gmcs/delegate.cs
+++ b/mcs/gmcs/delegate.cs
@@ -46,10 +46,10 @@ namespace Mono.CSharp {
Modifiers.UNSAFE |
Modifiers.PRIVATE;
- public Delegate (NamespaceEntry ns, TypeContainer parent, Expression type,
- int mod_flags, string name, Parameters param_list,
+ public Delegate (TypeContainer parent, Expression type, int mod_flags,
+ string name, Parameters param_list,
Attributes attrs, Location l)
- : base (ns, parent, name, l)
+ : base (parent, name, l)
{
this.ReturnType = type;
ModFlags = Modifiers.Check (AllowedModifiers, mod_flags,
diff --git a/mcs/gmcs/driver.cs b/mcs/gmcs/driver.cs
index 6418f49f471..01d12ea067c 100755
--- a/mcs/gmcs/driver.cs
+++ b/mcs/gmcs/driver.cs
@@ -60,7 +60,6 @@ namespace Mono.CSharp
static bool timestamps = false;
static bool pause = false;
static bool show_counters = false;
- public static bool parser_verbose = false;
//
// Whether to load the initial config file (what CSC.RSP has by default)
@@ -577,10 +576,6 @@ namespace Mono.CSharp
static bool UnixParseOption (string arg, ref string [] args, ref int i)
{
switch (arg){
- case "-vv":
- parser_verbose = true;
- return true;
-
case "-v":
yacc_verbose = true;
return true;
diff --git a/mcs/gmcs/ecore.cs b/mcs/gmcs/ecore.cs
index 5b09f2ce398..3e5af299637 100755
--- a/mcs/gmcs/ecore.cs
+++ b/mcs/gmcs/ecore.cs
@@ -1950,7 +1950,7 @@ namespace Mono.CSharp {
public override Expression ResolveAsTypeStep (EmitContext ec)
{
DeclSpace ds = ec.DeclSpace;
- NamespaceEntry ns = ds.NamespaceEntry;
+ NamespaceEntry ns = ds.Namespace;
Type t;
string alias_value;
@@ -2032,6 +2032,29 @@ namespace Mono.CSharp {
Expression e = null;
//
+ // Since we are cheating (is_base is our hint
+ // that we are the beginning of the name): we
+ // only do the Alias lookup for namespaces if
+ // the name does not include any dots in it
+ //
+ NamespaceEntry ns = ec.DeclSpace.Namespace;
+ if (is_base && ns != null){
+ string alias_value = ns.LookupAlias (Name);
+ if (alias_value != null){
+ Name = alias_value;
+ Type t;
+
+ if ((t = TypeManager.LookupType (Name)) != null)
+ return new TypeExpr (t, loc);
+
+ // No match, maybe our parent can compose us
+ // into something meaningful.
+ return this;
+ }
+ }
+
+
+ //
// Stage 1: Performed by the parser (binding to locals or parameters).
//
Block current_block = ec.CurrentBlock;
@@ -2085,31 +2108,8 @@ namespace Mono.CSharp {
if (e == null && ec.ContainerType != null)
e = MemberLookup (ec, ec.ContainerType, Name, loc);
- if (e == null) {
- //
- // Since we are cheating (is_base is our hint
- // that we are the beginning of the name): we
- // only do the Alias lookup for namespaces if
- // the name does not include any dots in it
- //
- NamespaceEntry ns = ec.DeclSpace.NamespaceEntry;
- if (is_base && ns != null){
- string alias_value = ns.LookupAlias (Name);
- if (alias_value != null){
- Name = alias_value;
- Type t;
-
- if ((t = TypeManager.LookupType (Name)) != null)
- return new TypeExpr (t, loc);
-
- // No match, maybe our parent can compose us
- // into something meaningful.
- return this;
- }
- }
-
+ if (e == null)
return ResolveAsTypeStep (ec);
- }
if (e is TypeExpr)
return e;
@@ -2535,9 +2535,6 @@ namespace Mono.CSharp {
//
if (ec.IsConstructor){
- if (IsStatic && !ec.IsStatic)
- Report_AssignToReadonly (false);
-
if (ec.ContainerType == FieldInfo.DeclaringType)
return this;
}
diff --git a/mcs/gmcs/enum.cs b/mcs/gmcs/enum.cs
index 06f4c9e0cf7..c6f613bfadf 100755
--- a/mcs/gmcs/enum.cs
+++ b/mcs/gmcs/enum.cs
@@ -49,9 +49,8 @@ namespace Mono.CSharp {
Modifiers.INTERNAL |
Modifiers.PRIVATE;
- public Enum (NamespaceEntry ns, TypeContainer parent, Expression type, int mod_flags,
- string name, Attributes attrs, Location l)
- : base (ns, parent, name, l)
+ public Enum (TypeContainer parent, Expression type, int mod_flags, string name, Attributes attrs, Location l)
+ : base (parent, name, l)
{
this.BaseType = type;
ModFlags = Modifiers.Check (AllowedModifiers, mod_flags,
diff --git a/mcs/gmcs/expression.cs b/mcs/gmcs/expression.cs
index 2f8054153e5..a223248ee94 100755
--- a/mcs/gmcs/expression.cs
+++ b/mcs/gmcs/expression.cs
@@ -700,7 +700,7 @@ namespace Mono.CSharp {
public new void CacheTemporaries (EmitContext ec)
{
- temporary = new LocalTemporary (ec, expr.Type);
+ temporary = new LocalTemporary (ec, type);
}
public override string ToString ()
@@ -826,9 +826,6 @@ namespace Mono.CSharp {
//
type = expr_type;
if (expr.eclass == ExprClass.Variable){
- LocalVariableReference var = expr as LocalVariableReference;
- if ((var != null) && var.IsReadOnly)
- Error (1604, "cannot assign to `" + var.Name + "' because it is readonly");
if (IsIncrementableNumber (expr_type) ||
expr_type == TypeManager.decimal_type){
return this;
@@ -1090,8 +1087,6 @@ namespace Mono.CSharp {
return null;
expr = expr.Resolve (ec);
- if (expr == null)
- return null;
return this;
}
@@ -3510,6 +3505,7 @@ namespace Mono.CSharp {
public readonly string Name;
public readonly Block Block;
LocalInfo local_info;
+ VariableInfo variable_info;
bool is_readonly;
public LocalVariableReference (Block block, string name, Location l)
@@ -3531,7 +3527,7 @@ namespace Mono.CSharp {
}
public VariableInfo VariableInfo {
- get { return local_info.VariableInfo; }
+ get { return variable_info; }
}
public bool IsReadOnly {
@@ -3547,11 +3543,8 @@ namespace Mono.CSharp {
is_readonly = local_info.ReadOnly;
}
+ variable_info = Block.GetVariableInfo (local_info);
type = local_info.VariableType;
-#if false
- if (ec.InAnonymousMethod)
- Block.LiftVariable (local_info);
-#endif
}
public override Expression DoResolve (EmitContext ec)
@@ -3565,7 +3558,6 @@ namespace Mono.CSharp {
return e;
}
- VariableInfo variable_info = local_info.VariableInfo;
if ((variable_info != null) && !variable_info.IsAssigned (ec, loc))
return null;
@@ -3579,7 +3571,6 @@ namespace Mono.CSharp {
{
DoResolveBase (ec);
- VariableInfo variable_info = local_info.VariableInfo;
if (variable_info != null)
variable_info.SetAssigned (ec);
@@ -4559,11 +4550,11 @@ namespace Mono.CSharp {
(applicable_type.IsSubclassOf (decl_type) ||
TypeManager.ImplementsInterface (applicable_type, decl_type)) &&
found_applicable)
- continue;
+ continue;
// Check if candidate is applicable (section 14.4.2.1)
- if (IsApplicable (ec, Arguments, candidate)) {
+ if (!IsApplicable (ec, Arguments, candidate)) {
// Candidate is applicable in normal form
candidates.Add (candidate);
applicable_type = candidate.DeclaringType;
@@ -6308,7 +6299,7 @@ namespace Mono.CSharp {
}
if ((block != null) && (block.ThisVariable != null))
- variable_info = block.ThisVariable.VariableInfo;
+ variable_info = block.GetVariableInfo (block.ThisVariable);
return true;
}
diff --git a/mcs/gmcs/flowanalysis.cs b/mcs/gmcs/flowanalysis.cs
deleted file mode 100644
index cab8a5108a5..00000000000
--- a/mcs/gmcs/flowanalysis.cs
+++ /dev/null
@@ -1,1895 +0,0 @@
-//
-// flowanalyis.cs: The control flow analysis code
-//
-// Author:
-// Martin Baulig (martin@ximian.com)
-//
-// (C) 2001, 2002, 2003 Ximian, Inc.
-//
-
-using System;
-using System.Text;
-using System.Collections;
-using System.Reflection;
-using System.Reflection.Emit;
-using System.Diagnostics;
-
-namespace Mono.CSharp
-{
- // <summary>
- // A new instance of this class is created every time a new block is resolved
- // and if there's branching in the block's control flow.
- // </summary>
- public abstract class FlowBranching
- {
- // <summary>
- // The type of a FlowBranching.
- // </summary>
- public enum BranchingType {
- // Normal (conditional or toplevel) block.
- Block,
-
- // A loop block.
- LoopBlock,
-
- // Try/Catch block.
- Exception,
-
- // Switch block.
- Switch,
-
- // Switch section.
- SwitchSection
- }
-
- // <summary>
- // The type of one sibling of a branching.
- // </summary>
- public enum SiblingType {
- Conditional,
- SwitchSection,
- Try,
- Catch,
- Finally
- }
-
- // <summary>
- // This is used in the control flow analysis code to specify whether the
- // current code block may return to its enclosing block before reaching
- // its end.
- // </summary>
- public enum FlowReturns {
- Undefined = 0,
-
- // It can never return.
- Never,
-
- // This means that the block contains a conditional return statement
- // somewhere.
- Sometimes,
-
- // The code always returns, ie. there's an unconditional return / break
- // statement in it.
- Always,
-
- // The code always throws an exception.
- Exception,
-
- // The current code block is unreachable. This happens if it's immediately
- // following a FlowReturns.Always block.
- Unreachable
- }
-
- public static FlowBranching CreateBranching (FlowBranching parent, BranchingType type, Block block, Location loc)
- {
- switch (type) {
- case BranchingType.Exception:
- return new FlowBranchingException (parent, type, block, loc);
-
- case BranchingType.Switch:
- return new FlowBranchingBlock (parent, type, SiblingType.SwitchSection, block, loc);
-
- default:
- return new FlowBranchingBlock (parent, type, SiblingType.Conditional, block, loc);
- }
- }
-
- // <summary>
- // The type of this flow branching.
- // </summary>
- public readonly BranchingType Type;
-
- // <summary>
- // The block this branching is contained in. This may be null if it's not
- // a top-level block and it doesn't declare any local variables.
- // </summary>
- public readonly Block Block;
-
- // <summary>
- // The parent of this branching or null if this is the top-block.
- // </summary>
- public readonly FlowBranching Parent;
-
- // <summary>
- // Start-Location of this flow branching.
- // </summary>
- public readonly Location Location;
-
- // <summary>
- // If this is an infinite loop.
- // </summary>
- public bool Infinite;
-
- // <summary>
- // If we may leave the current loop.
- // </summary>
- public bool MayLeaveLoop;
-
- //
- // Private
- //
- VariableMap param_map, local_map;
-
- static int next_id = 0;
- int id;
-
- // <summary>
- // Performs an `And' operation on the FlowReturns status
- // (for instance, a block only returns Always if all its siblings
- // always return).
- // </summary>
- public static FlowReturns AndFlowReturns (FlowReturns a, FlowReturns b)
- {
- if (a == FlowReturns.Undefined)
- return b;
- if (b == FlowReturns.Unreachable)
- return a;
-
- switch (a) {
- case FlowReturns.Never:
- if (b == FlowReturns.Never)
- return FlowReturns.Never;
- else
- return FlowReturns.Sometimes;
-
- case FlowReturns.Sometimes:
- return FlowReturns.Sometimes;
-
- case FlowReturns.Always:
- if ((b == FlowReturns.Always) || (b == FlowReturns.Exception))
- return FlowReturns.Always;
- else
- return FlowReturns.Sometimes;
-
- case FlowReturns.Exception:
- if (b == FlowReturns.Exception)
- return FlowReturns.Exception;
- else if (b == FlowReturns.Always)
- return FlowReturns.Always;
- else
- return FlowReturns.Sometimes;
- }
-
- return b;
- }
-
- // <summary>
- // The vector contains a BitArray with information about which local variables
- // and parameters are already initialized at the current code position.
- // </summary>
- public class UsageVector {
- // <summary>
- // The type of this branching.
- // </summary>
- public readonly SiblingType Type;
-
- // <summary>
- // Start location of this branching.
- // </summary>
- public readonly Location Location;
-
- // <summary>
- // If this is true, then the usage vector has been modified and must be
- // merged when we're done with this branching.
- // </summary>
- public bool IsDirty;
-
- // <summary>
- // The number of parameters in this block.
- // </summary>
- public readonly int CountParameters;
-
- // <summary>
- // The number of locals in this block.
- // </summary>
- public readonly int CountLocals;
-
- // <summary>
- // If not null, then we inherit our state from this vector and do a
- // copy-on-write. If null, then we're the first sibling in a top-level
- // block and inherit from the empty vector.
- // </summary>
- public readonly UsageVector InheritsFrom;
-
- //
- // Private.
- //
- MyBitVector locals, parameters;
- FlowReturns RealReturns, RealBreaks, RealReachable;
- bool is_finally;
-
- static int next_id = 0;
- int id;
-
- //
- // Normally, you should not use any of these constructors.
- //
- public UsageVector (SiblingType type, UsageVector parent, Location loc, int num_params, int num_locals)
- {
- this.Type = type;
- this.Location = loc;
- this.InheritsFrom = parent;
- this.CountParameters = num_params;
- this.CountLocals = num_locals;
- this.RealReturns = FlowReturns.Never;
- this.RealBreaks = FlowReturns.Never;
- this.RealReachable = FlowReturns.Always;
-
- if (parent != null) {
- locals = new MyBitVector (parent.locals, CountLocals);
- if (num_params > 0)
- parameters = new MyBitVector (parent.parameters, num_params);
- RealReturns = parent.Returns;
- RealBreaks = parent.Breaks;
- } else {
- locals = new MyBitVector (null, CountLocals);
- if (num_params > 0)
- parameters = new MyBitVector (null, num_params);
- }
-
- id = ++next_id;
- }
-
- public UsageVector (SiblingType type, UsageVector parent, Location loc)
- : this (type, parent, loc, parent.CountParameters, parent.CountLocals)
- { }
-
- // <summary>
- // This does a deep copy of the usage vector.
- // </summary>
- public UsageVector Clone ()
- {
- UsageVector retval = new UsageVector (Type, null, Location, CountParameters, CountLocals);
-
- retval.locals = locals.Clone ();
- if (parameters != null)
- retval.parameters = parameters.Clone ();
- retval.RealReturns = RealReturns;
- retval.RealBreaks = RealBreaks;
- retval.RealReachable = RealReachable;
-
- return retval;
- }
-
- public bool IsAssigned (VariableInfo var)
- {
- if (!var.IsParameter && AlwaysBreaks)
- return true;
-
- return var.IsAssigned (var.IsParameter ? parameters : locals);
- }
-
- public void SetAssigned (VariableInfo var)
- {
- if (!var.IsParameter && AlwaysBreaks)
- return;
-
- var.SetAssigned (var.IsParameter ? parameters : locals);
- }
-
- public bool IsFieldAssigned (VariableInfo var, string name)
- {
- if (!var.IsParameter && AlwaysBreaks)
- return true;
-
- return var.IsFieldAssigned (var.IsParameter ? parameters : locals, name);
- }
-
- public void SetFieldAssigned (VariableInfo var, string name)
- {
- if (!var.IsParameter && AlwaysBreaks)
- return;
-
- var.SetFieldAssigned (var.IsParameter ? parameters : locals, name);
- }
-
- // <summary>
- // Specifies when the current block returns.
- // If this is FlowReturns.Unreachable, then control can never reach the
- // end of the method (so that we don't need to emit a return statement).
- // The same applies for FlowReturns.Exception, but in this case the return
- // value will never be used.
- // </summary>
- public FlowReturns Returns {
- get {
- return RealReturns;
- }
- }
-
- // <summary>
- // Specifies whether control may return to our containing block
- // before reaching the end of this block. This happens if there
- // is a break/continue/goto/return in it.
- // This can also be used to find out whether the statement immediately
- // following the current block may be reached or not.
- // </summary>
- public FlowReturns Breaks {
- get {
- return RealBreaks;
- }
- }
-
- public FlowReturns Reachable {
- get {
- return RealReachable;
- }
- }
-
- public bool AlwaysBreaks {
- get {
- return (Breaks == FlowReturns.Always) ||
- (Breaks == FlowReturns.Exception) ||
- (Breaks == FlowReturns.Unreachable);
- }
- }
-
- public bool MayBreak {
- get {
- return Breaks != FlowReturns.Never;
- }
- }
-
- public bool AlwaysReturns {
- get {
- return (Returns == FlowReturns.Always) ||
- (Returns == FlowReturns.Exception);
- }
- }
-
- public bool MayReturn {
- get {
- return (Returns == FlowReturns.Sometimes) ||
- (Returns == FlowReturns.Always);
- }
- }
-
- public void Break ()
- {
- RealBreaks = FlowReturns.Always;
- }
-
- public void Return ()
- {
- RealReturns = FlowReturns.Always;
- }
-
- public bool IsUnreachable {
- get {
- return (Reachable == FlowReturns.Exception) ||
- (Reachable == FlowReturns.Unreachable);
- }
- }
-
- public void Unreachable ()
- {
- // If we're already unreachable, don't modify the reason why.
- if (!IsUnreachable)
- RealReachable = FlowReturns.Unreachable;
- }
-
- public void NeverReachable ()
- {
- // If we're already unreachable, don't modify the reason why.
- if (!IsUnreachable)
- RealReachable = FlowReturns.Never;
- }
-
- public void Throw ()
- {
- // If we're already unreachable, don't modify the reason why.
- if (!IsUnreachable)
- RealReachable = FlowReturns.Exception;
- }
-
- // <summary>
- // Merges a child branching.
- // </summary>
- public FlowReturns MergeChild (MyBitVector new_params, MyBitVector new_locals,
- FlowReturns new_returns, FlowReturns new_breaks,
- FlowReturns new_reachable)
- {
- Report.Debug (2, "MERGING CHILD", this, new_params, new_locals, new_returns, new_breaks,
- new_reachable);
-
- RealReturns = new_returns;
- RealBreaks = new_breaks;
- RealReachable = new_reachable;
-
- //
- // We've now either reached the point after the branching or we will
- // never get there since we always return or always throw an exception.
- //
- // If we can reach the point after the branching, mark all locals and
- // parameters as initialized which have been initialized in all branches
- // we need to look at (see above).
- //
-
- Report.Debug (2, "MERGING CHILD #1", this, Returns, Breaks, Reachable, new_locals, new_params);
-
- if ((Reachable == FlowReturns.Always) || (Reachable == FlowReturns.Sometimes) ||
- (Reachable == FlowReturns.Never)) {
- if ((Returns == FlowReturns.Always) || (Breaks == FlowReturns.Always))
- RealReachable = FlowReturns.Never;
- if ((Type == SiblingType.SwitchSection) && (Reachable != FlowReturns.Never)) {
- Report.Error (163, Location, "Control cannot fall through from one " +
- "case label to another");
- }
-
- if (new_locals != null)
- locals.Or (new_locals);
-
- if (new_params != null)
- parameters.Or (new_params);
- }
-
- Report.Debug (2, "MERGING CHILD DONE", this);
-
- return Returns;
- }
-
- // <summary>
- // Tells control flow analysis that the current code position may be reached with
- // a forward jump from any of the origins listed in `origin_vectors' which is a
- // list of UsageVectors.
- //
- // This is used when resolving forward gotos - in the following example, the
- // variable `a' is uninitialized in line 8 becase this line may be reached via
- // the goto in line 4:
- //
- // 1 int a;
- //
- // 3 if (something)
- // 4 goto World;
- //
- // 6 a = 5;
- //
- // 7 World:
- // 8 Console.WriteLine (a);
- //
- // </summary>
- public void MergeJumpOrigins (ICollection origin_vectors)
- {
- Report.Debug (1, "MERGING JUMP ORIGIN", this);
-
- RealBreaks = FlowReturns.Never;
- RealReturns = FlowReturns.Never;
- if (Reachable != FlowReturns.Always)
- RealReachable = FlowReturns.Always;
-
- if (origin_vectors == null)
- return;
-
- foreach (UsageVector vector in origin_vectors) {
- Report.Debug (1, " MERGING JUMP ORIGIN", vector);
-
- locals.And (vector.locals);
- if (parameters != null)
- parameters.And (vector.parameters);
- RealBreaks = AndFlowReturns (RealBreaks, vector.Breaks);
- RealReturns = AndFlowReturns (RealReturns, vector.Returns);
- RealReachable = AndFlowReturns (RealReachable, vector.Reachable);
- }
-
- Report.Debug (1, "MERGING JUMP ORIGIN DONE", this);
- }
-
- // <summary>
- // This is used at the beginning of a finally block if there were
- // any return statements in the try block or one of the catch blocks.
- // </summary>
- public void MergeFinallyOrigins (ICollection finally_vectors)
- {
- Report.Debug (1, "MERGING FINALLY ORIGIN", this);
-
- RealBreaks = FlowReturns.Never;
-
- foreach (UsageVector vector in finally_vectors) {
- Report.Debug (1, " MERGING FINALLY ORIGIN", vector);
-
- if (parameters != null)
- parameters.And (vector.parameters);
- RealBreaks = AndFlowReturns (Breaks, vector.Breaks);
- }
-
- is_finally = true;
-
- Report.Debug (1, "MERGING FINALLY ORIGIN DONE", this);
- }
-
- public void CheckOutParameters (FlowBranching branching)
- {
- if (parameters != null)
- branching.CheckOutParameters (parameters, branching.Location);
- }
-
- // <summary>
- // Performs an `or' operation on the locals and the parameters.
- // </summary>
- public void Or (UsageVector new_vector)
- {
- locals.Or (new_vector.locals);
- if (parameters != null)
- parameters.Or (new_vector.parameters);
- }
-
- // <summary>
- // Performs an `and' operation on the locals.
- // </summary>
- public void AndLocals (UsageVector new_vector)
- {
- locals.And (new_vector.locals);
- }
-
- public bool HasParameters {
- get {
- return parameters != null;
- }
- }
-
- public bool HasLocals {
- get {
- return locals != null;
- }
- }
-
- // <summary>
- // Returns a deep copy of the parameters.
- // </summary>
- public MyBitVector Parameters {
- get {
- if (parameters != null)
- return parameters.Clone ();
- else
- return null;
- }
- }
-
- // <summary>
- // Returns a deep copy of the locals.
- // </summary>
- public MyBitVector Locals {
- get {
- return locals.Clone ();
- }
- }
-
- public MyBitVector ParameterVector {
- get {
- return parameters;
- }
- }
-
- public MyBitVector LocalVector {
- get {
- return locals;
- }
- }
-
- //
- // Debugging stuff.
- //
-
- public override string ToString ()
- {
- StringBuilder sb = new StringBuilder ();
-
- sb.Append ("Vector (");
- sb.Append (id);
- sb.Append (",");
- sb.Append (Returns);
- sb.Append (",");
- sb.Append (Breaks);
- sb.Append (",");
- sb.Append (Reachable);
- if (parameters != null) {
- sb.Append (" - ");
- sb.Append (parameters);
- }
- sb.Append (" - ");
- sb.Append (locals);
- sb.Append (")");
-
- return sb.ToString ();
- }
- }
-
- // <summary>
- // Creates a new flow branching which is contained in `parent'.
- // You should only pass non-null for the `block' argument if this block
- // introduces any new variables - in this case, we need to create a new
- // usage vector with a different size than our parent's one.
- // </summary>
- protected FlowBranching (FlowBranching parent, BranchingType type, SiblingType stype,
- Block block, Location loc)
- {
- Parent = parent;
- Block = block;
- Location = loc;
- Type = type;
- id = ++next_id;
-
- UsageVector vector;
- if (Block != null) {
- param_map = Block.ParameterMap;
- local_map = Block.LocalMap;
-
- UsageVector parent_vector = parent != null ? parent.CurrentUsageVector : null;
- vector = new UsageVector (stype, parent_vector, loc, param_map.Length, local_map.Length);
- } else {
- param_map = Parent.param_map;
- local_map = Parent.local_map;
- vector = new UsageVector (stype, Parent.CurrentUsageVector, loc);
- }
-
- AddSibling (vector);
- }
-
- public abstract UsageVector CurrentUsageVector {
- get;
- }
-
- // <summary>
- // Creates a sibling of the current usage vector.
- // </summary>
- public virtual void CreateSibling (SiblingType type)
- {
- AddSibling (new UsageVector (type, Parent.CurrentUsageVector, Location));
-
- Report.Debug (1, "CREATED SIBLING", CurrentUsageVector);
- }
-
- protected abstract void AddSibling (UsageVector uv);
-
- public abstract void Break ();
- public abstract void Return ();
- public abstract void Goto ();
- public abstract void Throw ();
- public abstract void Label (ArrayList origin_vectors);
-
- // <summary>
- // Check whether all `out' parameters have been assigned.
- // </summary>
- public void CheckOutParameters (MyBitVector parameters, Location loc)
- {
- for (int i = 0; i < param_map.Count; i++) {
- VariableInfo var = param_map [i];
-
- if (var == null)
- continue;
-
- if (var.IsAssigned (parameters))
- continue;
-
- Report.Error (177, loc, "The out parameter `" +
- param_map.VariableNames [i] + "' must be " +
- "assigned before control leave the current method.");
- }
- }
-
- protected class MergeResult
- {
- public MyBitVector Parameters;
- public MyBitVector Locals;
- public FlowReturns Returns;
- public FlowReturns Breaks;
- public FlowReturns Reachable;
- public bool MayLeaveLoop;
-
- public MergeResult (MyBitVector parameters, MyBitVector locals, FlowReturns returns, FlowReturns breaks,
- FlowReturns reachable, bool may_leave_loop)
- {
- this.Parameters = parameters;
- this.Locals = locals;
- this.Returns = returns;
- this.Breaks = breaks;
- this.Reachable = reachable;
- this.MayLeaveLoop = may_leave_loop;
- }
- }
-
- protected MergeResult Merge (ArrayList children)
- {
- MyBitVector locals = null;
- MyBitVector parameters = null;
-
- FlowReturns returns = FlowReturns.Undefined;
- FlowReturns breaks = FlowReturns.Undefined;
- FlowReturns reachable = FlowReturns.Undefined;
-
- Report.Debug (2, "MERGING CHILDREN", this, Type, children.Count);
-
- foreach (UsageVector child in children) {
- Report.Debug (2, " MERGING CHILD", child, child.AlwaysBreaks, child.AlwaysReturns,
- child.IsUnreachable, child.Locals, child.Parameters,
- child.Returns, child.Breaks, child.Reachable);
-
- reachable = AndFlowReturns (reachable, child.Reachable);
-
- // Ignore unreachable children.
- if (child.IsUnreachable)
- continue;
-
- returns = AndFlowReturns (returns, child.Returns);
- breaks = AndFlowReturns (breaks, child.Breaks);
-
- // A local variable is initialized after a flow branching if it
- // has been initialized in all its branches which do neither
- // always return or always throw an exception.
- //
- // If a branch may return, but does not always return, then we
- // can treat it like a never-returning branch here: control will
- // only reach the code position after the branching if we did not
- // return here.
- //
- // It's important to distinguish between always and sometimes
- // returning branches here:
- //
- // 1 int a;
- // 2 if (something) {
- // 3 return;
- // 4 a = 5;
- // 5 }
- // 6 Console.WriteLine (a);
- //
- // The if block in lines 3-4 always returns, so we must not look
- // at the initialization of `a' in line 4 - thus it'll still be
- // uninitialized in line 6.
- //
- // On the other hand, the following is allowed:
- //
- // 1 int a;
- // 2 if (something)
- // 3 a = 5;
- // 4 else
- // 5 return;
- // 6 Console.WriteLine (a);
- //
- // Here, `a' is initialized in line 3 and we must not look at
- // line 5 since it always returns.
- //
- if (!child.AlwaysReturns && !child.AlwaysBreaks)
- MyBitVector.And (ref locals, child.LocalVector);
-
- // An `out' parameter must be assigned in all branches which do
- // not always throw an exception.
- if ((child.Type != SiblingType.Catch) &&
- (child.ParameterVector != null) && (child.Breaks != FlowReturns.Exception))
- MyBitVector.And (ref parameters, child.ParameterVector);
- }
-
- Report.Debug (2, "MERGING CHILDREN DONE", Type, parameters, locals, returns, breaks, reachable,
- Infinite, MayLeaveLoop, this);
-
- if (Infinite && !MayLeaveLoop) {
- Report.Debug (1, "INFINITE", returns, breaks, this);
-
- if (returns == FlowReturns.Never) {
- // We're actually infinite.
- breaks = FlowReturns.Unreachable;
- returns = FlowReturns.Unreachable;
- } else if ((returns == FlowReturns.Sometimes) || (returns == FlowReturns.Always)) {
- // If we're an infinite loop and do not break, the code after
- // the loop can never be reached. However, if we may return
- // from the loop, then we do always return (or stay in the loop
- // forever).
- returns = FlowReturns.Always;
- }
- }
-
- if (returns == FlowReturns.Undefined)
- returns = FlowReturns.Never;
- if (breaks == FlowReturns.Undefined)
- breaks = FlowReturns.Never;
-
- return new MergeResult (parameters, locals, returns, breaks, reachable, MayLeaveLoop);
- }
-
- protected abstract MergeResult Merge ();
-
- // <summary>
- // Merge a child branching.
- // </summary>
- public FlowReturns MergeChild (FlowBranching child)
- {
- MergeResult result = child.Merge ();
-
- CurrentUsageVector.MergeChild (
- result.Parameters, result.Locals, result.Returns, result.Breaks, result.Reachable);
-
- if ((child.Type != BranchingType.LoopBlock) && (child.Type != BranchingType.SwitchSection))
- MayLeaveLoop |= child.MayLeaveLoop;
-
- if (result.Reachable == FlowReturns.Exception)
- return FlowReturns.Exception;
- else
- return result.Returns;
- }
-
- // <summary>
- // Does the toplevel merging.
- // </summary>
- public FlowReturns MergeTopBlock ()
- {
- if ((Type != BranchingType.Block) || (Block == null))
- throw new NotSupportedException ();
-
- UsageVector vector = new UsageVector (
- SiblingType.Conditional, null, Location, param_map.Length, local_map.Length);
-
- MergeResult result = Merge ();
- vector.MergeChild (result.Parameters, result.Locals, result.Returns, result.Breaks, result.Reachable);
-
- if (vector.Reachable != FlowReturns.Exception)
- CheckOutParameters (vector.Parameters, Location);
- else
- return FlowReturns.Exception;
-
- return result.Returns;
- }
-
- public virtual bool InTryBlock ()
- {
- if (Parent != null)
- return Parent.InTryBlock ();
- else
- return false;
- }
-
- public virtual void AddFinallyVector (UsageVector vector)
- {
- if (Parent != null)
- Parent.AddFinallyVector (vector);
- else
- throw new NotSupportedException ();
- }
-
- public bool IsAssigned (VariableInfo vi)
- {
- return CurrentUsageVector.IsAssigned (vi);
- }
-
- public bool IsFieldAssigned (VariableInfo vi, string field_name)
- {
- if (CurrentUsageVector.IsAssigned (vi))
- return true;
-
- return CurrentUsageVector.IsFieldAssigned (vi, field_name);
- }
-
- public void SetAssigned (VariableInfo vi)
- {
- CurrentUsageVector.SetAssigned (vi);
- }
-
- public void SetFieldAssigned (VariableInfo vi, string name)
- {
- CurrentUsageVector.SetFieldAssigned (vi, name);
- }
-
- public override string ToString ()
- {
- StringBuilder sb = new StringBuilder ();
- sb.Append (GetType ());
- sb.Append (" (");
-
- sb.Append (id);
- sb.Append (",");
- sb.Append (Type);
- if (Block != null) {
- sb.Append (" - ");
- sb.Append (Block.ID);
- sb.Append (" - ");
- sb.Append (Block.StartLocation);
- }
- sb.Append (" - ");
- // sb.Append (Siblings.Length);
- // sb.Append (" - ");
- sb.Append (CurrentUsageVector);
- sb.Append (")");
- return sb.ToString ();
- }
- }
-
- public class FlowBranchingBlock : FlowBranching
- {
- UsageVector current_vector;
- ArrayList siblings = new ArrayList ();
-
- public FlowBranchingBlock (FlowBranching parent, BranchingType type, SiblingType stype,
- Block block, Location loc)
- : base (parent, type, stype, block, loc)
- { }
-
- public override UsageVector CurrentUsageVector {
- get { return current_vector; }
- }
-
- protected override void AddSibling (UsageVector sibling)
- {
- siblings.Add (sibling);
- current_vector = sibling;
- }
-
- public override void Break ()
- {
- if (Type == BranchingType.SwitchSection)
- CurrentUsageVector.NeverReachable ();
- else {
- if (Type == BranchingType.LoopBlock)
- MayLeaveLoop = true;
- CurrentUsageVector.Break ();
- }
- }
-
- public override void Return ()
- {
- CurrentUsageVector.Return ();
- }
-
- public override void Goto ()
- {
- CurrentUsageVector.Unreachable ();
- }
-
- public override void Throw ()
- {
- CurrentUsageVector.Throw ();
- }
-
- public override void Label (ArrayList origin_vectors)
- {
- CurrentUsageVector.MergeJumpOrigins (origin_vectors);
- }
-
- protected override MergeResult Merge ()
- {
- MergeResult result = Merge (siblings);
- if (Type == BranchingType.LoopBlock)
- result.MayLeaveLoop = false;
- return result;
- }
- }
-
- public class FlowBranchingException : FlowBranching
- {
- ArrayList finally_vectors;
-
- bool has_params;
- UsageVector current_vector;
- UsageVector try_vector;
- ArrayList catch_vectors = new ArrayList ();
- UsageVector finally_vector;
-
- public FlowBranchingException (FlowBranching parent, BranchingType type, Block block, Location loc)
- : base (parent, type, SiblingType.Try, block, loc)
- {
- finally_vectors = new ArrayList ();
- has_params = current_vector.HasParameters;
- }
-
- protected override void AddSibling (UsageVector sibling)
- {
- if (sibling.Type == SiblingType.Try) {
- try_vector = sibling;
- catch_vectors.Add (sibling);
- } else if (sibling.Type == SiblingType.Catch)
- catch_vectors.Add (sibling);
- else if (sibling.Type == SiblingType.Finally) {
- // sibling.MergeFinallyOrigins (finally_vectors);
- finally_vector = sibling;
- } else
- throw new InvalidOperationException ();
-
- current_vector = sibling;
- }
-
- public override UsageVector CurrentUsageVector {
- get { return current_vector; }
- }
-
- public override bool InTryBlock ()
- {
- return true;
- }
-
- public override void AddFinallyVector (UsageVector vector)
- {
- finally_vectors.Add (vector.Clone ());
- }
-
- public override void Break ()
- {
- CurrentUsageVector.Break ();
- }
-
- public override void Return ()
- {
- CurrentUsageVector.Return ();
- }
-
- public override void Goto ()
- {
- CurrentUsageVector.Unreachable ();
- }
-
- public override void Throw ()
- {
- CurrentUsageVector.Throw ();
- }
-
- public override void Label (ArrayList origin_vectors)
- {
- CurrentUsageVector.MergeJumpOrigins (origin_vectors);
- }
-
- protected void MergeFinally (MyBitVector f_params, ref MergeResult result)
- {
- foreach (UsageVector vector in finally_vectors) {
- MyBitVector temp_params = f_params.Clone ();
- temp_params.Or (vector.Parameters);
-
- CheckOutParameters (temp_params, Location);
- }
- }
-
- protected override MergeResult Merge ()
- {
- MergeResult result = Merge (catch_vectors);
-
- if (has_params) {
- if (finally_vector != null) {
- MergeFinally (finally_vector.Parameters, ref result);
- MyBitVector.Or (ref result.Parameters, finally_vector.ParameterVector);
- } else
- MergeFinally (result.Parameters, ref result);
- }
-
- if (finally_vector != null)
- MyBitVector.Or (ref result.Locals, finally_vector.LocalVector);
-
- return result;
- }
- }
-
- // <summary>
- // This is used by the flow analysis code to keep track of the type of local variables
- // and variables.
- //
- // The flow code uses a BitVector to keep track of whether a variable has been assigned
- // or not. This is easy for fundamental types (int, char etc.) or reference types since
- // you can only assign the whole variable as such.
- //
- // For structs, we also need to keep track of all its fields. To do this, we allocate one
- // bit for the struct itself (it's used if you assign/access the whole struct) followed by
- // one bit for each of its fields.
- //
- // This class computes this `layout' for each type.
- // </summary>
- public class TypeInfo
- {
- public readonly Type Type;
-
- // <summary>
- // Total number of bits a variable of this type consumes in the flow vector.
- // </summary>
- public readonly int TotalLength;
-
- // <summary>
- // Number of bits the simple fields of a variable of this type consume
- // in the flow vector.
- // </summary>
- public readonly int Length;
-
- // <summary>
- // This is only used by sub-structs.
- // </summary>
- public readonly int Offset;
-
- // <summary>
- // If this is a struct.
- // </summary>
- public readonly bool IsStruct;
-
- // <summary>
- // If this is a struct, all fields which are structs theirselves.
- // </summary>
- public TypeInfo[] SubStructInfo;
-
- protected readonly StructInfo struct_info;
- private static Hashtable type_hash = new Hashtable ();
-
- public static TypeInfo GetTypeInfo (Type type)
- {
- TypeInfo info = (TypeInfo) type_hash [type];
- if (info != null)
- return info;
-
- info = new TypeInfo (type);
- type_hash.Add (type, info);
- return info;
- }
-
- public static TypeInfo GetTypeInfo (TypeContainer tc)
- {
- TypeInfo info = (TypeInfo) type_hash [tc.TypeBuilder];
- if (info != null)
- return info;
-
- info = new TypeInfo (tc);
- type_hash.Add (tc.TypeBuilder, info);
- return info;
- }
-
- private TypeInfo (Type type)
- {
- this.Type = type;
-
- struct_info = StructInfo.GetStructInfo (type);
- if (struct_info != null) {
- Length = struct_info.Length;
- TotalLength = struct_info.TotalLength;
- SubStructInfo = struct_info.StructFields;
- IsStruct = true;
- } else {
- Length = 0;
- TotalLength = 1;
- IsStruct = false;
- }
- }
-
- private TypeInfo (TypeContainer tc)
- {
- this.Type = tc.TypeBuilder;
-
- struct_info = StructInfo.GetStructInfo (tc);
- if (struct_info != null) {
- Length = struct_info.Length;
- TotalLength = struct_info.TotalLength;
- SubStructInfo = struct_info.StructFields;
- IsStruct = true;
- } else {
- Length = 0;
- TotalLength = 1;
- IsStruct = false;
- }
- }
-
- protected TypeInfo (StructInfo struct_info, int offset)
- {
- this.struct_info = struct_info;
- this.Offset = offset;
- this.Length = struct_info.Length;
- this.TotalLength = struct_info.TotalLength;
- this.SubStructInfo = struct_info.StructFields;
- this.Type = struct_info.Type;
- this.IsStruct = true;
- }
-
- public int GetFieldIndex (string name)
- {
- if (struct_info == null)
- return 0;
-
- return struct_info [name];
- }
-
- public TypeInfo GetSubStruct (string name)
- {
- if (struct_info == null)
- return null;
-
- return struct_info.GetStructField (name);
- }
-
- // <summary>
- // A struct's constructor must always assign all fields.
- // This method checks whether it actually does so.
- // </summary>
- public bool IsFullyInitialized (FlowBranching branching, VariableInfo vi, Location loc)
- {
- if (struct_info == null)
- return true;
-
- bool ok = true;
- for (int i = 0; i < struct_info.Count; i++) {
- FieldInfo field = struct_info.Fields [i];
-
- if (!branching.IsFieldAssigned (vi, field.Name)) {
- Report.Error (171, loc,
- "Field `" + TypeManager.CSharpName (Type) +
- "." + field.Name + "' must be fully initialized " +
- "before control leaves the constructor");
- ok = false;
- }
- }
-
- return ok;
- }
-
- public override string ToString ()
- {
- return String.Format ("TypeInfo ({0}:{1}:{2}:{3})",
- Type, Offset, Length, TotalLength);
- }
-
- protected class StructInfo {
- public readonly Type Type;
- public readonly FieldInfo[] Fields;
- public readonly TypeInfo[] StructFields;
- public readonly int Count;
- public readonly int CountPublic;
- public readonly int CountNonPublic;
- public readonly int Length;
- public readonly int TotalLength;
- public readonly bool HasStructFields;
-
- private static Hashtable field_type_hash = new Hashtable ();
- private Hashtable struct_field_hash;
- private Hashtable field_hash;
-
- protected bool InTransit = false;
-
- // Private constructor. To save memory usage, we only need to create one instance
- // of this class per struct type.
- private StructInfo (Type type)
- {
- this.Type = type;
-
- field_type_hash.Add (type, this);
-
- if (type is TypeBuilder) {
- TypeContainer tc = TypeManager.LookupTypeContainer (type);
-
- ArrayList fields = tc.Fields;
-
- ArrayList public_fields = new ArrayList ();
- ArrayList non_public_fields = new ArrayList ();
-
- if (fields != null) {
- foreach (Field field in fields) {
- if ((field.ModFlags & Modifiers.STATIC) != 0)
- continue;
- if ((field.ModFlags & Modifiers.PUBLIC) != 0)
- public_fields.Add (field.FieldBuilder);
- else
- non_public_fields.Add (field.FieldBuilder);
- }
- }
-
- CountPublic = public_fields.Count;
- CountNonPublic = non_public_fields.Count;
- Count = CountPublic + CountNonPublic;
-
- Fields = new FieldInfo [Count];
- public_fields.CopyTo (Fields, 0);
- non_public_fields.CopyTo (Fields, CountPublic);
- } else {
- FieldInfo[] public_fields = type.GetFields (
- BindingFlags.Instance|BindingFlags.Public);
- FieldInfo[] non_public_fields = type.GetFields (
- BindingFlags.Instance|BindingFlags.NonPublic);
-
- CountPublic = public_fields.Length;
- CountNonPublic = non_public_fields.Length;
- Count = CountPublic + CountNonPublic;
-
- Fields = new FieldInfo [Count];
- public_fields.CopyTo (Fields, 0);
- non_public_fields.CopyTo (Fields, CountPublic);
- }
-
- struct_field_hash = new Hashtable ();
- field_hash = new Hashtable ();
-
- Length = 0;
- StructFields = new TypeInfo [Count];
- StructInfo[] sinfo = new StructInfo [Count];
-
- InTransit = true;
-
- for (int i = 0; i < Count; i++) {
- FieldInfo field = (FieldInfo) Fields [i];
-
- sinfo [i] = GetStructInfo (field.FieldType);
- if (sinfo [i] == null)
- field_hash.Add (field.Name, ++Length);
- else if (sinfo [i].InTransit) {
- Report.Error (523, String.Format (
- "Struct member '{0}.{1}' of type '{2}' causes " +
- "a cycle in the structure layout",
- type, field.Name, sinfo [i].Type));
- sinfo [i] = null;
- return;
- }
- }
-
- InTransit = false;
-
- TotalLength = Length + 1;
- for (int i = 0; i < Count; i++) {
- FieldInfo field = (FieldInfo) Fields [i];
-
- if (sinfo [i] == null)
- continue;
-
- field_hash.Add (field.Name, TotalLength);
-
- HasStructFields = true;
- StructFields [i] = new TypeInfo (sinfo [i], TotalLength);
- struct_field_hash.Add (field.Name, StructFields [i]);
- TotalLength += sinfo [i].TotalLength;
- }
- }
-
- public int this [string name] {
- get {
- if (field_hash.Contains (name))
- return (int) field_hash [name];
- else
- return 0;
- }
- }
-
- public TypeInfo GetStructField (string name)
- {
- return (TypeInfo) struct_field_hash [name];
- }
-
- public static StructInfo GetStructInfo (Type type)
- {
- if (!TypeManager.IsValueType (type) || TypeManager.IsEnumType (type) ||
- TypeManager.IsBuiltinType (type))
- return null;
-
- StructInfo info = (StructInfo) field_type_hash [type];
- if (info != null)
- return info;
-
- return new StructInfo (type);
- }
-
- public static StructInfo GetStructInfo (TypeContainer tc)
- {
- StructInfo info = (StructInfo) field_type_hash [tc.TypeBuilder];
- if (info != null)
- return info;
-
- return new StructInfo (tc.TypeBuilder);
- }
- }
- }
-
- // <summary>
- // This is used by the flow analysis code to store information about a single local variable
- // or parameter. Depending on the variable's type, we need to allocate one or more elements
- // in the BitVector - if it's a fundamental or reference type, we just need to know whether
- // it has been assigned or not, but for structs, we need this information for each of its fields.
- // </summary>
- public class VariableInfo {
- public readonly string Name;
- public readonly TypeInfo TypeInfo;
-
- // <summary>
- // The bit offset of this variable in the flow vector.
- // </summary>
- public readonly int Offset;
-
- // <summary>
- // The number of bits this variable needs in the flow vector.
- // The first bit always specifies whether the variable as such has been assigned while
- // the remaining bits contain this information for each of a struct's fields.
- // </summary>
- public readonly int Length;
-
- // <summary>
- // If this is a parameter of local variable.
- // </summary>
- public readonly bool IsParameter;
-
- public readonly LocalInfo LocalInfo;
- public readonly int ParameterIndex;
-
- readonly VariableInfo Parent;
- VariableInfo[] sub_info;
-
- protected VariableInfo (string name, Type type, int offset)
- {
- this.Name = name;
- this.Offset = offset;
- this.TypeInfo = TypeInfo.GetTypeInfo (type);
-
- Length = TypeInfo.TotalLength;
-
- Initialize ();
- }
-
- protected VariableInfo (VariableInfo parent, TypeInfo type)
- {
- this.Name = parent.Name;
- this.TypeInfo = type;
- this.Offset = parent.Offset + type.Offset;
- this.Parent = parent;
- this.Length = type.TotalLength;
-
- this.IsParameter = parent.IsParameter;
- this.LocalInfo = parent.LocalInfo;
- this.ParameterIndex = parent.ParameterIndex;
-
- Initialize ();
- }
-
- protected void Initialize ()
- {
- TypeInfo[] sub_fields = TypeInfo.SubStructInfo;
- if (sub_fields != null) {
- sub_info = new VariableInfo [sub_fields.Length];
- for (int i = 0; i < sub_fields.Length; i++) {
- if (sub_fields [i] != null)
- sub_info [i] = new VariableInfo (this, sub_fields [i]);
- }
- } else
- sub_info = new VariableInfo [0];
- }
-
- public VariableInfo (LocalInfo local_info, int offset)
- : this (local_info.Name, local_info.VariableType, offset)
- {
- this.LocalInfo = local_info;
- this.IsParameter = false;
- }
-
- public VariableInfo (string name, Type type, int param_idx, int offset)
- : this (name, type, offset)
- {
- this.ParameterIndex = param_idx;
- this.IsParameter = true;
- }
-
- public bool IsAssigned (EmitContext ec)
- {
- return !ec.DoFlowAnalysis || ec.CurrentBranching.IsAssigned (this);
- }
-
- public bool IsAssigned (EmitContext ec, Location loc)
- {
- if (IsAssigned (ec))
- return true;
-
- Report.Error (165, loc,
- "Use of unassigned local variable `" + Name + "'");
- ec.CurrentBranching.SetAssigned (this);
- return false;
- }
-
- public bool IsAssigned (MyBitVector vector)
- {
- if (vector [Offset])
- return true;
-
- for (VariableInfo parent = Parent; parent != null; parent = parent.Parent)
- if (vector [parent.Offset])
- return true;
-
- // Return unless this is a struct.
- if (!TypeInfo.IsStruct)
- return false;
-
- // Ok, so each field must be assigned.
- for (int i = 0; i < TypeInfo.Length; i++) {
- if (!vector [Offset + i + 1])
- return false;
- }
-
- // Ok, now check all fields which are structs.
- for (int i = 0; i < sub_info.Length; i++) {
- VariableInfo sinfo = sub_info [i];
- if (sinfo == null)
- continue;
-
- if (!sinfo.IsAssigned (vector))
- return false;
- }
-
- vector [Offset] = true;
- return true;
- }
-
- public void SetAssigned (EmitContext ec)
- {
- if (ec.DoFlowAnalysis)
- ec.CurrentBranching.SetAssigned (this);
- }
-
- public void SetAssigned (MyBitVector vector)
- {
- vector [Offset] = true;
- }
-
- public bool IsFieldAssigned (EmitContext ec, string name, Location loc)
- {
- if (!ec.DoFlowAnalysis || ec.CurrentBranching.IsFieldAssigned (this, name))
- return true;
-
- Report.Error (170, loc,
- "Use of possibly unassigned field `" + name + "'");
- ec.CurrentBranching.SetFieldAssigned (this, name);
- return false;
- }
-
- public bool IsFieldAssigned (MyBitVector vector, string field_name)
- {
- int field_idx = TypeInfo.GetFieldIndex (field_name);
-
- if (field_idx == 0)
- return true;
-
- return vector [Offset + field_idx];
- }
-
- public void SetFieldAssigned (EmitContext ec, string name)
- {
- if (ec.DoFlowAnalysis)
- ec.CurrentBranching.SetFieldAssigned (this, name);
- }
-
- public void SetFieldAssigned (MyBitVector vector, string field_name)
- {
- int field_idx = TypeInfo.GetFieldIndex (field_name);
-
- if (field_idx == 0)
- return;
-
- vector [Offset + field_idx] = true;
- }
-
- public VariableInfo GetSubStruct (string name)
- {
- TypeInfo type = TypeInfo.GetSubStruct (name);
-
- if (type == null)
- return null;
-
- return new VariableInfo (this, type);
- }
-
- public override string ToString ()
- {
- return String.Format ("VariableInfo ({0}:{1}:{2}:{3}:{4})",
- Name, TypeInfo, Offset, Length, IsParameter);
- }
- }
-
- // <summary>
- // This is used by the flow code to hold the `layout' of the flow vector for
- // all locals and all parameters (ie. we create one instance of this class for the
- // locals and another one for the params).
- // </summary>
- public class VariableMap {
- // <summary>
- // The number of variables in the map.
- // </summary>
- public readonly int Count;
-
- // <summary>
- // Total length of the flow vector for this map.
- // <summary>
- public readonly int Length;
-
- // <summary>
- // Type and name of all the variables.
- // Note that this is null for variables for which we do not need to compute
- // assignment info.
- // </summary>
- public readonly Type[] VariableTypes;
- public readonly string[] VariableNames;
-
- VariableInfo[] map;
-
- public VariableMap (InternalParameters ip)
- {
- Count = ip != null ? ip.Count : 0;
- map = new VariableInfo [Count];
- VariableNames = new string [Count];
- VariableTypes = new Type [Count];
- Length = 0;
-
- for (int i = 0; i < Count; i++) {
- Parameter.Modifier mod = ip.ParameterModifier (i);
-
- if ((mod & Parameter.Modifier.OUT) == 0)
- continue;
-
- VariableNames [i] = ip.ParameterName (i);
- VariableTypes [i] = TypeManager.GetElementType (ip.ParameterType (i));
-
- map [i] = new VariableInfo (VariableNames [i], VariableTypes [i], i, Length);
- Length += map [i].Length;
- }
- }
-
- public VariableMap (LocalInfo[] locals)
- : this (null, locals)
- { }
-
- public VariableMap (VariableMap parent, LocalInfo[] locals)
- {
- int offset = 0, start = 0;
- if (parent != null) {
- offset = parent.Length;
- start = parent.Count;
- }
-
- Count = locals.Length + start;
- map = new VariableInfo [Count];
- VariableNames = new string [Count];
- VariableTypes = new Type [Count];
- Length = offset;
-
- if (parent != null) {
- parent.map.CopyTo (map, 0);
- parent.VariableNames.CopyTo (VariableNames, 0);
- parent.VariableTypes.CopyTo (VariableTypes, 0);
- }
-
- for (int i = start; i < Count; i++) {
- LocalInfo li = locals [i-start];
-
- if (li.VariableType == null)
- continue;
-
- VariableNames [i] = li.Name;
- VariableTypes [i] = li.VariableType;
-
- map [i] = li.VariableInfo = new VariableInfo (li, Length);
- Length += map [i].Length;
- }
- }
-
- // <summary>
- // Returns the VariableInfo for variable @index or null if we don't need to
- // compute assignment info for this variable.
- // </summary>
- public VariableInfo this [int index] {
- get {
- return map [index];
- }
- }
-
- public override string ToString ()
- {
- return String.Format ("VariableMap ({0}:{1})", Count, Length);
- }
- }
-
- // <summary>
- // This is a special bit vector which can inherit from another bit vector doing a
- // copy-on-write strategy. The inherited vector may have a smaller size than the
- // current one.
- // </summary>
- public class MyBitVector {
- public readonly int Count;
- public readonly MyBitVector InheritsFrom;
-
- bool is_dirty;
- BitArray vector;
-
- public MyBitVector (int Count)
- : this (null, Count)
- { }
-
- public MyBitVector (MyBitVector InheritsFrom, int Count)
- {
- this.InheritsFrom = InheritsFrom;
- this.Count = Count;
- }
-
- // <summary>
- // Checks whether this bit vector has been modified. After setting this to true,
- // we won't use the inherited vector anymore, but our own copy of it.
- // </summary>
- public bool IsDirty {
- get {
- return is_dirty;
- }
-
- set {
- if (!is_dirty)
- initialize_vector ();
- }
- }
-
- // <summary>
- // Get/set bit `index' in the bit vector.
- // </summary>
- public bool this [int index]
- {
- get {
- if (index > Count)
- throw new ArgumentOutOfRangeException ();
-
- // We're doing a "copy-on-write" strategy here; as long
- // as nobody writes to the array, we can use our parent's
- // copy instead of duplicating the vector.
-
- if (vector != null)
- return vector [index];
- else if (InheritsFrom != null) {
- BitArray inherited = InheritsFrom.Vector;
-
- if (index < inherited.Count)
- return inherited [index];
- else
- return false;
- } else
- return false;
- }
-
- set {
- if (index > Count)
- throw new ArgumentOutOfRangeException ();
-
- // Only copy the vector if we're actually modifying it.
-
- if (this [index] != value) {
- initialize_vector ();
-
- vector [index] = value;
- }
- }
- }
-
- // <summary>
- // If you explicitly convert the MyBitVector to a BitArray, you will get a deep
- // copy of the bit vector.
- // </summary>
- public static explicit operator BitArray (MyBitVector vector)
- {
- vector.initialize_vector ();
- return vector.Vector;
- }
-
- // <summary>
- // Performs an `or' operation on the bit vector. The `new_vector' may have a
- // different size than the current one.
- // </summary>
- public void Or (MyBitVector new_vector)
- {
- BitArray new_array = new_vector.Vector;
-
- initialize_vector ();
-
- int upper;
- if (vector.Count < new_array.Count)
- upper = vector.Count;
- else
- upper = new_array.Count;
-
- for (int i = 0; i < upper; i++)
- vector [i] = vector [i] | new_array [i];
- }
-
- // <summary>
- // Perfonrms an `and' operation on the bit vector. The `new_vector' may have
- // a different size than the current one.
- // </summary>
- public void And (MyBitVector new_vector)
- {
- BitArray new_array = new_vector.Vector;
-
- initialize_vector ();
-
- int lower, upper;
- if (vector.Count < new_array.Count)
- lower = upper = vector.Count;
- else {
- lower = new_array.Count;
- upper = vector.Count;
- }
-
- for (int i = 0; i < lower; i++)
- vector [i] = vector [i] & new_array [i];
-
- for (int i = lower; i < upper; i++)
- vector [i] = false;
- }
-
- public static void And (ref MyBitVector target, MyBitVector vector)
- {
- if (target != null)
- target.And (vector);
- else
- target = vector.Clone ();
- }
-
- public static void Or (ref MyBitVector target, MyBitVector vector)
- {
- if (target != null)
- target.Or (vector);
- else
- target = vector.Clone ();
- }
-
- // <summary>
- // This does a deep copy of the bit vector.
- // </summary>
- public MyBitVector Clone ()
- {
- MyBitVector retval = new MyBitVector (Count);
-
- retval.Vector = Vector;
-
- return retval;
- }
-
- BitArray Vector {
- get {
- if (vector != null)
- return vector;
- else if (!is_dirty && (InheritsFrom != null))
- return InheritsFrom.Vector;
-
- initialize_vector ();
-
- return vector;
- }
-
- set {
- initialize_vector ();
-
- for (int i = 0; i < System.Math.Min (vector.Count, value.Count); i++)
- vector [i] = value [i];
- }
- }
-
- void initialize_vector ()
- {
- if (vector != null)
- return;
-
- vector = new BitArray (Count, false);
- if (InheritsFrom != null)
- Vector = InheritsFrom.Vector;
-
- is_dirty = true;
- }
-
- public override string ToString ()
- {
- StringBuilder sb = new StringBuilder ("MyBitVector (");
-
- BitArray vector = Vector;
- sb.Append (Count);
- sb.Append (",");
- if (!IsDirty)
- sb.Append ("INHERITED - ");
- for (int i = 0; i < vector.Count; i++) {
- if (i > 0)
- sb.Append (",");
- sb.Append (vector [i]);
- }
-
- sb.Append (")");
- return sb.ToString ();
- }
- }
-}
diff --git a/mcs/gmcs/interface.cs b/mcs/gmcs/interface.cs
index 67b5b6666b2..bf9e9343704 100755
--- a/mcs/gmcs/interface.cs
+++ b/mcs/gmcs/interface.cs
@@ -71,9 +71,8 @@ namespace Mono.CSharp {
Modifiers.UNSAFE |
Modifiers.PRIVATE;
- public Interface (NamespaceEntry ns, TypeContainer parent, string name, int mod,
- Attributes attrs, Location l)
- : base (ns, parent, name, l)
+ public Interface (TypeContainer parent, string name, int mod, Attributes attrs, Location l)
+ : base (parent, name, l)
{
ModFlags = Modifiers.Check (AllowedModifiers, mod, Modifiers.PRIVATE, l);
OptAttributes = attrs;
diff --git a/mcs/gmcs/iterators.cs b/mcs/gmcs/iterators.cs
index 21ac8756b1e..10be47f48a5 100644
--- a/mcs/gmcs/iterators.cs
+++ b/mcs/gmcs/iterators.cs
@@ -96,7 +96,8 @@ namespace Mono.CSharp {
if (!Yield.CheckContext (ec, loc))
return false;
- ec.CurrentBranching.Goto ();
+ ec.CurrentBranching.CurrentUsageVector.Breaks = FlowBranching.FlowReturns.Always;
+ ec.CurrentBranching.CurrentUsageVector.Returns = FlowBranching.FlowReturns.Always;
return true;
}
diff --git a/mcs/gmcs/namespace.cs b/mcs/gmcs/namespace.cs
index 764d19c69d9..83731a82e56 100755
--- a/mcs/gmcs/namespace.cs
+++ b/mcs/gmcs/namespace.cs
@@ -16,13 +16,11 @@ namespace Mono.CSharp {
/// </summary>
public class Namespace {
static ArrayList all_namespaces = new ArrayList ();
- static Hashtable namespaces_map = new Hashtable ();
Namespace parent;
string name, fullname;
ArrayList entries;
Hashtable namespaces;
- Hashtable defined_names;
/// <summary>
/// Constructor Takes the current namespace and the
@@ -43,19 +41,10 @@ namespace Mono.CSharp {
entries = new ArrayList ();
namespaces = new Hashtable ();
- defined_names = new Hashtable ();
all_namespaces.Add (this);
- if (namespaces_map.Contains (fullname))
- return;
- namespaces_map [fullname] = true;
}
- public static bool IsNamespace (string name)
- {
- return namespaces_map [name] != null;
- }
-
public static Namespace Root = new Namespace (null, "");
public Namespace GetNamespace (string name, bool create)
@@ -91,22 +80,11 @@ namespace Mono.CSharp {
public object Lookup (DeclSpace ds, string name)
{
- object o = Lookup (name);
-
- Type t;
- DeclSpace tdecl = o as DeclSpace;
- if (tdecl != null) {
- t = tdecl.DefineType ();
-
- if ((ds == null) || ds.CheckAccessLevel (t))
- return t;
- }
-
Namespace ns = GetNamespace (name, false);
if (ns != null)
return ns;
- t = TypeManager.LookupType (DeclSpace.MakeFQN (fullname, name));
+ Type t = TypeManager.LookupType (DeclSpace.MakeFQN (fullname, name));
if ((t == null) || ((ds != null) && !ds.CheckAccessLevel (t)))
return null;
@@ -118,16 +96,6 @@ namespace Mono.CSharp {
entries.Add (entry);
}
- public void DefineName (string name, object o)
- {
- defined_names.Add (name, o);
- }
-
- public object Lookup (string name)
- {
- return defined_names [name];
- }
-
static public ArrayList UserDefinedNamespaces {
get {
return all_namespaces;
@@ -220,6 +188,7 @@ namespace Mono.CSharp {
Namespace curr_ns = NamespaceEntry.NS;
while ((curr_ns != null) && (resolved_ns == null)) {
+ string full_name = DeclSpace.MakeFQN (curr_ns.Name, Name);
resolved_ns = curr_ns.GetNamespace (Name, false);
if (resolved_ns == null)
@@ -270,11 +239,11 @@ namespace Mono.CSharp {
}
}
- public NamespaceEntry (NamespaceEntry parent, SourceFile file, string name, Location loc)
- : this (parent, file, name, false, loc)
+ public NamespaceEntry (NamespaceEntry parent, SourceFile file, string name)
+ : this (parent, file, name, false)
{ }
- protected NamespaceEntry (NamespaceEntry parent, SourceFile file, string name, bool is_implicit, Location loc)
+ protected NamespaceEntry (NamespaceEntry parent, SourceFile file, string name, bool is_implicit)
{
this.parent = parent;
this.file = file;
@@ -290,18 +259,21 @@ namespace Mono.CSharp {
ns.AddNamespaceEntry (this);
if ((parent != null) && (parent.NS != ns.Parent))
- implicit_parent = new NamespaceEntry (parent, file, ns.Parent.Name, true, loc);
+ implicit_parent = new NamespaceEntry (parent, file, ns.Parent.Name, true);
else
implicit_parent = parent;
-
- this.FullName = ns.Name;
}
static int next_id = 0;
- public readonly string FullName;
public readonly int ID;
public readonly bool IsImplicit;
+ public string Name {
+ get {
+ return ns.Name;
+ }
+ }
+
public Namespace NS {
get {
return ns;
@@ -320,11 +292,6 @@ namespace Mono.CSharp {
}
}
- public void DefineName (string name, object o)
- {
- ns.DefineName (name, o);
- }
-
/// <summary>
/// Records a new namespace for resolving name references
/// </summary>
@@ -335,7 +302,7 @@ namespace Mono.CSharp {
return;
}
- if (ns == FullName)
+ if (ns == Name)
return;
if (using_clauses == null)
@@ -416,7 +383,7 @@ namespace Mono.CSharp {
if (ns != null)
return ns.Lookup (ds, last);
- Type nested = TypeManager.LookupType ((((Type) o).Name + "." + last));
+ Type nested = TypeManager.LookupType (DeclSpace.MakeFQN (((Type) o).Name, last));
if ((nested == null) || ((ds != null) && !ds.CheckAccessLevel (nested)))
return null;
@@ -592,7 +559,7 @@ namespace Mono.CSharp {
if (NS == Namespace.Root)
return "NamespaceEntry (<root>)";
else
- return String.Format ("NamespaceEntry ({0},{1},{2})", FullName, IsImplicit, ID);
+ return String.Format ("NamespaceEntry ({0},{1},{2})", Name, IsImplicit, ID);
}
}
}
diff --git a/mcs/gmcs/rootcontext.cs b/mcs/gmcs/rootcontext.cs
index 67ef6b9baf2..9c1c20c39c7 100755
--- a/mcs/gmcs/rootcontext.cs
+++ b/mcs/gmcs/rootcontext.cs
@@ -466,7 +466,7 @@ namespace Mono.CSharp {
//
// Try in the current namespace and all its implicit parents
//
- for (NamespaceEntry ns = ds.NamespaceEntry; ns != null; ns = ns.ImplicitParent) {
+ for (NamespaceEntry ns = ds.Namespace; ns != null; ns = ns.ImplicitParent) {
object result = ns.Lookup (ds, name, loc);
if (result == null)
continue;
@@ -705,7 +705,7 @@ namespace Mono.CSharp {
//
if (global_attributes.Count > 0){
AssemblyBuilder ab = CodeGen.AssemblyBuilder;
- TypeContainer dummy = new TypeContainer (null, null, "", new Location (-1));
+ TypeContainer dummy = new TypeContainer (null, "", new Location (-1));
EmitContext temp_ec = new EmitContext (
dummy, Mono.CSharp.Location.Null, null, null, 0, false);
@@ -713,7 +713,7 @@ namespace Mono.CSharp {
NamespaceEntry ns = (NamespaceEntry) de.Key;
Attributes attrs = (Attributes) de.Value;
- dummy.NamespaceEntry = ns;
+ dummy.Namespace = ns;
Attribute.ApplyAttributes (temp_ec, ab, ab, attrs);
}
}
@@ -813,7 +813,7 @@ namespace Mono.CSharp {
//
static public void AddGlobalAttributeSection (TypeContainer container, AttributeSection attr)
{
- NamespaceEntry ns = container.NamespaceEntry;
+ NamespaceEntry ns = container.Namespace;
Attributes a = (Attributes) global_attributes [ns];
if (a == null)
diff --git a/mcs/gmcs/statement.cs b/mcs/gmcs/statement.cs
index 1c32cbae006..8727b71ac32 100755
--- a/mcs/gmcs/statement.cs
+++ b/mcs/gmcs/statement.cs
@@ -605,7 +605,8 @@ namespace Mono.CSharp {
else
vector.CheckOutParameters (ec.CurrentBranching);
- ec.CurrentBranching.Return ();
+ vector.Returns = FlowBranching.FlowReturns.Always;
+ vector.Breaks = FlowBranching.FlowReturns.Always;
return true;
}
@@ -676,7 +677,8 @@ namespace Mono.CSharp {
if (!label.IsDefined)
label.AddUsageVector (ec.CurrentBranching.CurrentUsageVector);
- ec.CurrentBranching.Goto ();
+ ec.CurrentBranching.CurrentUsageVector.Breaks = FlowBranching.FlowReturns.Always;
+ ec.CurrentBranching.CurrentUsageVector.Returns = FlowBranching.FlowReturns.Always;
return true;
}
@@ -750,7 +752,12 @@ namespace Mono.CSharp {
public override bool Resolve (EmitContext ec)
{
- ec.CurrentBranching.Label (vectors);
+ if (vectors != null)
+ ec.CurrentBranching.CurrentUsageVector.MergeJumpOrigins (vectors);
+ else {
+ ec.CurrentBranching.CurrentUsageVector.Breaks = FlowBranching.FlowReturns.Never;
+ ec.CurrentBranching.CurrentUsageVector.Returns = FlowBranching.FlowReturns.Never;
+ }
referenced = true;
@@ -779,7 +786,8 @@ namespace Mono.CSharp {
public override bool Resolve (EmitContext ec)
{
- ec.CurrentBranching.Goto ();
+ ec.CurrentBranching.CurrentUsageVector.Breaks = FlowBranching.FlowReturns.Always;
+ ec.CurrentBranching.CurrentUsageVector.Returns = FlowBranching.FlowReturns.Always;
return true;
}
@@ -845,7 +853,8 @@ namespace Mono.CSharp {
label = sl.ILLabelCode;
- ec.CurrentBranching.Goto ();
+ ec.CurrentBranching.CurrentUsageVector.Breaks = FlowBranching.FlowReturns.Unreachable;
+ ec.CurrentBranching.CurrentUsageVector.Returns = FlowBranching.FlowReturns.Always;
return true;
}
@@ -892,7 +901,8 @@ namespace Mono.CSharp {
}
}
- ec.CurrentBranching.Throw ();
+ ec.CurrentBranching.CurrentUsageVector.Returns = FlowBranching.FlowReturns.Exception;
+ ec.CurrentBranching.CurrentUsageVector.Breaks = FlowBranching.FlowReturns.Exception;
return true;
}
@@ -928,7 +938,7 @@ namespace Mono.CSharp {
public override bool Resolve (EmitContext ec)
{
ec.CurrentBranching.MayLeaveLoop = true;
- ec.CurrentBranching.Break ();
+ ec.CurrentBranching.CurrentUsageVector.Breaks = FlowBranching.FlowReturns.Always;
return true;
}
@@ -959,7 +969,7 @@ namespace Mono.CSharp {
public override bool Resolve (EmitContext ec)
{
- ec.CurrentBranching.Goto ();
+ ec.CurrentBranching.CurrentUsageVector.Breaks = FlowBranching.FlowReturns.Always;
return true;
}
@@ -1013,20 +1023,17 @@ namespace Mono.CSharp {
public VariableInfo VariableInfo;
- enum Flags : byte {
- Used = 1,
- Assigned = 2,
- ReadOnly = 4,
- Fixed = 8
- }
-
- Flags flags;
-
+ public bool Used;
+ public bool Assigned;
+ public bool ReadOnly;
+ public bool is_fixed;
+
public LocalInfo (Expression type, string name, Block block, Location l)
{
Type = type;
Name = name;
Block = block;
+ LocalBuilder = null;
Location = l;
}
@@ -1034,18 +1041,20 @@ namespace Mono.CSharp {
{
VariableType = tc.TypeBuilder;
Block = block;
+ LocalBuilder = null;
Location = l;
}
public bool IsThisAssigned (EmitContext ec, Location loc)
{
- if (VariableInfo == null)
+ VariableInfo vi = Block.GetVariableInfo (this);
+ if (vi == null)
throw new Exception ();
- if (!ec.DoFlowAnalysis || ec.CurrentBranching.IsAssigned (VariableInfo))
+ if (!ec.DoFlowAnalysis || ec.CurrentBranching.IsAssigned (vi))
return true;
- return VariableInfo.TypeInfo.IsFullyInitialized (ec.CurrentBranching, VariableInfo, loc);
+ return vi.TypeInfo.IsFullyInitialized (ec.CurrentBranching, vi, loc);
}
public bool Resolve (DeclSpace decl)
@@ -1062,12 +1071,12 @@ namespace Mono.CSharp {
public void MakePinned ()
{
TypeManager.MakePinned (LocalBuilder);
- flags |= Flags.Fixed;
+ is_fixed = true;
}
public bool IsFixed {
get {
- if (((flags & Flags.Fixed) != 0) || TypeManager.IsValueType (VariableType))
+ if (is_fixed || TypeManager.IsValueType (VariableType))
return true;
return false;
@@ -1079,36 +1088,6 @@ namespace Mono.CSharp {
return String.Format ("LocalInfo ({0},{1},{2},{3})",
Name, Type, VariableInfo, Location);
}
-
- public bool Used {
- get {
- return (flags & Flags.Used) != 0;
- }
- set {
- flags = value ? (flags | Flags.Used) : (flags & ~Flags.Used);
- }
- }
-
- public bool Assigned {
- get {
- return (flags & Flags.Assigned) != 0;
- }
- set {
- flags = value ? (flags | Flags.Assigned) : (flags & ~Flags.Assigned);
- }
- }
-
- public bool ReadOnly {
- get {
- return (flags & Flags.ReadOnly) != 0;
- }
- set {
- flags = value ? (flags | Flags.ReadOnly) : (flags & ~Flags.ReadOnly);
- }
- }
-
-
-
}
/// <summary>
@@ -1469,6 +1448,11 @@ namespace Mono.CSharp {
return null;
}
+ public VariableInfo GetVariableInfo (LocalInfo li)
+ {
+ return li.VariableInfo;
+ }
+
public Expression GetVariableType (string name)
{
LocalInfo vi = GetLocalInfo (name);
@@ -1572,11 +1556,6 @@ namespace Mono.CSharp {
}
}
- public bool LiftVariable (LocalInfo local_info)
- {
- return false;
- }
-
/// <summary>
/// Emits the variable declarations and labels.
/// </summary>
@@ -1743,7 +1722,7 @@ namespace Mono.CSharp {
if (s is LabeledStatement)
unreachable = false;
else
- unreachable = ec.CurrentBranching.CurrentUsageVector.IsUnreachable;
+ unreachable = ! ec.CurrentBranching.IsReachable ();
new_statements.Add (s);
}
@@ -1768,8 +1747,6 @@ namespace Mono.CSharp {
"This label has not been referenced");
}
- Report.Debug (1, "RESOLVE BLOCK DONE #2", StartLocation, returns);
-
if ((returns == FlowBranching.FlowReturns.Always) ||
(returns == FlowBranching.FlowReturns.Exception) ||
(returns == FlowBranching.FlowReturns.Unreachable))
@@ -2850,7 +2827,6 @@ namespace Mono.CSharp {
Expression e = (Expression) p.Second;
vi.VariableInfo = null;
- vi.ReadOnly = true;
//
// The rules for the possible declarators are pretty wise,
@@ -3148,6 +3124,13 @@ namespace Mono.CSharp {
ok = false;
ec.InCatch = old_in_catch;
+
+ FlowBranching.UsageVector current = ec.CurrentBranching.CurrentUsageVector;
+
+ if (!current.AlwaysReturns && !current.AlwaysBreaks)
+ vector.AndLocals (current);
+ else
+ vector.Or (current);
}
Report.Debug (1, "END OF CATCH BLOCKS", ec.CurrentBranching);
@@ -3163,6 +3146,13 @@ namespace Mono.CSharp {
ok = false;
ec.InCatch = old_in_catch;
+
+ FlowBranching.UsageVector current = ec.CurrentBranching.CurrentUsageVector;
+
+ if (!current.AlwaysReturns && !current.AlwaysBreaks)
+ vector.AndLocals (current);
+ else
+ vector.Or (current);
}
Report.Debug (1, "END OF GENERAL CATCH BLOCKS", ec.CurrentBranching);
@@ -3185,7 +3175,15 @@ namespace Mono.CSharp {
FlowBranching.UsageVector f_vector = ec.CurrentBranching.CurrentUsageVector;
- Report.Debug (1, "END OF TRY", ec.CurrentBranching, returns, vector, f_vector);
+ Report.Debug (1, "END OF FINALLY", ec.CurrentBranching, returns, vector, f_vector);
+
+ if ((returns == FlowBranching.FlowReturns.Sometimes) || (returns == FlowBranching.FlowReturns.Always)) {
+ ec.CurrentBranching.CheckOutParameters (f_vector.Parameters, loc);
+ }
+
+ ec.CurrentBranching.CurrentUsageVector.Or (vector);
+
+ Report.Debug (1, "END OF TRY", ec.CurrentBranching);
if (returns != FlowBranching.FlowReturns.Always) {
// Unfortunately, System.Reflection.Emit automatically emits a leave
@@ -3441,28 +3439,9 @@ namespace Mono.CSharp {
if (!ResolveExpression (ec))
return false;
- }
-
- ec.StartFlowBranching (FlowBranching.BranchingType.Block, loc);
+ }
- bool ok = Statement.Resolve (ec);
-
- if (!ok) {
- ec.KillFlowBranching ();
- return false;
- }
-
- FlowBranching.FlowReturns returns = ec.EndFlowBranching ();
-
- if (returns != FlowBranching.FlowReturns.Always) {
- // Unfortunately, System.Reflection.Emit automatically emits a leave
- // to the end of the finally block. This is a problem if `returns'
- // is true since we may jump to a point after the end of the method.
- // As a workaround, emit an explicit ret here.
- ec.NeedExplicitReturn = true;
- }
-
- return true;
+ return Statement.Resolve (ec);
}
protected override bool DoEmit (EmitContext ec)
diff --git a/mcs/gmcs/support.cs b/mcs/gmcs/support.cs
index 43d7e746302..64f87b51945 100755
--- a/mcs/gmcs/support.cs
+++ b/mcs/gmcs/support.cs
@@ -328,42 +328,4 @@ namespace Mono.CSharp {
return buffer [pos++];
}
}
-
- public class DoubleHash {
- Hashtable l = new Hashtable ();
-
- public DoubleHash ()
- {
- }
-
- public bool Lookup (object a, object b, out object res)
- {
- object r = l [a];
- if (r == null){
- res = null;
- return false;
- }
- Hashtable ht = (Hashtable) r;
- if (ht.Contains (b)){
- res = ht [b];
- return true;
- }
- res = null;
- return false;
- }
-
- public void Insert (object a, object b, object value)
- {
- Hashtable ht;
- object r = l [a];
- if (r == null){
- ht = new Hashtable ();
- l [a] = ht;
- ht [b] = value;
- return;
- }
- ht = (Hashtable) r;
- ht [b] = value;
- }
- }
}
diff --git a/mcs/gmcs/symbolwriter.cs b/mcs/gmcs/symbolwriter.cs
index b971e574000..a6577e4013c 100644
--- a/mcs/gmcs/symbolwriter.cs
+++ b/mcs/gmcs/symbolwriter.cs
@@ -60,7 +60,7 @@ namespace Mono.CSharp {
public void OpenMethod (TypeContainer parent, MethodBase method, Location start, Location end)
{
- int ns_id = parent.NamespaceEntry.SymbolFileID;
+ int ns_id = parent.Namespace.SymbolFileID;
open_method.Invoke (symwriter, new object[] {
start.SymbolDocument, start.Row, 0, end.Row, 0, method, ns_id });
}
diff --git a/mcs/gmcs/tree.cs b/mcs/gmcs/tree.cs
index 21c2134a130..57e4740a751 100755
--- a/mcs/gmcs/tree.cs
+++ b/mcs/gmcs/tree.cs
@@ -45,14 +45,12 @@ namespace Mono.CSharp
public Tree ()
{
- root_types = new TypeContainer (null, null, "", new Location (-1));
+ root_types = new TypeContainer (null, "", new Location (-1));
decls = new Hashtable ();
namespaces = new Hashtable ();
}
- DoubleHash decl_ns_name = new DoubleHash ();
-
public void RecordDecl (string name, DeclSpace ds)
{
if (decls.Contains (name)){
@@ -64,40 +62,24 @@ namespace Mono.CSharp
other.Location, "(Location of symbol related to previous error)");
return;
}
-
- int p = name.LastIndexOf ('.');
- if (p == -1)
- decl_ns_name.Insert ("", name, ds);
- else {
- decl_ns_name.Insert (name.Substring (0, p), name.Substring (p+1), ds);
- }
-
decls.Add (name, ds);
}
-
- public DeclSpace LookupByNamespace (string ns, string name)
- {
- object res;
-
- decl_ns_name.Lookup (ns, name, out res);
- return (DeclSpace) res;
- }
- public NamespaceEntry RecordNamespace (NamespaceEntry parent, SourceFile file, string name, Location loc)
+ public NamespaceEntry RecordNamespace (NamespaceEntry parent, SourceFile file, string name)
{
- NamespaceEntry ns = new NamespaceEntry (parent, file, name, loc);
+ NamespaceEntry ns = new NamespaceEntry (parent, file, name);
if (namespaces.Contains (file)){
Hashtable ns_ns = (Hashtable) namespaces [file];
- if (ns_ns.Contains (ns.FullName))
- return (NamespaceEntry) ns_ns [ns.FullName];
- ns_ns.Add (ns.FullName, ns);
+ if (ns_ns.Contains (ns.Name))
+ return (NamespaceEntry) ns_ns [ns.Name];
+ ns_ns.Add (ns.Name, ns);
} else {
Hashtable new_table = new Hashtable ();
namespaces [file] = new_table;
- new_table.Add (ns.FullName, ns);
+ new_table.Add (ns.Name, ns);
}
return ns;
diff --git a/mcs/gmcs/typemanager.cs b/mcs/gmcs/typemanager.cs
index ad07dffe0a9..e3544a31f16 100755
--- a/mcs/gmcs/typemanager.cs
+++ b/mcs/gmcs/typemanager.cs
@@ -2122,8 +2122,8 @@ public class TypeManager {
[Flags]
public enum MethodFlags {
IsObsolete = 1,
- IsObsoleteError = 1 << 1,
- ShouldIgnore = 1 << 2
+ IsObsoleteError = 2,
+ ShouldIgnore = 3
}
//
diff --git a/mcs/ilasm/ChangeLog b/mcs/ilasm/ChangeLog
index a083e9ea24b..1d92701f2e6 100644
--- a/mcs/ilasm/ChangeLog
+++ b/mcs/ilasm/ChangeLog
@@ -1,10 +1,3 @@
-2003-08-14 Jackson Harper <jackson@latitudegeo.com>
-
- * Driver.cs: Report entry for each il file processed
- * Report.cs: New file - All error/warning/progress reporting will
- go through here.
- * ilasm.exe.sources: Add report to build
-
2003-08-12 Jackson Harper <jackson@latitudegeo.com>
* AssemblyInfo.cs: Bump up the vizzity-version number.
diff --git a/mcs/ilasm/Driver.cs b/mcs/ilasm/Driver.cs
index 88798fdc7d6..fdf6c535b81 100644
--- a/mcs/ilasm/Driver.cs
+++ b/mcs/ilasm/Driver.cs
@@ -39,10 +39,8 @@ namespace Mono.ILASM {
private class DriverMain {
private ArrayList il_file_list;
- private Report report;
private string output_file;
private Target target = Target.Exe;
- private string target_string = "exe";
private bool show_tokens = false;
private bool show_method_def = false;
private bool show_method_ref = false;
@@ -55,7 +53,6 @@ namespace Mono.ILASM {
{
il_file_list = new ArrayList ();
ParseArgs (args);
- report = new Report ();
}
public void Run ()
@@ -88,8 +85,6 @@ namespace Mono.ILASM {
file_path);
Environment.Exit (2);
}
- report.AssembleFile (file_path, null,
- target_string, output_file);
StreamReader reader = File.OpenText (file_path);
ILTokenizer scanner = new ILTokenizer (reader);
@@ -109,16 +104,16 @@ namespace Mono.ILASM {
}
ILParser parser = new ILParser (codegen);
- try {
- if (show_parser)
- parser.yyparse (new ScannerAdapter (scanner),
- new yydebug.yyDebugSimple ());
- else
- parser.yyparse (new ScannerAdapter (scanner), null);
- } catch {
- Console.WriteLine ("Error at: " + scanner.Reader.Location);
- throw;
- }
+ try {
+ if (show_parser)
+ parser.yyparse (new ScannerAdapter (scanner),
+ new yydebug.yyDebugSimple ());
+ else
+ parser.yyparse (new ScannerAdapter (scanner), null);
+ } catch {
+ Console.WriteLine ("Error at: " + scanner.Reader.Location);
+ throw;
+ }
}
public void ShowToken (object sender, NewTokenEventArgs args)
@@ -161,11 +156,9 @@ namespace Mono.ILASM {
break;
case "exe":
target = Target.Exe;
- target_string = "exe";
break;
case "dll":
target = Target.Dll;
- target_string = "dll";
break;
case "scan_only":
scan_only = true;
@@ -227,7 +220,7 @@ namespace Mono.ILASM {
ext_index = file_name.Length;
return String.Format ("{0}.{1}", file_name.Substring (0, ext_index),
- target_string);
+ target.ToString ().ToLower ());
}
private void Usage ()
diff --git a/mcs/ilasm/Report.cs b/mcs/ilasm/Report.cs
deleted file mode 100644
index 1f184afd4f5..00000000000
--- a/mcs/ilasm/Report.cs
+++ /dev/null
@@ -1,64 +0,0 @@
-//
-// Mono.ILASM.Report
-//
-// Author(s):
-// Jackson Harper (Jackson@LatitudeGeo.com)
-//
-// (C) 2003 Jackson Harper, All rights reserved
-//
-
-
-using System;
-using System.IO;
-
-namespace Mono.ILASM {
-
- public class Report {
-
- private int error_count;
- private int mark_count;
-
- public Report ()
- {
- error_count = 0;
- }
-
- public int ErrorCount {
- get { return error_count; }
- }
-
- public void Mark ()
- {
- mark_count = error_count;
- }
-
- public bool ErrorSinceMark ()
- {
- return (error_count > mark_count);
- }
-
- public void AssembleFile (string file, string listing,
- string target, string output)
- {
- Console.WriteLine ("Assembling '{0}' , {1}, to {2} --> '{3}'", file,
- GetListing (listing), target, output);
- }
-
- public void Error (int num, string message, Location location)
- {
- error_count++;
- Console.WriteLine ("{0} Error {1}: {2}",
- num, location, message);
- }
-
- private string GetListing (string listing)
- {
- if (listing == null)
- return "no listing file";
- return listing;
- }
-
- }
-
-}
-
diff --git a/mcs/ilasm/codegen/ChangeLog b/mcs/ilasm/codegen/ChangeLog
index eb838fdd2a7..88cf9921ced 100644
--- a/mcs/ilasm/codegen/ChangeLog
+++ b/mcs/ilasm/codegen/ChangeLog
@@ -1,20 +1,3 @@
-2003-08-19 Jackson Harper <jackson@latitudegeo.com>
-
- * DataDef.cs: Make name public so data names can be looked up
- * FieldDef.cs: Stub method for adding data values
- * TypeDef.cs: Implement long form overrides, fix some backwords
- variable naming, add a method to lookup data definitions.
-
-2003-08-19 Jackson Harper <jackson@latitudegeo.com>
-
- * IClassRef.cs: Removed methods that have been moved into ITypeRef
- * MethodDef.cs: Make some properties public, Add method to get a
- list of parameter types. This is used to build signatures. Alow
- sentinels in signatures and in param lists. Fix some tabbing.
- * ParamDef.cs: Expose the parameters type so they can be used when
- building signatures.
- * TypeDef.cs: Add and emit overrides.
-
2003-08-10 Jackson Harper <jackson@latitudegeo.com>
* CodeGen.cs: Fix tabbing
diff --git a/mcs/ilasm/codegen/DataDef.cs b/mcs/ilasm/codegen/DataDef.cs
index ad83cb476b5..b415296dd99 100644
--- a/mcs/ilasm/codegen/DataDef.cs
+++ b/mcs/ilasm/codegen/DataDef.cs
@@ -30,10 +30,6 @@ namespace Mono.ILASM {
set { constant = value; }
}
- public string Name {
- get { return name; }
- set { name = value; }
- }
}
}
diff --git a/mcs/ilasm/codegen/FieldDef.cs b/mcs/ilasm/codegen/FieldDef.cs
index f491a9b7c67..e81f93b2f44 100644
--- a/mcs/ilasm/codegen/FieldDef.cs
+++ b/mcs/ilasm/codegen/FieldDef.cs
@@ -62,11 +62,6 @@ namespace Mono.ILASM {
this.constant = constant;
}
- public void AddDataValue (PEAPI.DataConstant constant)
- {
-
- }
-
public PEAPI.FieldDef Resolve (CodeGen code_gen)
{
if (is_resolved)
diff --git a/mcs/ilasm/codegen/IClassRef.cs b/mcs/ilasm/codegen/IClassRef.cs
index 9321566bc91..9b639fc9917 100644
--- a/mcs/ilasm/codegen/IClassRef.cs
+++ b/mcs/ilasm/codegen/IClassRef.cs
@@ -15,8 +15,12 @@ namespace Mono.ILASM {
PEAPI.Class PeapiClass { get; }
- void MakeValueClass ();
+ new IMethodRef GetMethodRef (ITypeRef ret_type, PEAPI.CallConv call_conv,
+ string name, ITypeRef[] param);
+ new IFieldRef GetFieldRef (ITypeRef ret_type, string name);
+
+ void MakeValueClass ();
}
}
diff --git a/mcs/ilasm/codegen/MethodDef.cs b/mcs/ilasm/codegen/MethodDef.cs
index b7bc2c867f9..3a1162b00c3 100644
--- a/mcs/ilasm/codegen/MethodDef.cs
+++ b/mcs/ilasm/codegen/MethodDef.cs
@@ -28,8 +28,8 @@ namespace Mono.ILASM {
private ArrayList inst_list;
private ArrayList customattr_list;
private Hashtable label_table;
- private Hashtable labelref_table;
- private ArrayList label_list;
+ private Hashtable labelref_table;
+ private ArrayList label_list;
private PEAPI.MethodDef methoddef;
private bool entry_point;
private bool is_resolved;
@@ -38,7 +38,7 @@ namespace Mono.ILASM {
private Hashtable named_local_table;
private bool init_locals;
private int max_stack;
-
+ private Random label_random;
public MethodDef (PEAPI.MethAttr meth_attr, PEAPI.CallConv call_conv,
PEAPI.ImplAttr impl_attr, string name,
@@ -54,12 +54,12 @@ namespace Mono.ILASM {
inst_list = new ArrayList ();
customattr_list = new ArrayList ();
label_table = new Hashtable ();
- labelref_table = new Hashtable ();
- label_list = new ArrayList ();
+ labelref_table = new Hashtable ();
+ label_list = new ArrayList ();
local_list = new ArrayList ();
named_local_table = new Hashtable ();
named_param_table = new Hashtable ();
-
+ label_random = new Random ();
entry_point = false;
init_locals = false;
max_stack = -1;
@@ -78,14 +78,6 @@ namespace Mono.ILASM {
get { return signature; }
}
- public ITypeRef RetType {
- get { return ret_type; }
- }
-
- public PEAPI.CallConv CallConv {
- get { return call_conv; }
- }
-
public PEAPI.MethodDef PeapiMethodDef {
get { return methoddef; }
}
@@ -94,18 +86,6 @@ namespace Mono.ILASM {
get { return (call_conv & PEAPI.CallConv.Vararg) != 0; }
}
- public ITypeRef[] ParamTypeList () {
-
- if (param_list == null)
- return new ITypeRef[0];
- int count = 0;
- ITypeRef[] type_list = new ITypeRef[param_list.Count];
- foreach (ParamDef param in param_list) {
- type_list[count++] = param.Type;
- }
- return type_list;
- }
-
public void AddLocals (ArrayList local_list)
{
int slot_pos = this.local_list.Count;
@@ -171,10 +151,14 @@ namespace Mono.ILASM {
if (param_list != null) {
int param_count = param_list.Count;
+ if (IsVararg && param_list[param_count-1] == ParamDef.Ellipsis)
+ param_count--;
param_array = new PEAPI.Param[param_count];
int count = 0;
foreach (ParamDef paramdef in param_list) {
+ if (paramdef == ParamDef.Ellipsis)
+ break;
paramdef.Define (code_gen);
param_array[count++] = paramdef.PeapiParam;
}
@@ -203,10 +187,14 @@ namespace Mono.ILASM {
if (param_list != null) {
int param_count = param_list.Count;
+ if (IsVararg && param_list[param_count-1] == ParamDef.Ellipsis)
+ param_count--;
param_array = new PEAPI.Param[param_count];
int count = 0;
-
+
foreach (ParamDef paramdef in param_list) {
+ if (paramdef == ParamDef.Ellipsis)
+ break;
paramdef.Define (code_gen);
param_array[count++] = paramdef.PeapiParam;
}
@@ -303,34 +291,34 @@ namespace Mono.ILASM {
/// probably only create the ones that need to be
LabelInfo[] label_info = new LabelInfo[label_table.Count + label_list.Count];
label_table.Values.CopyTo (label_info, 0);
- label_list.CopyTo (label_info, label_table.Count);
+ label_list.CopyTo (label_info, label_table.Count);
int previous_pos = -1;
LabelInfo previous_label = null;
Array.Sort (label_info);
foreach (LabelInfo label in label_info) {
- if (label.UseOffset) {
- label.Define (new PEAPI.CILLabel (label.Offset));
- continue;
- }
+ if (label.UseOffset) {
+ label.Define (new PEAPI.CILLabel (label.Offset));
+ continue;
+ }
if (label.Pos == previous_pos)
label.Label = previous_label.Label;
else
label.Define (cil.NewLabel ());
-
+
previous_label = label;
previous_pos = label.Pos;
}
- // Set all the label refs
- foreach (LabelInfo label in labelref_table.Values) {
- LabelInfo def = (LabelInfo) label_table[label.Name];
- if (def == null) {
- Console.WriteLine ("Undefined Label: " + label);
- return;
- }
- label.Label = def.Label;
- }
+ // Set all the label refs
+ foreach (LabelInfo label in labelref_table.Values) {
+ LabelInfo def = (LabelInfo) label_table[label.Name];
+ if (def == null) {
+ Console.WriteLine ("Undefined Label: " + label);
+ return;
+ }
+ label.Label = def.Label;
+ }
int label_pos = 0;
int next_label_pos = (label_info.Length > 0 ? label_info[0].Pos : -1);
@@ -341,10 +329,10 @@ namespace Mono.ILASM {
cil.CodeLabel (label_info[label_pos].Label);
if (label_pos < label_info.Length) {
while (next_label_pos == i && ++label_pos < label_info.Length) {
- if (label_info[label_pos].UseOffset)
- cil.CodeLabel (label_info[label_pos].Label);
+ if (label_info[label_pos].UseOffset)
+ cil.CodeLabel (label_info[label_pos].Label);
next_label_pos = label_info[label_pos].Pos;
- }
+ }
}
if (label_pos >= label_info.Length)
next_label_pos = -1;
@@ -357,41 +345,41 @@ namespace Mono.ILASM {
public LabelInfo AddLabel (string name)
{
LabelInfo label_info = (LabelInfo) label_table[name];
- if (label_info != null)
- return label_info;
- label_info = new LabelInfo (name, inst_list.Count);
+ if (label_info != null)
+ return label_info;
+ label_info = new LabelInfo (name, inst_list.Count);
label_table.Add (name, label_info);
- return label_info;
- }
-
- public LabelInfo AddLabelRef (string name)
- {
- LabelInfo label_info = (LabelInfo) label_table[name];
- if (label_info != null)
- return label_info;
- label_info = (LabelInfo) labelref_table[name];
- if (label_info != null)
- return label_info;
- label_info = new LabelInfo (name, -1);
- labelref_table.Add (name, label_info);
- return label_info;
- }
-
- public LabelInfo AddLabel (int offset)
- {
- // We go pos + 1 so this line is not counted
- LabelInfo label_info = new LabelInfo (null, inst_list.Count+1, (uint) offset);
- label_list.Add (label_info);
- return label_info;
- }
-
- public LabelInfo AddLabel ()
- {
- int pos = inst_list.Count;
- LabelInfo label_info = new LabelInfo (null, inst_list.Count);
- label_list.Add (label_info);
- return label_info;
- }
+ return label_info;
+ }
+
+ public LabelInfo AddLabelRef (string name)
+ {
+ LabelInfo label_info = (LabelInfo) label_table[name];
+ if (label_info != null)
+ return label_info;
+ label_info = (LabelInfo) labelref_table[name];
+ if (label_info != null)
+ return label_info;
+ label_info = new LabelInfo (name, -1);
+ labelref_table.Add (name, label_info);
+ return label_info;
+ }
+
+ public LabelInfo AddLabel (int offset)
+ {
+ // We go pos + 1 so this line is not counted
+ LabelInfo label_info = new LabelInfo (null, inst_list.Count+1, (uint) offset);
+ label_list.Add (label_info);
+ return label_info;
+ }
+
+ public LabelInfo AddLabel ()
+ {
+ int pos = inst_list.Count;
+ LabelInfo label_info = new LabelInfo (null, inst_list.Count);
+ label_list.Add (label_info);
+ return label_info;
+ }
public PEAPI.CILLabel GetLabelDef (string name)
{
@@ -400,21 +388,21 @@ namespace Mono.ILASM {
return label_info.Label;
}
- public PEAPI.CILLabel GetLabelDef (int pos)
- {
- foreach (LabelInfo li in label_list) {
- if (li.Pos == pos)
- return li.Label;
- }
- return null;
- }
+ public PEAPI.CILLabel GetLabelDef (int pos)
+ {
+ foreach (LabelInfo li in label_list) {
+ if (li.Pos == pos)
+ return li.Label;
+ }
+ return null;
+ }
private void CreateSignature ()
{
- if (IsVararg)
- signature = CreateVarargSignature (name, param_list);
- else
- signature = CreateSignature (name, param_list);
+ if (IsVararg)
+ signature = CreateVarargSignature (name, param_list);
+ else
+ signature = CreateSignature (name, param_list);
}
public static string CreateSignature (string name, IList param_list)
@@ -438,14 +426,14 @@ namespace Mono.ILASM {
return builder.ToString ();
}
- public static string CreateVarargSignature (string name, IList param_list)
+ public static string CreateVarargSignature (string name, IList param_list)
{
StringBuilder builder = new StringBuilder ();
builder.Append (name);
builder.Append ('(');
- bool first = true;
+ bool first = true;
if (param_list != null) {
foreach (ParamDef paramdef in param_list) {
if (!first)
@@ -454,12 +442,12 @@ namespace Mono.ILASM {
first = false;
}
}
- ParamDef last = (ParamDef) param_list[param_list.Count - 1];
- if (!last.IsSentinel ()) {
- if (!first)
- builder.Append (',');
- builder.Append ("...");
- }
+ ParamDef last = (ParamDef) param_list[param_list.Count - 1];
+ if (!last.IsSentinel ()) {
+ if (!first)
+ builder.Append (',');
+ builder.Append ("...");
+ }
builder.Append (')');
return builder.ToString ();
@@ -479,8 +467,8 @@ namespace Mono.ILASM {
builder.Append (',');
builder.Append (param.FullName);
first = false;
- if (param is SentinelTypeRef)
- break;
+ if (param is SentinelTypeRef)
+ break;
}
}
builder.Append (')');
diff --git a/mcs/ilasm/codegen/ParamDef.cs b/mcs/ilasm/codegen/ParamDef.cs
index 9c597f525a0..0cd9d607fab 100644
--- a/mcs/ilasm/codegen/ParamDef.cs
+++ b/mcs/ilasm/codegen/ParamDef.cs
@@ -34,10 +34,6 @@ namespace Mono.ILASM {
is_defined = false;
}
- public ITypeRef Type {
- get { return typeref; }
- }
-
public string TypeName {
get { return typeref.FullName; }
}
@@ -50,10 +46,10 @@ namespace Mono.ILASM {
get { return peapi_param; }
}
- public bool IsSentinel ()
- {
- return (typeref is SentinelTypeRef);
- }
+ public bool IsSentinel ()
+ {
+ return (typeref is SentinelTypeRef);
+ }
public void Define (CodeGen code_gen)
{
diff --git a/mcs/ilasm/codegen/TypeDef.cs b/mcs/ilasm/codegen/TypeDef.cs
index a7889e728d3..bf94e092e3b 100644
--- a/mcs/ilasm/codegen/TypeDef.cs
+++ b/mcs/ilasm/codegen/TypeDef.cs
@@ -30,8 +30,6 @@ namespace Mono.ILASM {
private ArrayList event_list;
private ArrayList property_list;
private ArrayList typar_list;
- private ArrayList override_list;
- private ArrayList override_long_list;
private Hashtable constraint_table;
private TypeDef outer;
@@ -41,8 +39,8 @@ namespace Mono.ILASM {
private int size;
private int pack;
- private bool is_value_class;
- private bool is_enum_class;
+ private bool is_value_class;
+ private bool is_enum_class;
public TypeDef (PEAPI.TypeAttr attr, string name_space, string name,
IClassRef parent, ArrayList impl_list, Location location)
@@ -62,8 +60,8 @@ namespace Mono.ILASM {
is_defined = false;
is_intransit = false;
- is_value_class = false;
- is_value_class = false;
+ is_value_class = false;
+ is_value_class = false;
}
public string Name {
@@ -103,32 +101,15 @@ namespace Mono.ILASM {
get { return current_property; }
}
+ public void MakeValueClass ()
+ {
+ is_value_class = true;
+ }
- public void AddOverride (MethodDef body, ITypeRef parent, string name)
- {
- if (override_list == null)
- override_list = new ArrayList ();
- override_list.Add (new DictionaryEntry (body,
- new DictionaryEntry (parent, name)));
- }
-
- public void AddOverride (string sig, IMethodRef decl)
- {
- if (override_long_list == null)
- override_long_list = new ArrayList ();
- override_long_list.Add (new DictionaryEntry (sig,
- decl));
- }
-
- public void MakeValueClass ()
- {
- is_value_class = true;
- }
-
- public void MakeEnumClass ()
- {
- is_enum_class = true;
- }
+ public void MakeEnumClass ()
+ {
+ is_enum_class = true;
+ }
public void SetSize (int size)
{
@@ -150,15 +131,6 @@ namespace Mono.ILASM {
data_list.Add (datadef);
}
- public DataDef GetDataDef (string name)
- {
- foreach (DataDef def in data_list) {
- if (def.Name == name)
- return def;
- }
- return null;
- }
-
public void AddMethodDef (MethodDef methoddef)
{
method_table.Add (methoddef.Signature, methoddef);
@@ -246,14 +218,14 @@ namespace Mono.ILASM {
classdef = outer.PeapiType.AddNestedClass (attr,
name_space, name, parent.PeapiClass);
} else {
- if (is_value_class) {
- // Should probably confirm that the parent is System.ValueType
- classdef = code_gen.PEFile.AddValueClass (attr,
- name_space, name);
- } else {
- classdef = code_gen.PEFile.AddClass (attr,
- name_space, name, parent.PeapiClass);
- }
+ if (is_value_class) {
+ // Should probably confirm that the parent is System.ValueType
+ classdef = code_gen.PEFile.AddValueClass (attr,
+ name_space, name);
+ } else {
+ classdef = code_gen.PEFile.AddClass (attr,
+ name_space, name, parent.PeapiClass);
+ }
}
} else {
if (outer != null) {
@@ -262,15 +234,14 @@ namespace Mono.ILASM {
classdef = outer.PeapiType.AddNestedClass (attr,
name_space, name);
} else {
- if (is_value_class) {
- classdef = code_gen.PEFile.AddValueClass (attr,
- name_space, name);
- } else {
- classdef = code_gen.PEFile.AddClass (attr,
- name_space, name);
- }
+ if (is_value_class) {
+ classdef = code_gen.PEFile.AddValueClass (attr,
+ name_space, name);
+ } else {
+ classdef = code_gen.PEFile.AddClass (attr,
+ name_space, name);
+ }
}
- classdef.SpecialNoSuper ();
}
if (size != -1)
@@ -322,32 +293,6 @@ namespace Mono.ILASM {
foreach (CustomAttr customattr in customattr_list)
customattr.AddTo (code_gen, classdef);
}
-
- if (override_list != null) {
- foreach (DictionaryEntry entry in override_list) {
- MethodDef body = (MethodDef) entry.Key;
- DictionaryEntry decl = (DictionaryEntry) entry.Value;
- ITypeRef parent_type = (ITypeRef) decl.Key;
- parent_type.Resolve (code_gen);
- string over_name = (string) decl.Value;
- IMethodRef over_meth = parent_type.GetMethodRef (body.RetType,
- body.CallConv, over_name, body.ParamTypeList ());
- over_meth.Resolve (code_gen);
- classdef.AddMethodOverride (over_meth.PeapiMethod,
- body.PeapiMethodDef);
- }
- }
-
- if (override_long_list != null) {
- foreach (DictionaryEntry entry in override_long_list) {
- string sig = (string) entry.Key;
- IMethodRef decl = (IMethodRef) entry.Value;
- MethodDef body = (MethodDef) method_table[sig];
- decl.Resolve (code_gen);
- classdef.AddMethodOverride (decl.PeapiMethod,
- body.PeapiMethodDef);
- }
- }
}
public PEAPI.MethodDef ResolveMethod (string signature, CodeGen code_gen)
diff --git a/mcs/ilasm/ilasm.exe.sources b/mcs/ilasm/ilasm.exe.sources
index b93b7dbde71..12f255c9af0 100644
--- a/mcs/ilasm/ilasm.exe.sources
+++ b/mcs/ilasm/ilasm.exe.sources
@@ -1,5 +1,4 @@
Driver.cs
-Report.cs
AssemblyInfo.cs
codegen/CodeGen.cs
codegen/ExternTable.cs
diff --git a/mcs/ilasm/parser/ChangeLog b/mcs/ilasm/parser/ChangeLog
index fcd8b6c01b7..497944c6ad1 100644
--- a/mcs/ilasm/parser/ChangeLog
+++ b/mcs/ilasm/parser/ChangeLog
@@ -1,13 +1,3 @@
-2003-08-19 Jackson Harper <jackson@latitudegeo.com>
-
- * ILParser.jay: Implement address constants and string
- constants. Add data definitions to their types, and create data
- item lists. Also implement long form overrides.
-
-2003-08-19 Jackson Harper <jackson@latitudegeo.com>
-
- * ILParser.jay: Add override methods.
-
2003-08-10 Jackson Harper <jackson@latitudegeo.com>
* ILParser.jay: Create an empty array list for empty type
diff --git a/mcs/ilasm/parser/ILParser.jay b/mcs/ilasm/parser/ILParser.jay
index 736c072487b..a1492a8a4d4 100644
--- a/mcs/ilasm/parser/ILParser.jay
+++ b/mcs/ilasm/parser/ILParser.jay
@@ -634,30 +634,8 @@ class_decl : method_all
{
codegen.CurrentTypeDef.SetPack ((int) $2);
}
- | D_OVERRIDE type_spec DOUBLE_COLON method_name K_WITH call_conv type
- type_spec DOUBLE_COLON method_name type_list
- {
- //
- // My copy of the spec didn't have a type_list but
- // it seems pretty crucial
- //
- ITypeRef owner = (ITypeRef) $2;
- ArrayList arg_list = (ArrayList) $11;
- ITypeRef[] param_list;
- IMethodRef decl;
-
- if (arg_list != null)
- param_list = (ITypeRef[]) arg_list.ToArray (typeof (ITypeRef));
- else
- param_list = new ITypeRef[0];
-
- decl = owner.GetMethodRef ((ITypeRef) $7,
- (CallConv) $6, (string) $4, param_list);
-
- string sig = MethodDef.CreateSignature ((string) $10,
- param_list);
- codegen.CurrentTypeDef.AddOverride (sig, decl);
- }
+ | D_OVERRIDE type_spec DOUBLE_COLON method_name
+ K_WITH call_conv type type_spec DOUBLE_COLON method_name
OPEN_PARENS sig_args CLOSE_PARENS
| language_decl
| constraint_decl
@@ -1090,11 +1068,11 @@ field_decl : D_FIELD repeat_opt field_attr type id at_opt init_opt
if ($2 != null) {
field_def.SetOffset ((uint) $2);
}
-
+ /*
if ($6 != null) {
field_def.AddDataValue ((DataConstant) $6);
}
-
+ */
if ($7 != null) {
field_def.SetValue ((Constant) $7);
}
@@ -1173,8 +1151,8 @@ field_attr : /* EMPTY */
at_opt : /* EMPTY */
| K_AT id
{
- // DataDef def = new DataDef ((string) $2, false);
- // def.PeapiConstant = new DataConstant (DataTable.GetOffset ((string) $2));
+ // TODO: Implement DataTable
+ // $$ = new DataConstant (DataTable.GetOffset ((string) $2));
}
;
@@ -1242,6 +1220,9 @@ field_init : K_FLOAT32 OPEN_PARENS float64 CLOSE_PARENS
data_decl : data_head data_body
{
+ /*
+ Console.WriteLine ("Creating data decl: '{0}' '{1}'", $1, $2);
+
DataDef datadef = (DataDef) $1;
if ($2 is ArrayList) {
@@ -1255,7 +1236,7 @@ data_decl : data_head data_body
} else {
datadef.PeapiConstant = (PEAPI.Constant) $2;
}
- codegen.CurrentTypeDef.AddDataDef ((DataDef) $1);
+ */
}
;
@@ -1278,27 +1259,11 @@ data_body : OPEN_BRACE dataitem_list CLOSE_BRACE
;
dataitem_list : dataitem
- {
- ArrayList dataitem_list = new ArrayList ();
- dataitem_list.Add ($1);
- $$ = dataitem_list;
- }
| dataitem_list COMMA dataitem
- {
- ArrayList list = (ArrayList) $1;
- list.Add ($3);
- }
;
dataitem : K_CHAR STAR OPEN_PARENS comp_qstring CLOSE_PARENS
- {
- $$ = new StringConst ((string) $4);
- }
| AMPERSAND OPEN_PARENS id CLOSE_PARENS
- {
- DataDef def = codegen.CurrentTypeDef.GetDataDef ((string) $3);
- $$ = new AddressConstant ((DataConstant) def.PeapiConstant);
- }
| K_BYTEARRAY ASSIGN OPEN_PARENS bytes CLOSE_PARENS
{
$$ = new ByteArrConst ((byte[]) $4);
@@ -1603,11 +1568,6 @@ method_decl : D_EMITBYTE int32
| D_EXPORT OPEN_BRACKET int32 CLOSE_BRACKET K_AS id
| D_VTENTRY int32 COLON int32
| D_OVERRIDE type_spec DOUBLE_COLON method_name
- {
- codegen.CurrentTypeDef.AddOverride (codegen.CurrentMethodDef,
- (ITypeRef) $2, (string) $4);
-
- }
| scope_block
| D_PARAM OPEN_BRACKET int32 CLOSE_BRACKET init_opt
| id COLON
diff --git a/mcs/ilasm/tests/ChangeLog b/mcs/ilasm/tests/ChangeLog
index 1be3a784145..018b60a40eb 100644
--- a/mcs/ilasm/tests/ChangeLog
+++ b/mcs/ilasm/tests/ChangeLog
@@ -1,8 +1,4 @@
-2003-07-12 Zoltan Varga <vargaz@freemail.hu>
- * test-31.il: Added tests for static properties. Also made the code
- for methods verifiable IL.
-
Fri Jul 25 12:27:24 CEST 2003 Paolo Molaro <lupus@ximian.com>
* generics-c.il, generics-b.il: add constructors and fix code.
diff --git a/mcs/ilasm/tests/test-31.il b/mcs/ilasm/tests/test-31.il
index 19d7b454dc0..c82984ac051 100644
--- a/mcs/ilasm/tests/test-31.il
+++ b/mcs/ilasm/tests/test-31.il
@@ -14,34 +14,17 @@
.method public int32 get_foo ()
{
- ldc.i4.1
- ret
+ nop
}
.method public void set_foo (int32)
{
- ret
+ nop
}
.method public void other_foo ()
{
- ret
- }
-
- .method static public int32 get_static_foo ()
- {
- ldc.i4.1
- ret
- }
-
- .method static public void set_static_foo (int32)
- {
- ret
- }
-
- .method static public void other_static_foo ()
- {
- ret
+
}
.property int32 foo (int32) = int32 (0xFFFFFFFF)
@@ -50,12 +33,5 @@
.set instance void Mono.ILASM.Tests.PropertyTest::set_foo (int32)
.other instance void Mono.ILASM.Tests.PropertyTest::other_foo ()
}
-
- .property int32 static_foo ()
- {
- .get int32 Mono.ILASM.Tests.PropertyTest::get_static_foo ()
- .set int32 Mono.ILASM.Tests.PropertyTest::set_static_foo (int32)
- .other void Mono.ILASM.Tests.PropertyTest::other_foo ()
- }
}
}
diff --git a/mcs/mcs/ChangeLog b/mcs/mcs/ChangeLog
index 156a1b8de86..938e618ae73 100755
--- a/mcs/mcs/ChangeLog
+++ b/mcs/mcs/ChangeLog
@@ -1,89 +1,3 @@
-2003-08-26 Martin Baulig <martin@ximian.com>
-
- * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
- resolving aliases; fixes #47927.
-
-2003-08-26 Martin Baulig <martin@ximian.com>
-
- * statement.cs (Using.DoResolve): This is internally emitting a
- try/finally clause, so we need to set ec.NeedExplicitReturn if we
- do not always return. Fixes #47681.
-
-2003-08-26 Martin Baulig <martin@ximian.com>
-
- * decl.cs (MemberCore): Moved WarningNotHiding(),
- Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
- into MemberBase.
- (AdditionResult): Make this nested in DeclSpace.
- (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
- argument; call NamespaceEntry.Define() unless we're nested in a
- class or struct.
-
- * namespace.cs (Namespace.DefineName): New public function. This
- is called from DeclSpace's .ctor to add
- (Namespace.Lookup): Include DeclSpaces in the lookup.
-
- * class.cs (Operator): Derive from MemberBase, not MemberCore.
-
- * const.cs (Const): Derive from MemberBase, not MemberCore.
-
-2003-08-25 Martin Baulig <martin@ximian.com>
-
- * convert.cs (Convert.ExplicitReferenceConversion): When
- converting from an interface type to a class, unbox if the target
- type is a struct type. Fixes #47822.
-
-2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
- #47854.
-
-2003-08-22 Martin Baulig <martin@ximian.com>
-
- * class.cs (TypeManager.DefineType): When defining a nested type,
- call DefineType() on our parent; fixes #47801.
-
-2003-08-22 Martin Baulig <martin@ximian.com>
-
- * class.cs (MethodData.Define): While checking if a method is an
- interface implementation, improve the test a bit more to fix #47654.
-
-2003-08-22 Martin Baulig <martin@ximian.com>
-
- * expression.cs (Probe.DoResolve): Check whether `expr' resolved
- correctly; fixes #47722.
-
-2003-08-22 Martin Baulig <martin@ximian.com>
-
- * expression.cs (UnaryMutator.ResolveVariable): If the target is a
- LocalVariableReference, ensure it's not read-only. Fixes #47536.
-
- * statement.cs (Fixed.DoResolve): Make all variables read-only.
-
-2003-08-22 Martin Baulig <martin@ximian.com>
-
- * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
- can only be assigned in static constructors. Fixes #47161.
-
-2003-08-22 Martin Baulig <martin@ximian.com>
-
- Rewrote and improved the flow analysis code.
-
- * flowbranching.cs (FlowBranching): Make this class abstract.
- (FlowBranching.CreateBranching): New static function to create a
- new flow branching.
- (FlowBranchingBlock, FlowBranchingException): New classes.
- (FlowBranching.UsageVector.Type): New public readonly field.
- (FlowBranching.UsageVector.Breaks): Removed the setter.
- (FlowBranching.UsageVector.Returns): Removed the setter.
- (FlowBranching.UsageVector): Added Break(), Return(),
- NeverReachable() and Throw() methods to modify the reachability.
- (FlowBranching.UsageVector.MergeChildren): Removed, this is now
- done by FlowBranching.Merge().
- (FlowBranching.UsageVector.MergeChild): New method; merges the
- merge result into the current vector.
- (FlowBranching.Merge): New abstract method to merge a branching.
-
2003-08-12 Martin Baulig <martin@ximian.com>
* expression.cs (Indirection.CacheTemporaries): Create the
diff --git a/mcs/mcs/class.cs b/mcs/mcs/class.cs
index b580801ad3e..b76dc79d322 100755
--- a/mcs/mcs/class.cs
+++ b/mcs/mcs/class.cs
@@ -134,8 +134,8 @@ namespace Mono.CSharp {
//
public string IndexerName;
- public TypeContainer (NamespaceEntry ns, TypeContainer parent, string name, Location l)
- : base (ns, parent, name, l)
+ public TypeContainer (TypeContainer parent, string name, Location l)
+ : base (parent, name, l)
{
string n;
types = new ArrayList ();
@@ -791,6 +791,7 @@ namespace Mono.CSharp {
TypeAttributes type_attributes = TypeAttr;
+ // if (parent_builder is ModuleBuilder) {
if (IsTopLevel){
if (TypeManager.NamespaceClash (Name, Location))
return null;
@@ -800,7 +801,7 @@ namespace Mono.CSharp {
Name, type_attributes, parent, ifaces);
} else {
- TypeBuilder builder = Parent.DefineType ();
+ TypeBuilder builder = Parent.TypeBuilder;
TypeBuilder = builder.DefineNestedType (
Basename, type_attributes, parent, ifaces);
}
@@ -885,7 +886,7 @@ namespace Mono.CSharp {
if (idx < 0){
if (RootContext.WarningLevel >= 4){
if ((mc.ModFlags & Modifiers.NEW) != 0)
- Warning_KeywordNewNotRequired (mc.Location, mc);
+ Warning_KewywordNewNotRequired (mc.Location, mc);
}
} else if (mc is MethodCore)
((MethodCore) mc).OverridesSomething = true;
@@ -1625,7 +1626,7 @@ namespace Mono.CSharp {
mi.ReflectedType.Name + "." + mi.Name + "'");
}
- public void Warning_KeywordNewNotRequired (Location l, MemberCore mc)
+ public void Warning_KewywordNewNotRequired (Location l, MemberCore mc)
{
Report.Warning (
109, l, "The member " + MakeName (mc.Name) + " does not hide an " +
@@ -2095,8 +2096,8 @@ namespace Mono.CSharp {
Modifiers.SEALED |
Modifiers.UNSAFE;
- public Class (NamespaceEntry ns, TypeContainer parent, string name, int mod, Attributes attrs, Location l)
- : base (ns, parent, name, l)
+ public Class (TypeContainer parent, string name, int mod, Attributes attrs, Location l)
+ : base (parent, name, l)
{
int accmods;
@@ -2132,8 +2133,8 @@ namespace Mono.CSharp {
Modifiers.UNSAFE |
Modifiers.PRIVATE;
- public Struct (NamespaceEntry ns, TypeContainer parent, string name, int mod, Attributes attrs, Location l)
- : base (ns, parent, name, l)
+ public Struct (TypeContainer parent, string name, int mod, Attributes attrs, Location l)
+ : base (parent, name, l)
{
int accmods;
@@ -2181,7 +2182,7 @@ namespace Mono.CSharp {
public MethodCore (Expression type, int mod, int allowed_mod, string name,
Attributes attrs, Parameters parameters, Location loc)
- : base (type, mod, allowed_mod, Modifiers.PRIVATE, name, attrs, loc)
+ : base (type, mod, allowed_mod, name, attrs, loc)
{
Parameters = parameters;
}
@@ -3187,21 +3188,14 @@ namespace Mono.CSharp {
Modifiers.Error_InvalidModifier (Location, "public, virtual or abstract");
implementing = null;
}
- } else if ((flags & MethodAttributes.MemberAccessMask) != MethodAttributes.Public){
- if (TypeManager.IsInterfaceType (implementing.DeclaringType)){
- //
- // If this is an interface method implementation,
- // check for public accessibility
- //
- implementing = null;
- } else if ((flags & MethodAttributes.MemberAccessMask) == MethodAttributes.Private){
- // We may never be private.
- implementing = null;
- } else if ((modifiers & Modifiers.OVERRIDE) == 0){
- //
- // We may be protected if we're overriding something.
- //
- implementing = null;
+ } else {
+ //
+ // If this is an interface method implementation,
+ // check for public accessibility
+ //
+ if ((flags & MethodAttributes.MemberAccessMask) != MethodAttributes.Public){
+ if (TypeManager.IsInterfaceType (implementing.DeclaringType))
+ implementing = null;
}
}
@@ -3476,12 +3470,12 @@ namespace Mono.CSharp {
//
// The constructor is only exposed to our children
//
- protected MemberBase (Expression type, int mod, int allowed_mod, int def_mod, string name,
+ protected MemberBase (Expression type, int mod, int allowed_mod, string name,
Attributes attrs, Location loc)
: base (name, loc)
{
Type = type;
- ModFlags = Modifiers.Check (allowed_mod, mod, def_mod, loc);
+ ModFlags = Modifiers.Check (allowed_mod, mod, Modifiers.PRIVATE, loc);
OptAttributes = attrs;
}
@@ -3499,153 +3493,6 @@ namespace Mono.CSharp {
return true;
}
- protected void WarningNotHiding (TypeContainer parent)
- {
- Report.Warning (
- 109, Location,
- "The member " + parent.MakeName (Name) + " does not hide an " +
- "inherited member. The keyword new is not required");
-
- }
-
- void Error_CannotChangeAccessModifiers (TypeContainer parent, MethodInfo parent_method,
- string name)
- {
- //
- // FIXME: report the old/new permissions?
- //
- Report.Error (
- 507, Location, parent.MakeName (Name) +
- ": can't change the access modifiers when overriding inherited " +
- "member `" + name + "'");
- }
-
- //
- // Performs various checks on the MethodInfo `mb' regarding the modifier flags
- // that have been defined.
- //
- // `name' is the user visible name for reporting errors (this is used to
- // provide the right name regarding method names and properties)
- //
- protected bool CheckMethodAgainstBase (TypeContainer parent, MethodAttributes my_attrs,
- MethodInfo mb, string name)
- {
- bool ok = true;
-
- if ((ModFlags & Modifiers.OVERRIDE) != 0){
- if (!(mb.IsAbstract || mb.IsVirtual)){
- Report.Error (
- 506, Location, parent.MakeName (Name) +
- ": cannot override inherited member `" +
- name + "' because it is not " +
- "virtual, abstract or override");
- ok = false;
- }
-
- // Now we check that the overriden method is not final
-
- if (mb.IsFinal) {
- // This happens when implementing interface methods.
- if (mb.IsHideBySig && mb.IsVirtual) {
- Report.Error (
- 506, Location, parent.MakeName (Name) +
- ": cannot override inherited member `" +
- name + "' because it is not " +
- "virtual, abstract or override");
- } else
- Report.Error (239, Location, parent.MakeName (Name) + " : cannot " +
- "override inherited member `" + name +
- "' because it is sealed.");
- ok = false;
- }
- //
- // Check that the permissions are not being changed
- //
- MethodAttributes thisp = my_attrs & MethodAttributes.MemberAccessMask;
- MethodAttributes parentp = mb.Attributes & MethodAttributes.MemberAccessMask;
-
- //
- // special case for "protected internal"
- //
-
- if ((parentp & MethodAttributes.FamORAssem) == MethodAttributes.FamORAssem){
- //
- // when overriding protected internal, the method can be declared
- // protected internal only within the same assembly
- //
-
- if ((thisp & MethodAttributes.FamORAssem) == MethodAttributes.FamORAssem){
- if (parent.TypeBuilder.Assembly != mb.DeclaringType.Assembly){
- //
- // assemblies differ - report an error
- //
-
- Error_CannotChangeAccessModifiers (parent, mb, name);
- ok = false;
- } else if (thisp != parentp) {
- //
- // same assembly, but other attributes differ - report an error
- //
-
- Error_CannotChangeAccessModifiers (parent, mb, name);
- ok = false;
- };
- } else if ((thisp & MethodAttributes.Family) != MethodAttributes.Family) {
- //
- // if it's not "protected internal", it must be "protected"
- //
-
- Error_CannotChangeAccessModifiers (parent, mb, name);
- ok = false;
- } else if (parent.TypeBuilder.Assembly == mb.DeclaringType.Assembly) {
- //
- // protected within the same assembly - an error
- //
- Error_CannotChangeAccessModifiers (parent, mb, name);
- ok = false;
- } else if ((thisp & ~(MethodAttributes.Family | MethodAttributes.FamORAssem)) !=
- (parentp & ~(MethodAttributes.Family | MethodAttributes.FamORAssem))) {
- //
- // protected ok, but other attributes differ - report an error
- //
- Error_CannotChangeAccessModifiers (parent, mb, name);
- ok = false;
- }
- } else {
- if (thisp != parentp){
- Error_CannotChangeAccessModifiers (parent, mb, name);
- ok = false;
- }
- }
- }
-
- if (mb.IsVirtual || mb.IsAbstract){
- if ((ModFlags & (Modifiers.NEW | Modifiers.OVERRIDE)) == 0){
- if (Name != "Finalize"){
- Report.Warning (
- 114, 2, Location, parent.MakeName (Name) +
- " hides inherited member `" + name +
- "'. To make the current member override that " +
- "implementation, add the override keyword, " +
- "otherwise use the new keyword");
- ModFlags |= Modifiers.NEW;
- }
- }
- } else {
- if ((ModFlags & (Modifiers.NEW | Modifiers.OVERRIDE)) == 0){
- if (Name != "Finalize"){
- Report.Warning (
- 108, 1, Location, "The keyword new is required on " +
- parent.MakeName (Name) + " because it hides " +
- "inherited member `" + name + "'");
- ModFlags |= Modifiers.NEW;
- }
- }
- }
-
- return ok;
- }
-
protected virtual bool CheckParameters (TypeContainer container, Type [] parameters)
{
bool error = false;
@@ -3785,7 +3632,7 @@ namespace Mono.CSharp {
//
protected FieldBase (Expression type, int mod, int allowed_mod, string name,
object init, Attributes attrs, Location loc)
- : base (type, mod, allowed_mod, Modifiers.PRIVATE, name, attrs, loc)
+ : base (type, mod, allowed_mod, name, attrs, loc)
{
this.init = init;
}
@@ -4736,7 +4583,7 @@ namespace Mono.CSharp {
}
}
- public class Operator : MemberBase {
+ public class Operator : MemberCore {
const int AllowedModifiers =
Modifiers.PUBLIC |
@@ -4791,24 +4638,27 @@ namespace Mono.CSharp {
public readonly Expression FirstArgType, SecondArgType;
public readonly string FirstArgName, SecondArgName;
public Block Block;
+ public Attributes OptAttributes;
public MethodBuilder OperatorMethodBuilder;
public string MethodName;
public Method OperatorMethod;
- public Operator (OpType type, Expression ret_type, int mod_flags,
+ public Operator (OpType type, Expression ret_type, int flags,
Expression arg1type, string arg1name,
Expression arg2type, string arg2name,
Block block, Attributes attrs, Location loc)
- : base (ret_type, mod_flags, AllowedModifiers, Modifiers.PUBLIC, "", attrs, loc)
+ : base ("", loc)
{
OperatorType = type;
ReturnType = ret_type;
+ ModFlags = Modifiers.Check (AllowedModifiers, flags, Modifiers.PUBLIC, loc);
FirstArgType = arg1type;
FirstArgName = arg1name;
SecondArgType = arg2type;
SecondArgName = arg2name;
Block = block;
+ OptAttributes = attrs;
}
string Prototype (TypeContainer container)
diff --git a/mcs/mcs/codegen.cs b/mcs/mcs/codegen.cs
index a8c6ca296da..b1976c59de0 100755
--- a/mcs/mcs/codegen.cs
+++ b/mcs/mcs/codegen.cs
@@ -381,7 +381,7 @@ namespace Mono.CSharp {
// </summary>
public FlowBranching StartFlowBranching (FlowBranching.BranchingType type, Location loc)
{
- FlowBranching cfb = FlowBranching.CreateBranching (CurrentBranching, type, null, loc);
+ FlowBranching cfb = new FlowBranching (CurrentBranching, type, null, loc);
FlowStack.Push (cfb);
@@ -401,7 +401,7 @@ namespace Mono.CSharp {
else
type = FlowBranching.BranchingType.Block;
- cfb = FlowBranching.CreateBranching (CurrentBranching, type, block, block.StartLocation);
+ cfb = new FlowBranching (CurrentBranching, type, block, block.StartLocation);
FlowStack.Push (cfb);
@@ -445,8 +445,7 @@ namespace Mono.CSharp {
bool old_do_flow_analysis = DoFlowAnalysis;
DoFlowAnalysis = true;
- FlowBranching cfb = FlowBranching.CreateBranching (
- null, FlowBranching.BranchingType.Block, block, loc);
+ FlowBranching cfb = new FlowBranching (block, loc);
FlowStack.Push (cfb);
if (!block.Resolve (this)) {
diff --git a/mcs/mcs/const.cs b/mcs/mcs/const.cs
index fc7a29f6727..4f54d70e887 100755
--- a/mcs/mcs/const.cs
+++ b/mcs/mcs/const.cs
@@ -24,9 +24,10 @@ namespace Mono.CSharp {
using System.Reflection.Emit;
using System.Collections;
- public class Const : MemberBase {
+ public class Const : MemberCore {
public Expression ConstantType;
public Expression Expr;
+ public Attributes OptAttributes;
public FieldBuilder FieldBuilder;
EmitContext const_ec;
@@ -44,11 +45,13 @@ namespace Mono.CSharp {
public Const (Expression constant_type, string name, Expression expr, int mod_flags,
Attributes attrs, Location loc)
- : base (constant_type, mod_flags, AllowedModifiers, Modifiers.PRIVATE, name, attrs, loc)
+ : base (name, loc)
{
ConstantType = constant_type;
Name = name;
Expr = expr;
+ ModFlags = Modifiers.Check (AllowedModifiers, mod_flags, Modifiers.PRIVATE, loc);
+ OptAttributes = attrs;
}
public FieldAttributes FieldAttr {
@@ -95,7 +98,7 @@ namespace Mono.CSharp {
if (ptype != null) {
MemberList list = TypeContainer.FindMembers (
ptype, MemberTypes.Field, BindingFlags.Public,
- System.Type.FilterName, Name);
+ Type.FilterName, Name);
if (list.Count == 0)
if ((ModFlags & Modifiers.NEW) != 0)
diff --git a/mcs/mcs/convert.cs b/mcs/mcs/convert.cs
index 75b6036cdfa..04ce4a19e7d 100644
--- a/mcs/mcs/convert.cs
+++ b/mcs/mcs/convert.cs
@@ -1512,14 +1512,10 @@ namespace Mono.CSharp {
// sealed, or provided T implements S.
//
if (source_type.IsInterface) {
- if (!target_type.IsSealed || TypeManager.ImplementsInterface (target_type, source_type)) {
- if (target_type.IsClass)
- return new ClassCast (source, target_type);
- else
- return new UnboxCast (source, target_type);
- }
-
- return null;
+ if (!target_type.IsSealed || TypeManager.ImplementsInterface (target_type, source_type))
+ return new ClassCast (source, target_type);
+ else
+ return null;
}
// From an array type S with an element type Se to an array type T with an
diff --git a/mcs/mcs/cs-parser.jay b/mcs/mcs/cs-parser.jay
index e053aa6fdc6..aa61878730a 100755
--- a/mcs/mcs/cs-parser.jay
+++ b/mcs/mcs/cs-parser.jay
@@ -341,7 +341,7 @@ namespace_declaration
+ " Expected class, delegate, enum, interface, or struct");
}
- current_namespace = RootContext.Tree.RecordNamespace (current_namespace, file, (string) $3, lexer.Location);
+ current_namespace = RootContext.Tree.RecordNamespace (current_namespace, file, (string) $3);
}
namespace_body opt_semicolon
{
@@ -667,9 +667,10 @@ struct_declaration
Struct new_struct;
string full_struct_name = MakeName ((string) $4);
- new_struct = new Struct (current_namespace, current_container, full_struct_name,
- (int) $2, (Attributes) $1, lexer.Location);
+ new_struct = new Struct (current_container, full_struct_name, (int) $2,
+ (Attributes) $1, lexer.Location);
current_container = new_struct;
+ current_container.NamespaceEntry = current_namespace;
RootContext.Tree.RecordDecl (full_struct_name, new_struct);
}
opt_class_base
@@ -1131,13 +1132,14 @@ interface_declaration
Interface new_interface;
string full_interface_name = MakeName ((string) $4);
- new_interface = new Interface (current_namespace, current_container, full_interface_name,
- (int) $2, (Attributes) $1, lexer.Location);
+ new_interface = new Interface (current_container, full_interface_name, (int) $2,
+ (Attributes) $1, lexer.Location);
if (current_interface != null) {
Location l = lexer.Location;
Report.Error (-2, l, "Internal compiler error: interface inside interface");
}
current_interface = new_interface;
+ new_interface.NamespaceEntry = current_namespace;
RootContext.Tree.RecordDecl (full_interface_name, new_interface);
}
opt_interface_base
@@ -1748,8 +1750,8 @@ enum_declaration
Location enum_location = lexer.Location;
string full_name = MakeName ((string) $4);
- Enum e = new Enum (current_namespace, current_container, (Expression) $5, (int) $2,
- full_name, (Attributes) $1, enum_location);
+ Enum e = new Enum (current_container, (Expression) $5, (int) $2, full_name,
+ (Attributes) $1, enum_location);
foreach (VariableDeclaration ev in (ArrayList) $6) {
Location loc = (Location) ev.Location;
@@ -1760,6 +1762,8 @@ enum_declaration
ev.identifier, loc);
}
+ e.NamespaceEntry = current_namespace;
+
CheckDef (current_container.AddEnum (e), full_name, enum_location);
RootContext.Tree.RecordDecl (full_name, e);
@@ -1826,10 +1830,11 @@ delegate_declaration
SEMICOLON
{
Location l = lexer.Location;
- Delegate del = new Delegate (current_namespace, current_container, (Expression) $4,
- (int) $2, MakeName ((string) $5), (Parameters) $7,
+ Delegate del = new Delegate (current_container, (Expression) $4, (int) $2,
+ MakeName ((string) $5), (Parameters) $7,
(Attributes) $1, l);
+ del.NamespaceEntry = current_namespace;
CheckDef (current_container.AddDelegate (del), del.Name, l);
}
| opt_attributes
@@ -1842,10 +1847,11 @@ delegate_declaration
{
Location l = lexer.Location;
Delegate del = new Delegate (
- current_namespace, current_container,
+ current_container,
TypeManager.system_void_expr, (int) $2, MakeName ((string) $5),
(Parameters) $7, (Attributes) $1, l);
+ del.NamespaceEntry = current_namespace;
CheckDef (current_container.AddDelegate (del), del.Name, l);
}
;
@@ -2784,9 +2790,10 @@ class_declaration
name = MakeName ((string) $4);
- new_class = new Class (current_namespace, current_container, name, (int) $2,
+ new_class = new Class (current_container, name, (int) $2,
(Attributes) $1, lexer.Location);
current_container = new_class;
+ current_container.NamespaceEntry = current_namespace;
RootContext.Tree.RecordDecl (name, new_class);
}
opt_class_base
@@ -3880,7 +3887,7 @@ void Error_ExpectingTypeName (Location l, Expression expr)
string
MakeName (string class_name)
{
- string ns = current_namespace.FullName;
+ string ns = current_namespace.Name;
string container_name = current_container.Name;
if (container_name == ""){
@@ -3897,13 +3904,13 @@ MakeName (string class_name)
// in the current declaration space
// </summary>
void
-CheckDef (DeclSpace.AdditionResult result, string name, Location l)
+CheckDef (AdditionResult result, string name, Location l)
{
- if (result == DeclSpace.AdditionResult.Success)
+ if (result == AdditionResult.Success)
return;
switch (result){
- case DeclSpace.AdditionResult.NameExists:
+ case AdditionResult.NameExists:
Report.Error (102, l, "The container `" + current_container.Name +
"' already contains a definition for `"+
name + "'");
@@ -3914,22 +3921,22 @@ CheckDef (DeclSpace.AdditionResult result, string name, Location l)
// This is handled only for static Constructors, because
// in reality we handle these by the semantic analysis later
//
- case DeclSpace.AdditionResult.MethodExists:
+ case AdditionResult.MethodExists:
Report.Error (
111, l, "Class `"+current_container.Name+
"' already defines a member called '" +
name + "' with the same parameter types (more than one default constructor)");
break;
- case DeclSpace.AdditionResult.EnclosingClash:
+ case AdditionResult.EnclosingClash:
Report.Error (542, l, "Member names cannot be the same as their enclosing type");
break;
- case DeclSpace.AdditionResult.NotAConstructor:
+ case AdditionResult.NotAConstructor:
Report.Error (1520, l, "Class, struct, or interface method must have a return type");
break;
- case DeclSpace.AdditionResult.Error:
+ case AdditionResult.Error:
// Error has already been reported.
break;
}
@@ -3940,7 +3947,7 @@ CheckDef (bool result, string name, Location l)
{
if (result)
return;
- CheckDef (DeclSpace.AdditionResult.NameExists, name, l);
+ CheckDef (AdditionResult.NameExists, name, l);
}
Expression DecomposeQI (string name, Location loc)
@@ -4152,7 +4159,7 @@ public Tokenizer Lexer {
public CSharpParser (SeekableStreamReader reader, SourceFile file, ArrayList defines)
{
- current_namespace = new NamespaceEntry (null, file, null, Location.Null);
+ current_namespace = new NamespaceEntry (null, file, null);
this.name = file.Name;
this.file = file;
current_container = RootContext.Tree.Types;
@@ -4176,7 +4183,6 @@ public override void parse ()
// Please do not remove this, it is used during debugging
// of the grammar
//
- Console.WriteLine (e);
Report.Error (-25, lexer.Location, "Parsing error");
if (Driver.parser_verbose)
Console.WriteLine (e);
diff --git a/mcs/mcs/decl.cs b/mcs/mcs/decl.cs
index f3edd9474c0..f528e1be5dc 100755
--- a/mcs/mcs/decl.cs
+++ b/mcs/mcs/decl.cs
@@ -43,6 +43,153 @@ namespace Mono.CSharp {
Location = loc;
}
+ protected void WarningNotHiding (TypeContainer parent)
+ {
+ Report.Warning (
+ 109, Location,
+ "The member " + parent.MakeName (Name) + " does not hide an " +
+ "inherited member. The keyword new is not required");
+
+ }
+
+ void Error_CannotChangeAccessModifiers (TypeContainer parent, MethodInfo parent_method,
+ string name)
+ {
+ //
+ // FIXME: report the old/new permissions?
+ //
+ Report.Error (
+ 507, Location, parent.MakeName (Name) +
+ ": can't change the access modifiers when overriding inherited " +
+ "member `" + name + "'");
+ }
+
+ //
+ // Performs various checks on the MethodInfo `mb' regarding the modifier flags
+ // that have been defined.
+ //
+ // `name' is the user visible name for reporting errors (this is used to
+ // provide the right name regarding method names and properties)
+ //
+ protected bool CheckMethodAgainstBase (TypeContainer parent, MethodAttributes my_attrs,
+ MethodInfo mb, string name)
+ {
+ bool ok = true;
+
+ if ((ModFlags & Modifiers.OVERRIDE) != 0){
+ if (!(mb.IsAbstract || mb.IsVirtual)){
+ Report.Error (
+ 506, Location, parent.MakeName (Name) +
+ ": cannot override inherited member `" +
+ name + "' because it is not " +
+ "virtual, abstract or override");
+ ok = false;
+ }
+
+ // Now we check that the overriden method is not final
+
+ if (mb.IsFinal) {
+ // This happens when implementing interface methods.
+ if (mb.IsHideBySig && mb.IsVirtual) {
+ Report.Error (
+ 506, Location, parent.MakeName (Name) +
+ ": cannot override inherited member `" +
+ name + "' because it is not " +
+ "virtual, abstract or override");
+ } else
+ Report.Error (239, Location, parent.MakeName (Name) + " : cannot " +
+ "override inherited member `" + name +
+ "' because it is sealed.");
+ ok = false;
+ }
+ //
+ // Check that the permissions are not being changed
+ //
+ MethodAttributes thisp = my_attrs & MethodAttributes.MemberAccessMask;
+ MethodAttributes parentp = mb.Attributes & MethodAttributes.MemberAccessMask;
+
+ //
+ // special case for "protected internal"
+ //
+
+ if ((parentp & MethodAttributes.FamORAssem) == MethodAttributes.FamORAssem){
+ //
+ // when overriding protected internal, the method can be declared
+ // protected internal only within the same assembly
+ //
+
+ if ((thisp & MethodAttributes.FamORAssem) == MethodAttributes.FamORAssem){
+ if (parent.TypeBuilder.Assembly != mb.DeclaringType.Assembly){
+ //
+ // assemblies differ - report an error
+ //
+
+ Error_CannotChangeAccessModifiers (parent, mb, name);
+ ok = false;
+ } else if (thisp != parentp) {
+ //
+ // same assembly, but other attributes differ - report an error
+ //
+
+ Error_CannotChangeAccessModifiers (parent, mb, name);
+ ok = false;
+ };
+ } else if ((thisp & MethodAttributes.Family) != MethodAttributes.Family) {
+ //
+ // if it's not "protected internal", it must be "protected"
+ //
+
+ Error_CannotChangeAccessModifiers (parent, mb, name);
+ ok = false;
+ } else if (parent.TypeBuilder.Assembly == mb.DeclaringType.Assembly) {
+ //
+ // protected within the same assembly - an error
+ //
+ Error_CannotChangeAccessModifiers (parent, mb, name);
+ ok = false;
+ } else if ((thisp & ~(MethodAttributes.Family | MethodAttributes.FamORAssem)) !=
+ (parentp & ~(MethodAttributes.Family | MethodAttributes.FamORAssem))) {
+ //
+ // protected ok, but other attributes differ - report an error
+ //
+ Error_CannotChangeAccessModifiers (parent, mb, name);
+ ok = false;
+ }
+ } else {
+ if (thisp != parentp){
+ Error_CannotChangeAccessModifiers (parent, mb, name);
+ ok = false;
+ }
+ }
+ }
+
+ if (mb.IsVirtual || mb.IsAbstract){
+ if ((ModFlags & (Modifiers.NEW | Modifiers.OVERRIDE)) == 0){
+ if (Name != "Finalize"){
+ Report.Warning (
+ 114, 2, Location, parent.MakeName (Name) +
+ " hides inherited member `" + name +
+ "'. To make the current member override that " +
+ "implementation, add the override keyword, " +
+ "otherwise use the new keyword");
+ ModFlags |= Modifiers.NEW;
+ }
+ }
+ } else {
+ if ((ModFlags & (Modifiers.NEW | Modifiers.OVERRIDE)) == 0){
+ if (Name != "Finalize"){
+ Report.Warning (
+ 108, 1, Location, "The keyword new is required on " +
+ parent.MakeName (Name) + " because it hides " +
+ "inherited member `" + name + "'");
+ ModFlags |= Modifiers.NEW;
+ }
+ }
+ }
+
+ return ok;
+ }
+
public abstract bool Define (TypeContainer parent);
//
@@ -64,54 +211,10 @@ namespace Mono.CSharp {
}
}
- /// <summary>
- /// Base class for structs, classes, enumerations and interfaces.
- /// </summary>
- /// <remarks>
- /// They all create new declaration spaces. This
- /// provides the common foundation for managing those name
- /// spaces.
- /// </remarks>
- public abstract class DeclSpace : MemberCore {
- /// <summary>
- /// this points to the actual definition that is being
- /// created with System.Reflection.Emit
- /// </summary>
- public TypeBuilder TypeBuilder;
-
- /// <summary>
- /// This variable tracks whether we have Closed the type
- /// </summary>
- public bool Created = false;
-
- //
- // This is the namespace in which this typecontainer
- // was declared. We use this to resolve names.
- //
- public NamespaceEntry NamespaceEntry;
-
- public Hashtable Cache = new Hashtable ();
-
- public string Basename;
-
- /// <summary>
- /// defined_names is used for toplevel objects
- /// </summary>
- protected Hashtable defined_names;
-
- TypeContainer parent;
-
- public DeclSpace (NamespaceEntry ns, TypeContainer parent, string name, Location l)
- : base (name, l)
- {
- NamespaceEntry = ns;
- Basename = name.Substring (1 + name.LastIndexOf ('.'));
- defined_names = new Hashtable ();
- this.parent = parent;
-
- if ((NamespaceEntry != null) && (parent == RootContext.Tree.Types))
- NamespaceEntry.DefineName (Basename, this);
- }
+ //
+ // FIXME: This is temporary outside DeclSpace, because I have to fix a bug
+ // in MCS that makes it fail the lookup for the enum
+ //
/// <summary>
/// The result value from adding an declaration into
@@ -158,6 +261,51 @@ namespace Mono.CSharp {
Error
}
+ /// <summary>
+ /// Base class for structs, classes, enumerations and interfaces.
+ /// </summary>
+ /// <remarks>
+ /// They all create new declaration spaces. This
+ /// provides the common foundation for managing those name
+ /// spaces.
+ /// </remarks>
+ public abstract class DeclSpace : MemberCore {
+ /// <summary>
+ /// this points to the actual definition that is being
+ /// created with System.Reflection.Emit
+ /// </summary>
+ public TypeBuilder TypeBuilder;
+
+ /// <summary>
+ /// This variable tracks whether we have Closed the type
+ /// </summary>
+ public bool Created = false;
+
+ //
+ // This is the namespace in which this typecontainer
+ // was declared. We use this to resolve names.
+ //
+ public NamespaceEntry NamespaceEntry;
+
+ public Hashtable Cache = new Hashtable ();
+
+ public string Basename;
+
+ /// <summary>
+ /// defined_names is used for toplevel objects
+ /// </summary>
+ protected Hashtable defined_names;
+
+ TypeContainer parent;
+
+ public DeclSpace (TypeContainer parent, string name, Location l)
+ : base (name, l)
+ {
+ Basename = name.Substring (1 + name.LastIndexOf ('.'));
+ defined_names = new Hashtable ();
+ this.parent = parent;
+ }
+
/// <summary>
/// Returns a status code based purely on the name
/// of the member being added
@@ -560,7 +708,7 @@ namespace Mono.CSharp {
// Attempt to lookup the class on our namespace and all it's implicit parents
//
for (NamespaceEntry ns = NamespaceEntry; ns != null; ns = ns.ImplicitParent) {
- t = LookupInterfaceOrClass (ns.FullName, name, out error);
+ t = LookupInterfaceOrClass (ns.Name, name, out error);
if (error)
return null;
@@ -585,7 +733,7 @@ namespace Mono.CSharp {
for (NamespaceEntry ns = NamespaceEntry; ns != null; ns = ns.Parent){
- t = LookupInterfaceOrClass (ns.FullName, name, out error);
+ t = LookupInterfaceOrClass (ns.Name, name, out error);
if (error)
return null;
diff --git a/mcs/mcs/delegate.cs b/mcs/mcs/delegate.cs
index 35a9e43a0b5..f46b7c87abd 100644
--- a/mcs/mcs/delegate.cs
+++ b/mcs/mcs/delegate.cs
@@ -46,10 +46,10 @@ namespace Mono.CSharp {
Modifiers.UNSAFE |
Modifiers.PRIVATE;
- public Delegate (NamespaceEntry ns, TypeContainer parent, Expression type,
- int mod_flags, string name, Parameters param_list,
+ public Delegate (TypeContainer parent, Expression type, int mod_flags,
+ string name, Parameters param_list,
Attributes attrs, Location l)
- : base (ns, parent, name, l)
+ : base (parent, name, l)
{
this.ReturnType = type;
ModFlags = Modifiers.Check (AllowedModifiers, mod_flags,
diff --git a/mcs/mcs/ecore.cs b/mcs/mcs/ecore.cs
index 522051ba4dd..b4f23fe2488 100755
--- a/mcs/mcs/ecore.cs
+++ b/mcs/mcs/ecore.cs
@@ -2025,6 +2025,29 @@ namespace Mono.CSharp {
Expression e = null;
//
+ // Since we are cheating (is_base is our hint
+ // that we are the beginning of the name): we
+ // only do the Alias lookup for namespaces if
+ // the name does not include any dots in it
+ //
+ NamespaceEntry ns = ec.DeclSpace.NamespaceEntry;
+ if (is_base && ns != null){
+ string alias_value = ns.LookupAlias (Name);
+ if (alias_value != null){
+ Name = alias_value;
+ Type t;
+
+ if ((t = TypeManager.LookupType (Name)) != null)
+ return new TypeExpr (t, loc);
+
+ // No match, maybe our parent can compose us
+ // into something meaningful.
+ return this;
+ }
+ }
+
+
+ //
// Stage 1: Performed by the parser (binding to locals or parameters).
//
Block current_block = ec.CurrentBlock;
@@ -2078,31 +2101,8 @@ namespace Mono.CSharp {
if (e == null && ec.ContainerType != null)
e = MemberLookup (ec, ec.ContainerType, Name, loc);
- if (e == null) {
- //
- // Since we are cheating (is_base is our hint
- // that we are the beginning of the name): we
- // only do the Alias lookup for namespaces if
- // the name does not include any dots in it
- //
- NamespaceEntry ns = ec.DeclSpace.NamespaceEntry;
- if (is_base && ns != null){
- string alias_value = ns.LookupAlias (Name);
- if (alias_value != null){
- Name = alias_value;
- Type t;
-
- if ((t = TypeManager.LookupType (Name)) != null)
- return new TypeExpr (t, loc);
-
- // No match, maybe our parent can compose us
- // into something meaningful.
- return this;
- }
- }
-
+ if (e == null)
return ResolveAsTypeStep (ec);
- }
if (e is TypeExpr)
return e;
@@ -2527,9 +2527,6 @@ namespace Mono.CSharp {
//
if (ec.IsConstructor){
- if (IsStatic && !ec.IsStatic)
- Report_AssignToReadonly (false);
-
if (ec.ContainerType == FieldInfo.DeclaringType)
return this;
}
diff --git a/mcs/mcs/enum.cs b/mcs/mcs/enum.cs
index 06f4c9e0cf7..c6f613bfadf 100755
--- a/mcs/mcs/enum.cs
+++ b/mcs/mcs/enum.cs
@@ -49,9 +49,8 @@ namespace Mono.CSharp {
Modifiers.INTERNAL |
Modifiers.PRIVATE;
- public Enum (NamespaceEntry ns, TypeContainer parent, Expression type, int mod_flags,
- string name, Attributes attrs, Location l)
- : base (ns, parent, name, l)
+ public Enum (TypeContainer parent, Expression type, int mod_flags, string name, Attributes attrs, Location l)
+ : base (parent, name, l)
{
this.BaseType = type;
ModFlags = Modifiers.Check (AllowedModifiers, mod_flags,
diff --git a/mcs/mcs/expression.cs b/mcs/mcs/expression.cs
index 2df3981c917..3096ef1d02a 100755
--- a/mcs/mcs/expression.cs
+++ b/mcs/mcs/expression.cs
@@ -826,9 +826,6 @@ namespace Mono.CSharp {
//
type = expr_type;
if (expr.eclass == ExprClass.Variable){
- LocalVariableReference var = expr as LocalVariableReference;
- if ((var != null) && var.IsReadOnly)
- Error (1604, "cannot assign to `" + var.Name + "' because it is readonly");
if (IsIncrementableNumber (expr_type) ||
expr_type == TypeManager.decimal_type){
return this;
@@ -1090,8 +1087,6 @@ namespace Mono.CSharp {
return null;
expr = expr.Resolve (ec);
- if (expr == null)
- return null;
return this;
}
diff --git a/mcs/mcs/flowanalysis.cs b/mcs/mcs/flowanalysis.cs
index cab8a5108a5..6abe2e956e6 100644
--- a/mcs/mcs/flowanalysis.cs
+++ b/mcs/mcs/flowanalysis.cs
@@ -20,7 +20,7 @@ namespace Mono.CSharp
// A new instance of this class is created every time a new block is resolved
// and if there's branching in the block's control flow.
// </summary>
- public abstract class FlowBranching
+ public class FlowBranching
{
// <summary>
// The type of a FlowBranching.
@@ -80,20 +80,6 @@ namespace Mono.CSharp
Unreachable
}
- public static FlowBranching CreateBranching (FlowBranching parent, BranchingType type, Block block, Location loc)
- {
- switch (type) {
- case BranchingType.Exception:
- return new FlowBranchingException (parent, type, block, loc);
-
- case BranchingType.Switch:
- return new FlowBranchingBlock (parent, type, SiblingType.SwitchSection, block, loc);
-
- default:
- return new FlowBranchingBlock (parent, type, SiblingType.Conditional, block, loc);
- }
- }
-
// <summary>
// The type of this flow branching.
// </summary>
@@ -116,6 +102,12 @@ namespace Mono.CSharp
public readonly Location Location;
// <summary>
+ // A list of UsageVectors. A new vector is added each time control flow may
+ // take a different path.
+ // </summary>
+ public UsageVector[] Siblings;
+
+ // <summary>
// If this is an infinite loop.
// </summary>
public bool Infinite;
@@ -129,6 +121,7 @@ namespace Mono.CSharp
// Private
//
VariableMap param_map, local_map;
+ ArrayList finally_vectors;
static int next_id = 0;
int id;
@@ -140,8 +133,6 @@ namespace Mono.CSharp
// </summary>
public static FlowReturns AndFlowReturns (FlowReturns a, FlowReturns b)
{
- if (a == FlowReturns.Undefined)
- return b;
if (b == FlowReturns.Unreachable)
return a;
@@ -179,16 +170,6 @@ namespace Mono.CSharp
// </summary>
public class UsageVector {
// <summary>
- // The type of this branching.
- // </summary>
- public readonly SiblingType Type;
-
- // <summary>
- // Start location of this branching.
- // </summary>
- public readonly Location Location;
-
- // <summary>
// If this is true, then the usage vector has been modified and must be
// merged when we're done with this branching.
// </summary>
@@ -215,7 +196,7 @@ namespace Mono.CSharp
// Private.
//
MyBitVector locals, parameters;
- FlowReturns RealReturns, RealBreaks, RealReachable;
+ FlowReturns real_returns, real_breaks;
bool is_finally;
static int next_id = 0;
@@ -224,23 +205,20 @@ namespace Mono.CSharp
//
// Normally, you should not use any of these constructors.
//
- public UsageVector (SiblingType type, UsageVector parent, Location loc, int num_params, int num_locals)
+ public UsageVector (UsageVector parent, int num_params, int num_locals)
{
- this.Type = type;
- this.Location = loc;
this.InheritsFrom = parent;
this.CountParameters = num_params;
this.CountLocals = num_locals;
- this.RealReturns = FlowReturns.Never;
- this.RealBreaks = FlowReturns.Never;
- this.RealReachable = FlowReturns.Always;
+ this.real_returns = FlowReturns.Never;
+ this.real_breaks = FlowReturns.Never;
if (parent != null) {
locals = new MyBitVector (parent.locals, CountLocals);
if (num_params > 0)
parameters = new MyBitVector (parent.parameters, num_params);
- RealReturns = parent.Returns;
- RealBreaks = parent.Breaks;
+ real_returns = parent.Returns;
+ real_breaks = parent.Breaks;
} else {
locals = new MyBitVector (null, CountLocals);
if (num_params > 0)
@@ -250,8 +228,8 @@ namespace Mono.CSharp
id = ++next_id;
}
- public UsageVector (SiblingType type, UsageVector parent, Location loc)
- : this (type, parent, loc, parent.CountParameters, parent.CountLocals)
+ public UsageVector (UsageVector parent)
+ : this (parent, parent.CountParameters, parent.CountLocals)
{ }
// <summary>
@@ -259,14 +237,13 @@ namespace Mono.CSharp
// </summary>
public UsageVector Clone ()
{
- UsageVector retval = new UsageVector (Type, null, Location, CountParameters, CountLocals);
+ UsageVector retval = new UsageVector (null, CountParameters, CountLocals);
retval.locals = locals.Clone ();
if (parameters != null)
retval.parameters = parameters.Clone ();
- retval.RealReturns = RealReturns;
- retval.RealBreaks = RealBreaks;
- retval.RealReachable = RealReachable;
+ retval.real_returns = real_returns;
+ retval.real_breaks = real_breaks;
return retval;
}
@@ -312,7 +289,11 @@ namespace Mono.CSharp
// </summary>
public FlowReturns Returns {
get {
- return RealReturns;
+ return real_returns;
+ }
+
+ set {
+ real_returns = value;
}
}
@@ -325,13 +306,11 @@ namespace Mono.CSharp
// </summary>
public FlowReturns Breaks {
get {
- return RealBreaks;
+ return real_breaks;
}
- }
- public FlowReturns Reachable {
- get {
- return RealReachable;
+ set {
+ real_breaks = value;
}
}
@@ -363,57 +342,141 @@ namespace Mono.CSharp
}
}
- public void Break ()
+ // <summary>
+ // Merge a child branching.
+ // </summary>
+ public FlowReturns MergeChildren (FlowBranching branching, UsageVector[] children)
{
- RealBreaks = FlowReturns.Always;
- }
+ MyBitVector new_locals = null;
+ MyBitVector new_params = null;
- public void Return ()
- {
- RealReturns = FlowReturns.Always;
- }
+ FlowReturns new_returns = FlowReturns.Never;
+ FlowReturns new_breaks = FlowReturns.Never;
+ bool new_returns_set = false, new_breaks_set = false;
- public bool IsUnreachable {
- get {
- return (Reachable == FlowReturns.Exception) ||
- (Reachable == FlowReturns.Unreachable);
- }
- }
+ Report.Debug (2, "MERGING CHILDREN", branching, branching.Type,
+ this, children.Length);
- public void Unreachable ()
- {
- // If we're already unreachable, don't modify the reason why.
- if (!IsUnreachable)
- RealReachable = FlowReturns.Unreachable;
- }
+ foreach (UsageVector child in children) {
+ Report.Debug (2, " MERGING CHILD", child, child.is_finally);
+
+ if (!child.is_finally) {
+ if (child.Breaks != FlowReturns.Unreachable) {
+ // If Returns is already set, perform an
+ // `And' operation on it, otherwise just set just.
+ if (!new_returns_set) {
+ new_returns = child.Returns;
+ new_returns_set = true;
+ } else
+ new_returns = AndFlowReturns (
+ new_returns, child.Returns);
+ }
- public void NeverReachable ()
- {
- // If we're already unreachable, don't modify the reason why.
- if (!IsUnreachable)
- RealReachable = FlowReturns.Never;
- }
+ // If Breaks is already set, perform an
+ // `And' operation on it, otherwise just set just.
+ if (!new_breaks_set) {
+ new_breaks = child.Breaks;
+ new_breaks_set = true;
+ } else
+ new_breaks = AndFlowReturns (
+ new_breaks, child.Breaks);
+ }
- public void Throw ()
- {
- // If we're already unreachable, don't modify the reason why.
- if (!IsUnreachable)
- RealReachable = FlowReturns.Exception;
- }
+ // Ignore unreachable children.
+ if (child.Returns == FlowReturns.Unreachable)
+ continue;
- // <summary>
- // Merges a child branching.
- // </summary>
- public FlowReturns MergeChild (MyBitVector new_params, MyBitVector new_locals,
- FlowReturns new_returns, FlowReturns new_breaks,
- FlowReturns new_reachable)
- {
- Report.Debug (2, "MERGING CHILD", this, new_params, new_locals, new_returns, new_breaks,
- new_reachable);
+ // A local variable is initialized after a flow branching if it
+ // has been initialized in all its branches which do neither
+ // always return or always throw an exception.
+ //
+ // If a branch may return, but does not always return, then we
+ // can treat it like a never-returning branch here: control will
+ // only reach the code position after the branching if we did not
+ // return here.
+ //
+ // It's important to distinguish between always and sometimes
+ // returning branches here:
+ //
+ // 1 int a;
+ // 2 if (something) {
+ // 3 return;
+ // 4 a = 5;
+ // 5 }
+ // 6 Console.WriteLine (a);
+ //
+ // The if block in lines 3-4 always returns, so we must not look
+ // at the initialization of `a' in line 4 - thus it'll still be
+ // uninitialized in line 6.
+ //
+ // On the other hand, the following is allowed:
+ //
+ // 1 int a;
+ // 2 if (something)
+ // 3 a = 5;
+ // 4 else
+ // 5 return;
+ // 6 Console.WriteLine (a);
+ //
+ // Here, `a' is initialized in line 3 and we must not look at
+ // line 5 since it always returns.
+ //
+ if (child.is_finally) {
+ if (new_locals == null)
+ new_locals = locals.Clone ();
+ new_locals.Or (child.locals);
+
+ if (parameters != null) {
+ if (new_params == null)
+ new_params = parameters.Clone ();
+ new_params.Or (child.parameters);
+ }
+ } else {
+ if (!child.AlwaysReturns && !child.AlwaysBreaks) {
+ if (new_locals != null)
+ new_locals.And (child.locals);
+ else {
+ new_locals = locals.Clone ();
+ new_locals.Or (child.locals);
+ }
+ } else if (children.Length == 1) {
+ new_locals = locals.Clone ();
+ new_locals.Or (child.locals);
+ }
- RealReturns = new_returns;
- RealBreaks = new_breaks;
- RealReachable = new_reachable;
+ // An `out' parameter must be assigned in all branches which do
+ // not always throw an exception.
+ if (parameters != null) {
+ bool and_params = child.Breaks != FlowReturns.Exception;
+ if (branching.Type == BranchingType.Exception)
+ and_params &= child.Returns != FlowReturns.Never;
+ if (and_params) {
+ if (new_params != null)
+ new_params.And (child.parameters);
+ else {
+ new_params = parameters.Clone ();
+ new_params.Or (child.parameters);
+ }
+ } else if ((children.Length == 1) || (new_params == null)) {
+ new_params = parameters.Clone ();
+ new_params.Or (child.parameters);
+ }
+ }
+ }
+ }
+
+ Returns = new_returns;
+ if ((branching.Type == BranchingType.Block) ||
+ (branching.Type == BranchingType.Exception) ||
+ (new_breaks == FlowReturns.Unreachable) ||
+ (new_breaks == FlowReturns.Exception))
+ Breaks = new_breaks;
+ else if (branching.Type == BranchingType.SwitchSection)
+ Breaks = new_returns;
+ else if (branching.Type == BranchingType.Switch){
+ if (new_breaks == FlowReturns.Always)
+ Breaks = FlowReturns.Always;
+ }
//
// We've now either reached the point after the branching or we will
@@ -424,17 +487,10 @@ namespace Mono.CSharp
// we need to look at (see above).
//
- Report.Debug (2, "MERGING CHILD #1", this, Returns, Breaks, Reachable, new_locals, new_params);
-
- if ((Reachable == FlowReturns.Always) || (Reachable == FlowReturns.Sometimes) ||
- (Reachable == FlowReturns.Never)) {
- if ((Returns == FlowReturns.Always) || (Breaks == FlowReturns.Always))
- RealReachable = FlowReturns.Never;
- if ((Type == SiblingType.SwitchSection) && (Reachable != FlowReturns.Never)) {
- Report.Error (163, Location, "Control cannot fall through from one " +
- "case label to another");
- }
-
+ if (((new_breaks != FlowReturns.Always) &&
+ (new_breaks != FlowReturns.Exception) &&
+ (new_breaks != FlowReturns.Unreachable)) ||
+ (children.Length == 1)) {
if (new_locals != null)
locals.Or (new_locals);
@@ -442,9 +498,56 @@ namespace Mono.CSharp
parameters.Or (new_params);
}
- Report.Debug (2, "MERGING CHILD DONE", this);
+ Report.Debug (2, "MERGING CHILDREN DONE", branching.Type,
+ new_params, new_locals, new_returns, new_breaks,
+ branching.Infinite, branching.MayLeaveLoop, this);
+
+ if (branching.Type == BranchingType.SwitchSection) {
+ if ((new_breaks != FlowReturns.Always) &&
+ (new_breaks != FlowReturns.Exception) &&
+ (new_breaks != FlowReturns.Unreachable))
+ Report.Error (163, branching.Location,
+ "Control cannot fall through from one " +
+ "case label to another");
+ }
+
+ if (branching.Infinite && !branching.MayLeaveLoop) {
+ Report.Debug (1, "INFINITE", new_returns, new_breaks,
+ Returns, Breaks, this);
+
+ // We're actually infinite.
+ if (new_returns == FlowReturns.Never) {
+ Breaks = FlowReturns.Unreachable;
+ return FlowReturns.Unreachable;
+ }
+
+ // If we're an infinite loop and do not break, the code after
+ // the loop can never be reached. However, if we may return
+ // from the loop, then we do always return (or stay in the loop
+ // forever).
+ if ((new_returns == FlowReturns.Sometimes) ||
+ (new_returns == FlowReturns.Always)) {
+ Returns = FlowReturns.Always;
+ return FlowReturns.Always;
+ }
+ }
+
+ if (branching.Type == BranchingType.LoopBlock) {
+ Report.Debug (2, "MERGING LOOP BLOCK DONE", branching,
+ branching.Infinite, branching.MayLeaveLoop,
+ new_breaks, new_returns);
+
+ // If we may leave the loop, then we do not always return.
+ if (branching.MayLeaveLoop && (new_returns == FlowReturns.Always)) {
+ Returns = FlowReturns.Sometimes;
+ return FlowReturns.Sometimes;
+ }
- return Returns;
+ // A `break' in a loop does not "break" in the outer block.
+ Breaks = FlowReturns.Never;
+ }
+
+ return new_returns;
}
// <summary>
@@ -471,13 +574,8 @@ namespace Mono.CSharp
{
Report.Debug (1, "MERGING JUMP ORIGIN", this);
- RealBreaks = FlowReturns.Never;
- RealReturns = FlowReturns.Never;
- if (Reachable != FlowReturns.Always)
- RealReachable = FlowReturns.Always;
-
- if (origin_vectors == null)
- return;
+ real_breaks = FlowReturns.Never;
+ real_returns = FlowReturns.Never;
foreach (UsageVector vector in origin_vectors) {
Report.Debug (1, " MERGING JUMP ORIGIN", vector);
@@ -485,9 +583,8 @@ namespace Mono.CSharp
locals.And (vector.locals);
if (parameters != null)
parameters.And (vector.parameters);
- RealBreaks = AndFlowReturns (RealBreaks, vector.Breaks);
- RealReturns = AndFlowReturns (RealReturns, vector.Returns);
- RealReachable = AndFlowReturns (RealReachable, vector.Reachable);
+ Breaks = AndFlowReturns (Breaks, vector.Breaks);
+ Returns = AndFlowReturns (Returns, vector.Returns);
}
Report.Debug (1, "MERGING JUMP ORIGIN DONE", this);
@@ -501,14 +598,14 @@ namespace Mono.CSharp
{
Report.Debug (1, "MERGING FINALLY ORIGIN", this);
- RealBreaks = FlowReturns.Never;
+ real_breaks = FlowReturns.Never;
foreach (UsageVector vector in finally_vectors) {
Report.Debug (1, " MERGING FINALLY ORIGIN", vector);
if (parameters != null)
parameters.And (vector.parameters);
- RealBreaks = AndFlowReturns (Breaks, vector.Breaks);
+ Breaks = AndFlowReturns (Breaks, vector.Breaks);
}
is_finally = true;
@@ -540,18 +637,6 @@ namespace Mono.CSharp
locals.And (new_vector.locals);
}
- public bool HasParameters {
- get {
- return parameters != null;
- }
- }
-
- public bool HasLocals {
- get {
- return locals != null;
- }
- }
-
// <summary>
// Returns a deep copy of the parameters.
// </summary>
@@ -573,18 +658,6 @@ namespace Mono.CSharp
}
}
- public MyBitVector ParameterVector {
- get {
- return parameters;
- }
- }
-
- public MyBitVector LocalVector {
- get {
- return locals;
- }
- }
-
//
// Debugging stuff.
//
@@ -599,8 +672,6 @@ namespace Mono.CSharp
sb.Append (Returns);
sb.Append (",");
sb.Append (Breaks);
- sb.Append (",");
- sb.Append (Reachable);
if (parameters != null) {
sb.Append (" - ");
sb.Append (parameters);
@@ -613,64 +684,115 @@ namespace Mono.CSharp
}
}
+ FlowBranching (BranchingType type, Location loc)
+ {
+ this.Block = null;
+ this.Location = loc;
+ this.Type = type;
+ id = ++next_id;
+ }
+
+ // <summary>
+ // Creates a new flow branching for `block'.
+ // This is used from Block.Resolve to create the top-level branching of
+ // the block.
+ // </summary>
+ public FlowBranching (Block block, Location loc)
+ : this (BranchingType.Block, loc)
+ {
+ Block = block;
+ Parent = null;
+
+ param_map = block.ParameterMap;
+ local_map = block.LocalMap;
+
+ UsageVector vector = new UsageVector (null, param_map.Length, local_map.Length);
+
+ AddSibling (vector);
+ }
+
// <summary>
// Creates a new flow branching which is contained in `parent'.
// You should only pass non-null for the `block' argument if this block
// introduces any new variables - in this case, we need to create a new
// usage vector with a different size than our parent's one.
// </summary>
- protected FlowBranching (FlowBranching parent, BranchingType type, SiblingType stype,
- Block block, Location loc)
+ public FlowBranching (FlowBranching parent, BranchingType type,
+ Block block, Location loc)
+ : this (type, loc)
{
Parent = parent;
Block = block;
- Location = loc;
- Type = type;
- id = ++next_id;
UsageVector vector;
if (Block != null) {
param_map = Block.ParameterMap;
local_map = Block.LocalMap;
- UsageVector parent_vector = parent != null ? parent.CurrentUsageVector : null;
- vector = new UsageVector (stype, parent_vector, loc, param_map.Length, local_map.Length);
+ vector = new UsageVector (parent.CurrentUsageVector, param_map.Length,
+ local_map.Length);
} else {
param_map = Parent.param_map;
local_map = Parent.local_map;
- vector = new UsageVector (stype, Parent.CurrentUsageVector, loc);
+ vector = new UsageVector (Parent.CurrentUsageVector);
}
AddSibling (vector);
+
+ switch (Type) {
+ case BranchingType.Exception:
+ finally_vectors = new ArrayList ();
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ void AddSibling (UsageVector uv)
+ {
+ if (Siblings != null) {
+ UsageVector[] ns = new UsageVector [Siblings.Length + 1];
+ for (int i = 0; i < Siblings.Length; ++i)
+ ns [i] = Siblings [i];
+ Siblings = ns;
+ } else {
+ Siblings = new UsageVector [1];
+ }
+ Siblings [Siblings.Length - 1] = uv;
}
- public abstract UsageVector CurrentUsageVector {
- get;
- }
+ // <summary>
+ // Returns the branching's current usage vector.
+ // </summary>
+ public UsageVector CurrentUsageVector
+ {
+ get {
+ return Siblings [Siblings.Length - 1];
+ }
+ }
// <summary>
// Creates a sibling of the current usage vector.
// </summary>
- public virtual void CreateSibling (SiblingType type)
+ public void CreateSibling (SiblingType type)
{
- AddSibling (new UsageVector (type, Parent.CurrentUsageVector, Location));
+ AddSibling (new UsageVector (Parent.CurrentUsageVector));
Report.Debug (1, "CREATED SIBLING", CurrentUsageVector);
- }
- protected abstract void AddSibling (UsageVector uv);
-
- public abstract void Break ();
- public abstract void Return ();
- public abstract void Goto ();
- public abstract void Throw ();
- public abstract void Label (ArrayList origin_vectors);
+ if (type == SiblingType.Finally)
+ CurrentUsageVector.MergeFinallyOrigins (finally_vectors);
+ }
// <summary>
// Check whether all `out' parameters have been assigned.
// </summary>
public void CheckOutParameters (MyBitVector parameters, Location loc)
{
+ if (InTryBlock ())
+ return;
+
for (int i = 0; i < param_map.Count; i++) {
VariableInfo var = param_map [i];
@@ -686,145 +808,20 @@ namespace Mono.CSharp
}
}
- protected class MergeResult
- {
- public MyBitVector Parameters;
- public MyBitVector Locals;
- public FlowReturns Returns;
- public FlowReturns Breaks;
- public FlowReturns Reachable;
- public bool MayLeaveLoop;
-
- public MergeResult (MyBitVector parameters, MyBitVector locals, FlowReturns returns, FlowReturns breaks,
- FlowReturns reachable, bool may_leave_loop)
- {
- this.Parameters = parameters;
- this.Locals = locals;
- this.Returns = returns;
- this.Breaks = breaks;
- this.Reachable = reachable;
- this.MayLeaveLoop = may_leave_loop;
- }
- }
-
- protected MergeResult Merge (ArrayList children)
- {
- MyBitVector locals = null;
- MyBitVector parameters = null;
-
- FlowReturns returns = FlowReturns.Undefined;
- FlowReturns breaks = FlowReturns.Undefined;
- FlowReturns reachable = FlowReturns.Undefined;
-
- Report.Debug (2, "MERGING CHILDREN", this, Type, children.Count);
-
- foreach (UsageVector child in children) {
- Report.Debug (2, " MERGING CHILD", child, child.AlwaysBreaks, child.AlwaysReturns,
- child.IsUnreachable, child.Locals, child.Parameters,
- child.Returns, child.Breaks, child.Reachable);
-
- reachable = AndFlowReturns (reachable, child.Reachable);
-
- // Ignore unreachable children.
- if (child.IsUnreachable)
- continue;
-
- returns = AndFlowReturns (returns, child.Returns);
- breaks = AndFlowReturns (breaks, child.Breaks);
-
- // A local variable is initialized after a flow branching if it
- // has been initialized in all its branches which do neither
- // always return or always throw an exception.
- //
- // If a branch may return, but does not always return, then we
- // can treat it like a never-returning branch here: control will
- // only reach the code position after the branching if we did not
- // return here.
- //
- // It's important to distinguish between always and sometimes
- // returning branches here:
- //
- // 1 int a;
- // 2 if (something) {
- // 3 return;
- // 4 a = 5;
- // 5 }
- // 6 Console.WriteLine (a);
- //
- // The if block in lines 3-4 always returns, so we must not look
- // at the initialization of `a' in line 4 - thus it'll still be
- // uninitialized in line 6.
- //
- // On the other hand, the following is allowed:
- //
- // 1 int a;
- // 2 if (something)
- // 3 a = 5;
- // 4 else
- // 5 return;
- // 6 Console.WriteLine (a);
- //
- // Here, `a' is initialized in line 3 and we must not look at
- // line 5 since it always returns.
- //
- if (!child.AlwaysReturns && !child.AlwaysBreaks)
- MyBitVector.And (ref locals, child.LocalVector);
-
- // An `out' parameter must be assigned in all branches which do
- // not always throw an exception.
- if ((child.Type != SiblingType.Catch) &&
- (child.ParameterVector != null) && (child.Breaks != FlowReturns.Exception))
- MyBitVector.And (ref parameters, child.ParameterVector);
- }
-
- Report.Debug (2, "MERGING CHILDREN DONE", Type, parameters, locals, returns, breaks, reachable,
- Infinite, MayLeaveLoop, this);
-
- if (Infinite && !MayLeaveLoop) {
- Report.Debug (1, "INFINITE", returns, breaks, this);
-
- if (returns == FlowReturns.Never) {
- // We're actually infinite.
- breaks = FlowReturns.Unreachable;
- returns = FlowReturns.Unreachable;
- } else if ((returns == FlowReturns.Sometimes) || (returns == FlowReturns.Always)) {
- // If we're an infinite loop and do not break, the code after
- // the loop can never be reached. However, if we may return
- // from the loop, then we do always return (or stay in the loop
- // forever).
- returns = FlowReturns.Always;
- }
- }
-
- if (returns == FlowReturns.Undefined)
- returns = FlowReturns.Never;
- if (breaks == FlowReturns.Undefined)
- breaks = FlowReturns.Never;
-
- return new MergeResult (parameters, locals, returns, breaks, reachable, MayLeaveLoop);
- }
-
- protected abstract MergeResult Merge ();
-
// <summary>
// Merge a child branching.
// </summary>
public FlowReturns MergeChild (FlowBranching child)
{
- MergeResult result = child.Merge ();
-
- CurrentUsageVector.MergeChild (
- result.Parameters, result.Locals, result.Returns, result.Breaks, result.Reachable);
+ FlowReturns returns = CurrentUsageVector.MergeChildren (child, child.Siblings);
- if ((child.Type != BranchingType.LoopBlock) && (child.Type != BranchingType.SwitchSection))
+ if ((child.Type != BranchingType.LoopBlock) &&
+ (child.Type != BranchingType.SwitchSection))
MayLeaveLoop |= child.MayLeaveLoop;
- if (result.Reachable == FlowReturns.Exception)
- return FlowReturns.Exception;
- else
- return result.Returns;
+ return returns;
}
-
+
// <summary>
// Does the toplevel merging.
// </summary>
@@ -833,30 +830,46 @@ namespace Mono.CSharp
if ((Type != BranchingType.Block) || (Block == null))
throw new NotSupportedException ();
- UsageVector vector = new UsageVector (
- SiblingType.Conditional, null, Location, param_map.Length, local_map.Length);
+ UsageVector vector = new UsageVector (null, param_map.Length, local_map.Length);
- MergeResult result = Merge ();
- vector.MergeChild (result.Parameters, result.Locals, result.Returns, result.Breaks, result.Reachable);
+ Report.Debug (1, "MERGING TOP BLOCK", Location, vector);
- if (vector.Reachable != FlowReturns.Exception)
- CheckOutParameters (vector.Parameters, Location);
- else
- return FlowReturns.Exception;
+ vector.MergeChildren (this, Siblings);
- return result.Returns;
+ if (Siblings.Length == 1)
+ Siblings [0] = vector;
+ else {
+ Siblings = null;
+ AddSibling (vector);
+ }
+
+ Report.Debug (1, "MERGING TOP BLOCK DONE", Location, vector);
+
+ if (vector.Breaks != FlowReturns.Exception) {
+ if (!vector.AlwaysBreaks)
+ CheckOutParameters (CurrentUsageVector.Parameters, Location);
+ return vector.AlwaysBreaks ? FlowReturns.Always : vector.Returns;
+ } else
+ return FlowReturns.Exception;
}
- public virtual bool InTryBlock ()
+ public bool InTryBlock ()
{
- if (Parent != null)
+ if (finally_vectors != null)
+ return true;
+ else if (Parent != null)
return Parent.InTryBlock ();
else
return false;
}
- public virtual void AddFinallyVector (UsageVector vector)
+ public void AddFinallyVector (UsageVector vector)
{
+ if (finally_vectors != null) {
+ finally_vectors.Add (vector.Clone ());
+ return;
+ }
+
if (Parent != null)
Parent.AddFinallyVector (vector);
else
@@ -886,11 +899,45 @@ namespace Mono.CSharp
CurrentUsageVector.SetFieldAssigned (vi, name);
}
+ public bool IsReachable ()
+ {
+ bool reachable;
+
+ switch (Type) {
+ case BranchingType.SwitchSection:
+ // The code following a switch block is reachable unless the switch
+ // block always returns.
+ reachable = !CurrentUsageVector.AlwaysReturns;
+ break;
+
+ case BranchingType.LoopBlock:
+ // The code following a loop is reachable unless the loop always
+ // returns or it's an infinite loop without any `break's in it.
+ reachable = !CurrentUsageVector.AlwaysReturns &&
+ (CurrentUsageVector.Breaks != FlowReturns.Unreachable);
+ break;
+
+ default:
+ // The code following a block or exception is reachable unless the
+ // block either always returns or always breaks.
+ if (MayLeaveLoop)
+ reachable = true;
+ else
+ reachable = !CurrentUsageVector.AlwaysBreaks &&
+ !CurrentUsageVector.AlwaysReturns;
+ break;
+ }
+
+ Report.Debug (1, "REACHABLE", this, Type, CurrentUsageVector.Returns,
+ CurrentUsageVector.Breaks, CurrentUsageVector, MayLeaveLoop,
+ reachable);
+
+ return reachable;
+ }
+
public override string ToString ()
{
- StringBuilder sb = new StringBuilder ();
- sb.Append (GetType ());
- sb.Append (" (");
+ StringBuilder sb = new StringBuilder ("FlowBranching (");
sb.Append (id);
sb.Append (",");
@@ -902,175 +949,14 @@ namespace Mono.CSharp
sb.Append (Block.StartLocation);
}
sb.Append (" - ");
- // sb.Append (Siblings.Length);
- // sb.Append (" - ");
+ sb.Append (Siblings.Length);
+ sb.Append (" - ");
sb.Append (CurrentUsageVector);
sb.Append (")");
return sb.ToString ();
}
}
- public class FlowBranchingBlock : FlowBranching
- {
- UsageVector current_vector;
- ArrayList siblings = new ArrayList ();
-
- public FlowBranchingBlock (FlowBranching parent, BranchingType type, SiblingType stype,
- Block block, Location loc)
- : base (parent, type, stype, block, loc)
- { }
-
- public override UsageVector CurrentUsageVector {
- get { return current_vector; }
- }
-
- protected override void AddSibling (UsageVector sibling)
- {
- siblings.Add (sibling);
- current_vector = sibling;
- }
-
- public override void Break ()
- {
- if (Type == BranchingType.SwitchSection)
- CurrentUsageVector.NeverReachable ();
- else {
- if (Type == BranchingType.LoopBlock)
- MayLeaveLoop = true;
- CurrentUsageVector.Break ();
- }
- }
-
- public override void Return ()
- {
- CurrentUsageVector.Return ();
- }
-
- public override void Goto ()
- {
- CurrentUsageVector.Unreachable ();
- }
-
- public override void Throw ()
- {
- CurrentUsageVector.Throw ();
- }
-
- public override void Label (ArrayList origin_vectors)
- {
- CurrentUsageVector.MergeJumpOrigins (origin_vectors);
- }
-
- protected override MergeResult Merge ()
- {
- MergeResult result = Merge (siblings);
- if (Type == BranchingType.LoopBlock)
- result.MayLeaveLoop = false;
- return result;
- }
- }
-
- public class FlowBranchingException : FlowBranching
- {
- ArrayList finally_vectors;
-
- bool has_params;
- UsageVector current_vector;
- UsageVector try_vector;
- ArrayList catch_vectors = new ArrayList ();
- UsageVector finally_vector;
-
- public FlowBranchingException (FlowBranching parent, BranchingType type, Block block, Location loc)
- : base (parent, type, SiblingType.Try, block, loc)
- {
- finally_vectors = new ArrayList ();
- has_params = current_vector.HasParameters;
- }
-
- protected override void AddSibling (UsageVector sibling)
- {
- if (sibling.Type == SiblingType.Try) {
- try_vector = sibling;
- catch_vectors.Add (sibling);
- } else if (sibling.Type == SiblingType.Catch)
- catch_vectors.Add (sibling);
- else if (sibling.Type == SiblingType.Finally) {
- // sibling.MergeFinallyOrigins (finally_vectors);
- finally_vector = sibling;
- } else
- throw new InvalidOperationException ();
-
- current_vector = sibling;
- }
-
- public override UsageVector CurrentUsageVector {
- get { return current_vector; }
- }
-
- public override bool InTryBlock ()
- {
- return true;
- }
-
- public override void AddFinallyVector (UsageVector vector)
- {
- finally_vectors.Add (vector.Clone ());
- }
-
- public override void Break ()
- {
- CurrentUsageVector.Break ();
- }
-
- public override void Return ()
- {
- CurrentUsageVector.Return ();
- }
-
- public override void Goto ()
- {
- CurrentUsageVector.Unreachable ();
- }
-
- public override void Throw ()
- {
- CurrentUsageVector.Throw ();
- }
-
- public override void Label (ArrayList origin_vectors)
- {
- CurrentUsageVector.MergeJumpOrigins (origin_vectors);
- }
-
- protected void MergeFinally (MyBitVector f_params, ref MergeResult result)
- {
- foreach (UsageVector vector in finally_vectors) {
- MyBitVector temp_params = f_params.Clone ();
- temp_params.Or (vector.Parameters);
-
- CheckOutParameters (temp_params, Location);
- }
- }
-
- protected override MergeResult Merge ()
- {
- MergeResult result = Merge (catch_vectors);
-
- if (has_params) {
- if (finally_vector != null) {
- MergeFinally (finally_vector.Parameters, ref result);
- MyBitVector.Or (ref result.Parameters, finally_vector.ParameterVector);
- } else
- MergeFinally (result.Parameters, ref result);
- }
-
- if (finally_vector != null)
- MyBitVector.Or (ref result.Locals, finally_vector.LocalVector);
-
- return result;
- }
- }
-
// <summary>
// This is used by the flow analysis code to keep track of the type of local variables
// and variables.
@@ -1681,6 +1567,7 @@ namespace Mono.CSharp
}
}
+
// <summary>
// This is a special bit vector which can inherit from another bit vector doing a
// copy-on-write strategy. The inherited vector may have a smaller size than the
@@ -1813,22 +1700,6 @@ namespace Mono.CSharp
vector [i] = false;
}
- public static void And (ref MyBitVector target, MyBitVector vector)
- {
- if (target != null)
- target.And (vector);
- else
- target = vector.Clone ();
- }
-
- public static void Or (ref MyBitVector target, MyBitVector vector)
- {
- if (target != null)
- target.Or (vector);
- else
- target = vector.Clone ();
- }
-
// <summary>
// This does a deep copy of the bit vector.
// </summary>
diff --git a/mcs/mcs/interface.cs b/mcs/mcs/interface.cs
index 898513cf171..653ab1d9ebf 100755
--- a/mcs/mcs/interface.cs
+++ b/mcs/mcs/interface.cs
@@ -71,9 +71,8 @@ namespace Mono.CSharp {
Modifiers.UNSAFE |
Modifiers.PRIVATE;
- public Interface (NamespaceEntry ns, TypeContainer parent, string name, int mod,
- Attributes attrs, Location l)
- : base (ns, parent, name, l)
+ public Interface (TypeContainer parent, string name, int mod, Attributes attrs, Location l)
+ : base (parent, name, l)
{
ModFlags = Modifiers.Check (AllowedModifiers, mod, Modifiers.PRIVATE, l);
OptAttributes = attrs;
diff --git a/mcs/mcs/iterators.cs b/mcs/mcs/iterators.cs
index 21ac8756b1e..10be47f48a5 100644
--- a/mcs/mcs/iterators.cs
+++ b/mcs/mcs/iterators.cs
@@ -96,7 +96,8 @@ namespace Mono.CSharp {
if (!Yield.CheckContext (ec, loc))
return false;
- ec.CurrentBranching.Goto ();
+ ec.CurrentBranching.CurrentUsageVector.Breaks = FlowBranching.FlowReturns.Always;
+ ec.CurrentBranching.CurrentUsageVector.Returns = FlowBranching.FlowReturns.Always;
return true;
}
diff --git a/mcs/mcs/namespace.cs b/mcs/mcs/namespace.cs
index 584a20a0ff0..414249a3142 100755
--- a/mcs/mcs/namespace.cs
+++ b/mcs/mcs/namespace.cs
@@ -23,7 +23,6 @@ namespace Mono.CSharp {
string name, fullname;
ArrayList entries;
Hashtable namespaces;
- Hashtable defined_names;
/// <summary>
/// Constructor Takes the current namespace and the
@@ -44,7 +43,6 @@ namespace Mono.CSharp {
entries = new ArrayList ();
namespaces = new Hashtable ();
- defined_names = new Hashtable ();
all_namespaces.Add (this);
if (namespaces_map.Contains (fullname))
@@ -92,22 +90,11 @@ namespace Mono.CSharp {
public object Lookup (DeclSpace ds, string name)
{
- object o = Lookup (name);
-
- Type t;
- DeclSpace tdecl = o as DeclSpace;
- if (tdecl != null) {
- t = tdecl.DefineType ();
-
- if ((ds == null) || ds.CheckAccessLevel (t))
- return t;
- }
-
Namespace ns = GetNamespace (name, false);
if (ns != null)
return ns;
- t = TypeManager.LookupType (DeclSpace.MakeFQN (fullname, name));
+ Type t = TypeManager.LookupType (DeclSpace.MakeFQN (fullname, name));
if ((t == null) || ((ds != null) && !ds.CheckAccessLevel (t)))
return null;
@@ -119,16 +106,6 @@ namespace Mono.CSharp {
entries.Add (entry);
}
- public void DefineName (string name, object o)
- {
- defined_names.Add (name, o);
- }
-
- public object Lookup (string name)
- {
- return defined_names [name];
- }
-
static public ArrayList UserDefinedNamespaces {
get {
return all_namespaces;
@@ -264,11 +241,11 @@ namespace Mono.CSharp {
}
}
- public NamespaceEntry (NamespaceEntry parent, SourceFile file, string name, Location loc)
- : this (parent, file, name, false, loc)
+ public NamespaceEntry (NamespaceEntry parent, SourceFile file, string name)
+ : this (parent, file, name, false)
{ }
- protected NamespaceEntry (NamespaceEntry parent, SourceFile file, string name, bool is_implicit, Location loc)
+ protected NamespaceEntry (NamespaceEntry parent, SourceFile file, string name, bool is_implicit)
{
this.parent = parent;
this.file = file;
@@ -284,18 +261,21 @@ namespace Mono.CSharp {
ns.AddNamespaceEntry (this);
if ((parent != null) && (parent.NS != ns.Parent))
- implicit_parent = new NamespaceEntry (parent, file, ns.Parent.Name, true, loc);
+ implicit_parent = new NamespaceEntry (parent, file, ns.Parent.Name, true);
else
implicit_parent = parent;
-
- this.FullName = ns.Name;
}
static int next_id = 0;
- public readonly string FullName;
public readonly int ID;
public readonly bool IsImplicit;
+ public string Name {
+ get {
+ return ns.Name;
+ }
+ }
+
public Namespace NS {
get {
return ns;
@@ -314,11 +294,6 @@ namespace Mono.CSharp {
}
}
- public void DefineName (string name, object o)
- {
- ns.DefineName (name, o);
- }
-
/// <summary>
/// Records a new namespace for resolving name references
/// </summary>
@@ -329,7 +304,7 @@ namespace Mono.CSharp {
return;
}
- if (ns == FullName)
+ if (ns == Name)
return;
if (using_clauses == null)
@@ -586,7 +561,7 @@ namespace Mono.CSharp {
if (NS == Namespace.Root)
return "NamespaceEntry (<root>)";
else
- return String.Format ("NamespaceEntry ({0},{1},{2})", FullName, IsImplicit, ID);
+ return String.Format ("NamespaceEntry ({0},{1},{2})", Name, IsImplicit, ID);
}
}
}
diff --git a/mcs/mcs/rootcontext.cs b/mcs/mcs/rootcontext.cs
index 67ef6b9baf2..f4a3824bb28 100755
--- a/mcs/mcs/rootcontext.cs
+++ b/mcs/mcs/rootcontext.cs
@@ -705,7 +705,7 @@ namespace Mono.CSharp {
//
if (global_attributes.Count > 0){
AssemblyBuilder ab = CodeGen.AssemblyBuilder;
- TypeContainer dummy = new TypeContainer (null, null, "", new Location (-1));
+ TypeContainer dummy = new TypeContainer (null, "", new Location (-1));
EmitContext temp_ec = new EmitContext (
dummy, Mono.CSharp.Location.Null, null, null, 0, false);
diff --git a/mcs/mcs/statement.cs b/mcs/mcs/statement.cs
index 3430fedc18e..076e9ca19d0 100755
--- a/mcs/mcs/statement.cs
+++ b/mcs/mcs/statement.cs
@@ -605,7 +605,8 @@ namespace Mono.CSharp {
else
vector.CheckOutParameters (ec.CurrentBranching);
- ec.CurrentBranching.Return ();
+ vector.Returns = FlowBranching.FlowReturns.Always;
+ vector.Breaks = FlowBranching.FlowReturns.Always;
return true;
}
@@ -676,7 +677,8 @@ namespace Mono.CSharp {
if (!label.IsDefined)
label.AddUsageVector (ec.CurrentBranching.CurrentUsageVector);
- ec.CurrentBranching.Goto ();
+ ec.CurrentBranching.CurrentUsageVector.Breaks = FlowBranching.FlowReturns.Always;
+ ec.CurrentBranching.CurrentUsageVector.Returns = FlowBranching.FlowReturns.Always;
return true;
}
@@ -750,7 +752,12 @@ namespace Mono.CSharp {
public override bool Resolve (EmitContext ec)
{
- ec.CurrentBranching.Label (vectors);
+ if (vectors != null)
+ ec.CurrentBranching.CurrentUsageVector.MergeJumpOrigins (vectors);
+ else {
+ ec.CurrentBranching.CurrentUsageVector.Breaks = FlowBranching.FlowReturns.Never;
+ ec.CurrentBranching.CurrentUsageVector.Returns = FlowBranching.FlowReturns.Never;
+ }
referenced = true;
@@ -779,7 +786,8 @@ namespace Mono.CSharp {
public override bool Resolve (EmitContext ec)
{
- ec.CurrentBranching.Goto ();
+ ec.CurrentBranching.CurrentUsageVector.Breaks = FlowBranching.FlowReturns.Always;
+ ec.CurrentBranching.CurrentUsageVector.Returns = FlowBranching.FlowReturns.Always;
return true;
}
@@ -845,7 +853,8 @@ namespace Mono.CSharp {
label = sl.ILLabelCode;
- ec.CurrentBranching.Goto ();
+ ec.CurrentBranching.CurrentUsageVector.Breaks = FlowBranching.FlowReturns.Unreachable;
+ ec.CurrentBranching.CurrentUsageVector.Returns = FlowBranching.FlowReturns.Always;
return true;
}
@@ -892,7 +901,8 @@ namespace Mono.CSharp {
}
}
- ec.CurrentBranching.Throw ();
+ ec.CurrentBranching.CurrentUsageVector.Returns = FlowBranching.FlowReturns.Exception;
+ ec.CurrentBranching.CurrentUsageVector.Breaks = FlowBranching.FlowReturns.Exception;
return true;
}
@@ -928,7 +938,7 @@ namespace Mono.CSharp {
public override bool Resolve (EmitContext ec)
{
ec.CurrentBranching.MayLeaveLoop = true;
- ec.CurrentBranching.Break ();
+ ec.CurrentBranching.CurrentUsageVector.Breaks = FlowBranching.FlowReturns.Always;
return true;
}
@@ -959,7 +969,7 @@ namespace Mono.CSharp {
public override bool Resolve (EmitContext ec)
{
- ec.CurrentBranching.Goto ();
+ ec.CurrentBranching.CurrentUsageVector.Breaks = FlowBranching.FlowReturns.Always;
return true;
}
@@ -1743,7 +1753,7 @@ namespace Mono.CSharp {
if (s is LabeledStatement)
unreachable = false;
else
- unreachable = ec.CurrentBranching.CurrentUsageVector.IsUnreachable;
+ unreachable = ! ec.CurrentBranching.IsReachable ();
new_statements.Add (s);
}
@@ -1768,8 +1778,6 @@ namespace Mono.CSharp {
"This label has not been referenced");
}
- Report.Debug (1, "RESOLVE BLOCK DONE #2", StartLocation, returns);
-
if ((returns == FlowBranching.FlowReturns.Always) ||
(returns == FlowBranching.FlowReturns.Exception) ||
(returns == FlowBranching.FlowReturns.Unreachable))
@@ -2850,7 +2858,6 @@ namespace Mono.CSharp {
Expression e = (Expression) p.Second;
vi.VariableInfo = null;
- vi.ReadOnly = true;
//
// The rules for the possible declarators are pretty wise,
@@ -3148,6 +3155,13 @@ namespace Mono.CSharp {
ok = false;
ec.InCatch = old_in_catch;
+
+ FlowBranching.UsageVector current = ec.CurrentBranching.CurrentUsageVector;
+
+ if (!current.AlwaysReturns && !current.AlwaysBreaks)
+ vector.AndLocals (current);
+ else
+ vector.Or (current);
}
Report.Debug (1, "END OF CATCH BLOCKS", ec.CurrentBranching);
@@ -3163,6 +3177,13 @@ namespace Mono.CSharp {
ok = false;
ec.InCatch = old_in_catch;
+
+ FlowBranching.UsageVector current = ec.CurrentBranching.CurrentUsageVector;
+
+ if (!current.AlwaysReturns && !current.AlwaysBreaks)
+ vector.AndLocals (current);
+ else
+ vector.Or (current);
}
Report.Debug (1, "END OF GENERAL CATCH BLOCKS", ec.CurrentBranching);
@@ -3185,7 +3206,15 @@ namespace Mono.CSharp {
FlowBranching.UsageVector f_vector = ec.CurrentBranching.CurrentUsageVector;
- Report.Debug (1, "END OF TRY", ec.CurrentBranching, returns, vector, f_vector);
+ Report.Debug (1, "END OF FINALLY", ec.CurrentBranching, returns, vector, f_vector);
+
+ if ((returns == FlowBranching.FlowReturns.Sometimes) || (returns == FlowBranching.FlowReturns.Always)) {
+ ec.CurrentBranching.CheckOutParameters (f_vector.Parameters, loc);
+ }
+
+ ec.CurrentBranching.CurrentUsageVector.Or (vector);
+
+ Report.Debug (1, "END OF TRY", ec.CurrentBranching);
if (returns != FlowBranching.FlowReturns.Always) {
// Unfortunately, System.Reflection.Emit automatically emits a leave
@@ -3441,28 +3470,9 @@ namespace Mono.CSharp {
if (!ResolveExpression (ec))
return false;
- }
-
- ec.StartFlowBranching (FlowBranching.BranchingType.Block, loc);
-
- bool ok = Statement.Resolve (ec);
+ }
- if (!ok) {
- ec.KillFlowBranching ();
- return false;
- }
-
- FlowBranching.FlowReturns returns = ec.EndFlowBranching ();
-
- if (returns != FlowBranching.FlowReturns.Always) {
- // Unfortunately, System.Reflection.Emit automatically emits a leave
- // to the end of the finally block. This is a problem if `returns'
- // is true since we may jump to a point after the end of the method.
- // As a workaround, emit an explicit ret here.
- ec.NeedExplicitReturn = true;
- }
-
- return true;
+ return Statement.Resolve (ec);
}
protected override bool DoEmit (EmitContext ec)
diff --git a/mcs/mcs/tree.cs b/mcs/mcs/tree.cs
index 21c2134a130..4d571375ef3 100755
--- a/mcs/mcs/tree.cs
+++ b/mcs/mcs/tree.cs
@@ -45,7 +45,7 @@ namespace Mono.CSharp
public Tree ()
{
- root_types = new TypeContainer (null, null, "", new Location (-1));
+ root_types = new TypeContainer (null, "", new Location (-1));
decls = new Hashtable ();
namespaces = new Hashtable ();
@@ -83,21 +83,21 @@ namespace Mono.CSharp
return (DeclSpace) res;
}
- public NamespaceEntry RecordNamespace (NamespaceEntry parent, SourceFile file, string name, Location loc)
+ public NamespaceEntry RecordNamespace (NamespaceEntry parent, SourceFile file, string name)
{
- NamespaceEntry ns = new NamespaceEntry (parent, file, name, loc);
+ NamespaceEntry ns = new NamespaceEntry (parent, file, name);
if (namespaces.Contains (file)){
Hashtable ns_ns = (Hashtable) namespaces [file];
- if (ns_ns.Contains (ns.FullName))
- return (NamespaceEntry) ns_ns [ns.FullName];
- ns_ns.Add (ns.FullName, ns);
+ if (ns_ns.Contains (ns.Name))
+ return (NamespaceEntry) ns_ns [ns.Name];
+ ns_ns.Add (ns.Name, ns);
} else {
Hashtable new_table = new Hashtable ();
namespaces [file] = new_table;
- new_table.Add (ns.FullName, ns);
+ new_table.Add (ns.Name, ns);
}
return ns;
diff --git a/mcs/mcs/typemanager.cs b/mcs/mcs/typemanager.cs
index e546267782a..e3f3c056e28 100755
--- a/mcs/mcs/typemanager.cs
+++ b/mcs/mcs/typemanager.cs
@@ -2113,8 +2113,8 @@ public class TypeManager {
[Flags]
public enum MethodFlags {
IsObsolete = 1,
- IsObsoleteError = 1 << 1,
- ShouldIgnore = 1 << 2
+ IsObsoleteError = 2,
+ ShouldIgnore = 3
}
//
diff --git a/mcs/tests/ChangeLog b/mcs/tests/ChangeLog
index d98cda6c891..10b07dd0635 100755
--- a/mcs/tests/ChangeLog
+++ b/mcs/tests/ChangeLog
@@ -1,27 +1,3 @@
-2003-08-26 Martin Baulig <martin@ximian.com>
-
- * test-215.cs: New test for bug #47927.
-
-2003-08-26 Martin Baulig <martin@ximian.com>
-
- * verify-7.cs: New test for bug #47681.
-
-2003-08-26 Martin Baulig <martin@ximian.com>
-
- * test-214.cs: New test for bug #47853.
-
-2003-08-25 Martin Baulig <martin@ximian.com>
-
- * test-213.cs: New test for bug #47822.
-
-2003-08-22 Martin Baulig <martin@ximian.com>
-
- * test-154.cs: Added testcase for bug #46949.
-
-2003-08-22 Martin Baulig <martin@ximian.com>
-
- * test-154.cs: Added testcase for bug #47095.
-
2003-08-04 Martin Baulig <martin@ximian.com>
* Makefile: Put back test-211.cs.
diff --git a/mcs/tests/Makefile b/mcs/tests/Makefile
index c4079ad3401..b88a4685330 100644
--- a/mcs/tests/Makefile
+++ b/mcs/tests/Makefile
@@ -34,7 +34,7 @@ TEST_SOURCES = \
test-181 test-182 test-183 test-184 test-185 test-186 test-187 test-188 test-189 test-190 \
test-191 test-192 test-193 test-194 test-195 test-196 test-197 test-198 test-199 test-200 \
test-201 test-202 test-203 test-204 test-205 test-206 test-207 test-208 test-209 test-210 \
- test-211 test-212 test-213 test-214 test-215
+ test-211 test-212
#
# C# 2.0 tests
diff --git a/mcs/tests/README.tests b/mcs/tests/README.tests
index 1a6308749d5..9979c023181 100644
--- a/mcs/tests/README.tests
+++ b/mcs/tests/README.tests
@@ -63,7 +63,7 @@ Test cases listed by Category:
* Type resolution and name lookup
- test-198.cs test-201.cs test-202.cs test-203.cs test-214.cs
+ test-198.cs test-201.cs test-202.cs test-203.cs
Test cases listed by Number:
============================
@@ -364,21 +364,6 @@ test-212.cs
Params overload resolution with implicit user conversion
-test-213.cs
------------
-
-Unboxing struct from interface type; bug #47822.
-
-test-214.cs
------------
-
-Namespace lookups; bug #47853.
-
-test-215.cs
------------
-
-Namespace lookups; bug #47927.
-
verify-1.cs
-----------
Test whether we do not jump out of the method in a Try/Finally block.
diff --git a/mcs/tests/test-154.cs b/mcs/tests/test-154.cs
index db7705f8301..47e31d7b71f 100644
--- a/mcs/tests/test-154.cs
+++ b/mcs/tests/test-154.cs
@@ -431,35 +431,4 @@ public class X
}
value = null;
}
-
- //
- // Bug #47095
- //
- static bool test29 (out int a)
- {
- try {
- a = 0;
- return true;
- } catch (System.Exception) {
- a = -1;
- return false;
- }
- }
-
- //
- // Bug #46949
- //
- public string test30 (out string outparam)
- {
- try {
- if (true) {
- outparam = "";
- return "";
- }
- } catch {
- }
-
- outparam = null;
- return null;
- }
}
diff --git a/mcs/tests/test-213.cs b/mcs/tests/test-213.cs
deleted file mode 100644
index 3492c14059e..00000000000
--- a/mcs/tests/test-213.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-using System;
-
-class MyTest {
- public static void Main(String[] args) {
- S s1 = new S(11);
- I s2 = s1; // Implicit boxing S-->I
- S s3 = (S)s2; // Explicit unboxing I-->S
- s3.Print(); // Should print 11, does not
- }
-}
-
-interface I {
- void Print();
-}
-
-struct S : I {
- public int i;
- public S(int i) {
- this.i = i;
- }
- public void Print() {
- Console.WriteLine(i);
- }
-}
diff --git a/mcs/tests/test-214.cs b/mcs/tests/test-214.cs
deleted file mode 100644
index 859aac63ae7..00000000000
--- a/mcs/tests/test-214.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-using T1 = N1.C1;
-
-namespace N2
-{
- class Test : T1
- {
- static int Main()
- {
- // Compilation-only test.
- Foo ();
- return 0;
- }
- }
-}
-
-namespace N1
-{
- public class C1
- {
- public static void Foo ()
- { }
- }
-}
diff --git a/mcs/tests/test-215.cs b/mcs/tests/test-215.cs
deleted file mode 100644
index 073d2f4eb11..00000000000
--- a/mcs/tests/test-215.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-using C1 = N1.C1;
-
-public class Test {
- private static C1 c1 = null;
-
- public static C1 C1 {
- get {
- return c1;
- }
- }
-
- public static int Main() {
- C1 tmp = C1;
- return 0;
- }
-}
-
-namespace N1 {
- public class C1 {
- }
-}
diff --git a/mcs/tests/test-37.cs b/mcs/tests/test-37.cs
index 88f2843947c..91f54f4d9a0 100755
--- a/mcs/tests/test-37.cs
+++ b/mcs/tests/test-37.cs
@@ -108,8 +108,7 @@ class X {
Console.WriteLine ("hello");
return 0;
-
-#if FIXME
+
v = test_int_single_dim ();
if (v != 0)
@@ -133,6 +132,5 @@ class X {
// Console.WriteLine ("Should be: " + (i + 1) + " it is = " + a [i]);
}
return 0;
-#endif
}
}
diff --git a/mcs/tests/verify-7.cs b/mcs/tests/verify-7.cs
deleted file mode 100644
index 6ffad0f6040..00000000000
--- a/mcs/tests/verify-7.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-using System;
-
-public class TestClass : IDisposable
-{
- public static void Main()
- {
- TestClass test = new TestClass();
- test.MyMethod();
- }
-
- public void Dispose()
- {
-
- }
-
- public void MyMethod()
- {
- byte[] buffer = new byte[1500];
-
- using(TestClass test = new TestClass())
- {
- while(true)
- {
- }
- }
- }
-}
diff --git a/mono.pc.in b/mono.pc.in
index b837aa6d784..8191c7b11ab 100644
--- a/mono.pc.in
+++ b/mono.pc.in
@@ -7,6 +7,6 @@ includedir=@includedir@
Name: Mono
Description: Mono Runtime
Version: @VERSION@
-Requires: glib-2.0 gmodule-2.0 gthread-2.0
+Requires: glib-2.0 gmodule-2.0
Libs: -L${libdir} -lmono @libmono_ldflags@ -lm
Cflags: -I${includedir} @libmono_cflags@
diff --git a/mono/arch/ChangeLog b/mono/arch/ChangeLog
index f5535768757..312838730e8 100644
--- a/mono/arch/ChangeLog
+++ b/mono/arch/ChangeLog
@@ -1,6 +1,3 @@
-2003-08-21 Zoltan Varga <vargaz@freemail.hu>
-
- * x86/tramp.c: Fixes from Bernie Solomon (bernard@ugsolutions.com).
Tue Jul 1 13:03:43 CEST 2003 Paolo Molaro <lupus@ximian.com>
diff --git a/mono/arch/sparc/.cvsignore b/mono/arch/sparc/.cvsignore
index 051d1bd50ba..282522db034 100644
--- a/mono/arch/sparc/.cvsignore
+++ b/mono/arch/sparc/.cvsignore
@@ -1,3 +1,2 @@
Makefile
Makefile.in
-.deps
diff --git a/mono/arch/sparc/sparc-codegen.h b/mono/arch/sparc/sparc-codegen.h
index b2a583684f5..04a23c35822 100644
--- a/mono/arch/sparc/sparc-codegen.h
+++ b/mono/arch/sparc/sparc-codegen.h
@@ -153,45 +153,28 @@ typedef enum {
typedef enum {
/* fop1 format */
- sparc_fitos_val = 196,
- sparc_fitod_val = 200,
- sparc_fitoq_val = 204,
- sparc_fstoi_val = 209,
- sparc_fdtoi_val = 210,
- sparc_fqtoi_val = 211,
- sparc_fstod_val = 201,
- sparc_fstoq_val = 205,
- sparc_fdtos_val = 198,
- sparc_fdtoq_val = 206,
- sparc_fqtos_val = 199,
- sparc_fqtod_val = 203,
- sparc_fmovs_val = 1,
- sparc_fnegs_val = 5,
- sparc_fabss_val = 9,
- sparc_fsqrts_val = 41,
- sparc_fsqrtd_val = 42,
- sparc_fsqrtq_val = 43,
- sparc_fadds_val = 65,
- sparc_faddd_val = 66,
- sparc_faddq_val = 67,
- sparc_fsubs_val = 69,
- sparc_fsubd_val = 70,
- sparc_fsubq_val = 71,
- sparc_fmuls_val = 73,
- sparc_fmuld_val = 74,
- sparc_fmulq_val = 75,
- sparc_fsmuld_val = 105,
- sparc_fdmulq_val = 111,
- sparc_fdivs_val = 77,
- sparc_fdivd_val = 78,
- sparc_fdivq_val = 79,
+ sparc_fitos = 196,
+ sparc_fitod = 200,
+ sparc_fstoi = 209,
+ sparc_fdtoi = 210,
+ sparc_fstod = 201,
+ sparc_fdtos = 198,
+ sparc_fmov = 1,
+ sparc_fneg = 5,
+ sparc_fabs = 9,
+ sparc_fsqrts = 41,
+ sparc_fsqrtd = 42,
+ sparc_fadds = 65,
+ sparc_faddd = 66,
+ sparc_fsubs = 69,
+ sparc_fsubd = 70,
+ sparc_fmuls = 73,
+ sparc_fmuld = 74,
+ sparc_fdivs = 77,
+ sparc_fdivd = 78,
/* fop2 format */
- sparc_fcmps_val = 81,
- sparc_fcmpd_val = 82,
- sparc_fcmpq_val = 83,
- sparc_fcmpes_val = 85,
- sparc_fcmped_val = 86,
- sparc_fcmpeq_val = 87
+ sparc_fcmps = 81,
+ sparc_fcmpd = 82
} SparcFOp;
typedef struct {
@@ -402,60 +385,6 @@ typedef struct {
#define sparc_fop(ins,r1,op,r2,dest) sparc_encode_format3c((ins),2,(op),(r1),52,(r2),(dest))
#define sparc_fcmp(ins,r1,op,r2) sparc_encode_format3c((ins),2,(op),(r1),53,(r2),0)
-/* format 1 fops */
-#define sparc_fadds(ins, r1, r2, dest) sparc_fop( ins, r1, sparc_fadds_val, r2, dest )
-#define sparc_faddd(ins, r1, r2, dest) sparc_fop( ins, r1, sparc_faddd_val, r2, dest )
-#define sparc_faddq(ins, r1, r2, dest) sparc_fop( ins, r1, sparc_faddq_val, r2, dest )
-
-#define sparc_fsubs(ins, r1, r2, dest) sparc_fop( ins, r1, sparc_fsubs_val, r2, dest )
-#define sparc_fsubd(ins, r1, r2, dest) sparc_fop( ins, r1, sparc_fsubd_val, r2, dest )
-b#define sparc_fsubq(ins, r1, r2, dest) sparc_fop( ins, r1, sparc_fsubq_val, r2, dest )
-
-#define sparc_fmuls( ins, r1, r2, dest ) sparc_fop( ins, r1, sparc_fmuls_val, r2, dest )
-#define sparc_fmuld( ins, r1, r2, dest ) sparc_fop( ins, r1, sparc_fmuld_val, r2, dest )
-#define sparc_fmulq( ins, r1, r2, dest ) sparc_fop( ins, r1, sparc_fmulq_val, r2, dest )
-
-#define sparc_fsmuld( ins, r1, r2, dest ) sparc_fop( ins, r1, sparc_fsmuld_val, r2, dest )
-#define sparc_fdmulq( ins, r1, r2, dest ) sparc_fop( ins, r1, sparc_fdmulq_val, r2, dest )
-
-#define sparc_fdivs( ins, r1, r2, dest ) sparc_fop( ins, r1, sparc_fdivs_val, r2, dest )
-#define sparc_fdivd( ins, r1, r2, dest ) sparc_fop( ins, r1, sparc_fdivd_val, r2, dest )
-#define sparc_fdivq( ins, r1, r2, dest ) sparc_fop( ins, r1, sparc_fdivq_val, r2, dest )
-
-#define sparc_fitos( ins, r2, dest ) sparc_fop( ins, 0, sparc_fitos_val, r2, dest )
-#define sparc_fitod( ins, r2, dest ) sparc_fop( ins, 0, sparc_fitod_val, r2, dest )
-#define sparc_fitoq( ins, r2, dest ) sparc_fop( ins, 0, sparc_fitoq_val, r2, dest )
-
-#define sparc_fstoi( ins, r2, dest ) sparc_fop( ins, 0, sparc_fstoi_val, r2, dest )
-#define sparc_fdtoi( ins, r2, dest ) sparc_fop( ins, 0, sparc_fdtoi_val, r2, dest )
-#define sparc_fqtoi( ins, r2, dest ) sparc_fop( ins, 0, sparc_fqtoi_val, r2, dest )
-
-#define sparc_fstod( ins, r2, dest ) sparc_fop( ins, 0, sparc_fstod_val, r2, dest )
-#define sparc_fstoq( ins, r2, dest ) sparc_fop( ins, 0, sparc_fstoq_val, r2, dest )
-
-#define sparc_fdtos( ins, r2, dest ) sparc_fop( ins, 0, sparc_fdtos_val, r2, dest )
-#define sparc_fdtoq( ins, r2, dest ) sparc_fop( ins, 0, sparc_fdtoq_val, r2, dest )
-
-#define sparc_fqtos( ins, r2, dest ) sparc_fop( ins, 0, sparc_fqtos_val, r2, dest )
-#define sparc_fqtod( ins, r2, dest ) sparc_fop( ins, 0, sparc_fqtod_val, r2, dest )
-
-#define sparc_fmovs( ins, r2, dest ) sparc_fop( ins, 0, sparc_fmovs_val, r2, dest )
-#define sparc_fnegs( ins, r2, dest ) sparc_fop( ins, 0, sparc_fnegs_val, r2, dest )
-#define sparc_fabss( ins, r2, dest ) sparc_fop( ins, 0, sparc_fabss_val, r2, dest )
-
-#define sparc_fsqrts( ins, r2, dest ) sparc_fop( ins, 0, sparc_fsqrts_val, r2, dest )
-#define sparc_fsqrtd( ins, r2, dest ) sparc_fop( ins, 0, sparc_fsqrtd_val, r2, dest )
-#define sparc_fsqrtq( ins, r2, dest ) sparc_fop( ins, 0, sparc_fsqrtq_val, r2, dest )
-
-/* format 2 fops */
-
-#define sparc_fcmps( ins, r1, r2 ) sparc_fcmp( ins, r1, sparc_fcmps_val, r2 )
-#define sparc_fcmpd( ins, r1, r2 ) sparc_fcmp( ins, r1, sparc_fcmpd_val, r2 )
-#define sparc_fcmpq( ins, r1, r2 ) sparc_fcmp( ins, r1, sparc_fcmpq_val, r2 )
-#define sparc_fcmpes( ins, r1, r2 ) sparc_fcmpes( ins, r1, sparc_fcmpes_val, r2 )
-#define sparc_fcmped( ins, r1, r2 ) sparc_fcmped( ins, r1, sparc_fcmped_val, r2 )
-#define sparc_fcmpeq( ins, r1, r2 ) sparc_fcmpeq( ins, r1, sparc_fcmpeq_val, r2 )
-
/* logical */
#define sparc_and(ins,setcc,r1,r2,dest) sparc_encode_format3a((ins),2,0,(r1),(r2),(setcc)|1,(dest))
#define sparc_and_imm(ins,setcc,r1,imm,dest) sparc_encode_format3b((ins),2,(r1),(imm),(setcc)|1,(dest))
@@ -522,6 +451,7 @@ b#define sparc_fsubq(ins, r1, r2, dest) sparc_fop( ins, r1, sparc_fsubq_val, r2,
/* synthetic instructions */
#define sparc_cmp(ins,r1,r2) sparc_sub((ins),sparc_cc,(r1),(r2),sparc_g0)
#define sparc_cmp_imm(ins,r1,imm) sparc_sub_imm((ins),sparc_cc,(r1),(imm),sparc_g0)
+
#define sparc_jmp(ins,base,disp) sparc_jmpl((ins),(base),(disp),sparc_g0)
#define sparc_jmp_imm(ins,base,disp) sparc_jmpl_imm((ins),(base),(disp),sparc_g0)
#define sparc_call(ins,base,disp) sparc_jmpl((ins),(base),(disp),sparc_o7)
diff --git a/mono/arch/x86/tramp.c b/mono/arch/x86/tramp.c
index dab0d78ac89..b6dfeb203fe 100644
--- a/mono/arch/x86/tramp.c
+++ b/mono/arch/x86/tramp.c
@@ -78,6 +78,7 @@ enum_calc_size:
case MONO_TYPE_I:
case MONO_TYPE_U:
case MONO_TYPE_PTR:
+ case MONO_TYPE_R4:
case MONO_TYPE_SZARRAY:
case MONO_TYPE_CLASS:
case MONO_TYPE_OBJECT:
@@ -91,7 +92,7 @@ enum_calc_size:
simpletype = sig->params [i]->data.klass->enum_basetype->type;
goto enum_calc_size;
}
- if ((size = mono_class_native_size (sig->params [i]->data.klass, NULL)) != 4) {
+ if ((size = mono_class_value_size (sig->params [i]->data.klass, NULL)) != 4) {
stack_size += size + 3;
stack_size &= ~3;
code_size += 32;
@@ -105,10 +106,6 @@ enum_calc_size:
stack_size += 8;
code_size += i < 10 ? 5 : 8;
break;
- case MONO_TYPE_R4:
- stack_size += 4;
- code_size += i < 10 ? 10 : 13;
- break;
case MONO_TYPE_R8:
stack_size += 8;
code_size += i < 10 ? 7 : 10;
@@ -183,7 +180,7 @@ enum_marshal:
break;
case MONO_TYPE_VALUETYPE:
if (!sig->params [i - 1]->data.klass->enumtype) {
- int size = mono_class_native_size (sig->params [i - 1]->data.klass, NULL);
+ int size = mono_class_value_size (sig->params [i - 1]->data.klass, NULL);
if (size == 4) {
/* it's a structure that fits in 4 bytes, need to push the value pointed to */
x86_mov_reg_membase (p, X86_EAX, X86_EDX, arg_pos, 4);
diff --git a/mono/dis/ChangeLog b/mono/dis/ChangeLog
index 9895dbd8dbd..d2d0d7d12b0 100644
--- a/mono/dis/ChangeLog
+++ b/mono/dis/ChangeLog
@@ -1,14 +1,3 @@
-2003-08-22 Zoltan Varga <vargaz@freemail.hu>
-
- * main.c (dis_event_list): Same for event methods.
-
- * get.c (dis_stringify_method_signature): New argument specifying
- whenever to return a fully qualified method name.
- * dump.c main.c: Updated to work with the new function.
-
- * main.c (dis_property_methods): Print fully qualified method names
- for property methods. Fixes #46221.
-
2003-07-22 Jackson Harper <jackson@latitudegeo.com>
* main.c: Dissasemble generic type parameters for type
diff --git a/mono/dis/dump.c b/mono/dis/dump.c
index cbb0176bc00..75cb86abbef 100644
--- a/mono/dis/dump.c
+++ b/mono/dis/dump.c
@@ -548,7 +548,7 @@ dump_table_method (MonoImage *m)
sigblob = mono_metadata_blob_heap (m, cols [MONO_METHOD_SIGNATURE]);
mono_metadata_decode_blob_size (sigblob, &sigblob);
method = mono_metadata_parse_method_signature (m, i, sigblob, &sigblob);
- sig = dis_stringify_method_signature (m, method, i, FALSE);
+ sig = dis_stringify_method_signature (m, method, i);
fprintf (output, "%d: %s (param: %d)\n", i, sig, cols [MONO_METHOD_PARAMLIST]);
g_free (sig);
mono_metadata_free_method_signature (method);
diff --git a/mono/dis/get.c b/mono/dis/get.c
index 59bc08f6ee9..c4a45ecd602 100644
--- a/mono/dis/get.c
+++ b/mono/dis/get.c
@@ -450,7 +450,7 @@ dis_stringify_param (MonoImage *m, MonoType *param)
}
char*
-dis_stringify_method_signature (MonoImage *m, MonoMethodSignature *method, int methoddef_row, gboolean fully_qualified)
+dis_stringify_method_signature (MonoImage *m, MonoMethodSignature *method, int methoddef_row)
{
guint32 cols [MONO_METHOD_SIZE];
guint32 pcols [MONO_PARAM_SIZE];
@@ -458,7 +458,6 @@ dis_stringify_method_signature (MonoImage *m, MonoMethodSignature *method, int m
const char *name = "";
int free_method = 0;
char *retval;
- char *type = NULL;
GString *result = g_string_new ("");
int i;
@@ -466,8 +465,6 @@ dis_stringify_method_signature (MonoImage *m, MonoMethodSignature *method, int m
if (methoddef_row) {
mono_metadata_decode_row (&m->tables [MONO_TABLE_METHOD], methoddef_row -1, cols, MONO_METHOD_SIZE);
- if (fully_qualified)
- type = get_typedef (m, mono_metadata_typedef_from_method (m, methoddef_row));
name = mono_metadata_string_heap (m, cols [MONO_METHOD_NAME]);
param_index = cols [MONO_METHOD_PARAMLIST];
if (!method) {
@@ -482,10 +479,7 @@ dis_stringify_method_signature (MonoImage *m, MonoMethodSignature *method, int m
if (method->hasthis)
g_string_append (result, "instance ");
g_string_append (result, map (method->call_convention, call_conv_type_map));
- g_string_sprintfa (result, " %s ", retval);
- if (type)
- g_string_sprintfa (result, "%s::", type);
- g_string_sprintfa (result, "%s(", name);
+ g_string_sprintfa (result, " %s %s(", retval, name);
g_free (retval);
for (i = 0; i < method->param_count; ++i) {
if (param_index && param_index <= m->tables [MONO_TABLE_PARAM].rows) {
@@ -579,7 +573,7 @@ dis_stringify_type (MonoImage *m, MonoType *type)
break;
case MONO_TYPE_FNPTR:
- bare = dis_stringify_method_signature (m, type->data.method, 0, FALSE);
+ bare = dis_stringify_method_signature (m, type->data.method, 0);
break;
case MONO_TYPE_PTR: {
char *child_type;
diff --git a/mono/dis/get.h b/mono/dis/get.h
index 03eaba056f5..116549d1c5c 100644
--- a/mono/dis/get.h
+++ b/mono/dis/get.h
@@ -28,7 +28,7 @@ char *dis_stringify_token (MonoImage *m, guint32 token);
char *dis_stringify_array (MonoImage *m, MonoArrayType *array);
char *dis_stringify_modifiers (MonoImage *m, int n, MonoCustomMod *mod);
char *dis_stringify_param (MonoImage *m, MonoType *param);
-char *dis_stringify_method_signature (MonoImage *m, MonoMethodSignature *method, int methoddef_row, gboolean fully_qualified);
+char *dis_stringify_method_signature (MonoImage *m, MonoMethodSignature *method, int methoddef_row);
/*
* These functions are used during the decoding of streams in the
diff --git a/mono/dis/main.c b/mono/dis/main.c
index 87424d397e5..525665a8ad3 100644
--- a/mono/dis/main.c
+++ b/mono/dis/main.c
@@ -516,7 +516,7 @@ dis_method_list (const char *klass_name, MonoImage *m, guint32 start, guint32 en
sig = mono_metadata_blob_heap (m, cols [MONO_METHOD_SIGNATURE]);
mono_metadata_decode_blob_size (sig, &sig);
ms = mono_metadata_parse_method_signature (m, i + 1, sig, &sig);
- sig_str = dis_stringify_method_signature (m, ms, i + 1, FALSE);
+ sig_str = dis_stringify_method_signature (m, ms, i + 1);
fprintf (output, " // method line %d\n", i + 1);
fprintf (output, " .method %s", flags);
@@ -580,7 +580,7 @@ dis_property_methods (MonoImage *m, guint32 prop)
start = mono_metadata_methods_from_property (m, prop, &end);
while (start < end) {
mono_metadata_decode_row (msemt, start, cols, MONO_METHOD_SEMA_SIZE);
- sig = dis_stringify_method_signature (m, NULL, cols [MONO_METHOD_SEMA_METHOD], TRUE);
+ sig = dis_stringify_method_signature (m, NULL, cols [MONO_METHOD_SEMA_METHOD]);
fprintf (output, "\t\t%s %s\n", type [cols [MONO_METHOD_SEMA_SEMANTICS]], sig);
g_free (sig);
++start;
@@ -683,7 +683,7 @@ dis_event_methods (MonoImage *m, guint32 event)
start = mono_metadata_methods_from_event (m, event, &end);
while (start < end) {
mono_metadata_decode_row (msemt, start, cols, MONO_METHOD_SEMA_SIZE);
- sig = dis_stringify_method_signature (m, NULL, cols [MONO_METHOD_SEMA_METHOD], TRUE);
+ sig = dis_stringify_method_signature (m, NULL, cols [MONO_METHOD_SEMA_METHOD]);
switch (cols [MONO_METHOD_SEMA_SEMANTICS]) {
case METHOD_SEMANTIC_OTHER:
type = ".other"; break;
diff --git a/mono/interpreter/ChangeLog b/mono/interpreter/ChangeLog
index fa88c1f0e42..b0b656aa07e 100644
--- a/mono/interpreter/ChangeLog
+++ b/mono/interpreter/ChangeLog
@@ -1,31 +1,3 @@
-2003-08-27 Zoltan Varga <vargaz@freemail.hu>
-
- * interp.c: Get rid of metadata_section.
-
-2003-08-22 Zoltan Varga <vargaz@freemail.hu>
-
- * interp.c (main): Call g_thread_init () to make glib thread-safe.
- Fixes #47682. Thanks to Laurent Morichetti (l_m@pacbell.net) for
- reporting this.
-
-2003-08-18 Zoltan Varga <vargaz@freemail.hu>
-
- * interp.c: Get rid of duplicate definition of CHECK_MUL_OVERFLOW.
- * interp.h interp.c: Get rid of VAL_VALUETA, use VAL_MP instead. Fix
- the INITOBJ opcode which was the only user of VALUETA.
-
-2003-08-16 Zoltan Varga <vargaz@freemail.hu>
-
- * interp.c (ves_exec_method): Implemented mul.ovf correctly for int32
- and int64. Implement the conv.ovf opcodes for all argument types.
-
-2003-08-15 Zoltan Varga <vargaz@freemail.hu>
-
- * interp.c (ves_exec_method): Handle non-valuetypes in CEE_STOBJ.
- Fixes #46781.
- (ves_exec_method): Added support for the synchronized flag to the
- interpreter. Also fixed the CALLI opcode, and made exception handling
- work though the managed-unmanaged barrier.
Fri Jul 25 19:06:27 CEST 2003 Paolo Molaro <lupus@ximian.com>
diff --git a/mono/interpreter/interp.c b/mono/interpreter/interp.c
index bbbbb3347e6..1f2f81e57db 100644
--- a/mono/interpreter/interp.c
+++ b/mono/interpreter/interp.c
@@ -258,7 +258,7 @@ stackval_from_data (MonoType *type, stackval *result, char *data, gboolean pinvo
result->type = VAL_OBJ;
break;
default:
- result->type = VAL_MP;
+ result->type = VAL_VALUETA;
break;
}
result->data.p = *(gpointer*)data;
@@ -559,7 +559,7 @@ ves_array_element_address (MonoInvocation *frame)
esize = mono_array_element_size (ac);
ea = mono_array_addr_with_size (ao, esize, pos);
- frame->retval->type = VAL_MP;
+ frame->retval->type = VAL_TP;
frame->retval->data.p = ea;
}
@@ -892,6 +892,8 @@ calc_offsets (MonoImage *image, MonoMethod *method)
}
offsets [1] = offset;
+ /* FIXME: This might cause a deadlock with domain->lock */
+ EnterCriticalSection (metadata_section);
/* intern the strings in the method. */
ip = header->code;
end = ip + header->code_size;
@@ -989,6 +991,7 @@ calc_offsets (MonoImage *image, MonoMethod *method)
if (strcmp (method->name, "GetElementType") == 0)
method->addr = GUINT_TO_POINTER (INLINE_TYPE_ELEMENT_TYPE);
}
+ LeaveCriticalSection (metadata_section);
mono_profiler_method_end_jit (method, MONO_PROFILE_OK);
}
@@ -1102,25 +1105,19 @@ verify_method (MonoMethod *m)
/* Resolves to TRUE if the operands would overflow */
#define CHECK_MUL_OVERFLOW(a,b) \
((gint32)(a) == 0) || ((gint32)(b) == 0) ? 0 : \
- (((gint32)(a) > 0) && ((gint32)(b) == -1)) ? FALSE : \
- (((gint32)(a) < 0) && ((gint32)(b) == -1)) ? (a == - MYGINT32_MAX) : \
- (((gint32)(a) > 0) && ((gint32)(b) > 0)) ? (gint32)(a) > ((MYGINT32_MAX) / (gint32)(b)) : \
- (((gint32)(a) > 0) && ((gint32)(b) < 0)) ? (gint32)(a) > ((MYGINT32_MIN) / (gint32)(b)) : \
- (((gint32)(a) < 0) && ((gint32)(b) > 0)) ? (gint32)(a) < ((MYGINT32_MIN) / (gint32)(b)) : \
- (gint32)(a) < ((MYGINT32_MAX) / (gint32)(b))
+ (((gint32)(a) > 0) && ((gint32)(b) > 0)) || (((gint32)(a) < 0) && ((gint32)(b) < 0)) ? \
+ (gint32)(b) > ((MYGINT32_MAX) / (gint32)(a)) : \
+ (gint32)(b) < ((MYGINT32_MIN) / (gint32)(a))
#define CHECK_MUL_OVERFLOW_UN(a,b) \
((guint32)(a) == 0) || ((guint32)(b) == 0) ? 0 : \
(guint32)(b) > ((MYGUINT32_MAX) / (guint32)(a))
-
+
#define CHECK_MUL_OVERFLOW64(a,b) \
((gint64)(a) == 0) || ((gint64)(b) == 0) ? 0 : \
- (((gint64)(a) > 0) && ((gint64)(b) == -1)) ? FALSE : \
- (((gint64)(a) < 0) && ((gint64)(b) == -1)) ? (a == - MYGINT64_MAX) : \
- (((gint64)(a) > 0) && ((gint64)(b) > 0)) ? (gint64)(a) > ((MYGINT64_MAX) / (gint64)(b)) : \
- (((gint64)(a) > 0) && ((gint64)(b) < 0)) ? (gint64)(a) > ((MYGINT64_MIN) / (gint64)(b)) : \
- (((gint64)(a) < 0) && ((gint64)(b) > 0)) ? (gint64)(a) < ((MYGINT64_MIN) / (gint64)(b)) : \
- (gint64)(a) < ((MYGINT64_MAX) / (gint64)(b))
+ (((gint64)(a) > 0) && ((gint64)(b) > 0)) || (((gint64)(a) < 0) && ((gint64)(b) < 0)) ? \
+ (gint64)(b) > ((MYGINT64_MAX) / (gint64)(a)) : \
+ (gint64)(b) < ((MYGINT64_MIN) / (gint64)(a))
#define CHECK_MUL_OVERFLOW64_UN(a,b) \
((guint64)(a) == 0) || ((guint64)(b) == 0) ? 0 : \
@@ -1479,7 +1476,10 @@ ves_exec_method (MonoInvocation *frame)
sp->data.vt.klass = c;
sp->data.vt.vt = ARG_POS (*ip);
- sp->type = VAL_MP;
+ if (c->valuetype)
+ sp->type = VAL_VALUETA;
+ else
+ sp->type = VAL_TP;
++sp;
++ip;
@@ -1509,7 +1509,10 @@ ves_exec_method (MonoInvocation *frame)
sp->data.vt.klass = c;
sp->data.p = LOCAL_POS (*ip);
- sp->type = VAL_MP;
+ if (c->valuetype)
+ sp->type = VAL_VALUETA;
+ else
+ sp->type = VAL_TP;
++sp;
++ip;
@@ -1604,23 +1607,7 @@ ves_exec_method (MonoInvocation *frame)
--sp;
vt_free (sp);
BREAK;
- CASE (CEE_JMP) {
- guint32 token;
-
- frame->ip = ip;
-
- ++ip;
- token = read32 (ip);
- ip += 4;
-
- child_frame.method = mono_get_method (image, token, NULL);
- if (!child_frame.method)
- THROW_EX (mono_get_exception_missing_method (), ip -5);
-
- ves_abort ();
-
- BREAK;
- }
+ CASE (CEE_JMP) ves_abort(); BREAK;
CASE (CEE_CALLVIRT) /* Fall through */
CASE (CEE_CALLI) /* Fall through */
CASE (CEE_CALL) {
@@ -1649,13 +1636,10 @@ ves_exec_method (MonoInvocation *frame)
if (frame->method->wrapper_type != MONO_WRAPPER_NONE) {
csignature = (MonoMethodSignature *)mono_method_get_wrapper_data (frame->method, token);
child_frame.method = NULL;
+ } else if ((ji = mono_jit_info_table_find (mono_root_domain, code))) {
+ child_frame.method = ji->method;
} else {
- csignature = mono_metadata_parse_signature (image, token);
- if ((ji = mono_jit_info_table_find (mono_root_domain, code))) {
- child_frame.method = ji->method;
- } else {
- g_assert_not_reached ();
- }
+ g_assert_not_reached ();
}
g_assert (code);
} else {
@@ -1673,10 +1657,6 @@ ves_exec_method (MonoInvocation *frame)
}
}
- if (frame->method->wrapper_type == MONO_WRAPPER_NONE)
- if (child_frame.method && child_frame.method->iflags & METHOD_IMPL_ATTRIBUTE_SYNCHRONIZED)
- child_frame.method = mono_marshal_get_synchronized_wrapper (child_frame.method);
-
g_assert (csignature->call_convention == MONO_CALL_DEFAULT);
/* decrement by the actual number of args */
if (csignature->param_count) {
@@ -1690,7 +1670,7 @@ ves_exec_method (MonoInvocation *frame)
--sp;
/*
* It may also be a TP from LD(S)FLDA
- * g_assert (sp->type == VAL_OBJ || sp->type == VAL_MP);
+ * g_assert (sp->type == VAL_OBJ || sp->type == VAL_VALUETA);
*/
if (sp->type == VAL_OBJ && child_frame.method &&
child_frame.method->klass->valuetype) /* unbox it */
@@ -1713,10 +1693,6 @@ ves_exec_method (MonoInvocation *frame)
if (!child_frame.method) {
g_assert (code);
ves_pinvoke_method (&child_frame, csignature, (MonoFunc) code, FALSE);
- if (child_frame.ex) {
- frame->ex = child_frame.ex;
- goto handle_exception;
- }
} else if (csignature->hasthis && sp->type == VAL_OBJ &&
((MonoObject *)sp->data.p)->vtable->klass == mono_defaults.transparent_proxy_class) {
g_assert (child_frame.method);
@@ -2858,7 +2834,7 @@ array_constructed:
}
if (load_addr) {
- sp [-1].type = VAL_MP;
+ sp [-1].type = VAL_TP;
sp [-1].data.p = addr;
sp [-1].data.vt.klass = mono_class_from_mono_type (field->type);
} else {
@@ -2942,7 +2918,7 @@ array_constructed:
addr = mono_threads_get_static_data (GPOINTER_TO_UINT (addr));
if (load_addr) {
- sp->type = VAL_MP;
+ sp->type = VAL_TP;
sp->data.p = addr;
sp->data.vt.klass = mono_class_from_mono_type (field->type);
} else {
@@ -2992,15 +2968,7 @@ array_constructed:
vtklass = mono_class_get (image, read32 (ip));
ip += 4;
sp -= 2;
-
- /*
- * LAMESPEC: According to the spec, the stack should contain a
- * pointer to a value type. In reality, it can contain anything.
- */
- if (sp [1].type == VAL_VALUET)
- memcpy (sp [0].data.p, sp [1].data.vt.vt, mono_class_value_size (vtklass, NULL));
- else
- memcpy (sp [0].data.p, &sp [1].data, mono_class_value_size (vtklass, NULL));
+ memcpy (sp [0].data.p, sp [1].data.vt.vt, mono_class_value_size (vtklass, NULL));
BREAK;
}
#if SIZEOF_VOID_P == 8
@@ -3101,7 +3069,7 @@ array_constructed:
case CEE_CONV_OVF_I_UN: /* Fall through */
#endif
case CEE_CONV_OVF_I4_UN:
- if (value > MYGUINT32_MAX)
+ if (value > 2147483647)
THROW_EX (mono_get_exception_overflow (), ip);
sp [-1].data.i = value;
sp [-1].type = VAL_I32;
@@ -3396,87 +3364,68 @@ array_constructed:
CASE (CEE_UNUSED15)
CASE (CEE_UNUSED16)
CASE (CEE_UNUSED17) ves_abort(); BREAK;
-
-#if SIZEOF_VOID_P == 4
- CASE (CEE_CONV_OVF_I)
- CASE (CEE_CONV_OVF_U)
-#endif
CASE (CEE_CONV_OVF_I1)
- CASE (CEE_CONV_OVF_I2)
- CASE (CEE_CONV_OVF_I4)
- CASE (CEE_CONV_OVF_U1)
- CASE (CEE_CONV_OVF_U2)
- CASE (CEE_CONV_OVF_U4) {
- gint64 value;
- switch (sp [-1].type) {
- case VAL_DOUBLE:
- value = (gint64)sp [-1].data.f;
- break;
- case VAL_I64:
- value = (gint64)sp [-1].data.l;
- break;
- case VAL_VALUET:
- ves_abort();
- case VAL_I32:
- value = (gint64)sp [-1].data.i;
- break;
- default:
- value = (gint64)sp [-1].data.nati;
- break;
- }
- switch (*ip) {
- case CEE_CONV_OVF_I1:
- if (value < -128 || value > 127)
- THROW_EX (mono_get_exception_overflow (), ip);
- sp [-1].data.i = value;
- sp [-1].type = VAL_I32;
- break;
- case CEE_CONV_OVF_I2:
- if (value < -32768 || value > 32767)
+ if (sp [-1].type == VAL_I32) {
+ if (sp [-1].data.i < 128 || sp [-1].data.i > 127)
THROW_EX (mono_get_exception_overflow (), ip);
- sp [-1].data.i = value;
- sp [-1].type = VAL_I32;
- break;
-#if SIZEOF_VOID_P == 4
- case CEE_CONV_OVF_I: /* Fall through */
-#endif
- case CEE_CONV_OVF_I4:
- if (value < MYGINT32_MIN || value > MYGINT32_MAX)
+ sp [-1].data.i = (gint8)sp [-1].data.i;
+ } else if (sp [-1].type == VAL_I64) {
+ if (sp [-1].data.l < 128 || sp [-1].data.l > 127)
THROW_EX (mono_get_exception_overflow (), ip);
- sp [-1].data.i = value;
- sp [-1].type = VAL_I32;
- break;
- case CEE_CONV_OVF_U1:
- if (value < 0 || value > 255)
+ sp [-1].data.i = (gint8)sp [-1].data.l;
+ } else {
+ ves_abort();
+ }
+ ++ip;
+ BREAK;
+ CASE (CEE_CONV_OVF_U1)
+ if (sp [-1].type == VAL_I32) {
+ if (sp [-1].data.i < 0 || sp [-1].data.i > 255)
THROW_EX (mono_get_exception_overflow (), ip);
- sp [-1].data.i = value;
- sp [-1].type = VAL_I32;
- break;
- case CEE_CONV_OVF_U2:
- if (value < 0 || value > 65535)
+ sp [-1].data.i = (gint8)sp [-1].data.i;
+ } else if (sp [-1].type == VAL_I64) {
+ if (sp [-1].data.l < 0 || sp [-1].data.l > 255)
THROW_EX (mono_get_exception_overflow (), ip);
- sp [-1].data.i = value;
+ sp [-1].data.i = (gint8)sp [-1].data.l;
+ } else {
+ ves_abort();
+ }
+ ++ip;
+ BREAK;
+ CASE (CEE_CONV_OVF_I2)
+ CASE (CEE_CONV_OVF_U2)
+ ++ip;
+ /* FIXME: handle other cases */
+ if (sp [-1].type == VAL_I32) {
+ /* defined as NOP */
+ } else {
+ ves_abort();
+ }
+ BREAK;
+ CASE (CEE_CONV_OVF_I4)
+ /* FIXME: handle other cases */
+ if (sp [-1].type == VAL_I32) {
+ /* defined as NOP */
+ } else if(sp [-1].type == VAL_I64) {
+ sp [-1].data.i = (gint32)sp [-1].data.l;
sp [-1].type = VAL_I32;
- break;
-#if SIZEOF_VOID_P == 4
- case CEE_CONV_OVF_U: /* Fall through */
-#endif
- case CEE_CONV_OVF_U4:
- if (value < 0 || value > MYGUINT32_MAX)
- THROW_EX (mono_get_exception_overflow (), ip);
- sp [-1].data.i = value;
+ } else {
+ ves_abort();
+ }
+ ++ip;
+ BREAK;
+ CASE (CEE_CONV_OVF_U4)
+ /* FIXME: handle other cases */
+ if (sp [-1].type == VAL_I32) {
+ /* defined as NOP */
+ } else if(sp [-1].type == VAL_I64) {
+ sp [-1].data.i = (guint32)sp [-1].data.l;
sp [-1].type = VAL_I32;
- break;
- default:
- g_assert_not_reached ();
+ } else {
+ ves_abort();
}
++ip;
BREAK;
- }
-
-#if SIZEOF_VOID_P == 8
- CASE (CEE_CONV_OVF_I)
-#endif
CASE (CEE_CONV_OVF_I8)
/* FIXME: handle other cases */
if (sp [-1].type == VAL_I32) {
@@ -3489,10 +3438,6 @@ array_constructed:
}
++ip;
BREAK;
-
-#if SIZEOF_VOID_P == 8
- CASE (CEE_CONV_OVF_U)
-#endif
CASE (CEE_CONV_OVF_U8)
/* FIXME: handle other cases */
if (sp [-1].type == VAL_I32) {
@@ -3541,6 +3486,29 @@ array_constructed:
++sp;
BREAK;
}
+ CASE (CEE_CONV_OVF_I)
+ ++ip;
+ --sp;
+ /* FIXME: check overflow. */
+ switch (sp->type) {
+ case VAL_I32:
+ sp->data.p = (gpointer)(mono_i) sp->data.i;
+ break;
+ case VAL_I64:
+ sp->data.p = (gpointer)(mono_i) sp->data.l;
+ break;
+ case VAL_NATI:
+ break;
+ case VAL_DOUBLE:
+ sp->data.p = (gpointer)(mono_i) sp->data.f;
+ break;
+ default:
+ ves_abort ();
+ }
+ sp->type = VAL_NATI;
+ ++sp;
+ BREAK;
+ CASE (CEE_CONV_OVF_U) ves_abort(); BREAK;
CASE (CEE_ADD_OVF)
--sp;
/* FIXME: check overflow */
@@ -3584,6 +3552,7 @@ array_constructed:
CASE (CEE_MUL_OVF)
++ip;
--sp;
+ /* FIXME: check overflow */
if (sp->type == VAL_I32) {
if (CHECK_MUL_OVERFLOW (sp [-1].data.i, GET_NATI (sp [0])))
THROW_EX (mono_get_exception_overflow (), ip);
@@ -3779,7 +3748,7 @@ array_constructed:
case CEE_MONO_VTADDR: {
++ip;
- sp->type = VAL_MP;
+ sp->type = VAL_VALUETA;
/* do nothing? */
break;
}
@@ -4011,15 +3980,6 @@ array_constructed:
m = get_virtual_method (domain, m, sp);
}
-
- /*
- * This prevents infinite cycles since the wrapper contains
- * an ldftn too.
- */
- if (frame->method->wrapper_type != MONO_WRAPPER_SYNCHRONIZED)
- if (m && m->iflags & METHOD_IMPL_ATTRIBUTE_SYNCHRONIZED)
- m = mono_marshal_get_synchronized_wrapper (m);
-
sp->type = VAL_NATI;
sp->data.p = mono_create_method_pointer (m);
sp->data.vt.klass = NULL;
@@ -4050,7 +4010,10 @@ array_constructed:
sp->data.vt.klass = c;
sp->data.vt.vt = ARG_POS (anum);
- sp->type = VAL_MP;
+ if (c->valuetype)
+ sp->type = VAL_VALUETA;
+ else
+ sp->type = VAL_TP;
++sp;
break;
@@ -4088,7 +4051,10 @@ array_constructed:
sp->data.vt.vt = LOCAL_POS (loc_pos);
sp->data.vt.klass = c;
- sp->type = VAL_MP;
+ if (c->valuetype)
+ sp->type = VAL_VALUETA;
+ else
+ sp->type = VAL_TP;
++sp;
break;
@@ -4109,7 +4075,7 @@ array_constructed:
THROW_EX (mono_get_exception_execution_engine (NULL), ip - 1);
++ip;
sp->data.p = alloca (sp->data.i);
- sp->type = VAL_MP;
+ sp->type = VAL_TP;
sp++;
break;
case CEE_UNUSED57: ves_abort(); break;
@@ -4128,17 +4094,16 @@ array_constructed:
break;
case CEE_INITOBJ: {
guint32 token;
- MonoClass *class;
-
++ip;
token = read32 (ip);
ip += 4;
-
- class = mono_class_get (image, token);
-
+ /*
+ * we ignore the value of token (I think we can as unspecified
+ * behavior described in Partition II, 3.5).
+ */
--sp;
- g_assert (sp->type == VAL_TP || sp->type == VAL_MP);
- memset (sp->data.vt.vt, 0, mono_class_value_size (class, NULL));
+ g_assert (sp->type == VAL_VALUETA || sp->type == VAL_TP);
+ memset (sp->data.vt.vt, 0, mono_class_value_size (sp->data.vt.klass, NULL));
break;
}
case CEE_CONSTRAINED_: {
@@ -4258,7 +4223,6 @@ array_constructed:
if (tracing)
g_print ("* Found handler at '%s'\n", inv->method->name);
#endif
-
/*
* It seems that if the catch handler is found in the same method,
* it gets executed before the finally handler.
@@ -4347,7 +4311,7 @@ die_on_ex:
ip_offset = frame->ip - header->code;
for (i = 0; i < header->num_clauses; ++i) {
clause = &header->clauses [i];
- if (clause->flags == MONO_EXCEPTION_CLAUSE_FAULT && MONO_OFFSET_IN_CLAUSE (clause, ip_offset)) {
+ if (clause->flags == 3 && MONO_OFFSET_IN_CLAUSE (clause, ip_offset)) {
ip = header->code + clause->handler_offset;
#if DEBUG_INTERP
if (tracing)
@@ -4375,15 +4339,8 @@ die_on_ex:
++sp;
goto main_loop;
}
- if (!frame->parent) {
- /* Pass the exception though the managed barrier if possible */
- MonoInvocation *parent = TlsGetValue (frame_thread_id);
- if (parent) {
- parent->ex = frame->ex;
- longjmp (*(jmp_buf*)parent->locals, 1);
- }
+ if (!frame->parent)
goto die_on_ex;
- }
DEBUG_LEAVE ();
return;
}
@@ -4614,8 +4571,6 @@ main (int argc, char *argv [])
g_log_set_always_fatal (G_LOG_LEVEL_ERROR);
g_log_set_fatal_mask (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR);
- g_thread_init (NULL);
-
mono_init_icall ();
mono_add_internal_call ("System.Diagnostics.StackFrame::get_frame_info", ves_icall_get_frame_info);
mono_add_internal_call ("System.Diagnostics.StackTrace::get_trace", ves_icall_get_trace);
@@ -4632,6 +4587,8 @@ main (int argc, char *argv [])
mono_install_stack_walk (interp_walk_stack);
mono_runtime_install_cleanup (quit_function);
+ metadata_section = &ms;
+ InitializeCriticalSection (metadata_section);
domain = mono_init (file);
mono_runtime_init (domain, NULL, NULL);
diff --git a/mono/interpreter/interp.h b/mono/interpreter/interp.h
index 4fa68268d8d..90bbbbfc185 100644
--- a/mono/interpreter/interp.h
+++ b/mono/interpreter/interp.h
@@ -14,6 +14,7 @@ enum {
VAL_MP = 1 + VAL_POINTER,
VAL_TP = 2 + VAL_POINTER,
VAL_OBJ = 3 + VAL_POINTER,
+ VAL_VALUETA = 8
};
#if SIZEOF_VOID_P == 4
@@ -57,7 +58,6 @@ struct _MonoInvocation {
char *args;
stackval *stack_args; /* parent */
stackval *stack;
- stackval *sp; /* For GC stack marking */
/* exception info */
int invoke_trap;
const unsigned char *ip;
diff --git a/mono/metadata/.cvsignore b/mono/metadata/.cvsignore
index 18f33722269..75d912a3efe 100644
--- a/mono/metadata/.cvsignore
+++ b/mono/metadata/.cvsignore
@@ -1,7 +1,6 @@
Makefile
Makefile.in
pedump
-monosn
.libs
.deps
*.lo
diff --git a/mono/metadata/ChangeLog b/mono/metadata/ChangeLog
index c0830b1c32a..5107280e8ba 100644
--- a/mono/metadata/ChangeLog
+++ b/mono/metadata/ChangeLog
@@ -1,180 +1,3 @@
-2003-08-27 Zoltan Varga <vargaz@freemail.hu>
-
- * NOTES: New file.
-
- * object.c (mono_class_proxy_vtable): Make it thread safe.
-
- * pedump.c: Fix warning.
-
- * object.c appdomain.h: Get rid of metadata_section.
- It is no longer needed and it was causing deadlocks with domain->lock.
-
- * appdomain.c (add_assemblies_to_domain): Make it thread safe.
-
-2003-08-26 Martin Baulig <martin@ximian.com>
-
- * pedump.c (main): Don't call mono_image_close() if `verify_pe'.
-
-2003-08-26 Martin Baulig <martin@ximian.com>
-
- * pedump.c (main): Call mono_metadata_init(),
- mono_raw_buffer_init(), mono_images_init(), mono_assemblies_init()
- and mono_loader_init().
-
-2003-08-26 Zoltan Varga <vargaz@freemail.hu>
-
- * loader.h: Add missing include to fix build.
-
- * image.h: mono_image_load_references is no more.
-
- * assembly.c: Reworked assembly loading to make it really thread safe.
- After these changes, the assembly returned by mono_assembly_open is
- fully initialized, i.e. all its references assemblies are loaded.
-
- * assembly.c (mono_image_load_references): Renamed to
- mono_assembly_load_references, and made private, since clients no
- longer need to call it.
-
- * class.c: Removed calls to mono_assembly_load_references, since it was
- a source of deadlocks.
-
- * loader.h loader.c class.h class.c: Protect data structures using a
- new lock, the loader lock.
-
- * class.c (mono_class_setup_vtable): Create temporary hash tables and
- GPtrArrays only when needed.
-
- * class.c (mono_class_layout_fields): Ignore the dummy field inserted
- into empty structures by mcs. Fixes pinvoke7.cs.
-
- * domain.c (mono_init): Call a new initialization function.
-
- * appdomain.c (mono_runtime_init): Call the new initializer function
- of the marshal module.
-
- * marshal.c (mono_marshal_load_type_info): Ignore the dummy field
- inserted into empty structures by mcs. Fixes pinvoke7.cs.
-
- * marshal.h marshal.c: Added locks around the wrapper caches to make
- this module thread safe.
-
- * icall.c (ves_icall_InternalInvoke): Method wrappers doesn't require a
- this argument. Fixes pinvoke1.exe.
-
-2003-08-25 Lluis Sanchez <lluis@ximian.com>
-
- * object.h: Added call_type field to MonoMethodMessage and the corresponding
- enumeration of values. Removed fields to store remote call output values in
- MonoAsyncResult. Not needed any more.
- * object.c: Initialize call_type and async_result fields in mono_message_init.
- * marshal.c: mono_delegate_begin_invoke(): for proxies, set call_type before
- dispatching the message.
- mono_delegate_end_invoke (): delegate to the proxy the work of waiting for the
- async call to finish. To do it use a message with EndInvoke call type.
-
-2003-08-25 Zoltan Varga <vargaz@freemail.hu>
-
- * loader.h loader.c (mono_method_hash_marhal_info): New function which
- determines whenever a method has marshalling info.
-
-2003-08-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * assembly.c: fix the build on windows.
-
-2003-08-22 Lluis Sanchez <lluis@ximian.com>
-
- * object.cs: Fixed bug #47785.
-
-2003-08-22 Jackson Harper <jackson@latitudegeo.com>
-
- * string-icalls.c (StringReplace): If their are no occurances of
- the old string found return a reference to the supplied
- string. This saves some memory and matches MS behavoir.
-
-2003-08-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * socket-io.c: fixed compilation for systems that define AF_INET6
- and don't define SOL_IP/SOL_IPV6.
-
-2003-08-21 Zoltan Varga <vargaz@freemail.hu>
-
- * object.c (mono_object_isinst): Fix casts to TransparentProxy in
- the interpreter. Patch by Bernie Solomon (bernard@ugsolutions.com).
-
- * rawbuffer.c rawbuffer.h: Make this module thread safe.
-
- * domain.c: Make this module thread safe.
-
- * domain.c (mono_init): Call new initialization function.
-
- * icall.c (ves_icall_System_Array_SetValueImpl): Check types for
- reference types too. Fixes #38812.
-
- * image.c (mono_image_init): Fixed warnings.
-
- * class.c (mono_class_from_typeref): Handle assembly load failure
- correctly.
-
- * appdomain.c (add_assemblies_to_domain): Handle the case when
- the references of an assembly are not yet loaded.
-
- * metadata.c image.c assembly.c: Moved initialization of global
- variables to a separate function called at startup since lazy
- initialization of these variables is not thread safe.
-
- * image.c assembly.c: Made this module thread safe by adding locks in
- the appropriate places.
-
- * domain.c (mono_init): Call the new initialization functions of the
- three modules.
-
-2003-08-20 Lluis Sanchez Gual <lluis@ximian.com>
-
- * marshal.c: mono_delegate_begin_invoke(): If the target is a proxy,
- make a direct call. It is proxy's work to make the call asynchronous.
- mono_delegate_end_invoke(): If the targe is a proxy, just collect
- the return values.
- * object.cs: mono_method_call_message_new(): read AsyncResult and
- state object from parameters list, if this info is requested.
- * object.h: Added fields to store remote call output values in
- MonoAsyncResult. Added AsyncResult field in MonoMethodMessage.
-
-Wed Aug 20 12:57:42 CEST 2003 Paolo Molaro <lupus@ximian.com>
-
- * object.h: add needed fields to MonoThread.
- * threads.c, threads.h: allow registering a function to cleanup data
- allocated per thread by the JIT.
-
-Tue Aug 19 18:22:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
-
- * loader.h: portability fix by Bernie Solomon
- * <bernard@ugsolutions.com>.
-
-2003-08-16 Zoltan Varga <vargaz@freemail.hu>
-
- * reflection.h reflection.c (mono_param_get_objects): Changed this to
- return a MonoArray. This simplifies the code and also ensures that
- the cache allways contains an object reference as a value.
-
- * icall.c (ves_icall_get_parameter_info): Simplified using the new
- function.
-
-2003-08-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * socket-io.c: patch by Bernie Solomon <bernard@ugsolutions.com> that
- fixes a problem with byte ordering when getting the address family for
- a socket.
-
-2003-08-15 Zoltan Varga <vargaz@freemail.hu>
-
- * .cvsignore: Added monosn.
-
- * reflection.h reflection.c loader.c: Added support for parameter
- marshalling to dynamically created types. Fixes #47295.
-
-Fri Aug 15 11:42:46 CEST 2003 Paolo Molaro <lupus@ximian.com>
-
- * rand.c: remove useless warnings.
Wed Aug 13 15:49:57 CEST 2003 Paolo Molaro <lupus@ximian.com>
diff --git a/mono/metadata/appdomain.c b/mono/metadata/appdomain.c
index 3c0abbe7879..03d4d3ae77a 100644
--- a/mono/metadata/appdomain.c
+++ b/mono/metadata/appdomain.c
@@ -23,7 +23,6 @@
#include <mono/metadata/socket-io.h>
#include <mono/metadata/tabledefs.h>
#include <mono/metadata/gc-internal.h>
-#include <mono/metadata/marshal.h>
HANDLE mono_delegate_semaphore = NULL;
CRITICAL_SECTION mono_delegate_section;
@@ -61,8 +60,6 @@ mono_runtime_init (MonoDomain *domain, MonoThreadStartCB start_cb,
MonoAppDomainSetup *setup;
MonoAppDomain *ad;
MonoClass *class;
-
- mono_marshal_init ();
mono_install_assembly_preload_hook (mono_domain_assembly_preload, NULL);
mono_install_assembly_load_hook (mono_domain_fire_assembly_load, NULL);
@@ -416,19 +413,15 @@ add_assemblies_to_domain (MonoDomain *domain, MonoAssembly *ass)
{
gint i;
- mono_domain_lock (domain);
-
- if (g_hash_table_lookup (domain->assemblies, ass->aname.name)) {
- mono_domain_unlock (domain);
+ if (g_hash_table_lookup (domain->assemblies, ass->aname.name))
return; /* This is ok while no lazy loading of assemblies */
- }
+ mono_domain_lock (domain);
g_hash_table_insert (domain->assemblies, (gpointer) ass->aname.name, ass);
mono_domain_unlock (domain);
- if (ass->image->references)
- for (i = 0; ass->image->references [i] != NULL; i++)
- add_assemblies_to_domain (domain, ass->image->references [i]);
+ for (i = 0; ass->image->references [i] != NULL; i++)
+ add_assemblies_to_domain (domain, ass->image->references [i]);
}
static void
diff --git a/mono/metadata/appdomain.h b/mono/metadata/appdomain.h
index 1199a4a11a9..b946ec4f927 100644
--- a/mono/metadata/appdomain.h
+++ b/mono/metadata/appdomain.h
@@ -68,6 +68,8 @@ typedef struct {
gint32 context_id;
} MonoAppContext;
+extern CRITICAL_SECTION *metadata_section;
+
typedef struct _MonoAppDomain MonoAppDomain;
struct _MonoDomain {
diff --git a/mono/metadata/assembly.c b/mono/metadata/assembly.c
index 2b404e778f6..744550f7868 100644
--- a/mono/metadata/assembly.c
+++ b/mono/metadata/assembly.c
@@ -22,7 +22,6 @@
#ifdef WITH_BUNDLE
#include "mono-bundle.h"
#endif
-#include <mono/io-layer/io-layer.h>
/* the default search path is just MONO_ASSEMBLIES */
static const char*
@@ -32,26 +31,20 @@ default_path [] = {
};
static char **assemblies_path = NULL;
-
-/*
- * keeps track of loaded assemblies
- */
-static GList *loaded_assemblies = NULL;
-static MonoAssembly *corlib;
-
-/* This protects loaded_assemblies and image->references */
-static CRITICAL_SECTION assemblies_mutex;
-
-/* A hastable of thread->assembly list mappings */
-static GHashTable *assemblies_loading;
+static int env_checked = 0;
#ifdef PLATFORM_WIN32
+static gboolean path_inited = FALSE;
static void
init_default_path (void)
{
int i;
+ if (path_inited)
+ return;
+
+ path_inited = TRUE;
default_path [0] = g_strdup (MONO_ASSEMBLIES);
for (i = strlen (MONO_ASSEMBLIES) - 1; i >= 0; i--) {
if (default_path [0][i] == '/')
@@ -65,6 +58,10 @@ check_env (void) {
const char *path;
char **splitted;
+ if (env_checked)
+ return;
+ env_checked = 1;
+
path = getenv ("MONO_PATH");
if (!path)
return;
@@ -74,13 +71,17 @@ check_env (void) {
assemblies_path = splitted;
}
-/* assemblies_mutex must be held by the caller */
+/*
+ * keeps track of loaded assemblies
+ */
+static GList *loaded_assemblies = NULL;
+static MonoAssembly *corlib;
+
static MonoAssembly*
search_loaded (MonoAssemblyName* aname)
{
GList *tmp;
MonoAssembly *ass;
- GList *loading;
for (tmp = loaded_assemblies; tmp; tmp = tmp->next) {
ass = tmp->data;
@@ -91,25 +92,8 @@ search_loaded (MonoAssemblyName* aname)
if (strcmp (aname->name, ass->aname.name))
continue;
/* g_print ("success\n"); */
-
- return ass;
- }
-
- /*
- * The assembly might be under load by this thread. In this case, it is
- * safe to return an incomplete instance to prevent loops.
- */
- loading = g_hash_table_lookup (assemblies_loading, GetCurrentThread ());
- for (tmp = loading; tmp; tmp = tmp->next) {
- ass = tmp->data;
- if (!ass->aname.name)
- continue;
- if (strcmp (aname->name, ass->aname.name))
- continue;
-
return ass;
}
-
return NULL;
}
@@ -145,38 +129,21 @@ mono_assembly_setrootdir (const char *root_dir)
/*
* Override the MONO_ASSEMBLIES directory configured at compile time.
*/
- /* Leak if called more than once */
default_path [0] = g_strdup (root_dir);
-}
-
-/**
- * mono_assemblies_init:
- *
- * Initialize global variables used by this module.
- */
-void
-mono_assemblies_init (void)
-{
#ifdef PLATFORM_WIN32
- init_default_path ();
+ path_inited = TRUE;
#endif
-
- check_env ();
-
- InitializeCriticalSection (&assemblies_mutex);
-
- assemblies_loading = g_hash_table_new (NULL, NULL);
}
-static void
-mono_assembly_load_references (MonoImage *image, MonoImageOpenStatus *status)
-{
+void
+mono_image_load_references (MonoImage *image, MonoImageOpenStatus *status) {
MonoTableInfo *t;
guint32 cols [MONO_ASSEMBLYREF_SIZE];
const char *hash;
int i;
- *status = MONO_IMAGE_OK;
+ if (image->references)
+ return;
t = &image->tables [MONO_TABLE_ASSEMBLYREF];
@@ -202,12 +169,14 @@ mono_assembly_load_references (MonoImage *image, MonoImageOpenStatus *status)
aname.revision = cols [MONO_ASSEMBLYREF_REV_NUMBER];
image->references [i] = mono_assembly_load (&aname, image->assembly->basedir, status);
+
if (image->references [i] == NULL){
int j;
for (j = 0; j < i; j++)
mono_assembly_close (image->references [j]);
g_free (image->references);
+ image->references = NULL;
g_warning ("Could not find assembly %s", aname.name);
*status = MONO_IMAGE_MISSING_ASSEMBLYREF;
@@ -215,6 +184,7 @@ mono_assembly_load_references (MonoImage *image, MonoImageOpenStatus *status)
}
}
image->references [i] = NULL;
+
}
typedef struct AssemblyLoadHook AssemblyLoadHook;
@@ -295,7 +265,7 @@ absolute_dir (const gchar *filename)
gchar *mixed;
gchar **parts;
gchar *part;
- GList *list, *tmp;
+ GSList *list, *tmp;
GString *result;
gchar *res;
gint i;
@@ -316,14 +286,14 @@ absolute_dir (const gchar *filename)
if (!strcmp (part, "..")) {
if (list && list->next) /* Don't remove root */
- list = g_list_delete_link (list, list);
+ list = g_slist_delete_link (list, list);
} else {
- list = g_list_prepend (list, part);
+ list = g_slist_prepend (list, part);
}
}
result = g_string_new ("");
- list = g_list_reverse (list);
+ list = g_slist_reverse (list);
/* Ignores last data pointer, which should be the filename */
for (tmp = list; tmp && tmp->next != NULL; tmp = tmp->next)
@@ -333,7 +303,7 @@ absolute_dir (const gchar *filename)
res = result->str;
g_string_free (result, FALSE);
- g_list_free (list);
+ g_slist_free (list);
g_strfreev (parts);
if (*res == '\0') {
g_free (res);
@@ -360,10 +330,9 @@ do_mono_assembly_open (const char *filename, MonoImageOpenStatus *status)
g_free (name);
name = g_strdup ("mscorlib");
}
- /* we do a very simple search for bundled assemblies: it's not a general
- * purpose assembly loading mechanism.
+ /* we do a very simple search for bundled assemblies: it's not a general purpouse
+ * assembly loading mechanism.
*/
- EnterCriticalSection (&assemblies_mutex);
for (tmp = loaded_assemblies; tmp; tmp = tmp->next) {
ass = tmp->data;
if (!ass->aname.name)
@@ -373,7 +342,6 @@ do_mono_assembly_open (const char *filename, MonoImageOpenStatus *status)
image = ass->image;
break;
}
- LeaveCriticalSection (&assemblies_mutex);
for (i = 0; !image && bundled_assemblies [i]; ++i) {
if (strcmp (bundled_assemblies [i]->name, name) == 0) {
image = mono_image_open_from_data ((char*)bundled_assemblies [i]->data, bundled_assemblies [i]->size, FALSE, status);
@@ -410,7 +378,6 @@ mono_assembly_open (const char *filename, MonoImageOpenStatus *status)
char *base_dir, *aot_name;
MonoImageOpenStatus def_status;
gchar *fname;
- GList *loading;
g_return_val_if_fail (filename != NULL, NULL);
@@ -503,66 +470,33 @@ mono_assembly_open (const char *filename, MonoImageOpenStatus *status)
ass->aname.minor = cols [MONO_ASSEMBLY_MINOR_VERSION];
ass->aname.build = cols [MONO_ASSEMBLY_BUILD_NUMBER];
ass->aname.revision = cols [MONO_ASSEMBLY_REV_NUMBER];
- }
- /*
- * Atomically search the loaded list and add ourselves to it if necessary.
- */
- EnterCriticalSection (&assemblies_mutex);
- if (ass->aname.name)
/* avoid loading the same assembly twice for now... */
if ((ass2 = search_loaded (&ass->aname))) {
g_free (ass);
g_free (base_dir);
*status = MONO_IMAGE_OK;
- LeaveCriticalSection (&assemblies_mutex);
return ass2;
}
- loading = g_hash_table_lookup (assemblies_loading, GetCurrentThread ());
- loading = g_list_prepend (loading, ass);
- g_hash_table_insert (assemblies_loading, GetCurrentThread (), loading);
- LeaveCriticalSection (&assemblies_mutex);
+ }
image->assembly = ass;
- /*
- * We load referenced assemblies outside the lock to prevent deadlocks
- * with regards to preload hooks.
- */
- mono_assembly_load_references (image, status);
-
- EnterCriticalSection (&assemblies_mutex);
+ /* register right away to prevent loops */
+ loaded_assemblies = g_list_prepend (loaded_assemblies, ass);
- loading = g_hash_table_lookup (assemblies_loading, GetCurrentThread ());
- loading = g_list_remove (loading, ass);
- if (loading == NULL)
- /* Prevent memory leaks */
- g_hash_table_remove (assemblies_loading, GetCurrentThread ());
- else
- g_hash_table_insert (assemblies_loading, GetCurrentThread (), loading);
+ mono_image_load_references (image, status);
if (*status != MONO_IMAGE_OK) {
- LeaveCriticalSection (&assemblies_mutex);
mono_assembly_close (ass);
return NULL;
}
- ass2 = search_loaded (&ass->aname);
- if (ass2) {
- /* Somebody else has loaded the assembly before us */
- LeaveCriticalSection (&assemblies_mutex);
- mono_assembly_close (ass);
- return ass2;
- }
-
- loaded_assemblies = g_list_prepend (loaded_assemblies, ass);
- LeaveCriticalSection (&assemblies_mutex);
-
/* resolve assembly references for modules */
t = &image->tables [MONO_TABLE_MODULEREF];
for (i = 0; i < t->rows; i++){
if (image->modules [i]) {
image->modules [i]->assembly = ass;
- mono_assembly_load_references (image->modules [i], status);
+ mono_image_load_references (image->modules [i], status);
}
/*
* FIXME: what do we do here? it could be a native dll...
@@ -582,6 +516,9 @@ mono_assembly_load (MonoAssemblyName *aname, const char *basedir, MonoImageOpenS
MonoAssembly *result;
char *fullpath, *filename;
+#ifdef PLATFORM_WIN32
+ init_default_path ();
+#endif
check_env ();
result = invoke_assembly_preload_hook (aname, assemblies_path);
@@ -641,13 +578,10 @@ mono_assembly_close (MonoAssembly *assembly)
g_return_if_fail (assembly != NULL);
- EnterCriticalSection (&assemblies_mutex);
- if (--assembly->ref_count != 0) {
- LeaveCriticalSection (&assemblies_mutex);
+ if (--assembly->ref_count != 0)
return;
- }
+
loaded_assemblies = g_list_remove (loaded_assemblies, assembly);
- LeaveCriticalSection (&assemblies_mutex);
image = assembly->image;
if (image->references) {
for (i = 0; image->references [i] != NULL; i++)
@@ -664,19 +598,9 @@ mono_assembly_close (MonoAssembly *assembly)
void
mono_assembly_foreach (GFunc func, gpointer user_data)
{
- GList *copy;
-
- /*
- * We make a copy of the list to avoid calling the callback inside the
- * lock, which could lead to deadlocks.
- */
- EnterCriticalSection (&assemblies_mutex);
- copy = g_list_copy (loaded_assemblies);
- LeaveCriticalSection (&assemblies_mutex);
+ /* In the future this can do locking of loaded_assemblies */
g_list_foreach (loaded_assemblies, func, user_data);
-
- g_list_free (copy);
}
/* Holds the assembly of the application, for
diff --git a/mono/metadata/assembly.h b/mono/metadata/assembly.h
index 6d744ac4123..8ea0515dc6d 100644
--- a/mono/metadata/assembly.h
+++ b/mono/metadata/assembly.h
@@ -7,7 +7,6 @@
#define CORLIB_NAME "corlib.dll"
-void mono_assemblies_init (void);
MonoAssembly *mono_assembly_open (const char *filename,
MonoImageOpenStatus *status);
MonoAssembly* mono_assembly_load (MonoAssemblyName *aname,
diff --git a/mono/metadata/class.c b/mono/metadata/class.c
index 6902a0fafc3..024d8abc277 100644
--- a/mono/metadata/class.c
+++ b/mono/metadata/class.c
@@ -60,6 +60,7 @@ mono_class_from_typeref (MonoImage *image, guint32 type_token)
const char *name, *nspace;
MonoClass *res;
MonoAssembly **references;
+ MonoImageOpenStatus status;
mono_metadata_decode_row (t, (type_token&0xffffff)-1, cols, MONO_TYPEREF_SIZE);
@@ -91,6 +92,7 @@ mono_class_from_typeref (MonoImage *image, guint32 type_token)
break;
}
+ mono_image_load_references (image, &status);
references = image->references;
if (!references || !references [idx-1]) {
/*
@@ -460,12 +462,6 @@ mono_class_layout_fields (MonoClass *class)
}
#endif
- if ((top == 1) && (class->instance_size == sizeof (MonoObject)) &&
- (strcmp (class->fields [i].name, "$PRIVATE$") == 0)) {
- /* This field is a hack inserted by MCS to empty structures */
- continue;
- }
-
size = mono_type_size (class->fields [i].type, &align);
/* FIXME (LAMESPEC): should we also change the min alignment according to pack? */
@@ -619,15 +615,12 @@ mono_get_unique_iid (MonoClass *class)
g_assert (class->flags & TYPE_ATTRIBUTE_INTERFACE);
- mono_loader_lock ();
-
if (!iid_hash)
iid_hash = g_hash_table_new (g_str_hash, g_str_equal);
str = g_strdup_printf ("%s|%s.%s\n", class->image->name, class->name_space, class->name);
if (g_hash_table_lookup_extended (iid_hash, str, NULL, &value)) {
- mono_loader_unlock ();
g_free (str);
return (guint)value;
} else {
@@ -635,13 +628,11 @@ mono_get_unique_iid (MonoClass *class)
++iid;
}
- mono_loader_unlock ();
-
return iid - 1;
}
static void
-collect_implemented_interfaces_aux (MonoClass *klass, GPtrArray **res)
+collect_implemented_interfaces_aux (MonoClass *klass, GPtrArray *res)
{
int i;
MonoClass *ic;
@@ -649,20 +640,18 @@ collect_implemented_interfaces_aux (MonoClass *klass, GPtrArray **res)
for (i = 0; i < klass->interface_count; i++) {
ic = klass->interfaces [i];
- if (*res == NULL)
- *res = g_ptr_array_new ();
- g_ptr_array_add (*res, ic);
+ g_ptr_array_add (res, ic);
collect_implemented_interfaces_aux (ic, res);
}
}
-static inline GPtrArray*
+static GPtrArray*
collect_implemented_interfaces (MonoClass *klass)
{
- GPtrArray *res = NULL;
+ GPtrArray *res = g_ptr_array_new ();
- collect_implemented_interfaces_aux (klass, &res);
+ collect_implemented_interfaces_aux (klass, res);
return res;
}
@@ -699,31 +688,27 @@ setup_interface_offsets (MonoClass *class, int cur_slot)
class->interface_offsets [i] = -1;
ifaces = collect_implemented_interfaces (class);
- if (ifaces) {
- for (i = 0; i < ifaces->len; ++i) {
- ic = g_ptr_array_index (ifaces, i);
- class->interface_offsets [ic->interface_id] = cur_slot;
- cur_slot += ic->method.count;
- }
- g_ptr_array_free (ifaces, TRUE);
+ for (i = 0; i < ifaces->len; ++i) {
+ ic = g_ptr_array_index (ifaces, i);
+ class->interface_offsets [ic->interface_id] = cur_slot;
+ cur_slot += ic->method.count;
}
+ g_ptr_array_free (ifaces, TRUE);
for (k = class->parent; k ; k = k->parent) {
ifaces = collect_implemented_interfaces (k);
- if (ifaces) {
- for (i = 0; i < ifaces->len; ++i) {
- ic = g_ptr_array_index (ifaces, i);
+ for (i = 0; i < ifaces->len; ++i) {
+ ic = g_ptr_array_index (ifaces, i);
- if (class->interface_offsets [ic->interface_id] == -1) {
- int io = k->interface_offsets [ic->interface_id];
+ if (class->interface_offsets [ic->interface_id] == -1) {
+ int io = k->interface_offsets [ic->interface_id];
- g_assert (io >= 0);
+ g_assert (io >= 0);
- class->interface_offsets [ic->interface_id] = io;
- }
+ class->interface_offsets [ic->interface_id] = io;
}
- g_ptr_array_free (ifaces, TRUE);
}
+ g_ptr_array_free (ifaces, TRUE);
}
return cur_slot;
@@ -736,7 +721,7 @@ mono_class_setup_vtable (MonoClass *class, MonoMethod **overrides, int onum)
MonoMethod **vtable;
int i, max_vtsize = 0, max_iid, cur_slot = 0;
GPtrArray *ifaces;
- MonoGHashTable *override_map = NULL;
+ MonoGHashTable *override_map;
/* setup_vtable() must be called only once on the type */
if (class->interface_offsets) {
@@ -745,13 +730,11 @@ mono_class_setup_vtable (MonoClass *class, MonoMethod **overrides, int onum)
}
ifaces = collect_implemented_interfaces (class);
- if (ifaces) {
- for (i = 0; i < ifaces->len; i++) {
- MonoClass *ic = g_ptr_array_index (ifaces, i);
- max_vtsize += ic->method.count;
- }
- g_ptr_array_free (ifaces, TRUE);
+ for (i = 0; i < ifaces->len; i++) {
+ MonoClass *ic = g_ptr_array_index (ifaces, i);
+ max_vtsize += ic->method.count;
}
+ g_ptr_array_free (ifaces, TRUE);
if (class->parent) {
max_vtsize += class->parent->vtable_size;
@@ -771,6 +754,8 @@ mono_class_setup_vtable (MonoClass *class, MonoMethod **overrides, int onum)
if (class->parent && class->parent->vtable_size)
memcpy (vtable, class->parent->vtable, sizeof (gpointer) * class->parent->vtable_size);
+ override_map = mono_g_hash_table_new (NULL, NULL);
+
/* override interface methods */
for (i = 0; i < onum; i++) {
MonoMethod *decl = overrides [i*2];
@@ -780,19 +765,13 @@ mono_class_setup_vtable (MonoClass *class, MonoMethod **overrides, int onum)
dslot = decl->slot + class->interface_offsets [decl->klass->interface_id];
vtable [dslot] = overrides [i*2 + 1];
vtable [dslot]->slot = dslot;
- if (!override_map)
- override_map = mono_g_hash_table_new (NULL, NULL);
-
mono_g_hash_table_insert (override_map, overrides [i * 2], overrides [i * 2 + 1]);
}
}
for (k = class; k ; k = k->parent) {
- int nifaces = 0;
ifaces = collect_implemented_interfaces (k);
- if (ifaces)
- nifaces = ifaces->len;
- for (i = 0; i < nifaces; i++) {
+ for (i = 0; i < ifaces->len; i++) {
int j, l, io;
ic = g_ptr_array_index (ifaces, i);
@@ -933,8 +912,7 @@ mono_class_setup_vtable (MonoClass *class, MonoMethod **overrides, int onum)
}
}
}
- if (ifaces)
- g_ptr_array_free (ifaces, TRUE);
+ g_ptr_array_free (ifaces, TRUE);
}
for (i = 0; i < class->method.count; ++i) {
@@ -954,8 +932,6 @@ mono_class_setup_vtable (MonoClass *class, MonoMethod **overrides, int onum)
mono_metadata_signature_equal (cm->signature, m1->signature)) {
slot = k->methods [j]->slot;
g_assert (cm->slot < max_vtsize);
- if (!override_map)
- override_map = mono_g_hash_table_new (NULL, NULL);
mono_g_hash_table_insert (override_map, m1, cm);
break;
}
@@ -981,8 +957,6 @@ mono_class_setup_vtable (MonoClass *class, MonoMethod **overrides, int onum)
g_assert (decl->slot != -1);
vtable [decl->slot] = overrides [i*2 + 1];
overrides [i * 2 + 1]->slot = decl->slot;
- if (!override_map)
- override_map = mono_g_hash_table_new (NULL, NULL);
mono_g_hash_table_insert (override_map, decl, overrides [i * 2 + 1]);
}
}
@@ -991,16 +965,13 @@ mono_class_setup_vtable (MonoClass *class, MonoMethod **overrides, int onum)
* If a method occupies more than one place in the vtable, and it is
* overriden, then change the other occurances too.
*/
- if (override_map) {
- for (i = 0; i < max_vtsize; ++i)
- if (vtable [i]) {
- MonoMethod *cm = mono_g_hash_table_lookup (override_map, vtable [i]);
- if (cm)
- vtable [i] = cm;
- }
-
- mono_g_hash_table_destroy (override_map);
- }
+ for (i = 0; i < max_vtsize; ++i)
+ if (vtable [i]) {
+ MonoMethod *cm = mono_g_hash_table_lookup (override_map, vtable [i]);
+ if (cm)
+ vtable [i] = cm;
+ }
+ mono_g_hash_table_destroy (override_map);
class->vtable_size = cur_slot;
class->vtable = g_malloc0 (sizeof (gpointer) * class->vtable_size);
@@ -1078,15 +1049,6 @@ mono_class_init (MonoClass *class)
/*g_print ("Init class %s\n", class->name);*/
- /* We do everything inside the lock to prevent races */
- mono_loader_lock ();
-
- if (class->inited) {
- mono_loader_unlock ();
- /* Somebody might have gotten in before us */
- return;
- }
-
if (class->init_pending) {
/* this indicates a cyclic dependency */
g_error ("pending init %s.%s\n", class->name_space, class->name);
@@ -1180,7 +1142,6 @@ mono_class_init (MonoClass *class)
* we have to setup them for interfaces, too.
*/
setup_interface_offsets (class, 0);
- mono_loader_unlock ();
return;
}
@@ -1242,8 +1203,6 @@ mono_class_init (MonoClass *class)
class->has_finalize = 1;
}
- mono_loader_unlock ();
-
if (mono_debugger_class_init_func)
mono_debugger_class_init_func (class);
}
@@ -1462,12 +1421,8 @@ mono_class_create_from_typedef (MonoImage *image, guint32 type_token)
guint icount = 0;
MonoClass **interfaces;
- mono_loader_lock ();
-
- if ((class = g_hash_table_lookup (image->class_cache, GUINT_TO_POINTER (type_token)))) {
- mono_loader_unlock ();
+ if ((class = g_hash_table_lookup (image->class_cache, GUINT_TO_POINTER (type_token))))
return class;
- }
g_assert (mono_metadata_token_table (type_token) == MONO_TABLE_TYPEDEF);
@@ -1550,8 +1505,6 @@ mono_class_create_from_typedef (MonoImage *image, guint32 type_token)
class->gen_params = mono_metadata_load_generic_params (image, class->type_token, &icount);
class->num_gen_params = icount;
- mono_loader_unlock ();
-
return class;
}
@@ -1587,13 +1540,9 @@ mono_class_from_generic (MonoType *gtype)
MonoClass *class;
MonoImage *image;
- mono_loader_lock ();
-
image = gklass->image;
- if ((class = g_hash_table_lookup (image->generics_cache, gtype))) {
- mono_loader_unlock ();
+ if ((class = g_hash_table_lookup (image->generics_cache, gtype)))
return class;
- }
mono_class_init (gklass);
@@ -1617,8 +1566,6 @@ mono_class_from_generic (MonoType *gtype)
g_hash_table_insert (image->generics_cache, gtype, class);
- mono_loader_unlock ();
-
return class;
}
@@ -1629,18 +1576,14 @@ mono_class_from_gen_param (MonoImage *image, gboolean mvar, int type_num, MonoGe
int key;
static GHashTable *cache = NULL;
- mono_loader_lock ();
-
if (!cache)
cache = g_hash_table_new (NULL, NULL);
key = mvar? 1: 0;
key |= type_num << 1;
- if ((result = g_hash_table_lookup (cache, GINT_TO_POINTER (key)))) {
- mono_loader_unlock ();
+ if ((result = g_hash_table_lookup (cache, GINT_TO_POINTER (key))))
return result;
- }
result = g_new0 (MonoClass, 1);
result->parent = NULL;
@@ -1656,8 +1599,6 @@ mono_class_from_gen_param (MonoImage *image, gboolean mvar, int type_num, MonoGe
result->this_arg.byref = TRUE;
g_hash_table_insert (cache, GINT_TO_POINTER (key), result);
-
- mono_loader_unlock ();
return result;
}
@@ -1668,15 +1609,11 @@ mono_ptr_class_get (MonoType *type)
MonoClass *el_class;
static GHashTable *ptr_hash = NULL;
- mono_loader_lock ();
-
if (!ptr_hash)
ptr_hash = g_hash_table_new (g_direct_hash, g_direct_equal);
el_class = mono_class_from_mono_type (type);
- if ((result = g_hash_table_lookup (ptr_hash, el_class))) {
- mono_loader_unlock ();
+ if ((result = g_hash_table_lookup (ptr_hash, el_class)))
return result;
- }
result = g_new0 (MonoClass, 1);
result->parent = NULL; /* no parent for PTR types */
@@ -1698,8 +1635,6 @@ mono_ptr_class_get (MonoType *type)
g_hash_table_insert (ptr_hash, el_class, result);
- mono_loader_unlock ();
-
return result;
}
@@ -1709,15 +1644,11 @@ mono_fnptr_class_get (MonoMethodSignature *sig)
MonoClass *result;
static GHashTable *ptr_hash = NULL;
- mono_loader_lock ();
-
if (!ptr_hash)
ptr_hash = g_hash_table_new (g_direct_hash, g_direct_equal);
- if ((result = g_hash_table_lookup (ptr_hash, sig))) {
- mono_loader_unlock ();
+ if ((result = g_hash_table_lookup (ptr_hash, sig)))
return result;
- }
result = g_new0 (MonoClass, 1);
result->parent = NULL; /* no parent for PTR types */
@@ -1739,8 +1670,6 @@ mono_fnptr_class_get (MonoMethodSignature *sig)
g_hash_table_insert (ptr_hash, sig, result);
- mono_loader_unlock ();
-
return result;
}
@@ -1865,15 +1794,11 @@ mono_array_class_get (MonoClass *eclass, guint32 rank)
image = eclass->image;
- mono_loader_lock ();
-
if ((rootlist = list = g_hash_table_lookup (image->array_cache, eclass))) {
for (; list; list = list->next) {
class = list->data;
- if (class->rank == rank) {
- mono_loader_unlock ();
+ if (class->rank == rank)
return class;
- }
}
}
@@ -1939,9 +1864,6 @@ mono_array_class_get (MonoClass *eclass, guint32 rank)
list = g_slist_append (rootlist, class);
g_hash_table_insert (image->array_cache, eclass, list);
-
- mono_loader_unlock ();
-
return class;
}
@@ -1953,7 +1875,8 @@ mono_array_class_get (MonoClass *eclass, guint32 rank)
*/
gint32
mono_class_instance_size (MonoClass *klass)
-{
+{
+
if (!klass->size_inited)
mono_class_init (klass);
@@ -1968,7 +1891,8 @@ mono_class_instance_size (MonoClass *klass)
*/
gint32
mono_class_min_align (MonoClass *klass)
-{
+{
+
if (!klass->size_inited)
mono_class_init (klass);
@@ -2010,7 +1934,8 @@ mono_class_value_size (MonoClass *klass, guint32 *align)
*/
gint32
mono_class_data_size (MonoClass *klass)
-{
+{
+
if (!klass->inited)
mono_class_init (klass);
@@ -2172,6 +2097,7 @@ load_file_for_image (MonoImage *image, int fileidx)
if (res->modules [i] && !res->modules [i]->assembly)
res->modules [i]->assembly = image->assembly;
}
+ mono_image_load_references (image, NULL);
}
g_free (name);
g_free (base_dir);
@@ -2204,7 +2130,7 @@ mono_class_from_name (MonoImage *image, const char* name_space, const char *name
{
GHashTable *nspace_table;
MonoImage *loaded_image;
- guint32 token = 0;
+ guint32 token;
MonoClass *class;
char *nested;
char buf [1024];
@@ -2220,16 +2146,9 @@ mono_class_from_name (MonoImage *image, const char* name_space, const char *name
name = buf;
}
- mono_loader_lock ();
-
nspace_table = g_hash_table_lookup (image->name_cache, name_space);
-
- if (nspace_table)
- token = GPOINTER_TO_UINT (g_hash_table_lookup (nspace_table, name));
-
- mono_loader_unlock ();
- if (!token) {
+ if (!nspace_table || !(token = GPOINTER_TO_UINT (g_hash_table_lookup (nspace_table, name)))) {
MonoTableInfo *t = &image->tables [MONO_TABLE_EXPORTEDTYPE];
guint32 cols [MONO_EXP_TYPE_SIZE];
int i;
@@ -2509,6 +2428,3 @@ mono_lookup_dynamic_token (MonoImage *image, guint32 token)
{
return lookup_dynamic (image, token);
}
-
-
-
diff --git a/mono/metadata/class.h b/mono/metadata/class.h
index 7f56f6e0c90..b41822f172a 100644
--- a/mono/metadata/class.h
+++ b/mono/metadata/class.h
@@ -225,9 +225,6 @@ typedef gpointer (*MonoTrampoline) (MonoMethod *method);
typedef gpointer (*MonoLookupDynamicToken) (MonoImage *image, guint32 token);
-void
-mono_classes_init (void);
-
MonoClass *
mono_class_get (MonoImage *image, guint32 type_token);
diff --git a/mono/metadata/domain.c b/mono/metadata/domain.c
index 1f1f1fcd5b5..c5880b748e8 100644
--- a/mono/metadata/domain.c
+++ b/mono/metadata/domain.c
@@ -20,17 +20,14 @@
#include <mono/metadata/assembly.h>
#include <mono/metadata/exception.h>
#include <mono/metadata/cil-coff.h>
-#include <mono/metadata/rawbuffer.h>
-static guint32 appdomain_thread_id = -1;
-static guint32 context_thread_id = -1;
+static guint32 appdomain_thread_id = 0;
+static guint32 context_thread_id = 0;
static gint32 appdomain_id_counter = 0;
static MonoGHashTable * appdomains_list = NULL;
-static CRITICAL_SECTION appdomains_mutex;
-
MonoDomain *mono_root_domain = NULL;
static MonoJitInfoTable *
@@ -71,11 +68,8 @@ MonoJitInfo *
mono_jit_info_table_find (MonoDomain *domain, char *addr)
{
MonoJitInfoTable *table = domain->jit_info_table;
- int left = 0, right;
-
- mono_domain_lock (domain);
+ int left = 0, right = table->len;
- right = table->len;
while (left < right) {
int pos = (left + right) / 2;
MonoJitInfo *ji = g_array_index (table, gpointer, pos);
@@ -86,14 +80,11 @@ mono_jit_info_table_find (MonoDomain *domain, char *addr)
right = pos;
else if (addr >= end)
left = pos + 1;
- else {
- mono_domain_unlock (domain);
+ else
return ji;
- }
}
- mono_domain_unlock (domain);
- /* maybe it is shared code, so we also search in the root domain */
+ /* maybe irt is shared code, so we also search in the root domain */
if (domain != mono_root_domain)
return mono_jit_info_table_find (mono_root_domain, addr);
@@ -105,13 +96,9 @@ mono_jit_info_table_add (MonoDomain *domain, MonoJitInfo *ji)
{
MonoJitInfoTable *table = domain->jit_info_table;
gpointer start = ji->code_start;
- int pos;
-
- mono_domain_lock (domain);
- pos = mono_jit_info_table_index (table, start);
+ int pos = mono_jit_info_table_index (table, start);
g_array_insert_val (table, pos, ji);
- mono_domain_unlock (domain);
}
static int
@@ -206,9 +193,7 @@ mono_domain_create (void)
InitializeCriticalSection (&domain->lock);
- EnterCriticalSection (&appdomains_mutex);
mono_g_hash_table_insert(appdomains_list, GINT_TO_POINTER(domain->domain_id), domain);
- LeaveCriticalSection (&appdomains_mutex);
return domain;
}
@@ -236,14 +221,6 @@ mono_init (const char *filename)
appdomain_thread_id = TlsAlloc ();
context_thread_id = TlsAlloc ();
- InitializeCriticalSection (&appdomains_mutex);
-
- mono_metadata_init ();
- mono_raw_buffer_init ();
- mono_images_init ();
- mono_assemblies_init ();
- mono_loader_init ();
-
// FIXME: When should we release this memory?
appdomains_list = mono_g_hash_table_new (g_direct_hash, g_direct_equal);
@@ -504,14 +481,6 @@ typedef struct {
} DomainInfo;
static void
-copy_hash_entry (gpointer key, gpointer data, gpointer user_data)
-{
- MonoGHashTable *dest = (MonoGHashTable*)user_data;
-
- mono_g_hash_table_insert (dest, key, data);
-}
-
-static void
foreach_domain (gpointer key, gpointer data, gpointer user_data)
{
DomainInfo *dom_info = user_data;
@@ -523,23 +492,10 @@ void
mono_domain_foreach (MonoDomainFunc func, gpointer user_data)
{
DomainInfo dom_info;
- MonoGHashTable *copy;
-
- /*
- * Create a copy of the hashtable to avoid calling the user callback
- * inside the lock because that could lead to deadlocks.
- * We can do this because this function is not perf. critical.
- */
- copy = mono_g_hash_table_new (NULL, NULL);
- EnterCriticalSection (&appdomains_mutex);
- mono_g_hash_table_foreach (appdomains_list, copy_hash_entry, copy);
- LeaveCriticalSection (&appdomains_mutex);
dom_info.func = func;
dom_info.user_data = user_data;
- mono_g_hash_table_foreach (copy, foreach_domain, &dom_info);
-
- mono_g_hash_table_destroy (copy);
+ mono_g_hash_table_foreach (appdomains_list, foreach_domain, &dom_info);
}
/**
@@ -554,12 +510,8 @@ mono_domain_assembly_open (MonoDomain *domain, const char *name)
{
MonoAssembly *ass;
- mono_domain_lock (domain);
- if ((ass = g_hash_table_lookup (domain->assemblies, name))) {
- mono_domain_unlock (domain);
+ if ((ass = g_hash_table_lookup (domain->assemblies, name)))
return ass;
- }
- mono_domain_unlock (domain);
if (!(ass = mono_assembly_open (name, NULL)))
return NULL;
@@ -587,9 +539,7 @@ mono_domain_unload (MonoDomain *domain, gboolean force)
return;
}
- EnterCriticalSection (&appdomains_mutex);
mono_g_hash_table_remove(appdomains_list, GINT_TO_POINTER(domain->domain_id));
- LeaveCriticalSection (&appdomains_mutex);
g_free (domain->friendly_name);
g_hash_table_foreach (domain->assemblies, remove_assembly, NULL);
@@ -634,11 +584,10 @@ mono_domain_get_by_id (gint32 domainid)
{
MonoDomain * domain;
- EnterCriticalSection (&appdomains_mutex);
- domain = mono_g_hash_table_lookup (appdomains_list, GINT_TO_POINTER(domainid));
- LeaveCriticalSection (&appdomains_mutex);
+ if ((domain = mono_g_hash_table_lookup(appdomains_list, GINT_TO_POINTER(domainid))))
+ return domain;
- return domain;
+ return NULL;
}
void
diff --git a/mono/metadata/icall.c b/mono/metadata/icall.c
index dfa00fd3241..81ab070ffcd 100644
--- a/mono/metadata/icall.c
+++ b/mono/metadata/icall.c
@@ -225,8 +225,6 @@ ves_icall_System_Array_SetValueImpl (MonoArray *this, MonoObject *value, guint32
}
if (!ec->valuetype) {
- if (!mono_object_isinst (value, ec))
- INVALID_CAST;
*ea = (gpointer)value;
return;
}
@@ -1075,10 +1073,22 @@ static MonoArray*
ves_icall_get_parameter_info (MonoMethod *method)
{
MonoDomain *domain = mono_domain_get ();
+ MonoArray *res;
+ static MonoClass *System_Reflection_ParameterInfo;
+ MonoReflectionParameter** args;
+ int i;
MONO_ARCH_SAVE_REGS;
- return mono_param_get_objects (domain, method);
+ args = mono_param_get_objects (domain, method);
+ if (!System_Reflection_ParameterInfo)
+ System_Reflection_ParameterInfo = mono_class_from_name (
+ mono_defaults.corlib, "System.Reflection", "ParameterInfo");
+ res = mono_array_new (domain, System_Reflection_ParameterInfo, method->signature->param_count);
+ for (i = 0; i < method->signature->param_count; ++i) {
+ mono_array_set (res, gpointer, i, args [i]);
+ }
+ return res;
}
static MonoReflectionType*
@@ -1560,7 +1570,7 @@ ves_icall_InternalInvoke (MonoReflectionMethod *method, MonoObject *this, MonoAr
if (!mono_object_isinst (this, m->klass))
mono_raise_exception (mono_exception_from_name (mono_defaults.corlib, "System.Reflection", "TargetException"));
m = mono_object_get_virtual_method (this, m);
- } else if (!(m->flags & METHOD_ATTRIBUTE_STATIC) && strcmp (m->name, ".ctor") && !m->wrapper_type)
+ } else if (!(m->flags & METHOD_ATTRIBUTE_STATIC) && strcmp (m->name, ".ctor"))
mono_raise_exception (mono_exception_from_name (mono_defaults.corlib, "System.Reflection", "TargetException"));
pcount = params? mono_array_length (params): 0;
diff --git a/mono/metadata/image.c b/mono/metadata/image.c
index 30c66f7ffd8..097ed1731c2 100644
--- a/mono/metadata/image.c
+++ b/mono/metadata/image.c
@@ -22,7 +22,6 @@
#include "private.h"
#include "tabledefs.h"
#include "tokentype.h"
-#include <mono/io-layer/io-layer.h>
#define INVALID_ADDRESS 0xffffffff
@@ -32,8 +31,6 @@
static GHashTable *loaded_images_hash;
static GHashTable *loaded_images_guid_hash;
-static CRITICAL_SECTION images_mutex;
-
guint32
mono_cli_rva_image_map (MonoCLIImageInfo *iinfo, guint32 addr)
{
@@ -70,20 +67,6 @@ mono_cli_rva_map (MonoCLIImageInfo *iinfo, guint32 addr)
}
/**
- * mono_images_init:
- *
- * Initialize the global variables used by this module.
- */
-void
-mono_images_init (void)
-{
- InitializeCriticalSection (&images_mutex);
-
- loaded_images_hash = g_hash_table_new (g_str_hash, g_str_equal);
- loaded_images_guid_hash = g_hash_table_new (g_str_hash, g_str_equal);
-}
-
-/**
* mono_image_ensure_section_idx:
* @image: The image we are operating on
* @section: section number that we will load/map into memory
@@ -504,7 +487,7 @@ mono_image_init (MonoImage *image)
image->remoting_invoke_cache = g_hash_table_new (g_direct_hash, g_direct_equal);
image->synchronized_cache = g_hash_table_new (g_direct_hash, g_direct_equal);
- image->generics_cache = g_hash_table_new ((GHashFunc)mono_metadata_type_hash, (GEqualFunc)mono_metadata_type_equal);
+ image->generics_cache = g_hash_table_new (mono_metadata_type_hash, mono_metadata_type_equal);
}
@@ -710,27 +693,19 @@ do_mono_image_open (const char *fname, MonoImageOpenStatus *status)
}
MonoImage *
-mono_image_loaded (const char *name)
-{
- MonoImage *res;
-
+mono_image_loaded (const char *name) {
if (strcmp (name, "mscorlib") == 0)
name = "corlib";
- EnterCriticalSection (&images_mutex);
- res = g_hash_table_lookup (loaded_images_hash, name);
- LeaveCriticalSection (&images_mutex);
- return res;
+ if (loaded_images_hash)
+ return g_hash_table_lookup (loaded_images_hash, name);
+ return NULL;
}
MonoImage *
-mono_image_loaded_by_guid (const char *guid)
-{
- MonoImage *res;
-
- EnterCriticalSection (&images_mutex);
- res = g_hash_table_lookup (loaded_images_guid_hash, guid);
- LeaveCriticalSection (&images_mutex);
- return res;
+mono_image_loaded_by_guid (const char *guid) {
+ if (loaded_images_guid_hash)
+ return g_hash_table_lookup (loaded_images_guid_hash, guid);
+ return NULL;
}
MonoImage *
@@ -779,43 +754,31 @@ mono_image_open_from_data (char *data, guint32 data_len, gboolean need_copy, Mon
MonoImage *
mono_image_open (const char *fname, MonoImageOpenStatus *status)
{
- MonoImage *image, *image2;
+ MonoImage *image;
g_return_val_if_fail (fname != NULL, NULL);
- /*
- * The easiest solution would be to do all the loading inside the mutex,
- * but that would lead to scalability problems. So we let the loading
- * happen outside the mutex, and if multiple threads happen to load
- * the same image, we discard all but the first copy.
- */
- EnterCriticalSection (&images_mutex);
- image = g_hash_table_lookup (loaded_images_hash, fname);
- if (image){
- image->ref_count++;
- LeaveCriticalSection (&images_mutex);
- return image;
+ if (loaded_images_hash){
+ image = g_hash_table_lookup (loaded_images_hash, fname);
+ if (image){
+ image->ref_count++;
+ return image;
+ }
}
- LeaveCriticalSection (&images_mutex);
image = do_mono_image_open (fname, status);
if (image == NULL)
return NULL;
- EnterCriticalSection (&images_mutex);
- image2 = g_hash_table_lookup (loaded_images_hash, fname);
- if (image2) {
- /* Somebody else beat us to it */
- LeaveCriticalSection (&images_mutex);
- mono_image_close (image);
-
- return image2;
- }
+ if (!loaded_images_hash)
+ loaded_images_hash = g_hash_table_new (g_str_hash, g_str_equal);
g_hash_table_insert (loaded_images_hash, image->name, image);
if (image->assembly_name)
- g_hash_table_insert (loaded_images_hash, (char *) image->assembly_name, image);
+ g_hash_table_insert (loaded_images_hash, (char *) image->assembly_name, image);
+
+ if (!loaded_images_guid_hash)
+ loaded_images_guid_hash = g_hash_table_new (g_str_hash, g_str_equal);
g_hash_table_insert (loaded_images_guid_hash, image->guid, image);
- LeaveCriticalSection (&images_mutex);
return image;
}
@@ -836,25 +799,15 @@ free_hash_table(gpointer key, gpointer val, gpointer user_data)
void
mono_image_close (MonoImage *image)
{
- MonoImage *image2;
-
g_return_if_fail (image != NULL);
- EnterCriticalSection (&images_mutex);
- if (--image->ref_count) {
- LeaveCriticalSection (&images_mutex);
+ if (--image->ref_count)
return;
- }
- image2 = g_hash_table_lookup (loaded_images_hash, image->name);
- if (image == image2) {
- /* This is not true if we are called from mono_image_open () */
- g_hash_table_remove (loaded_images_hash, image->name);
- if (image->assembly_name)
- g_hash_table_remove (loaded_images_hash, (char *) image->assembly_name);
- g_hash_table_remove (loaded_images_guid_hash, image->guid);
- }
- LeaveCriticalSection (&images_mutex);
+ if (!loaded_images_hash)
+ loaded_images_hash = g_hash_table_new (g_str_hash, g_str_equal);
+ g_hash_table_remove (loaded_images_hash, image->name);
+
if (image->f)
fclose (image->f);
if (image->raw_data_allocated)
diff --git a/mono/metadata/image.h b/mono/metadata/image.h
index 2357e49adfd..4cbfe5f4670 100644
--- a/mono/metadata/image.h
+++ b/mono/metadata/image.h
@@ -141,8 +141,6 @@ typedef enum {
MONO_IMAGE_IMAGE_INVALID
} MonoImageOpenStatus;
-void mono_images_init (void);
-
MonoImage *mono_image_open (const char *fname,
MonoImageOpenStatus *status);
MonoImage *mono_image_open_from_data (char *data, guint32 data_len, gboolean need_copy,
@@ -161,6 +159,8 @@ int mono_image_ensure_section_idx (MonoImage *image,
guint32 mono_image_get_entry_point (MonoImage *image);
const char *mono_image_get_resource (MonoImage *image, guint32 offset, guint32 *size);
+void mono_image_load_references (MonoImage *image, MonoImageOpenStatus *status);
+
/* This actually returns a MonoPEResourceDataEntry *, but declaring it
* causes an include file loop.
*/
diff --git a/mono/metadata/loader.c b/mono/metadata/loader.c
index 14171a70675..5fd49838a0b 100644
--- a/mono/metadata/loader.c
+++ b/mono/metadata/loader.c
@@ -37,29 +37,17 @@ static gboolean dummy_icall = TRUE;
MonoDefaults mono_defaults;
-CRITICAL_SECTION loader_mutex;
-
static GHashTable *icall_hash = NULL;
void
-mono_loader_init ()
-{
- InitializeCriticalSection (&loader_mutex);
-}
-
-void
mono_add_internal_call (const char *name, gconstpointer method)
{
- mono_loader_lock ();
-
if (!icall_hash) {
dummy_icall = FALSE;
icall_hash = g_hash_table_new (g_str_hash , g_str_equal);
}
g_hash_table_insert (icall_hash, g_strdup (name), (gpointer) method);
-
- mono_loader_unlock ();
}
static void
@@ -88,8 +76,6 @@ mono_lookup_internal_call (MonoMethod *method)
g_assert_not_reached ();
}
- mono_loader_lock ();
-
if (*method->klass->name_space)
name = g_strconcat (method->klass->name_space, ".", method->klass->name, "::", method->name, NULL);
else
@@ -115,16 +101,12 @@ mono_lookup_internal_call (MonoMethod *method)
g_free (name);
g_free (tmpsig);
- mono_loader_unlock ();
-
return NULL;
}
g_free(tmpsig);
}
- mono_loader_unlock ();
-
g_free (name);
return res;
@@ -466,14 +448,9 @@ mono_dllmap_lookup (const char *dll, const char* func, const char **rdll, const
if (!dll_map)
return 0;
-
- mono_loader_lock ();
-
map = g_hash_table_lookup (dll_map, dll);
- if (!map) {
- mono_loader_unlock ();
+ if (!map)
return 0;
- }
*rdll = map->target? map->target: dll;
for (tmp = map->next; tmp; tmp = tmp->next) {
@@ -481,12 +458,10 @@ mono_dllmap_lookup (const char *dll, const char* func, const char **rdll, const
*rfunc = tmp->name;
if (tmp->dll)
*rdll = tmp->dll;
- mono_loader_unlock ();
return 1;
}
}
*rfunc = func;
- mono_loader_unlock ();
return 1;
}
@@ -494,8 +469,6 @@ void
mono_dllmap_insert (const char *dll, const char *func, const char *tdll, const char *tfunc) {
MonoDllMap *map, *entry;
- mono_loader_lock ();
-
if (!dll_map)
dll_map = g_hash_table_new (g_str_hash, g_str_equal);
@@ -517,8 +490,6 @@ mono_dllmap_insert (const char *dll, const char *func, const char *tdll, const c
entry->next = map->next;
map->next = entry;
}
-
- mono_loader_unlock ();
}
gpointer
@@ -610,8 +581,8 @@ mono_lookup_pinvoke_call (MonoMethod *method)
return method->addr;
}
-static MonoMethod *
-mono_get_method_from_token (MonoImage *image, guint32 token, MonoClass *klass)
+MonoMethod *
+mono_get_method (MonoImage *image, guint32 token, MonoClass *klass)
{
MonoMethod *result;
int table = mono_metadata_token_table (token);
@@ -621,6 +592,9 @@ mono_get_method_from_token (MonoImage *image, guint32 token, MonoClass *klass)
int size;
guint32 cols [MONO_TYPEDEF_SIZE];
+ if ((result = g_hash_table_lookup (image->method_cache, GINT_TO_POINTER (token))))
+ return result;
+
if (image->assembly->dynamic)
return mono_lookup_dynamic_token (image, token);
@@ -639,7 +613,7 @@ mono_get_method_from_token (MonoImage *image, guint32 token, MonoClass *klass)
g_print("got wrong token: 0x%08x\n", token);
g_assert (table == MONO_TABLE_MEMBERREF);
result = method_from_memberref (image, idx);
-
+ g_hash_table_insert (image->method_cache, GINT_TO_POINTER (token), result);
return result;
}
@@ -717,29 +691,8 @@ mono_get_method_from_token (MonoImage *image, guint32 token, MonoClass *klass)
}
}
- return result;
-}
-
-MonoMethod *
-mono_get_method (MonoImage *image, guint32 token, MonoClass *klass)
-{
- MonoMethod *result;
-
- /* We do everything inside the lock to prevent creation races */
-
- mono_loader_lock ();
-
- if ((result = g_hash_table_lookup (image->method_cache, GINT_TO_POINTER (token)))) {
- mono_loader_unlock ();
- return result;
- }
-
- result = mono_get_method_from_token (image, token, klass);
-
g_hash_table_insert (image->method_cache, GINT_TO_POINTER (token), result);
- mono_loader_unlock ();
-
return result;
}
@@ -808,20 +761,6 @@ mono_method_get_marshal_info (MonoMethod *method, MonoMarshalSpec **mspecs)
for (i = 0; i < method->signature->param_count + 1; ++i)
mspecs [i] = NULL;
- if (method->klass->image->assembly->dynamic) {
- MonoMarshalSpec **dyn_specs = mono_g_hash_table_lookup (
- ((MonoDynamicAssembly*)method->klass->image->assembly->dynamic)->param_marshalling,
- method);
- if (dyn_specs) {
- for (i = 0; i < method->signature->param_count + 1; ++i)
- if (dyn_specs [i]) {
- mspecs [i] = g_new0 (MonoMarshalSpec, 1);
- memcpy (mspecs [i], dyn_specs [i], sizeof (MonoMarshalSpec));
- }
- }
- return;
- }
-
mono_class_init (klass);
methodt = &klass->image->tables [MONO_TABLE_METHOD];
@@ -854,54 +793,6 @@ mono_method_get_marshal_info (MonoMethod *method, MonoMarshalSpec **mspecs)
}
}
-gboolean
-mono_method_has_marshal_info (MonoMethod *method)
-{
- int i, lastp;
- MonoClass *klass = method->klass;
- MonoTableInfo *methodt;
- MonoTableInfo *paramt;
-
- if (method->klass->image->assembly->dynamic) {
- MonoMarshalSpec **dyn_specs = mono_g_hash_table_lookup (
- ((MonoDynamicAssembly*)method->klass->image->assembly->dynamic)->param_marshalling,
- method);
- if (dyn_specs) {
- for (i = 0; i < method->signature->param_count + 1; ++i)
- if (dyn_specs [i])
- return TRUE;
- }
- return FALSE;
- }
-
- mono_class_init (klass);
-
- methodt = &klass->image->tables [MONO_TABLE_METHOD];
- paramt = &klass->image->tables [MONO_TABLE_PARAM];
-
- for (i = 0; i < klass->method.count; ++i) {
- if (method == klass->methods [i]) {
- guint32 idx = klass->method.first + i;
- guint32 cols [MONO_PARAM_SIZE];
- guint param_index = mono_metadata_decode_row_col (methodt, idx, MONO_METHOD_PARAMLIST);
-
- if (idx + 1 < methodt->rows)
- lastp = mono_metadata_decode_row_col (methodt, idx + 1, MONO_METHOD_PARAMLIST);
- else
- lastp = paramt->rows + 1;
-
- for (i = param_index; i < lastp; ++i) {
- mono_metadata_decode_row (paramt, i -1, cols, MONO_PARAM_SIZE);
-
- if (cols [MONO_PARAM_FLAGS] & PARAM_ATTRIBUTE_HAS_FIELD_MARSHAL)
- return TRUE;
- }
- return FALSE;
- }
- }
- return FALSE;
-}
-
gpointer
mono_method_get_wrapper_data (MonoMethod *method, guint32 id)
{
diff --git a/mono/metadata/loader.h b/mono/metadata/loader.h
index f44d1be13f9..5b69cc2a964 100644
--- a/mono/metadata/loader.h
+++ b/mono/metadata/loader.h
@@ -3,7 +3,6 @@
#include <mono/metadata/metadata.h>
#include <mono/metadata/image.h>
-#include <mono/io-layer/io-layer.h>
typedef enum {
MONO_WRAPPER_NONE,
@@ -36,7 +35,7 @@ typedef struct {
/* this is used by the inlining algorithm */
unsigned int inline_info:1;
unsigned int uses_this:1;
- unsigned int wrapper_type:4;
+ MonoWrapperType wrapper_type:4;
unsigned int string_ctor:1;
unsigned int save_lmf:1;
gint16 inline_count;
@@ -114,21 +113,9 @@ typedef struct {
extern MonoDefaults mono_defaults;
-/*
- * This lock protects the hash tables inside MonoImage used by the metadata
- * loading functions in class.c and loader.c.
- */
-extern CRITICAL_SECTION loader_mutex;
-
-#define mono_loader_lock() EnterCriticalSection (&loader_mutex);
-#define mono_loader_unlock() LeaveCriticalSection (&loader_mutex);
-
typedef gboolean (*MonoStackWalk) (MonoMethod *method, gint32 native_offset, gint32 il_offset, gboolean managed, gpointer data);
typedef void (*MonoStackWalkImpl) (MonoStackWalk func, gpointer user_data);
-void
-mono_loader_init (void);
-
void
mono_init_icall (void);
@@ -165,9 +152,6 @@ mono_method_get_param_names (MonoMethod *method, const char **names);
void
mono_method_get_marshal_info (MonoMethod *method, MonoMarshalSpec **mspecs);
-gboolean
-mono_method_has_marshal_info (MonoMethod *method);
-
gpointer
mono_method_get_wrapper_data (MonoMethod *method, guint32 id);
diff --git a/mono/metadata/marshal.c b/mono/metadata/marshal.c
index a38e95fac12..20115dc19f7 100644
--- a/mono/metadata/marshal.c
+++ b/mono/metadata/marshal.c
@@ -76,15 +76,6 @@ static MonoDisHelper marshal_dh = {
};
#endif
-/* This mutex protects the various marshalling related caches in MonoImage */
-static CRITICAL_SECTION marshal_mutex;
-
-void
-mono_marshal_init (void)
-{
- InitializeCriticalSection (&marshal_mutex);
-}
-
gpointer
mono_delegate_to_ftnptr (MonoDelegate *delegate)
{
@@ -417,7 +408,7 @@ mono_mb_emit_i2 (MonoMethodBuilder *mb, gint16 data)
void
mono_mb_emit_ldstr (MonoMethodBuilder *mb, char *str)
{
- mono_mb_emit_byte (mb, CEE_LDSTR);
+ mono_mb_emit_byte (mb, CEE_LDSTR);
mono_mb_emit_i4 (mb, mono_mb_add_data (mb, str));
}
@@ -761,10 +752,10 @@ emit_str_to_ptr_conv (MonoMethodBuilder *mb, MonoType *type, MonoMarshalConv con
g_assert_not_reached ();
}
- if (eclass->valuetype)
- esize = mono_class_native_size (eclass, NULL);
- else
- esize = sizeof (gpointer);
+ if (eclass->valuetype)
+ esize = mono_class_native_size (eclass, NULL);
+ else
+ esize = sizeof (gpointer);
if (!usize)
break;
@@ -981,32 +972,6 @@ mono_delegate_begin_invoke (MonoDelegate *delegate, gpointer *params)
g_assert (delegate);
- if (delegate->target && mono_object_class (delegate->target) == mono_defaults.transparent_proxy_class) {
-
- MonoTransparentProxy* tp = (MonoTransparentProxy *)delegate->target;
- if (!tp->klass->contextbound || tp->rp->context != (MonoObject *) mono_context_get ()) {
-
- // If the target is a proxy, make a direct call. Is proxy's work
- // to make the call asynchronous.
-
- MonoAsyncResult *ares;
- MonoObject *exc;
- MonoArray *out_args;
- HANDLE handle;
- method = delegate->method_info->method;
-
- msg = mono_method_call_message_new (method, params, NULL, &async_callback, &state);
- handle = CreateEvent (NULL, TRUE, FALSE, NULL);
- ares = mono_async_result_new (mono_domain_get (), handle, state, handle);
- ares->async_delegate = (MonoObject *)async_callback;
- msg->async_result = ares;
- msg->call_type = CallType_BeginInvoke;
-
- mono_remoting_invoke ((MonoObject *)tp->rp, msg, &exc, &out_args);
- return ares;
- }
- }
-
klass = delegate->object.vtable->klass;
method = mono_get_delegate_invoke (klass);
@@ -1021,6 +986,7 @@ mono_delegate_begin_invoke (MonoDelegate *delegate, gpointer *params)
g_assert (method != NULL);
im = mono_get_delegate_invoke (method->klass);
+
msg = mono_method_call_message_new (method, params, im, &async_callback, &state);
return mono_thread_pool_add ((MonoObject *)delegate, msg, async_callback, state);
@@ -1091,40 +1057,6 @@ mono_signature_to_name (MonoMethodSignature *sig, const char *prefix)
return result;
}
-static inline MonoMethod*
-mono_marshal_find_in_cache (GHashTable *cache, gpointer key)
-{
- MonoMethod *res;
-
- EnterCriticalSection (&marshal_mutex);
- res = g_hash_table_lookup (cache, key);
- LeaveCriticalSection (&marshal_mutex);
- return res;
-}
-
-/* Create the method from the builder and place it in the cache */
-static inline MonoMethod*
-mono_mb_create_and_cache (GHashTable *cache, gpointer key,
- MonoMethodBuilder *mb, MonoMethodSignature *sig,
- int max_stack)
-{
- MonoMethod *res;
-
- EnterCriticalSection (&marshal_mutex);
- res = g_hash_table_lookup (cache, key);
- if (!res) {
- /* This does not acquire any locks */
- res = mono_mb_create_method (mb, sig, max_stack);
- g_hash_table_insert (cache, key, res);
- }
- else
- /* Somebody created it before us */
- ;
- LeaveCriticalSection (&marshal_mutex);
-
- return res;
-}
-
MonoMethod *
mono_marshal_get_delegate_begin_invoke (MonoMethod *method)
{
@@ -1142,7 +1074,7 @@ mono_marshal_get_delegate_begin_invoke (MonoMethod *method)
sig = method->signature;
cache = method->klass->image->delegate_begin_invoke_cache;
- if ((res = mono_marshal_find_in_cache (cache, sig)))
+ if ((res = (MonoMethod *)g_hash_table_lookup (cache, sig)))
return res;
g_assert (sig->hasthis);
@@ -1171,8 +1103,9 @@ mono_marshal_get_delegate_begin_invoke (MonoMethod *method)
mono_mb_emit_native_call (mb, csig, mono_delegate_begin_invoke);
mono_mb_emit_byte (mb, CEE_RET);
- res = mono_mb_create_and_cache (cache, sig, mb, sig, sig->param_count + 16);
+ res = mono_mb_create_method (mb, sig, sig->param_count + 16);
mono_mb_free (mb);
+ g_hash_table_insert (cache, sig, res);
return res;
}
@@ -1213,16 +1146,7 @@ mono_delegate_end_invoke (MonoDelegate *delegate, gpointer *params)
ares = mono_array_get (msg->args, gpointer, sig->param_count - 1);
g_assert (ares);
- if (delegate->target && mono_object_class (delegate->target) == mono_defaults.transparent_proxy_class) {
- MonoTransparentProxy* tp = (MonoTransparentProxy *)delegate->target;
- msg = (MonoMethodMessage *)mono_object_new (domain, mono_defaults.mono_method_message_class);
- mono_message_init (domain, msg, delegate->method_info, NULL);
- msg->call_type = CallType_EndInvoke;
- msg->async_result = ares;
- res = mono_remoting_invoke ((MonoObject *)tp->rp, msg, &exc, &out_args);
- }
- else
- res = mono_thread_pool_finish (ares, &out_args, &exc);
+ res = mono_thread_pool_finish (ares, &out_args, &exc);
if (exc) {
char *strace = mono_string_to_utf8 (((MonoException*)exc)->stack_trace);
@@ -1346,7 +1270,7 @@ mono_marshal_get_delegate_end_invoke (MonoMethod *method)
sig = method->signature;
cache = method->klass->image->delegate_end_invoke_cache;
- if ((res = mono_marshal_find_in_cache (cache, sig)))
+ if ((res = (MonoMethod *)g_hash_table_lookup (cache, sig)))
return res;
g_assert (sig->hasthis);
@@ -1380,9 +1304,9 @@ mono_marshal_get_delegate_end_invoke (MonoMethod *method)
} else
mono_mb_emit_restore_result (mb, sig->ret);
- res = mono_mb_create_and_cache (cache, sig,
- mb, sig, sig->param_count + 16);
+ res = mono_mb_create_method (mb, sig, sig->param_count + 16);
mono_mb_free (mb);
+ g_hash_table_insert (cache, sig, res);
return res;
}
@@ -1459,7 +1383,7 @@ mono_marshal_get_remoting_invoke (MonoMethod *method)
return method;
cache = method->klass->image->remoting_invoke_cache;
- if ((res = mono_marshal_find_in_cache (cache, method)))
+ if ((res = (MonoMethod *)g_hash_table_lookup (cache, method)))
return res;
if (!csig) {
@@ -1488,9 +1412,9 @@ mono_marshal_get_remoting_invoke (MonoMethod *method)
mono_mb_emit_restore_result (mb, sig->ret);
}
- res = mono_mb_create_and_cache (cache, method, mb, sig, sig->param_count + 16);
+ res = mono_mb_create_method (mb, sig, sig->param_count + 16);
mono_mb_free (mb);
-
+ g_hash_table_insert (cache, method, res);
return res;
}
@@ -1514,7 +1438,7 @@ mono_marshal_get_remoting_invoke_with_check (MonoMethod *method)
g_assert (sig->hasthis);
cache = method->klass->image->remoting_invoke_cache;
- if ((res = mono_marshal_find_in_cache (cache, (char *)method + 1)))
+ if ((res = (MonoMethod *)g_hash_table_lookup (cache, (char *)method + 1)))
return res;
mb = mono_mb_new (method->klass, method->name, MONO_WRAPPER_REMOTING_INVOKE_WITH_CHECK);
@@ -1538,10 +1462,9 @@ mono_marshal_get_remoting_invoke_with_check (MonoMethod *method)
mono_mb_emit_managed_call (mb, method, method->signature);
mono_mb_emit_byte (mb, CEE_RET);
- res = mono_mb_create_and_cache (cache, (char*)method + 1,
- mb, sig, sig->param_count + 16);
+ res = mono_mb_create_method (mb, sig, sig->param_count + 16);
mono_mb_free (mb);
-
+ g_hash_table_insert (cache, (char *)method + 1, res);
return res;
}
@@ -1565,7 +1488,7 @@ mono_marshal_get_delegate_invoke (MonoMethod *method)
sig = method->signature;
cache = method->klass->image->delegate_invoke_cache;
- if ((res = mono_marshal_find_in_cache (cache, sig)))
+ if ((res = (MonoMethod *)g_hash_table_lookup (cache, sig)))
return res;
sigsize = sizeof (MonoMethodSignature) + sig->param_count * sizeof (MonoType *);
@@ -1652,10 +1575,11 @@ mono_marshal_get_delegate_invoke (MonoMethod *method)
mono_mb_patch_addr (mb, pos1, mb->pos - (pos1 + 4));
mono_mb_emit_byte (mb, CEE_RET);
- res = mono_mb_create_and_cache (cache, sig,
- mb, sig, sig->param_count + 16);
+ res = mono_mb_create_method (mb, sig, sig->param_count + 16);
mono_mb_free (mb);
+ g_hash_table_insert (cache, sig, res);
+
return res;
}
@@ -1680,7 +1604,7 @@ mono_marshal_get_runtime_invoke (MonoMethod *method)
g_assert (method);
cache = method->klass->image->runtime_invoke_cache;
- if ((res = mono_marshal_find_in_cache (cache, method)))
+ if ((res = (MonoMethod *)g_hash_table_lookup (cache, method)))
return res;
/* to make it work with our special string constructors */
@@ -1893,14 +1817,15 @@ handle_enum:
mono_mb_emit_ldloc (mb, 0);
mono_mb_emit_byte (mb, CEE_RET);
- res = mono_mb_create_and_cache (cache, method,
- mb, csig, sig->param_count + 16);
+ res = mono_mb_create_method (mb, csig, sig->param_count + 16);
mono_mb_free (mb);
header = ((MonoMethodNormal *)res)->header;
header->num_clauses = 1;
header->clauses = clause;
+ g_hash_table_insert (cache, method, res);
+
return res;
}
@@ -1921,7 +1846,7 @@ mono_marshal_get_managed_wrapper (MonoMethod *method, MonoObject *this, MonoMars
g_assert (!method->signature->pinvoke);
cache = method->klass->image->managed_wrapper_cache;
- if (!this && (res = mono_marshal_find_in_cache (cache, method)))
+ if (!this && (res = (MonoMethod *)g_hash_table_lookup (cache, method)))
return res;
if (this) {
@@ -2207,13 +2132,12 @@ mono_marshal_get_managed_wrapper (MonoMethod *method, MonoObject *this, MonoMars
mono_mb_emit_byte (mb, CEE_RET);
}
- if (!this)
- res = mono_mb_create_and_cache (cache, method,
- mb, csig, sig->param_count + 16);
- else
- res = mono_mb_create_method (mb, csig, sig->param_count + 16);
+ res = mono_mb_create_method (mb, csig, sig->param_count + 16);
mono_mb_free (mb);
+ if (!this)
+ g_hash_table_insert (cache, method, res);
+
return res;
}
@@ -2236,6 +2160,10 @@ mono_marshal_get_ldfld_wrapper (MonoType *type)
char *name;
int t, pos0, pos1;
+ if (!ldfld_hash)
+ ldfld_hash = g_hash_table_new (NULL, NULL);
+
+
t = type->type;
if (!type->byref) {
@@ -2259,12 +2187,7 @@ mono_marshal_get_ldfld_wrapper (MonoType *type)
klass = mono_defaults.int_class;
}
- EnterCriticalSection (&marshal_mutex);
- if (!ldfld_hash)
- ldfld_hash = g_hash_table_new (NULL, NULL);
- res = g_hash_table_lookup (ldfld_hash, klass);
- LeaveCriticalSection (&marshal_mutex);
- if (res)
+ if ((res = g_hash_table_lookup (ldfld_hash, klass)))
return res;
name = g_strdup_printf ("__ldfld_wrapper_%s.%s", klass->name_space, klass->name);
@@ -2366,10 +2289,11 @@ mono_marshal_get_ldfld_wrapper (MonoType *type)
mono_mb_emit_byte (mb, CEE_RET);
- res = mono_mb_create_and_cache (ldfld_hash, klass,
- mb, sig, sig->param_count + 16);
+ res = mono_mb_create_method (mb, sig, sig->param_count + 16);
mono_mb_free (mb);
+ g_hash_table_insert (ldfld_hash, klass, res);
+
return res;
}
@@ -2392,6 +2316,9 @@ mono_marshal_get_stfld_wrapper (MonoType *type)
char *name;
int t, pos;
+ if (!stfld_hash)
+ stfld_hash = g_hash_table_new (NULL, NULL);
+
t = type->type;
if (!type->byref) {
@@ -2415,12 +2342,7 @@ mono_marshal_get_stfld_wrapper (MonoType *type)
klass = mono_defaults.int_class;
}
- EnterCriticalSection (&marshal_mutex);
- if (!stfld_hash)
- stfld_hash = g_hash_table_new (NULL, NULL);
- res = g_hash_table_lookup (stfld_hash, klass);
- LeaveCriticalSection (&marshal_mutex);
- if (res)
+ if ((res = g_hash_table_lookup (stfld_hash, klass)))
return res;
name = g_strdup_printf ("__stfld_wrapper_%s.%s", klass->name_space, klass->name);
@@ -2519,10 +2441,11 @@ mono_marshal_get_stfld_wrapper (MonoType *type)
mono_mb_emit_byte (mb, CEE_RET);
- res = mono_mb_create_and_cache (stfld_hash, klass,
- mb, sig, sig->param_count + 16);
+ res = mono_mb_create_method (mb, sig, sig->param_count + 16);
mono_mb_free (mb);
+ g_hash_table_insert (stfld_hash, klass, res);
+
return res;
}
@@ -2568,7 +2491,7 @@ mono_marshal_get_icall_wrapper (MonoMethodSignature *sig, const char *name, gcon
/*
* generates IL code for the pinvoke wrapper (the generated method
- * calls the unmanaged code in method->addr)
+ * calls the unamnage code in method->addr)
*/
MonoMethod *
mono_marshal_get_native_wrapper (MonoMethod *method)
@@ -2588,7 +2511,7 @@ mono_marshal_get_native_wrapper (MonoMethod *method)
g_assert (method->signature->pinvoke);
cache = method->klass->image->native_wrapper_cache;
- if ((res = mono_marshal_find_in_cache (cache, method)))
+ if ((res = (MonoMethod *)g_hash_table_lookup (cache, method)))
return res;
sig = method->signature;
@@ -2611,9 +2534,9 @@ mono_marshal_get_native_wrapper (MonoMethod *method)
mono_mb_emit_exception (mb);
csig = g_memdup (sig, sigsize);
csig->pinvoke = 0;
- res = mono_mb_create_and_cache (cache, method,
- mb, csig, csig->param_count + 16);
+ res = mono_mb_create_method (mb, csig, csig->param_count + 16);
mono_mb_free (mb);
+ g_hash_table_insert (cache, method, res);
return res;
}
@@ -2640,9 +2563,9 @@ mono_marshal_get_native_wrapper (MonoMethod *method)
csig = g_memdup (csig, sigsize);
csig->pinvoke = 0;
- res = mono_mb_create_and_cache (cache, method,
- mb, csig, csig->param_count + 16);
+ res = mono_mb_create_method (mb, csig, csig->param_count + 16);
mono_mb_free (mb);
+ g_hash_table_insert (cache, method, res);
return res;
}
@@ -3314,10 +3237,11 @@ mono_marshal_get_native_wrapper (MonoMethod *method)
csig = g_memdup (sig, sigsize);
csig->pinvoke = 0;
- res = mono_mb_create_and_cache (cache, method,
- mb, csig, csig->param_count + 16);
+ res = mono_mb_create_method (mb, csig, csig->param_count + 16);
mono_mb_free (mb);
+ g_hash_table_insert (cache, method, res);
+
for (i = sig->param_count; i >= 0; i--)
g_free (mspecs [i]);
g_free (mspecs);
@@ -3476,7 +3400,7 @@ mono_marshal_get_synchronized_wrapper (MonoMethod *method)
return method;
cache = method->klass->image->synchronized_cache;
- if ((res = mono_marshal_find_in_cache (cache, method)))
+ if ((res = (MonoMethod *)g_hash_table_lookup (cache, method)))
return res;
sig = method->signature;
@@ -3561,14 +3485,15 @@ mono_marshal_get_synchronized_wrapper (MonoMethod *method)
mono_mb_emit_ldloc (mb, ret_local);
mono_mb_emit_byte (mb, CEE_RET);
- res = mono_mb_create_and_cache (cache, method,
- mb, sig, sig->param_count + 16);
+ res = mono_mb_create_method (mb, sig, sig->param_count + 16);
mono_mb_free (mb);
header = ((MonoMethodNormal *)res)->header;
header->num_clauses = 1;
header->clauses = clause;
+ g_hash_table_insert (cache, method, res);
+
return res;
}
@@ -4082,12 +4007,6 @@ mono_marshal_load_type_info (MonoClass* klass)
info->fields [j].field = &klass->fields [i];
- if ((klass->field.count == 1) && (klass->instance_size == sizeof (MonoObject)) &&
- (strcmp (klass->fields [i].name, "$PRIVATE$") == 0)) {
- /* This field is a hack inserted by MCS to empty structures */
- continue;
- }
-
switch (layout) {
case TYPE_ATTRIBUTE_AUTO_LAYOUT:
case TYPE_ATTRIBUTE_SEQUENTIAL_LAYOUT:
diff --git a/mono/metadata/marshal.h b/mono/metadata/marshal.h
index 943e6b3508d..da3597d8d71 100644
--- a/mono/metadata/marshal.h
+++ b/mono/metadata/marshal.h
@@ -21,9 +21,6 @@ typedef struct _MonoMethodBuilder MonoMethodBuilder;
/* marshaling helper functions */
-void
-mono_marshal_init (void);
-
gint32
mono_class_native_size (MonoClass *klass, guint32 *align);
diff --git a/mono/metadata/metadata.c b/mono/metadata/metadata.c
index c7faf84224a..31f3ac2fc24 100644
--- a/mono/metadata/metadata.c
+++ b/mono/metadata/metadata.c
@@ -1165,22 +1165,6 @@ mono_type_equal (gconstpointer ka, gconstpointer kb)
return 1;
}
-/**
- * mono_metadata_init:
- *
- * Initialize the global variables of this module.
- */
-void
-mono_metadata_init (void)
-{
- int i;
-
- type_cache = g_hash_table_new (mono_type_hash, mono_type_equal);
-
- for (i = 0; i < NBUILTIN_TYPES (); ++i)
- g_hash_table_insert (type_cache, &builtin_types [i], &builtin_types [i]);
-}
-
/*
* mono_metadata_parse_type:
* @m: metadata context
@@ -1202,6 +1186,14 @@ mono_metadata_parse_type (MonoImage *m, MonoParseTypeMode mode, short opt_attrs,
{
MonoType *type, *cached;
+ if (!type_cache) {
+ int i;
+ type_cache = g_hash_table_new (mono_type_hash, mono_type_equal);
+
+ for (i = 0; i < NBUILTIN_TYPES (); ++i)
+ g_hash_table_insert (type_cache, &builtin_types [i], &builtin_types [i]);
+ }
+
switch (mode) {
case MONO_PARSE_MOD_TYPE:
case MONO_PARSE_PARAM:
@@ -1261,8 +1253,6 @@ mono_metadata_parse_type (MonoImage *m, MonoParseTypeMode mode, short opt_attrs,
}
if (rptr)
*rptr = ptr;
-
- /* No need to use locking since nobody is modifying the hash table */
if (mode != MONO_PARSE_PARAM && !type->num_mods && (cached = g_hash_table_lookup (type_cache, type))) {
mono_metadata_free_type (type);
return cached;
diff --git a/mono/metadata/metadata.h b/mono/metadata/metadata.h
index 0afd373f60c..78dc7e13ad3 100644
--- a/mono/metadata/metadata.h
+++ b/mono/metadata/metadata.h
@@ -171,7 +171,6 @@ typedef struct {
} data;
} MonoMarshalSpec;
-void mono_metadata_init (void);
void mono_metadata_decode_row (MonoTableInfo *t,
int idx,
diff --git a/mono/metadata/object.c b/mono/metadata/object.c
index c6356ee8fa4..d99fe80e0e0 100644
--- a/mono/metadata/object.c
+++ b/mono/metadata/object.c
@@ -29,6 +29,8 @@
#include "mono/metadata/profiler-private.h"
#include <mono/os/gc_wrapper.h>
+CRITICAL_SECTION *metadata_section = NULL;
+
/*
* Enable experimental typed allocation using the GC_gcj_malloc function.
*/
@@ -92,10 +94,12 @@ mono_runtime_class_init (MonoVTable *vtable)
}
if (found) {
+ EnterCriticalSection (metadata_section);
mono_domain_lock (vtable->domain);
/* double check... */
if (vtable->initialized || vtable->initializing) {
mono_domain_unlock (vtable->domain);
+ LeaveCriticalSection (metadata_section);
return;
}
vtable->initializing = 1;
@@ -104,6 +108,7 @@ mono_runtime_class_init (MonoVTable *vtable)
vtable->initializing = 0;
/* FIXME: if the cctor fails, the type must be marked as unusable */
mono_domain_unlock (vtable->domain);
+ LeaveCriticalSection (metadata_section);
} else {
vtable->initialized = 1;
return;
@@ -534,15 +539,12 @@ mono_class_vtable (MonoDomain *domain, MonoClass *class)
MonoVTable *
mono_class_proxy_vtable (MonoDomain *domain, MonoClass *class)
{
- MonoVTable *vt, *pvt, *pvt2;
+ MonoVTable *vt, *pvt;
int i, j, vtsize, interface_vtsize = 0;
MonoClass* iclass = NULL;
MonoClass* k;
- mono_domain_lock (domain);
- pvt = mono_g_hash_table_lookup (domain->proxy_vtable_hash, class);
- mono_domain_unlock (domain);
- if (pvt)
+ if ((pvt = mono_g_hash_table_lookup (domain->proxy_vtable_hash, class)))
return pvt;
if (class->flags & TYPE_ATTRIBUTE_INTERFACE) {
@@ -629,20 +631,8 @@ mono_class_proxy_vtable (MonoDomain *domain, MonoClass *class)
}
}
- mono_domain_lock (domain);
-
- pvt2 = mono_g_hash_table_lookup (domain->proxy_vtable_hash, class);
- if (pvt2) {
- /* Somebody got in before us */
- mono_domain_unlock (domain);
- g_free (pvt);
-
- return pvt2;
- }
mono_g_hash_table_insert (domain->proxy_vtable_hash, class, pvt);
- mono_domain_unlock (domain);
-
return pvt;
}
@@ -655,7 +645,7 @@ mono_object_get_virtual_method (MonoObject *obj, MonoMethod *method) {
MonoClass *klass;
MonoMethod **vtable;
gboolean is_proxy;
- MonoMethod *res = NULL;
+ MonoMethod *res;
klass = mono_object_class (obj);
if (klass == mono_defaults.transparent_proxy_class) {
@@ -672,18 +662,15 @@ mono_object_get_virtual_method (MonoObject *obj, MonoMethod *method) {
/* check method->slot is a valid index: perform isinstance? */
if (method->klass->flags & TYPE_ATTRIBUTE_INTERFACE) {
- if (!is_proxy)
- res = vtable [klass->interface_offsets [method->klass->interface_id] + method->slot];
+ res = vtable [klass->interface_offsets [method->klass->interface_id] + method->slot];
} else {
res = vtable [method->slot];
}
- if (is_proxy) {
- if (!res) res = method; /* It may be an interface or abstract class method */
- res = mono_marshal_get_remoting_invoke (res);
- }
-
g_assert (res);
+
+ if (is_proxy)
+ return mono_marshal_get_remoting_invoke (res);
return res;
}
@@ -1758,7 +1745,7 @@ mono_object_isinst (MonoObject *obj, MonoClass *klass)
if (!klass->inited)
mono_class_init (klass);
- if (oklass != klass && oklass == mono_defaults.transparent_proxy_class) {
+ if (oklass == mono_defaults.transparent_proxy_class) {
/* fixme: add check for IRemotingTypeInfo */
MonoRealProxy *rp = ((MonoTransparentProxy *)obj)->rp;
MonoType *type;
@@ -2061,8 +2048,6 @@ mono_message_init (MonoDomain *domain,
this->args = mono_array_new (domain, mono_defaults.object_class, sig->param_count);
this->arg_types = mono_array_new (domain, mono_defaults.byte_class, sig->param_count);
- this->async_result = NULL;
- this->call_type = CallType_Sync;
names = g_new (char *, sig->param_count);
mono_method_get_param_names (method->method, (const char **) names);
@@ -2316,7 +2301,7 @@ mono_method_call_message_new (MonoMethod *method, gpointer *params, MonoMethod *
mono_array_set (msg->args, gpointer, i, arg);
}
- if (cb != NULL && state != NULL) {
+ if (invoke) {
*cb = *((MonoDelegate **)params [i]);
i++;
*state = *((MonoObject **)params [i]);
diff --git a/mono/metadata/object.h b/mono/metadata/object.h
index 94858570953..bd8d635a412 100644
--- a/mono/metadata/object.h
+++ b/mono/metadata/object.h
@@ -197,14 +197,6 @@ typedef struct {
MonoClass *klass;
} MonoTransparentProxy;
-/* This is a copy of System.Runtime.Remoting.Messaging.CallType */
-typedef enum {
- CallType_Sync = 0,
- CallType_BeginInvoke = 1,
- CallType_EndInvoke = 2,
- CallType_OneWay = 3
-} MonoCallType;
-
typedef struct {
MonoObject obj;
MonoReflectionMethod *method;
@@ -214,8 +206,6 @@ typedef struct {
MonoObject *ctx;
MonoObject *rval;
MonoObject *exc;
- MonoAsyncResult *async_result;
- guint32 call_type;
} MonoMethodMessage;
typedef struct {
@@ -240,8 +230,6 @@ typedef struct {
HANDLE start_notify;
gpointer stack_ptr;
gpointer *static_data;
- gpointer jit_data;
- gpointer lock_data;
} MonoThread;
typedef struct {
diff --git a/mono/metadata/pedump.c b/mono/metadata/pedump.c
index 5a01e8f733f..aab36a8fb89 100644
--- a/mono/metadata/pedump.c
+++ b/mono/metadata/pedump.c
@@ -21,7 +21,6 @@
#include <mono/metadata/tokentype.h>
#include <mono/metadata/appdomain.h>
#include <mono/metadata/assembly.h>
-#include <mono/metadata/rawbuffer.h>
#include "mono/utils/mono-digest.h"
gboolean dump_data = TRUE;
@@ -405,12 +404,6 @@ main (int argc, char *argv [])
if (!file)
usage ();
- mono_metadata_init ();
- mono_raw_buffer_init ();
- mono_images_init ();
- mono_assemblies_init ();
- mono_loader_init ();
-
image = mono_image_open (file, NULL);
if (!image){
fprintf (stderr, "Can not open image %s\n", file);
@@ -437,8 +430,9 @@ main (int argc, char *argv [])
mono_init (file);
assembly = mono_assembly_open (file, NULL);
dump_verify_info (assembly->image, f);
- } else
- mono_image_close (image);
+ }
+
+ mono_image_close (image);
return 0;
}
diff --git a/mono/metadata/rand.c b/mono/metadata/rand.c
index 40de9289390..0e5348a161e 100644
--- a/mono/metadata/rand.c
+++ b/mono/metadata/rand.c
@@ -105,13 +105,18 @@ ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_InternalGetNonZe
/* This needs to change when I do the Win32 support... */
#else
+#ifndef _MSC_VER
+#warning "No Entropy Source Found"
+#endif
void ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_InternalGetBytes(MonoObject *self, MonoArray *arry)
{
+ g_warning("0K problem. We have no entropy. Badness will occur.");
mono_raise_exception(mono_get_exception_not_implemented());
}
void ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_InternalGetNonZeroBytes(MonoObject *self, MonoArray *arry)
{
+ g_warning("0K problem. We have no entropy. Badness will occur.");
mono_raise_exception(mono_get_exception_not_implemented());
}
diff --git a/mono/metadata/rawbuffer.c b/mono/metadata/rawbuffer.c
index be7fc2a7172..6c97d4d6210 100644
--- a/mono/metadata/rawbuffer.c
+++ b/mono/metadata/rawbuffer.c
@@ -22,8 +22,6 @@
#include <glib.h>
#include "rawbuffer.h"
-#include <mono/io-layer/io-layer.h>
-
#define ROUND_DOWN(VALUE,SIZE) ((VALUE) & ~((SIZE) - 1))
#define ROUND_UP(VALUE,SIZE) (ROUND_DOWN((VALUE) + (SIZE) - 1, (SIZE)))
#if SIZEOF_VOID_P == 8
@@ -34,7 +32,6 @@
static GHashTable *mmap_map = NULL;
static size_t alignment = 0;
-static CRITICAL_SECTION mmap_mutex;
static void
get_alignment (void)
@@ -73,16 +70,6 @@ mono_raw_buffer_free_malloc (void *base)
g_free (base);
}
-void
-mono_raw_buffer_init (void)
-{
- InitializeCriticalSection (&mmap_mutex);
-
- get_alignment ();
-
- mmap_map = g_hash_table_new (g_direct_hash, g_direct_equal);
-}
-
static void *
mono_raw_buffer_load_mmap (int fd, int is_writable, guint32 base, size_t size)
{
@@ -94,6 +81,8 @@ mono_raw_buffer_load_mmap (int fd, int is_writable, guint32 base, size_t size)
void *ptr;
HANDLE file, mapping;
+ if (alignment == 0)
+ get_alignment ();
start = ROUND_DOWN (base, alignment);
end = base + size;
@@ -117,9 +106,10 @@ mono_raw_buffer_load_mmap (int fd, int is_writable, guint32 base, size_t size)
return 0;
}
- EnterCriticalSection (&mmap_mutex);
+ if (mmap_map == NULL)
+ mmap_map = g_hash_table_new (g_direct_hash, g_direct_equal);
+
g_hash_table_insert (mmap_map, ptr, GINT_TO_POINTER (mapping));
- LeaveCriticalSection (&mmap_mutex);
return ((char *)ptr) + (base - start);
@@ -132,6 +122,8 @@ mono_raw_buffer_load_mmap (int fd, int is_writable, guint32 base, size_t size)
int flags = 0;
void *ptr;
+ if (alignment == 0)
+ get_alignment ();
start = ROUND_DOWN (base, alignment);
end = ROUND_UP (base + size, alignment);
@@ -147,9 +139,10 @@ mono_raw_buffer_load_mmap (int fd, int is_writable, guint32 base, size_t size)
if (ptr == (void *) -1)
return 0;
- EnterCriticalSection (&mmap_mutex);
+ if (mmap_map == NULL)
+ mmap_map = g_hash_table_new (g_direct_hash, g_direct_equal);
+
g_hash_table_insert (mmap_map, ptr, GINT_TO_POINTER (size));
- LeaveCriticalSection (&mmap_mutex);
return ((char *)ptr) + (base - start);
#endif
@@ -160,9 +153,7 @@ mono_raw_buffer_free_mmap (void *base)
{
int value;
- EnterCriticalSection (&mmap_mutex);
value = GPOINTER_TO_INT (g_hash_table_lookup (mmap_map, base));
- LeaveCriticalSection (&mmap_mutex);
#ifdef USE_WIN32_API
UnmapViewOfFile (base);
@@ -198,14 +189,10 @@ void
mono_raw_buffer_update (void *buffer, size_t size)
{
char *mmap_base;
- gboolean exists;
mmap_base = (gpointer)(ROUND_DOWN ((UINTPTR_TYPE) (buffer), alignment));
-
- EnterCriticalSection (&mmap_mutex);
- exists = g_hash_table_lookup (mmap_map, mmap_base) != NULL;
- LeaveCriticalSection (&mmap_mutex);
- if (exists)
+
+ if (mmap_map && g_hash_table_lookup (mmap_map, mmap_base))
mono_raw_buffer_update_mmap (mmap_base, size);
}
@@ -213,12 +200,10 @@ void
mono_raw_buffer_free (void *buffer)
{
char *mmap_base;
- gboolean exists;
mmap_base = (gpointer)(ROUND_DOWN ((UINTPTR_TYPE) (buffer), alignment));
- exists = g_hash_table_lookup (mmap_map, mmap_base) != NULL;
- if (exists)
+ if (mmap_map && g_hash_table_lookup (mmap_map, mmap_base))
mono_raw_buffer_free_mmap (mmap_base);
else
mono_raw_buffer_free_malloc (buffer);
diff --git a/mono/metadata/rawbuffer.h b/mono/metadata/rawbuffer.h
index 6ff6aef3179..47232a2639f 100644
--- a/mono/metadata/rawbuffer.h
+++ b/mono/metadata/rawbuffer.h
@@ -1,10 +1,4 @@
-#ifndef __MONO_RAWBUFFER_H__
-#define __MONO_RAWBUFFER_H__
-
-void mono_raw_buffer_init (void);
void *mono_raw_buffer_load (int fd, int writable, guint32 base, size_t size);
void mono_raw_buffer_update (void *buffer, size_t size);
void mono_raw_buffer_free (void *buffer);
-
-#endif /* __MONO_RAWBUFFER_H__ */
diff --git a/mono/metadata/reflection.c b/mono/metadata/reflection.c
index f7c074139a6..52160815529 100644
--- a/mono/metadata/reflection.c
+++ b/mono/metadata/reflection.c
@@ -2952,7 +2952,6 @@ mono_image_basic_init (MonoReflectionAssemblyBuilder *assemblyb)
assembly->token_fixups = mono_g_hash_table_new (g_direct_hash, g_direct_equal);
assembly->method_to_table_idx = mono_g_hash_table_new (g_direct_hash, g_direct_equal);
assembly->field_to_table_idx = mono_g_hash_table_new (g_direct_hash, g_direct_equal);
- assembly->param_marshalling = mono_g_hash_table_new (g_direct_hash, g_direct_equal);
assembly->handleref = g_hash_table_new (g_direct_hash, g_direct_equal);
assembly->tokens = mono_g_hash_table_new (g_direct_hash, g_direct_equal);
assembly->typeref = g_hash_table_new ((GHashFunc)mono_metadata_type_hash, (GCompareFunc)mono_metadata_type_equal);
@@ -3731,43 +3730,41 @@ mono_event_get_object (MonoDomain *domain, MonoClass *klass, MonoEvent *event)
* Return an System.Reflection.ParameterInfo array object representing the parameters
* in the method @method.
*/
-MonoArray*
+MonoReflectionParameter**
mono_param_get_objects (MonoDomain *domain, MonoMethod *method)
{
- static MonoClass *System_Reflection_ParameterInfo;
- MonoArray *res = NULL;
- MonoReflectionMethod *member = NULL;
- MonoReflectionParameter *param = NULL;
+ MonoReflectionParameter **res;
+ MonoReflectionMethod *member;
+ MonoClass *oklass;
char **names;
int i;
- if (!System_Reflection_ParameterInfo)
- System_Reflection_ParameterInfo = mono_class_from_name (
- mono_defaults.corlib, "System.Reflection", "ParameterInfo");
-
if (!method->signature->param_count)
- return mono_array_new (domain, System_Reflection_ParameterInfo, 0);
+ return NULL;
/* Note: the cache is based on the address of the signature into the method
* since we already cache MethodInfos with the method as keys.
*/
- CHECK_OBJECT (MonoArray*, &(method->signature), NULL);
+ CHECK_OBJECT (MonoReflectionParameter**, &(method->signature), NULL);
member = mono_method_get_object (domain, method, NULL);
names = g_new (char *, method->signature->param_count);
mono_method_get_param_names (method, (const char **) names);
-
- res = mono_array_new (domain, System_Reflection_ParameterInfo, method->signature->param_count);
+
+ oklass = mono_class_from_name (mono_defaults.corlib, "System.Reflection", "ParameterInfo");
+#if HAVE_BOEHM_GC
+ res = GC_MALLOC (sizeof (MonoReflectionParameter*) * method->signature->param_count);
+#else
+ res = g_new0 (MonoReflectionParameter*, method->signature->param_count);
+#endif
for (i = 0; i < method->signature->param_count; ++i) {
- param = (MonoReflectionParameter *)mono_object_new (domain,
- System_Reflection_ParameterInfo);
- param->ClassImpl = mono_type_get_object (domain, method->signature->params [i]);
- param->DefaultValueImpl = NULL; /* FIXME */
- param->MemberImpl = (MonoObject*)member;
- param->NameImpl = mono_string_new (domain, names [i]);
- param->PositionImpl = i;
- param->AttrsImpl = method->signature->params [i]->attrs;
- mono_array_set (res, gpointer, i, param);
+ res [i] = (MonoReflectionParameter *)mono_object_new (domain, oklass);
+ res [i]->ClassImpl = mono_type_get_object (domain, method->signature->params [i]);
+ res [i]->DefaultValueImpl = NULL; /* FIXME */
+ res [i]->MemberImpl = (MonoObject*)member;
+ res [i]->NameImpl = mono_string_new (domain, names [i]);
+ res [i]->PositionImpl = i;
+ res [i]->AttrsImpl = method->signature->params [i]->attrs;
}
g_free (names);
CACHE_OBJECT (&(method->signature), res, NULL);
@@ -5307,43 +5304,6 @@ mono_reflection_create_internal_class (MonoReflectionTypeBuilder *tb)
}
}
-static MonoMarshalSpec*
-mono_marshal_spec_from_builder (MonoAssembly *assembly,
- MonoReflectionMarshal *minfo)
-{
- MonoMarshalSpec *res;
-
- res = g_new0 (MonoMarshalSpec, 1);
- res->native = minfo->type;
-
- switch (minfo->type) {
- case MONO_NATIVE_LPARRAY:
- res->data.array_data.elem_type = minfo->eltype;
- res->data.array_data.param_num = 0; /* Not yet */
- res->data.array_data.num_elem = minfo->count;
- break;
-
- case MONO_NATIVE_BYVALTSTR:
- case MONO_NATIVE_BYVALARRAY:
- res->data.array_data.num_elem = minfo->count;
- break;
-
- case MONO_NATIVE_CUSTOM:
- if (minfo->marshaltyperef)
- res->data.custom_data.custom_name =
- type_get_qualified_name (minfo->marshaltyperef->type,
- assembly);
- if (minfo->mcookie)
- res->data.custom_data.cookie = mono_string_to_utf8 (minfo->mcookie);
- break;
-
- default:
- break;
- }
-
- return res;
-}
-
static MonoMethod*
reflection_methodbuilder_to_mono_method (MonoClass *klass,
ReflectionMethodBuilder *rmb,
@@ -5351,8 +5311,6 @@ reflection_methodbuilder_to_mono_method (MonoClass *klass,
{
MonoMethod *m;
MonoMethodNormal *pm;
- MonoMarshalSpec **specs;
- int i;
if ((rmb->attrs & METHOD_ATTRIBUTE_PINVOKE_IMPL) ||
(rmb->iattrs & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL))
@@ -5439,25 +5397,6 @@ reflection_methodbuilder_to_mono_method (MonoClass *klass,
pm->header = header;
}
- /* Parameter marshalling */
- specs = NULL;
- if (rmb->pinfo)
- for (i = 0; i < mono_array_length (rmb->pinfo); ++i) {
- MonoReflectionParamBuilder *pb;
- if ((pb = mono_array_get (rmb->pinfo, MonoReflectionParamBuilder*, i))) {
- if (pb->marshal_info) {
- if (specs == NULL)
- specs = g_new0 (MonoMarshalSpec*, sig->param_count + 1);
- specs [pb->position] =
- mono_marshal_spec_from_builder (klass->image->assembly, pb->marshal_info);
- }
- }
- }
- if (specs != NULL)
- mono_g_hash_table_insert (
- ((MonoDynamicAssembly*)klass->image->assembly->dynamic)->param_marshalling,
- m, specs);
-
return m;
}
diff --git a/mono/metadata/reflection.h b/mono/metadata/reflection.h
index fd0b481e000..43bff2f681c 100644
--- a/mono/metadata/reflection.h
+++ b/mono/metadata/reflection.h
@@ -270,7 +270,6 @@ typedef struct {
MonoGHashTable *token_fixups;
MonoGHashTable *method_to_table_idx;
MonoGHashTable *field_to_table_idx;
- MonoGHashTable *param_marshalling;
gboolean run;
gboolean save;
char *strong_name;
@@ -487,7 +486,7 @@ MonoReflectionField* mono_field_get_object (MonoDomain *domain, MonoClass
MonoReflectionProperty* mono_property_get_object (MonoDomain *domain, MonoClass *klass, MonoProperty *property);
MonoReflectionEvent* mono_event_get_object (MonoDomain *domain, MonoClass *klass, MonoEvent *event);
/* note: this one is slightly different: we keep the whole array of params in the cache */
-MonoArray* mono_param_get_objects (MonoDomain *domain, MonoMethod *method);
+MonoReflectionParameter** mono_param_get_objects (MonoDomain *domain, MonoMethod *method);
MonoArray* mono_reflection_get_custom_attrs (MonoObject *obj);
MonoArray* mono_reflection_get_custom_attrs_blob (MonoObject *ctor, MonoArray *ctorArgs, MonoArray *properties, MonoArray *porpValues, MonoArray *fields, MonoArray* fieldValues);
diff --git a/mono/metadata/socket-io.c b/mono/metadata/socket-io.c
index aa6da979b10..fee8059af88 100644
--- a/mono/metadata/socket-io.c
+++ b/mono/metadata/socket-io.c
@@ -893,7 +893,7 @@ static struct sockaddr *create_sockaddr_from_object(MonoObject *saddr_obj,
mono_raise_exception (mono_exception_from_name(mono_defaults.corlib, "System", "SystemException"));
}
- family = convert_family (mono_array_get (data, guint8, 0) + (mono_array_get (data, guint8, 1) << 8));
+ family = convert_family (mono_array_get (data, guint16, 0));
if(family==AF_INET) {
struct sockaddr_in *sa=g_new0(struct sockaddr_in, 1);
guint16 port=(mono_array_get(data, guint8, 2) << 8) +
@@ -1465,30 +1465,6 @@ void ves_icall_System_Net_Sockets_Socket_SetSocketOption_internal(SOCKET sock, g
int system_level;
int system_name;
int ret;
-#ifdef AF_INET6
- int sol_ip;
- int sol_ipv6;
-
-#ifdef HAVE_SOL_IPV6
- sol_ipv6 = SOL_IPV6;
-#else
- {
- struct protoent *pent;
- pent = getprotobyname ("ipv6");
- sol_ipv6 = (pent != NULL) ? pent->p_proto : 41;
- }
-#endif
-
-#ifdef HAVE_SOL_IP
- sol_ip = SOL_IP;
-#else
- {
- struct protoent *pent;
- pent = getprotobyname ("ip");
- sol_ip = (pent != NULL) ? pent->p_proto : 0;
- }
-#endif
-#endif /* AF_INET6 */
MONO_ARCH_SAVE_REGS;
@@ -1534,7 +1510,7 @@ void ves_icall_System_Net_Sockets_Socket_SetSocketOption_internal(SOCKET sock, g
MonoObject *address = NULL;
#ifdef AF_INET6
- if(system_level == sol_ipv6) {
+ if(system_level == SOL_IPV6) {
struct ipv6_mreq mreq6;
/*
@@ -1553,7 +1529,7 @@ void ves_icall_System_Net_Sockets_Socket_SetSocketOption_internal(SOCKET sock, g
ret = setsockopt (sock, system_level,
system_name, &mreq6,
sizeof (mreq6));
- } else if(system_level == sol_ip)
+ } else if(system_level == SOL_IP)
#endif /* AF_INET6 */
{
#ifdef HAVE_STRUCT_IP_MREQN
diff --git a/mono/metadata/string-icalls.c b/mono/metadata/string-icalls.c
index e55d25a2a2e..44010157395 100644
--- a/mono/metadata/string-icalls.c
+++ b/mono/metadata/string-icalls.c
@@ -343,36 +343,28 @@ ves_icall_System_String_InternalReplace_Str (MonoString *me, MonoString *oldValu
for (i = 0; i <= srclen - oldstrlen; i++)
if (0 == memcmp(src + i, oldstr, oldstrlen * sizeof(gunichar2)))
occurr++;
- if (occurr == 0)
- return me;
+
newsize = srclen + ((newstrlen - oldstrlen) * occurr);
} else
newsize = srclen;
- ret = NULL;
+ ret = mono_string_new_size( mono_domain_get (), newsize);
+ dest = mono_string_chars(ret);
+
i = 0;
while (i < srclen) {
if (0 == memcmp(src + i, oldstr, oldstrlen * sizeof(gunichar2))) {
- if (ret == NULL) {
- ret = mono_string_new_size( mono_domain_get (), newsize);
- dest = mono_string_chars(ret);
- memcpy (dest, src, i * sizeof(gunichar2));
- }
if (newstrlen > 0) {
memcpy(dest + destpos, newstr, newstrlen * sizeof(gunichar2));
destpos += newstrlen;
}
i += oldstrlen;
- continue;
- } else if (ret != NULL) {
+ } else {
dest[destpos] = src[i];
- }
destpos++;
i++;
}
-
- if (ret == NULL)
- return me;
+ }
return ret;
}
diff --git a/mono/metadata/threads.c b/mono/metadata/threads.c
index b14672c59a6..9006f6b53ab 100644
--- a/mono/metadata/threads.c
+++ b/mono/metadata/threads.c
@@ -56,7 +56,7 @@ static CRITICAL_SECTION threads_mutex;
static MonoGHashTable *threads=NULL;
/* The TLS key that holds the MonoObject assigned to each thread */
-static guint32 current_object_key = -1;
+static guint32 current_object_key;
/* function called at thread start */
static MonoThreadStartCB mono_thread_start_cb = NULL;
@@ -64,14 +64,11 @@ static MonoThreadStartCB mono_thread_start_cb = NULL;
/* function called at thread attach */
static MonoThreadAttachCB mono_thread_attach_cb = NULL;
-/* function called at thread cleanup */
-static MonoThreadCleanupFunc mono_thread_cleanup = NULL;
-
/* function called when a new thread has been created */
static MonoThreadCallbacks *mono_thread_callbacks = NULL;
/* The TLS key that holds the LocalDataStoreSlot hash in each thread */
-static guint32 slothash_key = -1;
+static guint32 slothash_key;
static void thread_adjust_static_data (MonoThread *thread);
@@ -136,8 +133,6 @@ static void thread_cleanup (MonoThread *thread)
mono_profiler_thread_end (thread->tid);
handle_remove (thread->tid);
- if (mono_thread_cleanup)
- mono_thread_cleanup (thread);
}
static guint32 start_wrapper(void *data)
@@ -160,8 +155,6 @@ static guint32 start_wrapper(void *data)
*/
tid=thread->tid;
-
- TlsSetValue (current_object_key, thread);
mono_domain_set (start_info->domain);
@@ -187,6 +180,8 @@ static guint32 start_wrapper(void *data)
GetCurrentThreadId (), thread);
#endif
+ TlsSetValue (current_object_key, thread);
+
mono_profiler_thread_start (tid);
if(thread->start_notify!=NULL) {
@@ -930,12 +925,6 @@ void mono_thread_init (MonoThreadStartCB start_cb,
GetCurrentProcess ();
}
-void
-mono_threads_install_cleanup (MonoThreadCleanupFunc func)
-{
- mono_thread_cleanup = func;
-}
-
void mono_install_thread_callbacks (MonoThreadCallbacks *callbacks)
{
mono_thread_callbacks = callbacks;
diff --git a/mono/metadata/threads.h b/mono/metadata/threads.h
index 5a823554431..dfa962d6448 100644
--- a/mono/metadata/threads.h
+++ b/mono/metadata/threads.h
@@ -28,7 +28,6 @@ typedef enum {
ThreadState_Aborted = 0x00000100,
} MonoThreadState;
-typedef void (*MonoThreadCleanupFunc) (MonoThread* thread);
extern int mono_thread_get_abort_signal (void);
@@ -54,8 +53,6 @@ extern void mono_thread_create (MonoDomain *domain, gpointer func,
gpointer arg);
extern MonoThread *mono_thread_attach (MonoDomain *domain);
-void mono_threads_install_cleanup (MonoThreadCleanupFunc func);
-
guint32 mono_threads_alloc_static_data (guint32 size, guint32 align);
gpointer mono_threads_get_static_data (guint32 offset);
diff --git a/mono/mini/.cvsignore b/mono/mini/.cvsignore
index 0fe50cedb98..a0e16ba5bff 100644
--- a/mono/mini/.cvsignore
+++ b/mono/mini/.cvsignore
@@ -11,6 +11,3 @@ genmdesc
inssel.c inssel.h
mini.pc
cpu-pentium.h
-cpu-g4.h
-mono
-cpu-sparc.h
diff --git a/mono/mini/ChangeLog b/mono/mini/ChangeLog
index 2dfda0af012..bde5939cabf 100644
--- a/mono/mini/ChangeLog
+++ b/mono/mini/ChangeLog
@@ -1,59 +1,3 @@
-2003-08-27 Zoltan Varga <vargaz@freemail.hu>
-
- * mini.c jit-icalls.c tramp-x86.c tramp-ppc.c tramp-sparc.c: Get rid of
- metadata_section.
-
-2003-08-26 Martin Baulig <martin@ximian.com>
-
- * mini.c (get_basic_blocks): Added `unsigned char **pos' argument;
- when reporting an error, set this to the actual error location.
- (mono_method_to_ir): Report the correct error location if
- get_basic_blocks() returned an error.
-
-2003-08-25 Zoltan Varga <vargaz@freemail.hu>
-
- * mini.c (mono_type_blittable): OBJECT is not blittable.
- (mono_method_blittable): Methods which have marshalling descriptors
- are not blittable either. Fixes #47842.
-
-2003-08-22 Zoltan Varga <vargaz@freemail.hu>
-
- * driver.c mini.c: Use an environment variable instead of a global
- variable. Also fix the build.
-
- * mini.c (mini_init): Call g_thread_init () to make glib thread-safe.
- Fixes #47682. Thanks to Laurent Morichetti (l_m@pacbell.net) for
- reporting this.
-
- * driver.c mini.c: Added --with-valgrind option to turn off some
- code which prevents mono from running under valgrind.
-
- * mini.c (mono_emit_call_args): Fixed warning.
-
- * mini.c (mono_emulate_opcode): Fixed warning.
-
-Thu Aug 21 19:10:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
-
- * inssel.brg: 64bit fixes from Laurent Morichetti <l_m@pacbell.net>.
- * linear-scan.c, mini-ppc.h, mini-sparc.h, mini-x86.h, mini.h,
- regalloc.c, regalloc.h: specify available registers in arch-specific
- code and support floats in the regallocator (patch by Laurent Morichetti
- <l_m@pacbell.net>)
-
-Wed Aug 20 19:02:22 CEST 2003 Paolo Molaro <lupus@ximian.com>
-
- * mini.c: mono_thread_current() can be called only after
- mono_runtime_init(): rearrange code to not call it early on.
-
-Wed Aug 20 13:14:31 CEST 2003 Paolo Molaro <lupus@ximian.com>
-
- * mini.c: allocate jump tables in the code mempools.
-
-Wed Aug 20 13:04:53 CEST 2003 Paolo Molaro <lupus@ximian.com>
-
- * mini.c, mini.h: make sure per-thread data allocated by the jit is
- freed.
-
2003-08-10 Miguel de Icaza <miguel@ximian.com>
* cpu-pentium.md (ldtoken): Change the length for mul.ovf.un from
diff --git a/mono/mini/Makefile.am b/mono/mini/Makefile.am
index 6999ec7ab13..34f3e7e5614 100644
--- a/mono/mini/Makefile.am
+++ b/mono/mini/Makefile.am
@@ -195,7 +195,6 @@ documents=mini-doc.txt mini-porting.txt
BUILT_SOURCES= inssel.c inssel.h cpu-pentium.h cpu-g4.h cpu-sparc.h
CLEANFILES= $(BUILT_SOURCES)
EXTRA_DIST = $(common_BURGSRC) $(documents) inssel-x86.brg inssel-ppc.brg \
- $(x86_sources) $(ppc_sources) $(sparc_sources) \
jit-icalls.c cprop.c inssel-sparc.brg \
cpu-pentium.md cpu-g4.md ldscript cpu-sparc.md
diff --git a/mono/mini/driver.c b/mono/mini/driver.c
index 700134cf3a9..acbe22da131 100644
--- a/mono/mini/driver.c
+++ b/mono/mini/driver.c
@@ -477,7 +477,6 @@ mini_usage (void)
" --breakonex Inserts a breakpoint on exceptions\n"
" --break METHOD Inserts a breakpoint at METHOD entry\n"
" --debug Enable debugging support\n"
- " --stats Print statistics about the JIT operations\n"
"\n"
"Development:\n"
" --statfile FILE Sets the stat file to FILE\n"
diff --git a/mono/mini/inssel.brg b/mono/mini/inssel.brg
index 9e0001838f8..5869b621619 100644
--- a/mono/mini/inssel.brg
+++ b/mono/mini/inssel.brg
@@ -9,10 +9,10 @@
*
*/
-#include <config.h>
#include <string.h>
#include "mini.h"
+#include "mini-arch.h"
#include <mono/metadata/marshal.h>
#define MBTREE_TYPE MonoInst
@@ -185,24 +185,6 @@
mono_bblock_add_inst ((cfg)->cbb, inst); \
} while (0)
-#define MONO_EMIT_NEW_I8CONST(cfg,dr,imm) do { \
- MonoInst *inst; \
- inst = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoInst)); \
- inst->opcode = OP_I8CONST; \
- inst->dreg = dr; \
- inst->inst_l = imm; \
- mono_bblock_add_inst ((cfg)->cbb, inst); \
- } while (0)
-
-#define MONO_EMIT_NEW_PCONST(cfg,dr,imm) do { \
- MonoInst *inst; \
- inst = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoInst)); \
- inst->opcode = OP_ICONST; \
- inst->dreg = dr; \
- inst->inst_p0 = (gpointer) imm; \
- mono_bblock_add_inst ((cfg)->cbb, inst); \
- } while (0)
-
#define MONO_EMIT_NEW_AOTCONST(cfg,dr,imm,type) do { \
MonoInst *inst; \
inst = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoInst)); \
@@ -282,11 +264,6 @@ base: reg "0" {
//tree->inst_basereg = state->reg1;
}
-base: CEE_LDIND_I (OP_REGVAR) "0" {
- tree->inst_offset = 0;
- tree->inst_basereg = state->left->tree->dreg;
-}
-
base: OP_REGOFFSET "0" {
/* nothing to do */
}
@@ -1660,12 +1637,12 @@ mini_emit_virtual_call (MonoCompile *cfg, void *st, MonoInst *tree, int novirtop
int ifoffset_reg = mono_regstate_next_int (cfg->rs);
slot_reg = mono_regstate_next_int (cfg->rs);
MONO_EMIT_NEW_LOAD_MEMBASE (cfg, ifoffset_reg, vtable_reg, G_STRUCT_OFFSET (MonoVTable, interface_offsets));
- MONO_EMIT_NEW_LOAD_MEMBASE (cfg, slot_reg, ifoffset_reg, method->klass->interface_id * SIZEOF_VOID_P);
- tree->inst_offset = method->slot * SIZEOF_VOID_P;
+ MONO_EMIT_NEW_LOAD_MEMBASE (cfg, slot_reg, ifoffset_reg, method->klass->interface_id << 2);
+ tree->inst_offset = method->slot << 2;
cfg->disable_aot = TRUE;
} else {
slot_reg = vtable_reg;
- tree->inst_offset = G_STRUCT_OFFSET (MonoVTable, vtable) + (method->slot * SIZEOF_VOID_P);
+ tree->inst_offset = G_STRUCT_OFFSET (MonoVTable, vtable) + (method->slot << 2);
}
tree->dreg = state->reg1;
@@ -1687,7 +1664,7 @@ mini_emit_isninst_cast (MonoCompile *s, int klass_reg, MonoClass *klass, MonoIns
MONO_EMIT_NEW_BRANCH_LABEL (s, CEE_BLT_UN, false_target);
}
MONO_EMIT_NEW_LOAD_MEMBASE (s, stypes_reg, klass_reg, G_STRUCT_OFFSET (MonoClass, supertypes));
- MONO_EMIT_NEW_LOAD_MEMBASE (s, stype, stypes_reg, ((klass->idepth - 1) * SIZEOF_VOID_P));
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, stype, stypes_reg, ((klass->idepth - 1) << 2));
if (mono_compile_aot) {
int const_reg = mono_regstate_next_int (s->rs);
MONO_EMIT_NEW_CLASSCONST (s, const_reg, klass);
@@ -1711,7 +1688,7 @@ mini_emit_isninst_iface_cast (MonoCompile *s, int vtable_reg, MonoClass *klass,
MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, max_iid_reg, klass->interface_id);
MONO_EMIT_NEW_BRANCH_LABEL (s, CEE_BLT_UN, false_target);
MONO_EMIT_NEW_LOAD_MEMBASE (s, ioffset_reg, vtable_reg, G_STRUCT_OFFSET (MonoVTable, interface_offsets));
- MONO_EMIT_NEW_LOAD_MEMBASE (s, intf_reg, ioffset_reg, klass->interface_id * SIZEOF_VOID_P);
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, intf_reg, ioffset_reg, klass->interface_id << 2);
MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, intf_reg, 0);
/* the object_is_null target simply copies the input register to the output */
MONO_EMIT_NEW_BRANCH_LABEL (s, CEE_BNE_UN, true_target);
@@ -1734,7 +1711,7 @@ mini_emit_isninst_iface_class_cast (MonoCompile *s, int klass_reg, MonoClass *kl
MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, max_iid_reg, klass->interface_id);
MONO_EMIT_NEW_BRANCH_LABEL (s, CEE_BLT_UN, false_target);
MONO_EMIT_NEW_LOAD_MEMBASE (s, ioffset_reg, klass_reg, G_STRUCT_OFFSET (MonoClass, interface_offsets));
- MONO_EMIT_NEW_LOAD_MEMBASE (s, intf_reg, ioffset_reg, klass->interface_id * SIZEOF_VOID_P);
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, intf_reg, ioffset_reg, klass->interface_id << 2);
MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, intf_reg, 0);
/* the object_is_null target simply copies the input register to the output */
MONO_EMIT_NEW_BRANCH_LABEL (s, CEE_BGE, true_target);
@@ -1753,7 +1730,7 @@ mini_emit_castclass (MonoCompile *s, int klass_reg, MonoClass *klass)
MONO_EMIT_NEW_COND_EXC (s, LT_UN, "InvalidCastException");
}
MONO_EMIT_NEW_LOAD_MEMBASE (s, stypes_reg, klass_reg, G_STRUCT_OFFSET (MonoClass, supertypes));
- MONO_EMIT_NEW_LOAD_MEMBASE (s, stype, stypes_reg, ((klass->idepth - 1) * SIZEOF_VOID_P));
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, stype, stypes_reg, ((klass->idepth - 1) << 2));
if (mono_compile_aot) {
int const_reg = mono_regstate_next_int (s->rs);
MONO_EMIT_NEW_CLASSCONST (s, const_reg, klass);
@@ -1777,7 +1754,7 @@ mini_emit_castclass_iface (MonoCompile *s, int vtable_reg, MonoClass *klass)
MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, max_iid_reg, klass->interface_id);
MONO_EMIT_NEW_COND_EXC (s, LT_UN, "InvalidCastException");
MONO_EMIT_NEW_LOAD_MEMBASE (s, ioffset_reg, vtable_reg, G_STRUCT_OFFSET (MonoVTable, interface_offsets));
- MONO_EMIT_NEW_LOAD_MEMBASE (s, intf_reg, ioffset_reg, klass->interface_id * SIZEOF_VOID_P);
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, intf_reg, ioffset_reg, klass->interface_id << 2);
MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, intf_reg, 0);
MONO_EMIT_NEW_COND_EXC (s, EQ, "InvalidCastException");
}
@@ -1799,7 +1776,7 @@ mini_emit_castclass_iface_class (MonoCompile *s, int klass_reg, MonoClass *klass
MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, max_iid_reg, klass->interface_id);
MONO_EMIT_NEW_COND_EXC (s, LT_UN, "InvalidCastException");
MONO_EMIT_NEW_LOAD_MEMBASE (s, ioffset_reg, klass_reg, G_STRUCT_OFFSET (MonoClass, interface_offsets));
- MONO_EMIT_NEW_LOAD_MEMBASE (s, intf_reg, ioffset_reg, klass->interface_id * SIZEOF_VOID_P);
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, intf_reg, ioffset_reg, klass->interface_id << 2);
MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, intf_reg, 0);
MONO_EMIT_NEW_COND_EXC (s, EQ, "InvalidCastException");
}
diff --git a/mono/mini/jit-icalls.c b/mono/mini/jit-icalls.c
index 02b3dd9b429..3e2f105929d 100644
--- a/mono/mini/jit-icalls.c
+++ b/mono/mini/jit-icalls.c
@@ -17,7 +17,9 @@ mono_ldftn (MonoMethod *method)
MONO_ARCH_SAVE_REGS;
+ EnterCriticalSection (metadata_section);
addr = mono_compile_method (method);
+ LeaveCriticalSection (metadata_section);
return addr;
}
diff --git a/mono/mini/linear-scan.c b/mono/mini/linear-scan.c
index 91ed1cf2a04..3cf0775d296 100644
--- a/mono/mini/linear-scan.c
+++ b/mono/mini/linear-scan.c
@@ -46,12 +46,12 @@ mono_varlist_insert_sorted (MonoCompile *cfg, GList *list, MonoMethodVar *mv, in
//#define DEBUG_LSCAN
void
-mono_linear_scan (MonoCompile *cfg, GList *vars, GList *regs, regmask_t *used_mask)
+mono_linear_scan (MonoCompile *cfg, GList *vars, GList *regs, guint32 *used_mask)
{
GList *l, *a, *active = NULL;
MonoMethodVar *vmv, *amv;
- int max_regs, gains [sizeof (regmask_t) * 8];
- regmask_t used_regs = 0;
+ int max_regs, gains [32];
+ guint32 used_regs = 0;
gboolean cost_driven;
cost_driven = (cfg->comp_done & MONO_COMP_LOOPS);
@@ -136,14 +136,14 @@ mono_linear_scan (MonoCompile *cfg, GList *vars, GList *regs, regmask_t *used_ma
vmv->reg = (int)regs->data;
- used_regs |= 1LL << vmv->reg;
+ used_regs |= 1 << vmv->reg;
regs = g_list_remove_link (regs, regs);
#ifdef DEBUG_LSCAN
- printf ("ADD %2d %08x %08x C%d R%d\n", vmv->idx,
+ printf ("ADD %2d %08x %08x C%d\n", vnum,
vmv->range.first_use.abs_pos, vmv->range.last_use.abs_pos,
- vmv->spill_costs, vmv->reg);
+ vmv->spill_costs);
#endif
active = mono_varlist_insert_sorted (cfg, active, vmv, TRUE);
}
@@ -168,13 +168,14 @@ mono_linear_scan (MonoCompile *cfg, GList *vars, GList *regs, regmask_t *used_ma
vmv = l->data;
if (vmv->reg >= 0) {
- if (gains [vmv->reg] > 3) {
+ if (gains [vmv->reg] > 5) {
cfg->varinfo [vmv->idx]->opcode = OP_REGVAR;
cfg->varinfo [vmv->idx]->dreg = vmv->reg;
- if (cfg->verbose_level > 2)
- printf ("REGVAR %d C%d R%d\n", vmv->idx, vmv->spill_costs, vmv->reg);
+#ifdef DEBUG_LSCAN
+ printf ("REGVAR %d C%d R%d\n", vmv->idx, vmv->spill_costs, vmv->reg);
+#endif
} else {
- used_regs &= ~(1LL << vmv->reg);
+ used_regs &= ~(1 << vmv->reg);
vmv->reg = -1;
}
}
@@ -186,4 +187,3 @@ mono_linear_scan (MonoCompile *cfg, GList *vars, GList *regs, regmask_t *used_ma
g_list_free (active);
g_list_free (vars);
}
-
diff --git a/mono/mini/mini-ppc.h b/mono/mini/mini-ppc.h
index c2a6d4677de..3ce44410764 100644
--- a/mono/mini/mini-ppc.h
+++ b/mono/mini/mini-ppc.h
@@ -4,9 +4,6 @@
#include <mono/arch/x86/x86-codegen.h>
#include <mono/arch/ppc/ppc-codegen.h>
-#define MONO_MAX_IREGS 32
-#define MONO_MAX_FREGS 32
-
#define MONO_ARCH_FRAME_ALIGNMENT 4
/* fixme: align to 16byte instead of 32byte (we align to 32byte to get
diff --git a/mono/mini/mini-sparc.h b/mono/mini/mini-sparc.h
index 1dd575ed6fe..40b31f24b50 100644
--- a/mono/mini/mini-sparc.h
+++ b/mono/mini/mini-sparc.h
@@ -3,9 +3,6 @@
#include <mono/arch/sparc/sparc-codegen.h>
-#define MONO_MAX_IREGS 32
-#define MONO_MAX_FREGS 32
-
/* Check this for Sparc. I think it is right. */
#define MONO_ARCH_FRAME_ALIGNMENT 4
diff --git a/mono/mini/mini-x86.h b/mono/mini/mini-x86.h
index 1acb3bc49b3..85e292569e0 100644
--- a/mono/mini/mini-x86.h
+++ b/mono/mini/mini-x86.h
@@ -3,9 +3,6 @@
#include <mono/arch/x86/x86-codegen.h>
-#define MONO_MAX_IREGS 8
-#define MONO_MAX_FREGS 7
-
#define MONO_ARCH_FRAME_ALIGNMENT 4
/* fixme: align to 16byte instead of 32byte (we align to 32byte to get
diff --git a/mono/mini/mini.c b/mono/mini/mini.c
index a0ba9f3c758..d0a18d86caf 100644
--- a/mono/mini/mini.c
+++ b/mono/mini/mini.c
@@ -89,7 +89,7 @@ static MonoMethodSignature *helper_sig_stelem_ref = NULL;
static guint32 default_opt = MONO_OPT_PEEPHOLE;
-guint32 mono_jit_tls_id = -1;
+guint32 mono_jit_tls_id = 0;
gboolean mono_jit_trace_calls = FALSE;
gboolean mono_break_on_exc = FALSE;
gboolean mono_compile_aot = FALSE;
@@ -117,10 +117,10 @@ mono_type_blittable (MonoType *type)
case MONO_TYPE_R8:
case MONO_TYPE_I:
case MONO_TYPE_U:
+ case MONO_TYPE_OBJECT:
return TRUE;
case MONO_TYPE_VALUETYPE:
case MONO_TYPE_CLASS:
- case MONO_TYPE_OBJECT:
return type->data.klass->blittable;
break;
default:
@@ -155,9 +155,6 @@ mono_method_blittable (MonoMethod *method)
if (!mono_type_blittable (sig->params [i]))
return FALSE;
- if (mono_method_has_marshal_info (method))
- return FALSE;
-
return TRUE;
}
#endif
@@ -1799,6 +1796,7 @@ mono_emit_call_args (MonoCompile *cfg, MonoBasicBlock *bblock, MonoMethodSignatu
{
MonoCallInst *call;
MonoInst *arg;
+ int i;
MONO_INST_NEW_CALL (cfg, call, ret_type_to_call_opcode (sig->ret, calli, virtual));
@@ -1894,7 +1892,7 @@ mono_emulate_opcode (MonoCompile *cfg, MonoInst *tree, MonoInst **iargs, MonoJit
{
MonoInst *ins, *temp = NULL, *store, *load;
MonoInst *last_arg = NULL;
- int nargs;
+ int i, nargs;
MonoCallInst *call;
/*g_print ("emulating: ");
@@ -2357,7 +2355,7 @@ inline_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsig,
#define BIG_BRANCH_OFFSET 13
static int
-get_basic_blocks (MonoCompile *cfg, GHashTable *bbhash, MonoMethodHeader* header, guint real_offset, unsigned char *start, unsigned char *end, unsigned char **pos)
+get_basic_blocks (MonoCompile *cfg, GHashTable *bbhash, MonoMethodHeader* header, guint real_offset, unsigned char *start, unsigned char *end)
{
unsigned char *ip = start;
unsigned char *target;
@@ -2426,7 +2424,6 @@ get_basic_blocks (MonoCompile *cfg, GHashTable *bbhash, MonoMethodHeader* header
}
return 0;
unverified:
- *pos = ip;
return 1;
}
@@ -2461,7 +2458,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
MonoImage *image;
guint32 token, ins_flag;
MonoClass *klass;
- unsigned char *ip, *end, *target, *err_pos;
+ unsigned char *ip, *end, *target;
static double r8_0 = 0.0;
MonoMethodSignature *sig;
MonoType **param_types;
@@ -2603,10 +2600,8 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
link_bblock (cfg, start_bblock, bblock);
}
- if (get_basic_blocks (cfg, bbhash, header, real_offset, ip, end, &err_pos)) {
- ip = err_pos;
+ if (get_basic_blocks (cfg, bbhash, header, real_offset, ip, end))
goto unverified;
- }
mono_debug_init_method (cfg, bblock, breakpoint_id);
@@ -5805,14 +5800,13 @@ mono_thread_abort (MonoObject *obj)
{
MonoJitTlsData *jit_tls = TlsGetValue (mono_jit_tls_id);
- /* handle_remove should be eventually called for this thread, too
- g_free (jit_tls);*/
+ g_free (jit_tls);
ExitThread (-1);
}
-static void*
-setup_jit_tls_data (gpointer stack_start, gpointer abort_func)
+static void
+mono_thread_start_cb (guint32 tid, gpointer stack_start, gpointer func)
{
MonoJitTlsData *jit_tls;
MonoLMF *lmf;
@@ -5821,24 +5815,13 @@ setup_jit_tls_data (gpointer stack_start, gpointer abort_func)
TlsSetValue (mono_jit_tls_id, jit_tls);
- jit_tls->abort_func = abort_func;
+ jit_tls->abort_func = mono_thread_abort;
jit_tls->end_of_stack = stack_start;
lmf = g_new0 (MonoLMF, 1);
lmf->ebp = -1;
- jit_tls->lmf = jit_tls->first_lmf = lmf;
- return jit_tls;
-}
-
-static void
-mono_thread_start_cb (guint32 tid, gpointer stack_start, gpointer func)
-{
- MonoThread *thread;
- void *jit_tls = setup_jit_tls_data (stack_start, mono_thread_abort);
- thread = mono_thread_current ();
- if (thread)
- thread->jit_data = jit_tls;
+ jit_tls->lmf = lmf;
}
void (*mono_thread_attach_aborted_cb ) (MonoObject *obj) = NULL;
@@ -5855,23 +5838,20 @@ mono_thread_abort_dummy (MonoObject *obj)
static void
mono_thread_attach_cb (guint32 tid, gpointer stack_start)
{
- MonoThread *thread;
- void *jit_tls = setup_jit_tls_data (stack_start, mono_thread_abort_dummy);
- thread = mono_thread_current ();
- if (thread)
- thread->jit_data = jit_tls;
-}
+ MonoJitTlsData *jit_tls;
+ MonoLMF *lmf;
-static void
-mini_thread_cleanup (MonoThread *thread)
-{
- MonoJitTlsData *jit_tls = thread->jit_data;
+ jit_tls = g_new0 (MonoJitTlsData, 1);
- if (jit_tls) {
- g_free (jit_tls->first_lmf);
- g_free (jit_tls);
- thread->jit_data = NULL;
- }
+ TlsSetValue (mono_jit_tls_id, jit_tls);
+
+ jit_tls->abort_func = mono_thread_abort_dummy;
+ jit_tls->end_of_stack = stack_start;
+
+ lmf = g_new0 (MonoLMF, 1);
+ lmf->ebp = -1;
+
+ jit_tls->lmf = lmf;
}
void
@@ -6462,7 +6442,7 @@ mono_codegen (MonoCompile *cfg)
cfg->prolog_end = cfg->code_len;
mono_debug_open_method (cfg);
-
+
/* emit code all basic blocks */
for (bb = cfg->bb_entry; bb; bb = bb->next_bb) {
bb->native_offset = cfg->code_len;
@@ -6506,7 +6486,7 @@ mono_codegen (MonoCompile *cfg)
break;
}
case MONO_PATCH_INFO_SWITCH: {
- gpointer *table = mono_mempool_alloc (cfg->domain->code_mp, sizeof (gpointer) * patch_info->table_size);
+ gpointer *table = g_new (gpointer, patch_info->table_size);
patch_info->ip.i = patch_info->ip.label->inst_c0;
for (i = 0; i < patch_info->table_size; i++) {
table [i] = (gpointer)patch_info->data.table [i]->native_offset;
@@ -7075,7 +7055,7 @@ mono_jit_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObjec
MonoMethod *invoke;
MonoObject *(*runtime_invoke) (MonoObject *this, void **params, MonoObject **exc);
invoke = mono_marshal_get_runtime_invoke (method);
- runtime_invoke = mono_jit_compile_method (invoke);
+ runtime_invoke = mono_jit_compile_method (invoke);
return runtime_invoke (obj, params, exc);
}
@@ -7189,9 +7169,7 @@ mono_runtime_install_handlers (void)
sigemptyset (&sa.sa_mask);
sa.sa_flags = 0;
//g_assert (syscall (SYS_sigaction, SIGILL, &sa, NULL) != -1);
- if (!getenv ("MONO_VALGRIND"))
- /* valgrind 20030725 and earlier aborts on this call so we skip it */
- g_assert (sigaction (mono_thread_get_abort_signal (), &sa, NULL) != -1);
+ g_assert (sigaction (mono_thread_get_abort_signal (), &sa, NULL) != -1);
#if 1
/* catch SIGSEGV */
@@ -7228,6 +7206,8 @@ mono_jit_create_remoting_trampoline (MonoMethod *method)
return addr;
}
+static CRITICAL_SECTION ms;
+
MonoDomain *
mini_init (const char *filename)
{
@@ -7235,15 +7215,15 @@ mini_init (const char *filename)
mono_arch_cpu_init ();
- g_thread_init (NULL);
+ metadata_section = &ms;
+ InitializeCriticalSection (metadata_section);
mono_jit_tls_id = TlsAlloc ();
- setup_jit_tls_data ((gpointer)-1, NULL);
+ mono_thread_start_cb (GetCurrentThreadId (), (gpointer)-1, NULL);
mono_burg_init ();
mono_runtime_install_handlers ();
- mono_threads_install_cleanup (mini_thread_cleanup);
mono_install_compile_method (mono_jit_compile_method);
mono_install_trampoline (mono_arch_create_jit_trampoline);
@@ -7409,6 +7389,7 @@ mini_cleanup (MonoDomain *domain)
mono_domain_unload (domain, TRUE);
print_jit_stats ();
+ DeleteCriticalSection (metadata_section);
}
void
diff --git a/mono/mini/mini.h b/mono/mini/mini.h
index 67cb3a92633..d7127def1e3 100644
--- a/mono/mini/mini.h
+++ b/mono/mini/mini.h
@@ -11,10 +11,11 @@
#include <mono/metadata/opcodes.h>
#include <mono/metadata/tabledefs.h>
#include <mono/metadata/profiler-private.h>
-
-#include "mini-arch.h"
#include "regalloc.h"
+/* fixme: configure should set this */
+#define SIZEOF_VOID_P 4
+
#define MONO_USE_AOT_COMPILER
#if 1
@@ -187,7 +188,7 @@ struct MonoInst {
union {
MonoInst *src;
MonoMethodVar *var;
- gssize const_val;
+ gint32 const_val;
gpointer p;
MonoMethod *method;
MonoMethodSignature *signature;
@@ -222,8 +223,8 @@ struct MonoCallInst {
MonoInst *out_args;
gconstpointer fptr;
guint stack_usage;
- regmask_t used_iregs;
- regmask_t used_fregs;
+ guint32 used_iregs;
+ guint32 used_fregs;
};
/*
@@ -324,7 +325,6 @@ struct MonoMethodVar {
typedef struct {
gpointer end_of_stack;
MonoLMF *lmf;
- MonoLMF *first_lmf;
void (*abort_func) (MonoObject *object);
} MonoJitTlsData;
@@ -438,7 +438,7 @@ typedef struct {
guint code_len;
guint prolog_end;
guint epilog_begin;
- regmask_t used_int_regs;
+ guint32 used_int_regs;
guint32 opt;
guint32 prof_options;
guint32 flags;
@@ -453,9 +453,6 @@ typedef struct {
gpointer debug_info;
guint16 *intvars;
MonoProfileCoverageInfo *coverage_info;
-#ifdef __ia64
- guint8 ins, locals, outs; /* reg stack region sizes */
-#endif /* __ia64 */
} MonoCompile;
typedef enum {
@@ -602,7 +599,7 @@ void mono_remove_patch_info (MonoCompile *cfg, int ip);
gpointer mono_get_lmf_addr (void);
GList *mono_varlist_insert_sorted (MonoCompile *cfg, GList *list, MonoMethodVar *mv, gboolean sort_end);
void mono_analyze_liveness (MonoCompile *cfg);
-void mono_linear_scan (MonoCompile *cfg, GList *vars, GList *regs, regmask_t *used_mask);
+void mono_linear_scan (MonoCompile *cfg, GList *vars, GList *regs, guint32 *used_mask);
void mono_create_jump_table (MonoCompile *cfg, MonoInst *label, MonoBasicBlock **bbs, int num_blocks);
int mono_compile_assembly (MonoAssembly *ass, guint32 opts);
MonoCompile *mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, int parts);
diff --git a/mono/mini/regalloc.c b/mono/mini/regalloc.c
index 33635390186..850539a5d9a 100644
--- a/mono/mini/regalloc.c
+++ b/mono/mini/regalloc.c
@@ -41,21 +41,13 @@ mono_regstate_assign (MonoRegState *rs) {
}
for (; i < rs->next_vireg; ++i)
rs->iassign [i] = -1;
-
- rs->fassign = g_malloc (MAX (MONO_MAX_FREGS, rs->next_vfreg));
- for (i = 0; i < MONO_MAX_FREGS; ++i) {
- rs->fassign [i] = i;
- rs->fsymbolic [i] = 0;
- }
- for (; i < rs->next_vfreg; ++i)
- rs->fassign [i] = -1;
}
int
-mono_regstate_alloc_int (MonoRegState *rs, regmask_t allow)
+mono_regstate_alloc_int (MonoRegState *rs, guint32 allow)
{
int i;
- regmask_t mask = allow & rs->ifree_mask;
+ guint32 mask = allow & rs->ifree_mask;
for (i = 0; i < MONO_MAX_IREGS; ++i) {
if (mask & (1 << i)) {
rs->ifree_mask &= ~ (1 << i);
@@ -74,29 +66,6 @@ mono_regstate_free_int (MonoRegState *rs, int reg)
}
}
-int
-mono_regstate_alloc_float (MonoRegState *rs, regmask_t allow)
-{
- int i;
- regmask_t mask = allow & rs->ffree_mask;
- for (i = 0; i < MONO_MAX_FREGS; ++i) {
- if (mask & (1 << i)) {
- rs->ffree_mask &= ~ (1 << i);
- return i;
- }
- }
- return -1;
-}
-
-void
-mono_regstate_free_float (MonoRegState *rs, int reg)
-{
- if (reg >= 0) {
- rs->ffree_mask |= 1 << reg;
- rs->fsymbolic [reg] = 0;
- }
-}
-
inline int
mono_regstate_next_long (MonoRegState *rs)
{
diff --git a/mono/mini/regalloc.h b/mono/mini/regalloc.h
index 22da79b611c..55cacbf8135 100644
--- a/mono/mini/regalloc.h
+++ b/mono/mini/regalloc.h
@@ -1,6 +1,4 @@
-typedef size_t regmask_t;
-
enum {
MONO_REG_FREE,
MONO_REG_FREEABLE,
@@ -14,6 +12,10 @@ enum {
MONO_REG_DOUBLE
};
+/* make this arch-dependent */
+#define MONO_MAX_IREGS 8
+#define MONO_MAX_FREGS 7
+
typedef struct {
/* symbolic registers */
int next_vireg;
@@ -23,8 +25,8 @@ typedef struct {
int num_iregs;
int num_fregs;
- regmask_t ifree_mask;
- regmask_t ffree_mask;
+ guint32 ifree_mask;
+ guint32 ffree_mask;
/* symbolic -> hard register assignment */
char *iassign;
@@ -46,9 +48,7 @@ MonoRegState* mono_regstate_new (void);
void mono_regstate_free (MonoRegState *rs);
void mono_regstate_reset (MonoRegState *rs);
void mono_regstate_assign (MonoRegState *rs);
-int mono_regstate_alloc_int (MonoRegState *rs, regmask_t allow);
+int mono_regstate_alloc_int (MonoRegState *rs, guint32 allow);
void mono_regstate_free_int (MonoRegState *rs, int reg);
-int mono_regstate_alloc_float (MonoRegState *rs, regmask_t allow);
-void mono_regstate_free_float (MonoRegState *rs, int reg);
inline int mono_regstate_next_long (MonoRegState *rs);
diff --git a/mono/mini/tramp-ppc.c b/mono/mini/tramp-ppc.c
index 42d60a9bcf9..b178dd62601 100644
--- a/mono/mini/tramp-ppc.c
+++ b/mono/mini/tramp-ppc.c
@@ -85,7 +85,9 @@ ppc_magic_trampoline (MonoMethod *method, guint32 *code, char *sp)
gpointer addr;
int reg;
+ EnterCriticalSection(metadata_section);
addr = mono_compile_method(method);
+ LeaveCriticalSection(metadata_section);
g_assert(addr);
/* Locate the address of the method-specific trampoline. The call using
@@ -494,7 +496,9 @@ x86_magic_trampoline (int eax, int ecx, int edx, int esi, int edi,
char *o;
gpointer addr;
+ EnterCriticalSection (metadata_section);
addr = mono_compile_method (m);
+ LeaveCriticalSection (metadata_section);
g_assert (addr);
/* go to the start of the call instruction
diff --git a/mono/mini/tramp-sparc.c b/mono/mini/tramp-sparc.c
index f2c7360b1ce..95f90e67667 100644
--- a/mono/mini/tramp-sparc.c
+++ b/mono/mini/tramp-sparc.c
@@ -87,7 +87,9 @@ x86_magic_trampoline (int eax, int ecx, int edx, int esi, int edi,
char *o;
gpointer addr;
+ EnterCriticalSection (metadata_section);
addr = mono_compile_method (m);
+ LeaveCriticalSection (metadata_section);
g_assert (addr);
/* the method was jumped to */
diff --git a/mono/mini/tramp-x86.c b/mono/mini/tramp-x86.c
index 37b6de5b8e4..aa894433fc0 100644
--- a/mono/mini/tramp-x86.c
+++ b/mono/mini/tramp-x86.c
@@ -84,7 +84,9 @@ x86_magic_trampoline (int eax, int ecx, int edx, int esi, int edi,
char *o;
gpointer addr;
+ EnterCriticalSection (metadata_section);
addr = mono_compile_method (m);
+ LeaveCriticalSection (metadata_section);
g_assert (addr);
/* the method was jumped to */
diff --git a/mono/tests/Makefile.am b/mono/tests/Makefile.am
index 4341d28c0b3..61d4c449a59 100644
--- a/mono/tests/Makefile.am
+++ b/mono/tests/Makefile.am
@@ -168,8 +168,7 @@ TEST_CS_SRC= \
threadpool.cs \
threadpool1.cs \
base-definition.cs \
- bug-27420.cs \
- bug-47295.cs
+ bug-27420.cs
# These only compile with MS CSC
TEST_CSC_SRC= \
@@ -254,7 +253,7 @@ testjit: $(TESTSI_CS) $(TESTSI_IL) $(TESTBS) libtest.la
echo "$${passed} test(s) passed. $${failed} test(s) failed."; \
if [ $$failed > 0 ]; then echo -e "\nFailed tests:\n"; for i in $${failed_tests}; do echo $${i}; done; fi;
-testinterp: $(TESTSI_CS) libtest.la
+testinterp: $(TESTSI_CS) $(TESTSI_IL) libtest.la
@failed=0; \
passed=0; \
failed_tests="";\
diff --git a/mono/tests/checked.cs b/mono/tests/checked.cs
index 87c3f2ab23b..659ed5f834c 100755
--- a/mono/tests/checked.cs
+++ b/mono/tests/checked.cs
@@ -93,96 +93,8 @@ namespace test {
if (ui != 100000)
return -6;
-
- // Check mul.ovf
- checked {
- int l;
- int m;
-
- int[][] cases = new int [][] {
- new int [] {0, 0, 0},
- new int [] {-5, 0, 0},
- new int [] {3, -5, -15},
- new int [] {3, 5, 15},
- new int [] {-3, -5, 15},
- new int [] {-3, 5, -15},
- new int [] {-1, 32767, -32767},
- new int [] {32767, -1, -32767}};
-
-
- for (int j = 0; j < cases.Length; ++j)
- if (cases [j][0] * cases [j][1] != cases [j][2])
- return -7 - j;
- }
-
- checked {
- int j;
- int k;
-
- j = k = 0;
- if (j * k != 0)
- return -7;
-
- j = -5;
- k = 0;
- if (j * k != 0)
- return -8;
-
- j = 0;
- k = -5;
- if (j * k != 0)
- return -9;
-
- j = 3;
- k = -5;
- if (j * k != -15)
- return -10;
-
- j = 3;
- k = 5;
- if (j * k != 15)
- return -11;
-
- j = -3;
- k = -5;
- if (j * k != 15)
- return -12;
-
- j = -3;
- k = 5;
- if (j * k != -15)
- return -13;
-
- j = -1;
- k = 32767;
- if (j * k != -32767)
- return -14;
-
- j = 32767;
- k = -1;
- if (j * k != -32767)
- return -15;
- }
-
- checked {
- long l;
- long m;
-
- long[][] cases = new long [][] {
- new long [] {0, 0, 0},
- new long [] {-5, 0, 0},
- new long [] {3, -5, -15},
- new long [] {3, 5, 15},
- new long [] {-3, -5, 15},
- new long [] {-3, 5, -15},
- new long [] {-1, 2147483647, -2147483647},
- new long [] {2147483647, -1, -2147483647}};
-
- for (int j = 0; j < cases.Length; ++j)
- if (cases [j][0] * cases [j][1] != cases [j][2])
- return -15 - j;
- }
-
+
+
Console.WriteLine("test-ok");
return 0;
diff --git a/mono/tests/threadpool.cs b/mono/tests/threadpool.cs
index cfcc6ee4c8a..ae64daf8137 100755
--- a/mono/tests/threadpool.cs
+++ b/mono/tests/threadpool.cs
@@ -8,7 +8,7 @@ public class Test {
public static void test_callback (object state) {
Console.WriteLine("test_casllback:" + state);
Thread.Sleep (200);
- Interlocked.Increment (ref csum);
+ csum++;
}
public static int Main () {
diff --git a/mono/tests/threadpool1.cs b/mono/tests/threadpool1.cs
index ea3014a3da7..6e2c1eff721 100755
--- a/mono/tests/threadpool1.cs
+++ b/mono/tests/threadpool1.cs
@@ -12,7 +12,7 @@ public class Test {
Console.WriteLine("test_casllback:" + state + "ATH: " + workerThreads);
Thread.Sleep (10);
- Interlocked.Increment (ref csum);
+ csum += 1;
}
public static int Main () {
diff --git a/mono/utils/ChangeLog b/mono/utils/ChangeLog
index 050eeb8b245..16a0d6b19f4 100644
--- a/mono/utils/ChangeLog
+++ b/mono/utils/ChangeLog
@@ -1,19 +1,3 @@
-2003-08-26 Zoltan Varga <vargaz@freemail.hu>
-
- * mono-hash.h mono-hash.c (mono_g_hash_table_remap): New function used
- to remap hashtable values during a copying collection. Not used at the
- moment.
- * mono-hash.c (g_hash_node_new): Restructured to avoid the global lock
- in the common case.
- * mono-hash.c (mono_g_hash_table_new_full): Enable the optimization of
- the key function even if the client supplied g_direct_equal instead of
- NULL.
-
-2003-08-22 Duncan Mak <duncan@ximian.com>
-
- * strtod.c: 64-bit related fixes from Laurent Morichetti
- <l_m@pacbell.net>. Patch approval from Miguel.
-
Fri Jun 6 19:09:51 CEST 2003 Paolo Molaro <lupus@ximian.com>
* mono-logger.h, mono-logger.c, Makefile.am: added
diff --git a/mono/utils/mono-hash.c b/mono/utils/mono-hash.c
index fa209a9c94f..c5c7a543160 100644
--- a/mono/utils/mono-hash.c
+++ b/mono/utils/mono-hash.c
@@ -156,7 +156,7 @@ mono_g_hash_table_new_full (GHashFunc hash_func,
hash_table->size = HASH_TABLE_MIN_SIZE;
hash_table->nnodes = 0;
hash_table->hash_func = hash_func ? hash_func : g_direct_hash;
- hash_table->key_equal_func = key_equal_func == g_direct_equal ? NULL : key_equal_func;
+ hash_table->key_equal_func = key_equal_func;
hash_table->key_destroy_func = key_destroy_func;
hash_table->value_destroy_func = value_destroy_func;
#if HAVE_BOEHM_GC
@@ -281,50 +281,6 @@ mono_g_hash_table_lookup_extended (MonoGHashTable *hash_table,
return FALSE;
}
-static inline MonoGHashNode*
-g_hash_node_new (gpointer key,
- gpointer value)
-{
- MonoGHashNode *hash_node = NULL;
-
-#if HAVE_BOEHM_GC
- if (node_free_list) {
- G_LOCK (g_hash_global);
-
- if (node_free_list) {
- hash_node = node_free_list;
- node_free_list = node_free_list->next;
- }
- G_UNLOCK (g_hash_global);
- }
- if (!hash_node)
- hash_node = GC_MALLOC (sizeof (MonoGHashNode));
-#else
- G_LOCK (g_hash_global);
- if (node_free_list)
- {
- hash_node = node_free_list;
- node_free_list = node_free_list->next;
- }
- else
- {
- if (!node_mem_chunk)
- node_mem_chunk = g_mem_chunk_new ("hash node mem chunk",
- sizeof (MonoGHashNode),
- 1024, G_ALLOC_ONLY);
-
- hash_node = g_chunk_new (MonoGHashNode, node_mem_chunk);
- }
- G_UNLOCK (g_hash_global);
-#endif
-
- hash_node->key = key;
- hash_node->value = value;
- hash_node->next = NULL;
-
- return hash_node;
-}
-
/**
* g_hash_table_insert:
* @hash_table: a #GHashTable.
@@ -633,30 +589,6 @@ mono_g_hash_table_size (MonoGHashTable *hash_table)
return hash_table->nnodes;
}
-/**
- * mono_g_hash_table_remap:
- *
- * Calls the given function for each key-value pair in the hash table,
- * and replaces the value stored in the hash table by the value returned by
- * the function.
- *
- **/
-void
-mono_g_hash_table_remap (MonoGHashTable *hash_table,
- MonoGRemapperFunc func,
- gpointer user_data)
-{
- MonoGHashNode *node;
- gint i;
-
- g_return_if_fail (hash_table != NULL);
- g_return_if_fail (func != NULL);
-
- for (i = 0; i < hash_table->size; i++)
- for (node = hash_table->nodes[i]; node; node = node->next)
- node->value = (* func) (node->key, node->value, user_data);
-}
-
static void
g_hash_table_resize (MonoGHashTable *hash_table)
{
@@ -695,6 +627,40 @@ g_hash_table_resize (MonoGHashTable *hash_table)
hash_table->size = new_size;
}
+static MonoGHashNode*
+g_hash_node_new (gpointer key,
+ gpointer value)
+{
+ MonoGHashNode *hash_node;
+
+ G_LOCK (g_hash_global);
+ if (node_free_list)
+ {
+ hash_node = node_free_list;
+ node_free_list = node_free_list->next;
+ }
+ else
+ {
+#if HAVE_BOEHM_GC
+ hash_node = GC_MALLOC (sizeof (MonoGHashNode));
+#else
+ if (!node_mem_chunk)
+ node_mem_chunk = g_mem_chunk_new ("hash node mem chunk",
+ sizeof (MonoGHashNode),
+ 1024, G_ALLOC_ONLY);
+
+ hash_node = g_chunk_new (MonoGHashNode, node_mem_chunk);
+#endif
+ }
+ G_UNLOCK (g_hash_global);
+
+ hash_node->key = key;
+ hash_node->value = value;
+ hash_node->next = NULL;
+
+ return hash_node;
+}
+
static void
g_hash_node_destroy (MonoGHashNode *hash_node,
GDestroyNotify key_destroy_func,
diff --git a/mono/utils/mono-hash.h b/mono/utils/mono-hash.h
index 29e9c621e14..c76f7ca2620 100644
--- a/mono/utils/mono-hash.h
+++ b/mono/utils/mono-hash.h
@@ -39,9 +39,6 @@ G_BEGIN_DECLS
typedef struct _MonoGHashTable MonoGHashTable;
-typedef gpointer (*MonoGRemapperFunc) (gpointer key, gpointer value,
- gpointer user_data);
-
/* Hash tables
*/
MonoGHashTable* mono_g_hash_table_new (GHashFunc hash_func,
@@ -78,10 +75,6 @@ guint mono_g_hash_table_foreach_steal (MonoGHashTable *hash_table,
gpointer user_data);
guint mono_g_hash_table_size (MonoGHashTable *hash_table);
-void mono_g_hash_table_remap (MonoGHashTable *hash_table,
- MonoGRemapperFunc func,
- gpointer user_data);
-
G_END_DECLS
#endif /* __MONO_G_HASH_H__ */
diff --git a/mono/utils/strtod.c b/mono/utils/strtod.c
index a480c713c61..c36b148b1c4 100644
--- a/mono/utils/strtod.c
+++ b/mono/utils/strtod.c
@@ -138,39 +138,12 @@ static char sccsid[] = "@(#)strtod.c 8.1 (Berkeley) 6/4/93";
* FLT_RADIX, FLT_ROUNDS, and DBL_MAX.
*/
-#if defined(i386) || defined(mips) && defined(MIPSEL) || defined (__arm__)
-
+#if defined(i386) || defined(mips) && defined(MIPSEL)
#define IEEE_8087
-#define Long long
-
-#elif defined(__ia64)
-
-# ifndef __LP64__
-# define Long long
-# else
-# define Long int
-# endif
-# ifdef __hpux
-# define IEEE_MC68k
-# else
-# define IEEE_8087
-# endif
-
-#elif defined(__hppa)
-
-# define IEEE_MC68k
-# ifndef __LP64__
-# define Long long
-# else
-# define Long int
-# endif
-
#else
#define IEEE_MC68k
#endif
-#define ULong unsigned Long
-
#ifdef DEBUG
#include "stdio.h"
#define Bug(x) {fprintf(stderr, "%s\n", x); exit(1);}
@@ -260,11 +233,11 @@ Exactly one of IEEE_8087, IEEE_MC68k, VAX, or IBM should be defined.
#endif
#ifdef IEEE_8087
-#define word0(x) ((ULong *)&x)[1]
-#define word1(x) ((ULong *)&x)[0]
+#define word0(x) ((unsigned long *)&x)[1]
+#define word1(x) ((unsigned long *)&x)[0]
#else
-#define word0(x) ((ULong *)&x)[0]
-#define word1(x) ((ULong *)&x)[1]
+#define word0(x) ((unsigned long *)&x)[0]
+#define word1(x) ((unsigned long *)&x)[1]
#endif
/* The following definition of Storeinc is appropriate for MIPS processors.
@@ -409,7 +382,7 @@ extern "C" char *__dtoa(double d, int mode, int ndigits,
Bigint {
struct Bigint *next;
int k, maxwds, sign, wds;
- ULong x[1];
+ unsigned long x[1];
};
typedef struct Bigint Bigint;
@@ -426,7 +399,7 @@ Balloc
Bigint *rv;
x = 1 << k;
- rv = (Bigint *)malloc(sizeof(Bigint) + (x-1)*sizeof(Long));
+ rv = (Bigint *)malloc(sizeof(Bigint) + (x-1)*sizeof(long));
rv->k = k;
rv->maxwds = x;
rv->sign = rv->wds = 0;
@@ -445,7 +418,7 @@ Bfree
}
#define Bcopy(x,y) memcpy((char *)&x->sign, (char *)&y->sign, \
-y->wds*sizeof(Long) + 2*sizeof(int))
+y->wds*sizeof(long) + 2*sizeof(int))
static Bigint *
multadd
@@ -456,9 +429,9 @@ multadd
#endif
{
int i, wds;
- ULong *x, y;
+ unsigned long *x, y;
#ifdef Pack_32
- ULong xi, z;
+ unsigned long xi, z;
#endif
Bigint *b1;
@@ -494,14 +467,14 @@ multadd
static Bigint *
s2b
#ifdef KR_headers
- (s, nd0, nd, y9) CONST char *s; int nd0, nd; ULong y9;
+ (s, nd0, nd, y9) CONST char *s; int nd0, nd; unsigned long y9;
#else
- (CONST char *s, int nd0, int nd, ULong y9)
+ (CONST char *s, int nd0, int nd, unsigned long y9)
#endif
{
Bigint *b;
int i, k;
- Long x, y;
+ long x, y;
x = (nd + 8) / 9;
for (k = 0, y = 1; x > y; y <<= 1, k++) ;
@@ -532,9 +505,9 @@ s2b
static int
hi0bits
#ifdef KR_headers
- (x) register ULong x;
+ (x) register unsigned long x;
#else
- (register ULong x)
+ (register unsigned long x)
#endif
{
register int k = 0;
@@ -566,13 +539,13 @@ hi0bits
static int
lo0bits
#ifdef KR_headers
- (y) ULong *y;
+ (y) unsigned long *y;
#else
- (ULong *y)
+ (unsigned long *y)
#endif
{
register int k;
- register ULong x = *y;
+ register unsigned long x = *y;
if (x & 7) {
if (x & 1)
@@ -637,10 +610,10 @@ mult
{
Bigint *c;
int k, wa, wb, wc;
- ULong carry, y, z;
- ULong *x, *xa, *xae, *xb, *xbe, *xc, *xc0;
+ unsigned long carry, y, z;
+ unsigned long *x, *xa, *xae, *xb, *xbe, *xc, *xc0;
#ifdef Pack_32
- ULong z2;
+ unsigned long z2;
#endif
if (a->wds < b->wds) {
@@ -763,7 +736,7 @@ lshift
{
int i, k1, n, n1;
Bigint *b1;
- ULong *x, *x1, *xe, z;
+ unsigned long *x, *x1, *xe, z;
#ifdef Pack_32
n = k >> 5;
@@ -820,7 +793,7 @@ cmp
(Bigint *a, Bigint *b)
#endif
{
- ULong *xa, *xa0, *xb, *xb0;
+ unsigned long *xa, *xa0, *xb, *xb0;
int i, j;
i = a->wds;
@@ -856,10 +829,10 @@ diff
{
Bigint *c;
int i, wa, wb;
- Long borrow, y; /* We need signed shifts here. */
- ULong *xa, *xae, *xb, *xbe, *xc;
+ long borrow, y; /* We need signed shifts here. */
+ unsigned long *xa, *xae, *xb, *xbe, *xc;
#ifdef Pack_32
- Long z;
+ long z;
#endif
i = cmp(a,b);
@@ -933,7 +906,7 @@ ulp
(double x)
#endif
{
- register Long L;
+ register long L;
double a;
L = (word0(x) & Exp_mask) - (P-1)*Exp_msk1;
@@ -969,11 +942,11 @@ b2d
(Bigint *a, int *e)
#endif
{
- ULong *xa, *xa0, w, y, z;
+ unsigned long *xa, *xa0, w, y, z;
int k;
double d;
#ifdef VAX
- ULong d0, d1;
+ unsigned long d0, d1;
#else
#define d0 word0(d)
#define d1 word1(d)
@@ -1040,9 +1013,9 @@ d2b
{
Bigint *b;
int de, i, k;
- ULong *x, y, z;
+ unsigned long *x, y, z;
#ifdef VAX
- ULong d0, d1;
+ unsigned long d0, d1;
d0 = word0(d) >> 16 | word0(d) << 16;
d1 = word1(d) >> 16 | word1(d) << 16;
#else
@@ -1233,8 +1206,8 @@ bsd_strtod
e, e1, esign, i, j, k, nd, nd0, nf, nz, nz0, sign;
CONST char *s, *s0, *s1;
double aadj, aadj1, adj, rv, rv0;
- Long L;
- ULong y, z;
+ long L;
+ unsigned long y, z;
Bigint *bb, *bb1, *bd, *bd0, *bs, *delta;
char decimal_point = '.';
@@ -1745,12 +1718,12 @@ quorem
#endif
{
int n;
- Long borrow, y;
- ULong carry, q, ys;
- ULong *bx, *bxe, *sx, *sxe;
+ long borrow, y;
+ unsigned long carry, q, ys;
+ unsigned long *bx, *bxe, *sx, *sxe;
#ifdef Pack_32
- Long z;
- ULong si, zs;
+ long z;
+ unsigned long si, zs;
#endif
n = S->wds;
@@ -1921,10 +1894,10 @@ __bsd_dtoa
int bbits, b2, b5, be, dig, i, ieps, ilim, ilim0, ilim1,
j, j1, k, k0, k_check, leftright, m2, m5, s2, s5,
spec_case, try_quick;
- Long L;
+ long L;
#ifndef Sudden_Underflow
int denorm;
- ULong x;
+ unsigned long x;
#endif
Bigint *b, *b1, *delta, *mlo, *mhi, *S;
double d2, ds, eps;
diff --git a/scripts/.cvsignore b/scripts/.cvsignore
index c5f2cdd8916..0c9351957eb 100644
--- a/scripts/.cvsignore
+++ b/scripts/.cvsignore
@@ -1,10 +1,4 @@
Makefile
Makefile.in
-cilc
-ilasm
-mbas
mcs
-monoresgen
-secutil
-sqlsharp
-xsd
+mbas
diff --git a/scripts/wsdl.in b/scripts/wsdl.in
new file mode 100644
index 00000000000..b8294982ed7
--- /dev/null
+++ b/scripts/wsdl.in
@@ -0,0 +1,2 @@
+#!/bin/sh
+@bindir@/@mono_interp@ @bindir@/wsdl.exe "$@"
diff --git a/web/bugs b/web/bugs
new file mode 100644
index 00000000000..bfb06a1883e
--- /dev/null
+++ b/web/bugs
@@ -0,0 +1,69 @@
+* Bug reporting
+
+ To report bugs you need to create a <a
+ href="http://bugzilla.ximian.com/createaccount.cgi">Bugzilla
+ Account</a>.
+
+ Here are some convenient shortcuts to browse or add bug reports.
+
+ <ul>
+ * <a href="http://bugzilla.ximian.com/buglist.cgi?product=Mono%2FClass+Libraries&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&email1=&emailtype1=substring&emailassigned_to1=1&email2=&emailtype2=substring&emailreporter2=1&changedin=&chfieldfrom=&chfieldto=Now&chfieldvalue=&short_desc=&short_desc_type=substring&long_desc=&long_desc_type=substring&bug_file_loc=&bug_file_loc_type=substring&keywords=&keywords_type=anywords&op_sys_details=&op_sys_details_type=substring&version_details=&version_details_type=substring&newqueryname=&form_name=query&order=bugs.priority%2C%20bugs.bug_id">[Query]</> <a href="http://bugzilla.ximian.com/enter_bug.cgi?product=Mono%2FClass%20Libraries">[Add]</a> Class Libraries
+
+ * <a href="http://bugzilla.ximian.com/buglist.cgi?product=Mono%2FAssembler&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&email1=&emailtype1=substring&emailassigned_to1=1&email2=&emailtype2=substring&emailreporter2=1&changedin=&chfieldfrom=&chfieldto=Now&chfieldvalue=&short_desc=&short_desc_type=substring&long_desc=&long_desc_type=substring&bug_file_loc=&bug_file_loc_type=substring&keywords=&keywords_type=anywords&op_sys_details=&op_sys_details_type=substring&version_details=&version_details_type=substring&cmdtype=doit&newqueryname=&order=Reuse+same+sort+as+last+time&form_name=query">[Query]</a> <a href="http://bugzilla.ximian.com/enter_bug.cgi?product=Mono%2FAssembler">[Add]</a> IL Assembler.
+
+ * <a href="http://bugzilla.ximian.com/buglist.cgi?product=Mono%2FMCS&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&email1=&emailtype1=substring&emailassigned_to1=1&email2=&emailtype2=substring&emailreporter2=1&changedin=&chfieldfrom=&chfieldto=Now&chfieldvalue=&short_desc=&short_desc_type=substring&long_desc=&long_desc_type=substring&bug_file_loc=&bug_file_loc_type=substring&keywords=&keywords_type=anywords&op_sys_details=&op_sys_details_type=substring&version_details=&version_details_type=substring&cmdtype=doit&newqueryname=&order=Reuse+same+sort+as+last+time&form_name=query">[Query]</a> <a href="http://bugzilla.ximian.com/enter_bug.cgi?product=Mono%2FMCS">[Add]</a> C# Compiler.
+
+ * <a href="http://bugzilla.ximian.com/buglist.cgi?product=Mono%2FRuntime&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&email1=&emailtype1=substring&emailassigned_to1=1&email2=&emailtype2=substring&emailreporter2=1&changedin=&chfieldfrom=&chfieldto=Now&chfieldvalue=&short_desc=&short_desc_type=substring&long_desc=&long_desc_type=substring&bug_file_loc=&bug_file_loc_type=substring&keywords=&keywords_type=anywords&op_sys_details=&op_sys_details_type=substring&version_details=&version_details_type=substring&cmdtype=doit&newqueryname=&order=Reuse+same+sort+as+last+time&form_name=query">[Query]</a> <a href="http://bugzilla.ximian.com/enter_bug.cgi?product=Mono%2FRuntime">[Add]</a> Runtime
+
+ * <a href="http://bugzilla.ximian.com/buglist.cgi?product=Mono%2FDoctools&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&email1=&emailtype1=substring&emailassigned_to1=1&email2=&emailtype2=substring&emailreporter2=1&changedin=&chfieldfrom=&chfieldto=Now&chfieldvalue=&short_desc=&short_desc_type=substring&long_desc=&long_desc_type=substring&bug_file_loc=&bug_file_loc_type=substring&keywords=&keywords_type=anywords&op_sys_details=&op_sys_details_type=substring&version_details=&version_details_type=substring&cmdtype=doit&newqueryname=&order=Reuse+same+sort+as+last+time&form_name=query">[Query]</a> <a href="http://bugzilla.ximian.com/enter_bug.cgi?product=Mono%2FDoctools">[Add]</a> Documentation system.
+
+ * <a href="http://bugzilla.ximian.com/buglist.cgi?product=gtk%23&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&email1=&emailtype1=substring&emailassigned_to1=1&email2=&emailtype2=substring&emailreporter2=1&changedin=&chfieldfrom=&chfieldto=Now&chfieldvalue=&short_desc=&short_desc_type=substring&long_desc=&long_desc_type=substring&bug_file_loc=&bug_file_loc_type=substring&keywords=&keywords_type=anywords&op_sys_details=&op_sys_details_type=substring&version_details=&version_details_type=substring&cmdtype=doit&newqueryname=&order=Reuse+same+sort+as+last+time&form_name=query">[Query]</a> <a href="http://bugzilla.ximian.com/enter_bug.cgi?product=gtk%23">[Add]</a> Gtk#
+
+ * <a href="http://bugzilla.ximian.com/buglist.cgi?product=Mono%2FDebugger&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&email1=&emailtype1=substring&emailassigned_to1=1&email2=&emailtype2=substring&emailreporter2=1&changedin=&chfieldfrom=&chfieldto=Now&chfieldvalue=&short_desc=&short_desc_type=substring&long_desc=&long_desc_type=substring&bug_file_loc=&bug_file_loc_type=substring&keywords=&keywords_type=anywords&op_sys_details=&op_sys_details_type=substring&version_details=&version_details_type=substring&cmdtype=doit&newqueryname=&order=Reuse+same+sort+as+last+time&form_name=query">[Query]</a> <a href="http://bugzilla.ximian.com/enter_bug.cgi?product=Mono%2FDebugger">[Add]</a> Debugger.
+
+ * <a href="http://bugzilla.ximian.com/buglist.cgi?product=Mono%2FClass+Libraries&product=Mono%2FMCS&product=Mono%2FRuntime&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&email1=&emailtype1=substring&emailassigned_to1=1&email2=&emailtype2=substring&emailreporter2=1&changedin=&chfieldfrom=&chfieldto=Now&chfieldvalue=&short_desc=&short_desc_type=substring&long_desc=&long_desc_type=substring&bug_file_loc=&bug_file_loc_type=substring&keywords=&keywords_type=anywords&op_sys_details=&op_sys_details_type=substring&version_details=&version_details_type=substring&cmdtype=doit&order=%27Importance%27&form_name=query">[Query]</a> All core components.
+ </ul>
+
+<a name="goodbugreport"/>
+** How to make good bug reports
+
+ <ol>
+ * Submit a test case, the smaller it is, the better
+
+ * Use <a href="http://bugzilla.ximian.com">
+ http://bugzilla.ximian.com</a> to report the bug.
+
+ <p>In <b>addition</b> to bugzilla, posting to the list is
+ fine if the bug merits larger exposure or design
+ discussions to solve; posting to the list twice or more
+ is just a way to annoy people and make them waste time,
+ specially when you start a new thread about it.
+
+ * If the test involves libraries or assemblies that are
+ not part of mono, add info about where to download all
+ the dependencies, and how to compile/install them.
+
+ * If compiling the test case requires more than:
+ <pre> mcs test.cs </pre>
+ provide the <b>full command line</b> you used to compile
+ the test.
+
+ * If running the test requires more than:
+ <pre> mono test.exe </pre>
+ provide the <b>full command line</b> needed to replicate
+ the bug.
+
+ * Provide info about the version of the software you're
+ using (both mono and the operating system or relevant
+ libraries).
+
+ * Provide the output you expect the test case to produce.
+
+ * Provide the actual output <b>you</b> get from the test case.
+ </ol>
+
+ A good bug report complies with at least 6 items from the list.
+ If your bug report complies with 3 or less items, it is very
+ poor and it means it will take much more time to fix (when it's
+ not ignored).
+
diff --git a/web/download b/web/download
index 211f6d4cb63..26f6380b3fb 100644
--- a/web/download
+++ b/web/download
@@ -12,113 +12,7 @@
href="http://www.go-mono.org/mono-beginning.html">Resources/Beginning
section</a>, the <a
href="http://www.go-mono.org/faq.html">FAQ</a>.
- <table>
- <tbody>
- <tr bgcolor="#DDDDDD">
- <td>
- <b>Release 0.26</b><br>
- <a href="archive/mono-0.26.html">Release notes</a><br>
- Aug 14, 2003
- </td>
- <td>
- <table cellspacing="1" cellpadding="3">
- <tr bgcolor="#BBBBBB">
- <td>
- <b>Source Code</b>
- </td>
- <td>
- <ul>
- <li><a href="archive/mcs-0.26.tar.gz">Mono Class Libraries and C# Compiler.</a>
- <li><a href="archive/mono-0.26.tar.gz">Mono Runtime</a>
- <li><a href="archive/xsp-0.5.tar.gz">XSP web server (0.5)</a>
- <li><a href="archive/mod_mono-0.4.tar.gz">Apache Mono module (mod_mono)</a>
- <li><a href="archive/monodoc-0.6.tar.gz">MonoDoc 0.6</a>
- </ul>
- </td>
- </tr>
- <tr bgcolor="#BBBBBB">
- <td>
- <b>Source RPMs</b><br>
- (No RPMS for XSP).
- </td>
- <td>
- <ul>
- <li><a href="archive/redhat-90-i386/mono-0.26-1.ximian.6.1.src.rpm">mono-0.26-1.src.rpm (RH9)</a>
- <li><a href="archive/redhat-90-i386/mono-0.26-1.ximian.5.1.src.rpm">mono-0.26-1.src.rpm (RH8)</a>
- </ul>
- </td>
- </tr>
- <tr>
- <td></td>
- </tr>
- <tr>
- <td bgcolor="#999999">
- <img src="images/redhat-36.gif"><b>Red Hat 9.0/x86</b>
- <ul>
- <li><a href="archive/redhat-90-i386/mono-0.26-1.ximian.6.1.i386.rpm">mono-0.26-1.ximian.6.1.i386.rpm</a>
- <li><a href="archive/redhat-90-i386/mono-devel-0.26-1.ximian.6.1.i386.rpm">mono-devel-0.26-1.ximian.6.1.i386.rpm</a>
- <li><a href="archive/redhat-90-i386/mono-debuginfo-0.26-1.ximian.6.1.i386.rpm">mono-debuginfo-0.26-1.i386.rpm</a>
- <br>
- <li><a href="archive/redhat-90-i386/libpixregion-0.1.0-1.ximian.6.1.i386.rpm">libpixregion-0.1.0-1.ximian.6.1.i386.rpm</a>
- <li><a href="archive/redhat-90-i386/libpixregion-debuginfo-0.1.0-1.ximian.6.1.i386.rpm">libpixregion-debuginfo-0.1.0-1.ximian.6.1.i386.rpm</a>
- <li><a href="archive/redhat-90-i386/libic-0.1.0-1.ximian.6.1.i386.rpm">libic-0.1.0-1.ximian.6.1.i386.rpm</a>
- <li><a href="archive/redhat-90-i386/libic-debuginfo-0.1.0-1.ximian.6.1.i386.rpm">libic-debuginfo-0.1.0-1.ximian.6.1.i386.rpm</a>
- <li><a href="archive/redhat-90-i386/xc-0.1.0-1.ximian.6.1.i386.rpm">xc-0.1.0-1.ximian.6.1.i386.rpm</a>
- <li><a href="archive/redhat-90-i386/xc-debuginfo-0.1.0-1.ximian.6.1.i386.rpm">xc-debuginfo-0.1.0-1.ximian.6.1.i386.rpm</a>
- <li><a href="archive/redhat-90-i386/xr-0.1.0-1.ximian.6.1.i386.rpm">xr-0.1.0-1.ximian.6.1.i386.rpm</a>
- <li><a href="archive/redhat-90-i386/xr-debuginfo-0.1.0-1.ximian.6.1.i386.rpm">xr-debuginfo-0.1.0-1.ximian.6.1.i386.rpm</a>
- <br>
- <li><a href="archive/redhat-90-i386/monodoc-0.6-1.ximian.6.1.i386.rpm">monodoc-0.6-1.ximian.6.1.i386.rpm</a> (To be used only with CVS gtk-sharp)
- <li><a href="archive/redhat-90-i386/monodoc-debuginfo-0.5-1.ximian.6.1.i386.rpm">monodoc-debuginfo-0.5-1.ximian.6.1.i386.rpm</a>
- <li><a href="archive/mono-wine-20030318-1.ximian.6.2.i386.rpm">mono-wine-20030318-1.ximian.6.2.i386.rpm</a>
- <li><a href="archive/mono-wine-debuginfo-20030318-1.ximian.6.2.i386.rpm">mono-wine-debuginfo-20030318-1.ximian.6.2.i386.rpm</a>
- </ul>
- </td>
- <td bgcolor="#999999">
- <img src="images/redhat-36.gif"><b>Red Hat 8.0/x86</b>
- <ul>
- <li><a href="archive/redhat-80-i386/mono-0.26-2.ximian.5.1.i386.rpm">mono-0.26-2.ximian.5.1.i386.rpm</a>
- <li><a href="archive/redhat-80-i386/mono-devel-0.26-2.ximian.5.1.i386.rpm">mono-devel-0.26-2.ximian.5.1.i386.rpm</a>
- <br>
- <li><a href="archive/redhat-80-i386/monodoc-0.5-1.ximian.5.1.i386.rpm">monodoc-0.5-1.ximian.5.1.i386.rpm</a> (To be used only with CVS gtk-sharp)
- <li><a href="archive/mono-wine-20030318-1.ximian.5.2.i386.rpm">mono-wine-20030318-1.ximian.5.2.i386.rpm</a>
- </ul>
- </td>
- </tr>
- <tr>
- <td bgcolor="#999999">
- <img src="images/debian-36.gif"><b>Debian</b>
- <ul>
- <li><a href="h#ttp://www.debianplanet.com/mono/">Debian Packages here.</a>
- </ul>
- </td>
- <td bgcolor="#999999">
- <img src="images/mandrake-36.gif"><b>Mandrake 9.1/x86</b>
- <ul>
- <li><a href="archive/mandrake-91-i586/mono-0.26-1.ximian.6.1.i586.rpm">mono-0.26-1.ximian.6.1.i586.rpm</a>
- <li><a href="archive/mandrake-91-i586/mono-devel-0.26-1.ximian.6.1.i586.rpm">mono-devel-0.26-1.ximian.6.1.i586.rpm</a>
-<!-- <li><a href="archive/mandrake-91-i586/monodoc-0.5-1.ximian.6.1.i586.rpm">monodoc-0.5-1.ximian.6.1.i586.rpm</a> -->
- </ul>
- </td>
- </tr>
- <tr>
- <td bgcolor="#999999">
- <img src="images/suse-36.gif"><b>SuSE 8.2</b>
- <ul>
- <li><a href="archive/suse-82-i586/mono-0.26-2.ximian.7.1.i586.rpm">mono-0.26-2.ximian.7.1.i586.rpm</a>
- <li><a href="archive/suse-82-i586/mono-devel-0.26-2.ximian.7.1.i586.rpm">mono-devel-0.26-2.ximian.7.1.i586.rpm</a>
- </ul>
- </td>
- <td bgcolor="#999999">
- <img src="images/windows-36.gif"><b>Windows installer</b>
- <ul>
- <li><a href="archive/mono-0.26-win32-2.exe">mono-0.26-win32-2.exe</a>
- </ul>
- </td>
- </tr>
- </table>
- </td>
<table>
<tbody>
<tr bgcolor="#DDDDDD">
diff --git a/web/index b/web/index
index dea9f820532..7138e25e740 100644
--- a/web/index
+++ b/web/index
@@ -14,8 +14,8 @@
runtime can be <a href="embedded-api.html">embedded</a> into your
application.
- Mono has implementations of both <a href="ado-net.html">ADO.NET</a>
- and <a href="asp-net.html">ASP.NET</a> as part of its distribution.
+ Mono has implementations of both <a href="ado-net">ADO.NET</a>
+ and <a href="asp-net">ASP.NET</a> as part of its distribution.
You can read our <a href="rationale.html">rationale</a> for
this project. If you have questions about the project, please
@@ -151,21 +151,6 @@
</tr>
</table>
-@item Aug 14th, 2003: Mono 0.26 has been released
-
- A new version of Mono is available, the new features include:
- <a href="http://www.cairographics.org/">Cairo support</a>, <a
- href="http://remoting-corba.sf.net">Remoting.Corba</a>
- support, as well as a managed XSLT implementation.
-
- Existing features have been improved vastly: better
- Windows.Forms, runtime, faster compiler, web services, better
- compliance to the spec and more.
-
- Check out the <a
- href="http://www.go-mono.com/archive/mono-0.26.html">Release
- notes</a> for details.
-
@item Aug 9th, 2003: Python for .NET Preview 2 available; Mono Documentation site up.
Brian Lloyd has <a
diff --git a/web/mysql b/web/mysql
index 7b0a4d5811b..56c5f112950 100755
--- a/web/mysql
+++ b/web/mysql
@@ -43,7 +43,7 @@
in the Microsoft .NET Environment</a> is an article
by Mr. Venu who is a MySQL AB developer.</li>
- <p>Testing for Mono's Mono.Data.MySql and ByteFX's ByteFX.Data.MySqlClient is below.
+ <p>Testing for Mono's Mono.Data.MySql and ByteFX's ByteFX.Data.MySQLClient is below.
** Current Status
@@ -51,7 +51,7 @@
<ul>
- <li>ByteFX.Data.MySqlClient
+ <li>ByteFX.Data.MySQLClient
<ul>
<li>Build and Runs on Microsoft .NET and Mono</li>
<li>Works with SQL# (command-line and GTK# GUI versions)</li>
@@ -109,7 +109,7 @@
The current plan for the MySQL data providers:
<ul>
- <li>ByteFX.Data.MySqlClient
+ <li>ByteFX.Data.MySQLClient
<ul>
<li>Testing and fixes</li>
<li>Implement missing features</li>
@@ -163,7 +163,7 @@
<pre>
using System;
using System.Data;
- using ByteFX.Data.MySqlClient;
+ using ByteFX.Data.MySQLClient;
public class Test
{
@@ -175,7 +175,7 @@
"User ID=myuserid;" +
"Password=mypassword;";
IDbConnection dbcon;
- dbcon = new MySqlConnection(connectionString);
+ dbcon = new MySQLConnection(connectionString);
dbcon.Open();
IDbCommand dbcmd = dbcon.CreateCommand();
// requires a table to be created named employee
diff --git a/web/pending-classes.in b/web/pending-classes.in
deleted file mode 100644
index 1cdb5a4cb36..00000000000
--- a/web/pending-classes.in
+++ /dev/null
@@ -1,246 +0,0 @@
-System.Object
-System.Exception
-System.ValueType
-System.Delegate
-System.MulticastDelegate
-System.Enum
-System.Activator
-System.ArgIterator
-System.__ComObject
-System.TypedReference
-System.Security.AllowPartiallyTrustedCallersAttribute
-System.Runtime.Serialization.Formatter
-System.Runtime.Serialization.FormatterConverter
-System.Runtime.Serialization.FormatterServices
-System.Runtime.Serialization.ObjectIDGenerator
-System.Runtime.Serialization.ObjectManager
-System.Reflection.ModuleResolveEventHandler
-System.Reflection.Pointer
-System.Globalization.CompareInfo
-System.Globalization.HebrewCalendar
-System.Globalization.HijriCalendar
-System.Globalization.JapaneseCalendar
-System.Globalization.KoreanCalendar
-System.Globalization.SortKey
-System.Globalization.StringInfo
-System.Globalization.TaiwanCalendar
-System.Globalization.TextElementEnumerator
-System.Globalization.TextInfo
-System.Globalization.ThaiBuddhistCalendar
-System.IO.IsolatedStorage.IsolatedStorageFile
-System.Reflection.Emit.MethodRental
-System.Runtime.CompilerServices.AccessedThroughPropertyAttribute
-System.Runtime.CompilerServices.CallConvCdecl
-System.Runtime.CompilerServices.CallConvStdcall
-System.Runtime.CompilerServices.CallConvThiscall
-System.Runtime.CompilerServices.CallConvFastcall
-System.Runtime.CompilerServices.CustomConstantAttribute
-System.Runtime.CompilerServices.DateTimeConstantAttribute
-System.Runtime.CompilerServices.DiscardableAttribute
-System.Runtime.CompilerServices.DecimalConstantAttribute
-System.Runtime.CompilerServices.CompilationRelaxationsAttribute
-System.Runtime.CompilerServices.CompilerGlobalScopeAttribute
-System.Runtime.CompilerServices.IDispatchConstantAttribute
-System.Runtime.CompilerServices.IsVolatile
-System.Runtime.CompilerServices.IUnknownConstantAttribute
-System.Runtime.CompilerServices.RequiredAttributeAttribute
-System.Runtime.InteropServices.ArrayWithOffset
-System.Runtime.InteropServices.DispIdAttribute
-System.Runtime.InteropServices.ClassInterfaceType
-System.Runtime.InteropServices.ClassInterfaceAttribute
-System.Runtime.InteropServices.ComVisibleAttribute
-System.Runtime.InteropServices.LCIDConversionAttribute
-System.Runtime.InteropServices.ComRegisterFunctionAttribute
-System.Runtime.InteropServices.ComUnregisterFunctionAttribute
-System.Runtime.InteropServices.ProgIdAttribute
-System.Runtime.InteropServices.ImportedFromTypeLibAttribute
-System.Runtime.InteropServices.IDispatchImplType
-System.Runtime.InteropServices.IDispatchImplAttribute
-System.Runtime.InteropServices.ComSourceInterfacesAttribute
-System.Runtime.InteropServices.ComConversionLossAttribute
-System.Runtime.InteropServices.TypeLibTypeFlags
-System.Runtime.InteropServices.TypeLibFuncFlags
-System.Runtime.InteropServices.TypeLibVarFlags
-System.Runtime.InteropServices.TypeLibTypeAttribute
-System.Runtime.InteropServices.TypeLibFuncAttribute
-System.Runtime.InteropServices.TypeLibVarAttribute
-System.Runtime.InteropServices.ComImportAttribute
-System.Runtime.InteropServices.PreserveSigAttribute
-System.Runtime.InteropServices.ComAliasNameAttribute
-System.Runtime.InteropServices.AutomationProxyAttribute
-System.Runtime.InteropServices.PrimaryInteropAssemblyAttribute
-System.Runtime.InteropServices.CoClassAttribute
-System.Runtime.InteropServices.ComEventInterfaceAttribute
-System.Runtime.InteropServices.COMException
-System.Runtime.InteropServices.ComMemberType
-System.Runtime.InteropServices.CurrencyWrapper
-System.Runtime.InteropServices.DispatchWrapper
-System.Runtime.InteropServices.ErrorWrapper
-System.Runtime.InteropServices.ExtensibleClassFactory
-System.Runtime.InteropServices.HandleRef
-System.Runtime.InteropServices.InvalidComObjectException
-System.Runtime.InteropServices.InvalidOleVariantTypeException
-System.Runtime.InteropServices.TypeLibImporterFlags
-System.Runtime.InteropServices.ExporterEventKind
-System.Runtime.InteropServices.ITypeLibExporterNotifySink
-System.Runtime.InteropServices.ITypeLibConverter
-System.Runtime.InteropServices.MarshalDirectiveException
-System.Runtime.InteropServices.ObjectCreationDelegate
-System.Runtime.InteropServices.RuntimeEnvironment
-System.Runtime.InteropServices.RegistrationServices
-System.Runtime.InteropServices.SafeArrayRankMismatchException
-System.Runtime.InteropServices.SafeArrayTypeMismatchException
-System.Runtime.InteropServices.SEHException
-System.Runtime.InteropServices.TypeLibConverter
-System.Runtime.InteropServices.BIND_OPTS
-System.Runtime.InteropServices.UCOMIBindCtx
-System.Runtime.InteropServices.UCOMIConnectionPointContainer
-System.Runtime.InteropServices.UCOMIConnectionPoint
-System.Runtime.InteropServices.UCOMIEnumMoniker
-System.Runtime.InteropServices.CONNECTDATA
-System.Runtime.InteropServices.UCOMIEnumConnections
-System.Runtime.InteropServices.UCOMIEnumConnectionPoints
-System.Runtime.InteropServices.UCOMIEnumString
-System.Runtime.InteropServices.UCOMIEnumVARIANT
-System.Runtime.InteropServices.FILETIME
-System.Runtime.InteropServices.UCOMIMoniker
-System.Runtime.InteropServices.UCOMIPersistFile
-System.Runtime.InteropServices.UCOMIRunningObjectTable
-System.Runtime.InteropServices.STATSTG
-System.Runtime.InteropServices.UCOMIStream
-System.Runtime.InteropServices.DESCKIND
-System.Runtime.InteropServices.BINDPTR
-System.Runtime.InteropServices.UCOMITypeComp
-System.Runtime.InteropServices.TYPEKIND
-System.Runtime.InteropServices.TYPEFLAGS
-System.Runtime.InteropServices.IMPLTYPEFLAGS
-System.Runtime.InteropServices.TYPEATTR
-System.Runtime.InteropServices.FUNCDESC
-System.Runtime.InteropServices.IDLFLAG
-System.Runtime.InteropServices.IDLDESC
-System.Runtime.InteropServices.PARAMFLAG
-System.Runtime.InteropServices.PARAMDESC
-System.Runtime.InteropServices.TYPEDESC
-System.Runtime.InteropServices.ELEMDESC
-System.Runtime.InteropServices.VARDESC
-System.Runtime.InteropServices.DISPPARAMS
-System.Runtime.InteropServices.EXCEPINFO
-System.Runtime.InteropServices.FUNCKIND
-System.Runtime.InteropServices.INVOKEKIND
-System.Runtime.InteropServices.CALLCONV
-System.Runtime.InteropServices.FUNCFLAGS
-System.Runtime.InteropServices.VARFLAGS
-System.Runtime.InteropServices.UCOMITypeInfo
-System.Runtime.InteropServices.SYSKIND
-System.Runtime.InteropServices.LIBFLAGS
-System.Runtime.InteropServices.TYPELIBATTR
-System.Runtime.InteropServices.UCOMITypeLib
-System.Runtime.InteropServices.UnknownWrapper
-System.Runtime.Remoting.IObjectHandle
-System.Runtime.Remoting.IRemotingTypeInfo
-System.Runtime.Remoting.IChannelInfo
-System.Runtime.Remoting.IEnvoyInfo
-System.Runtime.Remoting.RemotingConfiguration
-System.Runtime.Remoting.TypeEntry
-System.Runtime.Remoting.ActivatedClientTypeEntry
-System.Runtime.Remoting.ActivatedServiceTypeEntry
-System.Runtime.Remoting.WellKnownClientTypeEntry
-System.Runtime.Remoting.WellKnownServiceTypeEntry
-System.Runtime.Remoting.RemotingException
-System.Runtime.Remoting.ServerException
-System.Runtime.Remoting.RemotingTimeoutException
-System.Runtime.Remoting.RemotingServices
-System.Runtime.Remoting.InternalRemotingServices
-System.Runtime.Remoting.SoapServices
-System.Runtime.Remoting.Activation.UrlAttribute
-System.Runtime.Remoting.Messaging.IMessageSink
-System.Runtime.Remoting.Messaging.AsyncResult
-System.Runtime.Remoting.Messaging.CallContext
-System.Runtime.Remoting.Messaging.ILogicalThreadAffinative
-System.Runtime.Remoting.Messaging.InternalMessageWrapper
-System.Runtime.Remoting.Messaging.IMethodCallMessage
-System.Runtime.Remoting.Messaging.MethodCallMessageWrapper
-System.Runtime.Remoting.Messaging.HeaderHandler
-System.Runtime.Remoting.Messaging.IMessageCtrl
-System.Runtime.Remoting.Messaging.IRemotingFormatter
-System.Runtime.Remoting.Messaging.ReturnMessage
-System.Runtime.Remoting.Messaging.MethodCall
-System.Runtime.Remoting.Messaging.ConstructionCall
-System.Runtime.Remoting.Messaging.MethodResponse
-System.Runtime.Remoting.Messaging.ConstructionResponse
-System.Runtime.Remoting.Messaging.MethodReturnMessageWrapper
-System.Runtime.Remoting.Messaging.OneWayAttribute
-System.Runtime.Remoting.Messaging.MessageSurrogateFilter
-System.Runtime.Remoting.Messaging.RemotingSurrogateSelector
-System.Runtime.Remoting.Contexts.CrossContextDelegate
-System.Runtime.Remoting.Contexts.ContextProperty
-System.Runtime.Remoting.Contexts.IContextPropertyActivator
-System.Runtime.Remoting.Contexts.IContributeClientContextSink
-System.Runtime.Remoting.Contexts.IContributeDynamicSink
-System.Runtime.Remoting.Contexts.IContributeEnvoySink
-System.Runtime.Remoting.Contexts.IContributeObjectSink
-System.Runtime.Remoting.Contexts.IContributeServerContextSink
-System.Runtime.Serialization.Formatters.InternalRM
-System.Runtime.Serialization.Formatters.InternalST
-System.Runtime.Serialization.Formatters.SoapMessage
-System.Runtime.Serialization.Formatters.SoapFault
-System.Runtime.Serialization.Formatters.ServerFault
-System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
-System.Security.Cryptography.CryptoConfig
-System.Security.Cryptography.KeyedHashAlgorithm
-System.Security.Cryptography.HMACSHA1
-System.Security.Cryptography.MACTripleDES
-System.Security.Cryptography.MaskGenerationMethod
-System.Security.Cryptography.PasswordDeriveBytes
-System.Security.Cryptography.PKCS1MaskGenerationMethod
-System.Security.Cryptography.RC2
-System.Security.Cryptography.RC2CryptoServiceProvider
-System.Security.Cryptography.RSACryptoServiceProvider
-System.Security.Cryptography.RSAOAEPKeyExchangeDeformatter
-System.Security.Cryptography.RSAOAEPKeyExchangeFormatter
-System.Security.Cryptography.RSAPKCS1KeyExchangeDeformatter
-System.Security.Cryptography.RSAPKCS1KeyExchangeFormatter
-System.Security.Cryptography.RSAPKCS1SignatureDeformatter
-System.Security.Cryptography.RSAPKCS1SignatureFormatter
-System.Security.Cryptography.SHA1Managed
-System.Security.Cryptography.TripleDES
-System.Security.Cryptography.TripleDESCryptoServiceProvider
-System.Security.Permissions.EnvironmentPermission
-System.Security.Permissions.FileDialogPermission
-System.Security.Permissions.IsolatedStorageFilePermission
-System.Security.Permissions.PrincipalPermissionAttribute
-System.Security.Permissions.SecurityPermissionAttribute
-System.Security.Permissions.PublisherIdentityPermissionAttribute
-System.Security.Permissions.PublisherIdentityPermission
-System.Security.Permissions.ReflectionPermission
-System.Security.Permissions.RegistryPermission
-System.Security.Permissions.PrincipalPermission
-System.Security.Permissions.SiteIdentityPermission
-System.Security.Permissions.StrongNameIdentityPermission
-System.Security.Permissions.StrongNamePublicKeyBlob
-System.Security.Permissions.UIPermission
-System.Security.Permissions.UrlIdentityPermission
-System.Security.Permissions.ZoneIdentityPermission
-System.Security.Policy.ApplicationDirectory
-System.Security.Policy.ApplicationDirectoryMembershipCondition
-System.Security.Policy.FirstMatchCodeGroup
-System.Security.Policy.Hash
-System.Security.Policy.HashMembershipCondition
-System.Security.Policy.NetCodeGroup
-System.Security.Policy.PermissionRequestEvidence
-System.Security.Policy.Publisher
-System.Security.Policy.PublisherMembershipCondition
-System.Security.Policy.Site
-System.Security.Policy.SiteMembershipCondition
-System.Security.Policy.StrongName
-System.Security.Policy.StrongNameMembershipCondition
-System.Security.Policy.UnionCodeGroup
-System.Security.Policy.Url
-System.Security.Policy.UrlMembershipCondition
-System.Security.Policy.Zone
-System.Security.Policy.ZoneMembershipCondition
-System.Security.Principal.WindowsIdentity
-System.Security.Principal.WindowsImpersonationContext
-System.Security.Principal.WindowsPrincipal
-System.Threading.CompressedStack
-
diff --git a/web/web/makefile b/web/web/makefile
index ed5b87ac8a5..90fe990fec1 100644
--- a/web/web/makefile
+++ b/web/web/makefile
@@ -64,6 +64,20 @@ OBJECTS= \
deploy/testing.html \
deploy/tools.html \
deploy/winforms.html \
+ deploy/class-status.html \
+ deploy/class-status-corlib.html \
+ deploy/class-status-System.html \
+ deploy/class-status-System.Xml.html \
+ deploy/class-status-System.Drawing.html \
+ deploy/class-status-System.Data.html \
+ deploy/class-status-System.Web.html \
+ deploy/class-status-System.Web.Services.html \
+ deploy/class-status-Microsoft.VisualBasic.html \
+ deploy/class-status-System.EnterpriseServices.html \
+ deploy/class-status-System.Runtime.Serialization.Formatters.Soap.html \
+ deploy/class-status-System.Security.html \
+ deploy/class-status-System.Windows.Forms.html \
+ deploy/class-status-Cscompmgd.html \
deploy/class-library.html \
deploy/classlib-doc.html
@@ -77,7 +91,7 @@ NON_HTML_SOURCES= \
../mono-build.sh \
../mono-build-w32.sh
-all: $(OBJECT) deploy/index.rss ../team
+all: $(OBJECTS) deploy/index.rss ../team
perl process.pl commands template.html.in deploy
-mkdir deploy/team
cp team/*png deploy/team
diff --git a/web/web/team.xml b/web/web/team.xml
index 7444d88f082..ccc9d97a16d 100644
--- a/web/web/team.xml
+++ b/web/web/team.xml
@@ -1453,7 +1453,7 @@
<e-mail>peter@newton.cx</e-mail>
- <image>peterw.png</image>
+ <image>none.png</image>
<location>Cambridge, MA</location>
diff --git a/web/web/template.html.in b/web/web/template.html.in
index fc2466834dc..2aab918a0a5 100644
--- a/web/web/template.html.in
+++ b/web/web/template.html.in
@@ -38,26 +38,11 @@
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
- <td><img src="images/pixel.gif" alt=""></td><!-- left border
- -->
- <td colspan="4">
- <table>
- <tr>
- <td>
- <a href="http://www.go-mono.com"><img
- src="images/mono-new.gif" alt="mono-logo" border="0"></a>
- </td>
- <td>
- <a class="navi0" href="download.html">Downloads</a> |
- <a class="navi0" href="http://go-mono.com/daily">Daily snapshots</a> |
- <a class="navi0" href="screenshots.html">Screenshots</a> |
- <a class="navi0" href="http://mono.ximian.com:8080">API Docs</a>
- </td>
- </tr>
- </table>
- </td>
- <td><img src="images/pixel.gif" alt=""></td><!-- right border
- -->
+ <td><img src="images/pixel.gif" alt=""></td><!-- left border -->
+ <td colspan="4">
+ <a href="http://www.go-mono.com"><img src="images/mono-new.gif"
+ alt="mono-logo" border="0"></a></td>
+ <td><img src="images/pixel.gif" alt=""></td><!-- right border -->
</tr>
<tr>
<td><img src="images/pixel.gif" width="1" height="1" alt=""></td>