diff options
142 files changed, 769 insertions, 1445 deletions
diff --git a/ChangeLog b/ChangeLog index 4f572cf505d..cd83c2e4c33 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2004-07-27 John Merryweather Cooper <john_m_cooper@yahoo.com> + * configure.in: Disable __thread test (TLS) for FreeBSD as + it succeeds on FreeBSD 5.x when it should fail. Fix pthread + library detection for FreeBSD 4.x since pthread is embedded + in libc_r on this platform. Fix some typos in my host + regexes for freebsd. + 2004-07-23 Dick Porter <dick@ximian.com> * configure.in: Changes for FreeBSD thread support by John diff --git a/configure.in b/configure.in index 62675cb37cf..9e5f7d431e8 100644 --- a/configure.in +++ b/configure.in @@ -69,7 +69,7 @@ case "$host" in ;; # these flags will work for all versions of -STABLE # - *-*-*freebsd4) + *-*-*freebsd4*) platform_win32=no if test "x$PTHREAD_CFLAGS" = "x"; then CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE -DGC_FREEBSD_THREADS" @@ -91,11 +91,12 @@ case "$host" in libgc_threads=pthreads # TLS isn't implemented at all on -STABLE with_nptl=no + with_tls=pthread ;; # older versions of -CURRENT will break with these flags but testing # indicates these older versions won't run Mono anyway # - *-*-*freebsd5) + *-*-*freebsd5*) platform_win32=no if test "x$PTHREAD_CFLAGS" = "x"; then CPPFLAGS="$CPPFLAGS -DGC_FREEBSD_THREADS" @@ -119,6 +120,7 @@ case "$host" in # but NOT library support) # with_nptl=no + with_tls=pthread ;; *-*-*openbsd*) platform_win32=no @@ -706,7 +708,17 @@ if test x$platform_win32 = xno; then dnl ***************************** dnl *** Checks for libpthread *** dnl ***************************** - AC_CHECK_LIB(pthread, main, LIBS="$LIBS -lpthread") +# on FreeBSD -STABLE, the pthreads functions all reside in libc_r +# and libpthread does not exist +# + case "${host}" in + *-*-*freebsd4*) + AC_CHECK_LIB(pthread, main, LIBS="$LIBS -pthread") + ;; + *) + AC_CHECK_LIB(pthread, main, LIBS="$LIBS -lpthread") + ;; + esac AC_CHECK_HEADERS(pthread.h) AC_CHECK_FUNCS(pthread_mutex_timedlock) AC_CHECK_FUNCS(pthread_getattr_np pthread_attr_get_np) diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/ChangeLog b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/ChangeLog index 594c2b007f8..e0aaa445669 100644 --- a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/ChangeLog +++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/ChangeLog @@ -1,8 +1,3 @@ -2004-07-22 Jambunathan K <kjambunathan@novell.com> - - * Constants.cs: Fixed definitions of vbCr, vbLf, vbCrLf and - vbNewLine - 2004-06-24 Jambunathan K <kjambunathan@novell.com> * RandomVBFile.cs: Fixed FileGet() for Date and Decimal types * FileSystem.cs: Fixed ChDir, FileCopy diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Constants.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Constants.cs index 16fc0d5da8f..310051ccf03 100644 --- a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Constants.cs +++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Constants.cs @@ -1,11 +1,11 @@ -// -// Constants.cs -// -// Author: -// Chris J Breisch (cjbreisch@altavista.net) -// -// (C) 2002 Chris J Breisch -// +//
+// Constants.cs
+//
+// Author:
+// Chris J Breisch (cjbreisch@altavista.net)
+//
+// (C) 2002 Chris J Breisch
+//
// // Copyright (c) 2002-2003 Mainsoft Corporation. @@ -30,131 +30,131 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // - -using System; - -namespace Microsoft.VisualBasic { - [Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute] - sealed public class Constants { - // Declarations - public const System.Int32 vbObjectError = (System.Int32)(-2147221504); - public const System.String vbCrLf = "\r\n"; - public const System.String vbNewLine = "\r\n"; - public const System.String vbCr = "\r"; - public const System.String vbLf = "\n"; - public const System.String vbBack = "\b"; - public const System.String vbFormFeed = "\f"; - public const System.String vbTab = "\t"; - public const System.String vbVerticalTab = "\v"; - public const System.String vbNullChar = "\0"; - public const System.String vbNullString = ""; - - public const AppWinStyle vbHide = AppWinStyle.Hide; - public const AppWinStyle vbNormalFocus = AppWinStyle.NormalFocus; - public const AppWinStyle vbMinimizedFocus = AppWinStyle.MinimizedFocus; - public const AppWinStyle vbMaximizedFocus = AppWinStyle.MaximizedFocus; - public const AppWinStyle vbNormalNoFocus = AppWinStyle.NormalNoFocus; - public const AppWinStyle vbMinimizedNoFocus = AppWinStyle.MinimizedNoFocus; - - public const CallType vbMethod = CallType.Method; - public const CallType vbGet = CallType.Get; - public const CallType vbLet = CallType.Let; - public const CallType vbSet = CallType.Set; - - public const CompareMethod vbBinaryCompare = CompareMethod.Binary; - public const CompareMethod vbTextCompare = CompareMethod.Text; - - public const DateFormat vbGeneralDate = DateFormat.GeneralDate; - public const DateFormat vbLongDate = DateFormat.LongDate; - public const DateFormat vbShortDate = DateFormat.ShortDate; - public const DateFormat vbLongTime = DateFormat.LongTime; - public const DateFormat vbShortTime = DateFormat.ShortTime; - - public const FirstDayOfWeek vbUseSystemDayOfWeek = FirstDayOfWeek.System; - public const FirstDayOfWeek vbSunday = FirstDayOfWeek.Sunday; - public const FirstDayOfWeek vbMonday = FirstDayOfWeek.Monday; - public const FirstDayOfWeek vbTuesday = FirstDayOfWeek.Tuesday; - public const FirstDayOfWeek vbWednesday = FirstDayOfWeek.Wednesday; - public const FirstDayOfWeek vbThursday = FirstDayOfWeek.Thursday; - public const FirstDayOfWeek vbFriday = FirstDayOfWeek.Friday; - public const FirstDayOfWeek vbSaturday = FirstDayOfWeek.Saturday; - - public const FileAttribute vbNormal = FileAttribute.Normal; - public const FileAttribute vbReadOnly = FileAttribute.ReadOnly; - public const FileAttribute vbHidden = FileAttribute.Hidden; - public const FileAttribute vbSystem = FileAttribute.System; - public const FileAttribute vbVolume = FileAttribute.Volume; - public const FileAttribute vbDirectory = FileAttribute.Directory; - public const FileAttribute vbArchive = FileAttribute.Archive; - - public const FirstWeekOfYear vbUseSystem = FirstWeekOfYear.System; - public const FirstWeekOfYear vbFirstJan1 = FirstWeekOfYear.Jan1; - public const FirstWeekOfYear vbFirstFourDays = FirstWeekOfYear.FirstFourDays; - public const FirstWeekOfYear vbFirstFullWeek = FirstWeekOfYear.FirstFullWeek; - - public const VbStrConv vbUpperCase = VbStrConv.UpperCase; - public const VbStrConv vbLowerCase = VbStrConv.LowerCase; - public const VbStrConv vbProperCase = VbStrConv.ProperCase; - public const VbStrConv vbWide = VbStrConv.Wide; - public const VbStrConv vbNarrow = VbStrConv.Narrow; - public const VbStrConv vbKatakana = VbStrConv.Katakana; - public const VbStrConv vbHiragana = VbStrConv.Hiragana; - public const VbStrConv vbSimplifiedChinese = VbStrConv.SimplifiedChinese; - public const VbStrConv vbTraditionalChinese = VbStrConv.TraditionalChinese; - public const VbStrConv vbLinguisticCasing = VbStrConv.LinguisticCasing; - - public const TriState vbUseDefault = TriState.UseDefault; - public const TriState vbTrue = TriState.True; - public const TriState vbFalse = TriState.False; - - public const VariantType vbEmpty = VariantType.Empty; - public const VariantType vbNull = VariantType.Null; - public const VariantType vbInteger = VariantType.Integer; - public const VariantType vbLong = VariantType.Long; - public const VariantType vbSingle = VariantType.Single; - public const VariantType vbDouble = VariantType.Double; - public const VariantType vbCurrency = VariantType.Currency; - public const VariantType vbDate = VariantType.Date; - public const VariantType vbString = VariantType.String; - public const VariantType vbObject = VariantType.Object; - public const VariantType vbBoolean = VariantType.Boolean; - public const VariantType vbVariant = VariantType.Variant; - public const VariantType vbDecimal = VariantType.Decimal; - public const VariantType vbByte = VariantType.Byte; - public const VariantType vbUserDefinedType = VariantType.UserDefinedType; - public const VariantType vbArray = VariantType.Array; - - public const MsgBoxResult vbOK = MsgBoxResult.OK; - public const MsgBoxResult vbCancel = MsgBoxResult.Cancel; - public const MsgBoxResult vbAbort = MsgBoxResult.Abort; - public const MsgBoxResult vbRetry = MsgBoxResult.Retry; - public const MsgBoxResult vbIgnore = MsgBoxResult.Ignore; - public const MsgBoxResult vbYes = MsgBoxResult.Yes; - public const MsgBoxResult vbNo = MsgBoxResult.No; - - public const MsgBoxStyle vbOKOnly = MsgBoxStyle.OKOnly; - public const MsgBoxStyle vbOKCancel = MsgBoxStyle.OKCancel; - public const MsgBoxStyle vbAbortRetryIgnore = MsgBoxStyle.AbortRetryIgnore; - public const MsgBoxStyle vbYesNoCancel = MsgBoxStyle.YesNoCancel; - public const MsgBoxStyle vbYesNo = MsgBoxStyle.YesNo; - public const MsgBoxStyle vbRetryCancel = MsgBoxStyle.RetryCancel; - public const MsgBoxStyle vbCritical = MsgBoxStyle.Critical; - public const MsgBoxStyle vbQuestion = MsgBoxStyle.Question; - public const MsgBoxStyle vbExclamation = MsgBoxStyle.Exclamation; - public const MsgBoxStyle vbInformation = MsgBoxStyle.Information; - public const MsgBoxStyle vbDefaultButton1 = MsgBoxStyle.DefaultButton1; - public const MsgBoxStyle vbDefaultButton2 = MsgBoxStyle.DefaultButton2; - public const MsgBoxStyle vbDefaultButton3 = MsgBoxStyle.DefaultButton3; - public const MsgBoxStyle vbApplicationModal = MsgBoxStyle.ApplicationModal; - public const MsgBoxStyle vbSystemModal = MsgBoxStyle.SystemModal; - public const MsgBoxStyle vbMsgBoxHelp = MsgBoxStyle.MsgBoxHelp; - public const MsgBoxStyle vbMsgBoxRight = MsgBoxStyle.MsgBoxRight; - public const MsgBoxStyle vbMsgBoxRtlReading = MsgBoxStyle.MsgBoxRtlReading; - public const MsgBoxStyle vbMsgBoxSetForeground = MsgBoxStyle.MsgBoxSetForeground; - - // Constructors - // Properties - // Methods - // Events - }; -} +
+using System;
+
+namespace Microsoft.VisualBasic {
+ [Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute]
+ sealed public class Constants {
+ // Declarations
+ public const System.Int32 vbObjectError = (System.Int32)(-2147221504);
+ public const System.String vbCrLf = "\n\r";
+ public const System.String vbNewLine = "\n\r";
+ public const System.String vbCr = "\n";
+ public const System.String vbLf = "\r";
+ public const System.String vbBack = "\b";
+ public const System.String vbFormFeed = "\f";
+ public const System.String vbTab = "\t";
+ public const System.String vbVerticalTab = "\v";
+ public const System.String vbNullChar = "\0";
+ public const System.String vbNullString = "";
+
+ public const AppWinStyle vbHide = AppWinStyle.Hide;
+ public const AppWinStyle vbNormalFocus = AppWinStyle.NormalFocus;
+ public const AppWinStyle vbMinimizedFocus = AppWinStyle.MinimizedFocus;
+ public const AppWinStyle vbMaximizedFocus = AppWinStyle.MaximizedFocus;
+ public const AppWinStyle vbNormalNoFocus = AppWinStyle.NormalNoFocus;
+ public const AppWinStyle vbMinimizedNoFocus = AppWinStyle.MinimizedNoFocus;
+
+ public const CallType vbMethod = CallType.Method;
+ public const CallType vbGet = CallType.Get;
+ public const CallType vbLet = CallType.Let;
+ public const CallType vbSet = CallType.Set;
+
+ public const CompareMethod vbBinaryCompare = CompareMethod.Binary;
+ public const CompareMethod vbTextCompare = CompareMethod.Text;
+
+ public const DateFormat vbGeneralDate = DateFormat.GeneralDate;
+ public const DateFormat vbLongDate = DateFormat.LongDate;
+ public const DateFormat vbShortDate = DateFormat.ShortDate;
+ public const DateFormat vbLongTime = DateFormat.LongTime;
+ public const DateFormat vbShortTime = DateFormat.ShortTime;
+
+ public const FirstDayOfWeek vbUseSystemDayOfWeek = FirstDayOfWeek.System;
+ public const FirstDayOfWeek vbSunday = FirstDayOfWeek.Sunday;
+ public const FirstDayOfWeek vbMonday = FirstDayOfWeek.Monday;
+ public const FirstDayOfWeek vbTuesday = FirstDayOfWeek.Tuesday;
+ public const FirstDayOfWeek vbWednesday = FirstDayOfWeek.Wednesday;
+ public const FirstDayOfWeek vbThursday = FirstDayOfWeek.Thursday;
+ public const FirstDayOfWeek vbFriday = FirstDayOfWeek.Friday;
+ public const FirstDayOfWeek vbSaturday = FirstDayOfWeek.Saturday;
+
+ public const FileAttribute vbNormal = FileAttribute.Normal;
+ public const FileAttribute vbReadOnly = FileAttribute.ReadOnly;
+ public const FileAttribute vbHidden = FileAttribute.Hidden;
+ public const FileAttribute vbSystem = FileAttribute.System;
+ public const FileAttribute vbVolume = FileAttribute.Volume;
+ public const FileAttribute vbDirectory = FileAttribute.Directory;
+ public const FileAttribute vbArchive = FileAttribute.Archive;
+
+ public const FirstWeekOfYear vbUseSystem = FirstWeekOfYear.System;
+ public const FirstWeekOfYear vbFirstJan1 = FirstWeekOfYear.Jan1;
+ public const FirstWeekOfYear vbFirstFourDays = FirstWeekOfYear.FirstFourDays;
+ public const FirstWeekOfYear vbFirstFullWeek = FirstWeekOfYear.FirstFullWeek;
+
+ public const VbStrConv vbUpperCase = VbStrConv.UpperCase;
+ public const VbStrConv vbLowerCase = VbStrConv.LowerCase;
+ public const VbStrConv vbProperCase = VbStrConv.ProperCase;
+ public const VbStrConv vbWide = VbStrConv.Wide;
+ public const VbStrConv vbNarrow = VbStrConv.Narrow;
+ public const VbStrConv vbKatakana = VbStrConv.Katakana;
+ public const VbStrConv vbHiragana = VbStrConv.Hiragana;
+ public const VbStrConv vbSimplifiedChinese = VbStrConv.SimplifiedChinese;
+ public const VbStrConv vbTraditionalChinese = VbStrConv.TraditionalChinese;
+ public const VbStrConv vbLinguisticCasing = VbStrConv.LinguisticCasing;
+
+ public const TriState vbUseDefault = TriState.UseDefault;
+ public const TriState vbTrue = TriState.True;
+ public const TriState vbFalse = TriState.False;
+
+ public const VariantType vbEmpty = VariantType.Empty;
+ public const VariantType vbNull = VariantType.Null;
+ public const VariantType vbInteger = VariantType.Integer;
+ public const VariantType vbLong = VariantType.Long;
+ public const VariantType vbSingle = VariantType.Single;
+ public const VariantType vbDouble = VariantType.Double;
+ public const VariantType vbCurrency = VariantType.Currency;
+ public const VariantType vbDate = VariantType.Date;
+ public const VariantType vbString = VariantType.String;
+ public const VariantType vbObject = VariantType.Object;
+ public const VariantType vbBoolean = VariantType.Boolean;
+ public const VariantType vbVariant = VariantType.Variant;
+ public const VariantType vbDecimal = VariantType.Decimal;
+ public const VariantType vbByte = VariantType.Byte;
+ public const VariantType vbUserDefinedType = VariantType.UserDefinedType;
+ public const VariantType vbArray = VariantType.Array;
+
+ public const MsgBoxResult vbOK = MsgBoxResult.OK;
+ public const MsgBoxResult vbCancel = MsgBoxResult.Cancel;
+ public const MsgBoxResult vbAbort = MsgBoxResult.Abort;
+ public const MsgBoxResult vbRetry = MsgBoxResult.Retry;
+ public const MsgBoxResult vbIgnore = MsgBoxResult.Ignore;
+ public const MsgBoxResult vbYes = MsgBoxResult.Yes;
+ public const MsgBoxResult vbNo = MsgBoxResult.No;
+
+ public const MsgBoxStyle vbOKOnly = MsgBoxStyle.OKOnly;
+ public const MsgBoxStyle vbOKCancel = MsgBoxStyle.OKCancel;
+ public const MsgBoxStyle vbAbortRetryIgnore = MsgBoxStyle.AbortRetryIgnore;
+ public const MsgBoxStyle vbYesNoCancel = MsgBoxStyle.YesNoCancel;
+ public const MsgBoxStyle vbYesNo = MsgBoxStyle.YesNo;
+ public const MsgBoxStyle vbRetryCancel = MsgBoxStyle.RetryCancel;
+ public const MsgBoxStyle vbCritical = MsgBoxStyle.Critical;
+ public const MsgBoxStyle vbQuestion = MsgBoxStyle.Question;
+ public const MsgBoxStyle vbExclamation = MsgBoxStyle.Exclamation;
+ public const MsgBoxStyle vbInformation = MsgBoxStyle.Information;
+ public const MsgBoxStyle vbDefaultButton1 = MsgBoxStyle.DefaultButton1;
+ public const MsgBoxStyle vbDefaultButton2 = MsgBoxStyle.DefaultButton2;
+ public const MsgBoxStyle vbDefaultButton3 = MsgBoxStyle.DefaultButton3;
+ public const MsgBoxStyle vbApplicationModal = MsgBoxStyle.ApplicationModal;
+ public const MsgBoxStyle vbSystemModal = MsgBoxStyle.SystemModal;
+ public const MsgBoxStyle vbMsgBoxHelp = MsgBoxStyle.MsgBoxHelp;
+ public const MsgBoxStyle vbMsgBoxRight = MsgBoxStyle.MsgBoxRight;
+ public const MsgBoxStyle vbMsgBoxRtlReading = MsgBoxStyle.MsgBoxRtlReading;
+ public const MsgBoxStyle vbMsgBoxSetForeground = MsgBoxStyle.MsgBoxSetForeground;
+
+ // Constructors
+ // Properties
+ // Methods
+ // Events
+ };
+}
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 bcf7dd8b1f8..42df9e1632a 100644 --- a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/ChangeLog +++ b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/ChangeLog @@ -1,3 +1,7 @@ +2004-06-30 Umadevi S <sumadevi@novell.com> + * Tds.cs - In the NextResult method handling TdsPacketSubType. TableName. + + 2004-04-22 Sebastien Pouliot <sebastien@ximian.com> * Tds70.cs: Updated to match changes in Mono.Security.dll. 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 1a917399a3f..e1cf4697ee7 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 @@ -293,6 +293,12 @@ namespace Mono.Data.Tds.Protocol { break; case TdsPacketSubType.TableName: + // done = true; + peek = Comm.Peek (); + done = (peek != (byte) TdsPacketSubType.ColumnDetail); + + break; + case TdsPacketSubType.ColumnDetail: done = true; break; default: diff --git a/mcs/class/Mono.Posix/Mono.Posix.dll.sources b/mcs/class/Mono.Posix/Mono.Posix.dll.sources index b426c78e14a..cf4150a2efb 100644 --- a/mcs/class/Mono.Posix/Mono.Posix.dll.sources +++ b/mcs/class/Mono.Posix/Mono.Posix.dll.sources @@ -4,5 +4,4 @@ ./Mono.Posix/Syscall.cs ./Mono.Posix/MapAttribute.cs ./Mono.Posix/IncludeAttribute.cs -./Mono.Posix/Catalog.cs -./Mono.Posix/PeerCred.cs +./Mono.Posix/Catalog.cs
\ No newline at end of file diff --git a/mcs/class/Mono.Posix/Mono.Posix/ChangeLog b/mcs/class/Mono.Posix/Mono.Posix/ChangeLog index c38db5ee850..b6fd766afdc 100644 --- a/mcs/class/Mono.Posix/Mono.Posix/ChangeLog +++ b/mcs/class/Mono.Posix/Mono.Posix/ChangeLog @@ -1,7 +1,3 @@ -2004-07-09 Dick Porter <dick@ximian.com> - - * PeerCred.cs: Get the unix socket peer credentials. - 2004-05-26 Miguel de Icaza <miguel@ximian.com> * Syscall.cs: Do not let the runtime handle strings, as we do not diff --git a/mcs/class/Mono.Posix/Mono.Posix/PeerCred.cs b/mcs/class/Mono.Posix/Mono.Posix/PeerCred.cs deleted file mode 100644 index 76071bcbca5..00000000000 --- a/mcs/class/Mono.Posix/Mono.Posix/PeerCred.cs +++ /dev/null @@ -1,78 +0,0 @@ -// -// Mono.Posix.PeerCred: Peer credentials class for AF_UNIX sockets -// -// Authors: -// Dick Porter (dick@ximian.com) -// -// (C) 2004 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Net.Sockets; - -namespace Mono.Posix -{ - public class PeerCred - { - private struct PeerCredData { - public int pid; - public int uid; - public int gid; - } - - /* Make sure this doesn't clash with anything in - * SocketOptionName, and keep it synchronised with the - * runtime - */ - private const int so_peercred=10001; - private PeerCredData data; - - public PeerCred (Socket sock) { - if (sock.AddressFamily != AddressFamily.Unix) { - throw new ArgumentException ("Only Unix sockets are supported", "sock"); - } - - data = (PeerCredData)sock.GetSocketOption (SocketOptionLevel.Socket, (SocketOptionName)so_peercred); - } - - public int ProcessID { - get { - return(data.pid); - } - } - - public int UserID { - get { - return(data.uid); - } - } - - public int GroupID { - get { - return(data.gid); - } - } - } -} - diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/ChangeLog b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/ChangeLog index a5a20358101..e55f1f5ecd8 100644 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/ChangeLog +++ b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/ChangeLog @@ -1,15 +1,3 @@ -2004-07-14 Sebastien Pouliot <sebastien@ximian.com> - - * SslClientStream.cs: Changed lock to "new object()" and not - String.Empty (as the read/write locks points becomes the same). - * SslServerStream.cs: Changed lock to "new object()" and not - String.Empty (as the read/write locks points becomes the same). - -2004-07-14 Gonzalo Paniagua Javier <gonzalo@ximian.com> - - * HttpsClientStream.cs: get an HttpWebRequest so that we can use the - ServicePoint it has. No need to get the host now. - 2004-05-09 Carlos Guzman Alvarez <carlosga@telefonica.net>
* Mono.Security.Protocol.Tls/Alert.cs:
diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/HttpsClientStream.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/HttpsClientStream.cs index 678cf83163c..1da66f06849 100644 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/HttpsClientStream.cs +++ b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/HttpsClientStream.cs @@ -40,13 +40,14 @@ namespace Mono.Security.Protocol.Tls { internal class HttpsClientStream : SslClientStream { - private HttpWebRequest _request; + private string _host; + private WebRequest _request; - public HttpsClientStream (Stream stream, X509CertificateCollection clientCertificates, - HttpWebRequest request) - : base (stream, request.RequestUri.Host, false, SecurityProtocolType.Default, clientCertificates) + public HttpsClientStream (Stream stream, string targetHost, X509CertificateCollection clientCertificates, WebRequest request) + : base (stream, targetHost, false, SecurityProtocolType.Default, clientCertificates) { + _host = targetHost; // this constructor permit access to the WebRequest to call // ICertificatePolicy.CheckValidationResult _request = request; @@ -60,7 +61,8 @@ namespace Mono.Security.Protocol.Tls { { bool failed = (certificateErrors.Length > 0); if (ServicePointManager.CertificatePolicy != null) { - ServicePoint sp = _request.ServicePoint; + Uri target = new Uri ("https://" + _host); + ServicePoint sp = ServicePointManager.FindServicePoint (target); // only one problem can be reported by this interface int problem = ((failed) ? certificateErrors [0] : 0); diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslClientStream.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslClientStream.cs index fccfb9902b3..068a24f68c7 100644 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslClientStream.cs +++ b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslClientStream.cs @@ -349,8 +349,8 @@ namespace Mono.Security.Protocol.Tls this.inputBuffer = new BufferedStream(new MemoryStream()); this.innerStream = stream; this.ownsStream = ownsStream; - this.read = new object (); - this.write = new object (); + this.read = String.Empty; + this.write = String.Empty; this.protocol = new ClientRecordProtocol(innerStream, context); } @@ -821,4 +821,4 @@ namespace Mono.Security.Protocol.Tls #endregion } -} +}
\ No newline at end of file diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslServerStream.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslServerStream.cs index f2786f7554b..53b3d095def 100644 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslServerStream.cs +++ b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslServerStream.cs @@ -306,8 +306,8 @@ namespace Mono.Security.Protocol.Tls this.inputBuffer = new BufferedStream(new MemoryStream()); this.innerStream = stream; this.ownsStream = ownsStream; - this.read = new object (); - this.write = new object (); + this.read = String.Empty; + this.write = String.Empty; this.protocol = new ServerRecordProtocol(innerStream, context); } diff --git a/mcs/class/Mono.Security/Mono.Security.X509.Extensions/ChangeLog b/mcs/class/Mono.Security/Mono.Security.X509.Extensions/ChangeLog index b8d2dc9942e..f00dcacd041 100644 --- a/mcs/class/Mono.Security/Mono.Security.X509.Extensions/ChangeLog +++ b/mcs/class/Mono.Security/Mono.Security.X509.Extensions/ChangeLog @@ -1,8 +1,3 @@ -2004-07-15 Sebastien Pouliot <sebastien@ximian.com> - - * KeyUsageExtension.cs: Added Encode to extension so it can be used - by makecert. Fix bug # 61240. Patch provided by Ianier Munoz. - 2004-04-28 Sebastien Pouliot <sebastien@ximian.com> * KeyUsageExtension.cs: Added missing INSIDE_CORLIB to enum. diff --git a/mcs/class/Mono.Security/Mono.Security.X509.Extensions/KeyUsageExtension.cs b/mcs/class/Mono.Security/Mono.Security.X509.Extensions/KeyUsageExtension.cs index 0c5d3b0cf38..a8c5553ed58 100644 --- a/mcs/class/Mono.Security/Mono.Security.X509.Extensions/KeyUsageExtension.cs +++ b/mcs/class/Mono.Security/Mono.Security.X509.Extensions/KeyUsageExtension.cs @@ -86,11 +86,6 @@ namespace Mono.Security.X509.Extensions { public KeyUsageExtension (X509Extension extension) : base (extension) {} - public KeyUsageExtension () : base () - { - extnOid = "2.5.29.15"; - } - protected override void Decode () { ASN1 bitString = new ASN1 (extnValue.Value); @@ -101,18 +96,6 @@ namespace Mono.Security.X509.Extensions { kubits = (kubits << 8) + bitString.Value [i++]; } - protected override void Encode () - { - if (extnValue == null) { - extnValue = new ASN1 (0x03, new byte[] { 0x00, (byte)kubits }); - } - } - - public KeyUsages KeyUsage { - get { return (KeyUsages) kubits; } - set { kubits = Convert.ToInt32 (value, CultureInfo.InvariantCulture); } - } - public override string Name { get { return "Key Usage"; } } diff --git a/mcs/class/Mono.Security/Mono.Security.X509/ChangeLog b/mcs/class/Mono.Security/Mono.Security.X509/ChangeLog index 38b3d393aa5..14d6852db71 100644 --- a/mcs/class/Mono.Security/Mono.Security.X509/ChangeLog +++ b/mcs/class/Mono.Security/Mono.Security.X509/ChangeLog @@ -1,9 +1,3 @@ -2004-07-15 Sebastien Pouliot <sebastien@ximian.com> - - * X501Name.cs: Support for E (email) in FromString. - * X520Attributes.cs: Added X520.EmailAddress. - Both patches fix bug #61241 and were contributed by Ianier Munoz. - 2004-05-27 Sebastien Pouliot <sebastien@ximian.com> * X509Certificate.cs: Rethrow original exception when parsing X.509 diff --git a/mcs/class/Mono.Security/Mono.Security.X509/X501Name.cs b/mcs/class/Mono.Security/Mono.Security.X509/X501Name.cs index 22e3ea30169..515e24c0b9b 100644 --- a/mcs/class/Mono.Security/Mono.Security.X509/X501Name.cs +++ b/mcs/class/Mono.Security/Mono.Security.X509/X501Name.cs @@ -162,8 +162,6 @@ namespace Mono.Security.X509 { case "S": // Microsoft case "ST": // RFC2253 return new X520.StateOrProvinceName (); - case "E": // NOTE: Not part of RFC2253 - return new X520.EmailAddress (); case "DC": // return streetAddress; case "UID": diff --git a/mcs/class/Mono.Security/Mono.Security.X509/X520Attributes.cs b/mcs/class/Mono.Security/Mono.Security.X509/X520Attributes.cs index b8feb6a2db6..54a8af9ba23 100644 --- a/mcs/class/Mono.Security/Mono.Security.X509/X520Attributes.cs +++ b/mcs/class/Mono.Security/Mono.Security.X509/X520Attributes.cs @@ -101,10 +101,6 @@ namespace Mono.Security.X509 { // PRINTABLESTRING asn1.Add (new ASN1 (0x13, Encoding.ASCII.GetBytes (attrValue))); break; - case 0x16: - // IA5STRING - asn1.Add (new ASN1 (0x16, Encoding.ASCII.GetBytes (attrValue))); - break; case 0x1E: // BMPSTRING asn1.Add (new ASN1 (0x1E, Encoding.BigEndianUnicode.GetBytes (attrValue))); @@ -180,14 +176,6 @@ namespace Mono.Security.X509 { } } - // NOTE: Not part of RFC2253 - public class EmailAddress : AttributeTypeAndValue - { - public EmailAddress () : base ("1.2.840.113549.1.9.1", 128, 0x16) - { - } - } - /* -- Naming attributes of type X520Title * id-at-title AttributeType ::= { id-at 12 } * diff --git a/mcs/class/System.Data/Mono.Data.SqlExpressions/ChangeLog b/mcs/class/System.Data/Mono.Data.SqlExpressions/ChangeLog index f633f97c624..e4266e2d3cd 100644 --- a/mcs/class/System.Data/Mono.Data.SqlExpressions/ChangeLog +++ b/mcs/class/System.Data/Mono.Data.SqlExpressions/ChangeLog @@ -1,6 +1,3 @@ -2004-07-12 Umadevi S <sumadevi@novell.com> - * Tokenizer.cs - read an Int64 from the text instead of Int32. Resolves bug 61203 - 2004-06-17 Boris Kirzner <borisk@mainsoft.com> * Comparison.cs - use 'as' to avoid NullReferenceExeption in casting. diff --git a/mcs/class/System.Data/Mono.Data.SqlExpressions/Tokenizer.cs b/mcs/class/System.Data/Mono.Data.SqlExpressions/Tokenizer.cs index c3b4eb1faf8..a9b427d1bf0 100644 --- a/mcs/class/System.Data/Mono.Data.SqlExpressions/Tokenizer.cs +++ b/mcs/class/System.Data/Mono.Data.SqlExpressions/Tokenizer.cs @@ -122,7 +122,7 @@ namespace Mono.Data.SqlExpressions { string str = sb.ToString (); if (str.IndexOf(".") == -1) - return Int64.Parse (str); + return int.Parse (str); else return double.Parse (str); } diff --git a/mcs/class/System.Data/System.Data.Common/ChangeLog b/mcs/class/System.Data/System.Data.Common/ChangeLog index 6af8fca9b77..0db883a625e 100755 --- a/mcs/class/System.Data/System.Data.Common/ChangeLog +++ b/mcs/class/System.Data/System.Data.Common/ChangeLog @@ -1,11 +1,5 @@ -2004-07-21 Umadevi S <sumadevi@novell.com> - * DbDataRecord.cs - Fix for bug 58163. Return DBNull instead of null - -2004-07-07 Umadevi S <sumadevi@novell.com> - * DataContainer.cs :CheckedforNull before calling the relavant setmethods in each of the - SetItemForDataRecord method for the DateTimeClass - 2004-06-24 Atsushi Enomoto <atsushi@ximian.com> + * DataColumnMappingCollection.cs : fixed typo. * DbDataAdapter.cs : column mappings were not filled. diff --git a/mcs/class/System.Data/System.Data.Common/DataContainer.cs b/mcs/class/System.Data/System.Data.Common/DataContainer.cs index de0d64bc598..5b627d7d8ba 100644 --- a/mcs/class/System.Data/System.Data.Common/DataContainer.cs +++ b/mcs/class/System.Data/System.Data.Common/DataContainer.cs @@ -1098,8 +1098,8 @@ namespace System.Data.Common { // if exception thrown, it should be caught // in the caller method - if (!CheckAndSetNull(index,record,field)) - base.SetValue(index,record.GetDateTime(field)); + base.SetValue(index,record.GetDateTime(field)); + base.SetItemFromDataRecord(index,record,field); } internal override int CompareValues(int index1, int index2) diff --git a/mcs/class/System.Data/System.Data.Common/DbDataRecord.cs b/mcs/class/System.Data/System.Data.Common/DbDataRecord.cs index 69a2013f64d..0a6fa0e868d 100644 --- a/mcs/class/System.Data/System.Data.Common/DbDataRecord.cs +++ b/mcs/class/System.Data/System.Data.Common/DbDataRecord.cs @@ -340,7 +340,7 @@ namespace System.Data.Common { public bool IsDBNull (int i) { - return GetValue (i) == DBNull.Value; + return GetValue (i) == null; } #if NET_2_0 public virtual bool IsSetAsDefault (int i) diff --git a/mcs/class/System.Data/System.Data.Odbc/ChangeLog b/mcs/class/System.Data/System.Data.Odbc/ChangeLog index df53dbcdd71..d8581c1975b 100644 --- a/mcs/class/System.Data/System.Data.Odbc/ChangeLog +++ b/mcs/class/System.Data/System.Data.Odbc/ChangeLog @@ -1,16 +1,3 @@ -2004-07-28 Umadevi S (sumadevi@novell.com) - * OdbcParameter.cs - fixed bug 61968. String values passed with quotes - -2004-07-07 Umadevi S (sumadevi@novell.com) - * OdbcConnection.cs - Allowed Close to be called multiple times - - Implementation of Dispose method - -2004-07-07 Umadevi S (sumadevi@novell.com) - * OdbcCommand.cs : fixed set method for Transaction - -2004-07-01 Sureshkumar T (tsureshkumar@novell.com) - * OdbcCommand.cs : fixed reader problem with ExecuteScalar - 2004-06-23 Sureshkumar T (tsureshkumar@novell.com) * OdbcConnection.cs: Fix: Moved env allocation to Open method. Disconnection & freeing handles are done in Close diff --git a/mcs/class/System.Data/System.Data.Odbc/OdbcCommand.cs b/mcs/class/System.Data/System.Data.Odbc/OdbcCommand.cs index c414b38fee0..fe242f3bf8f 100644 --- a/mcs/class/System.Data/System.Data.Odbc/OdbcCommand.cs +++ b/mcs/class/System.Data/System.Data.Odbc/OdbcCommand.cs @@ -223,14 +223,7 @@ namespace System.Data.Odbc return (IDbTransaction) Transaction;
}
set {
- if (value is OdbcTransaction) - { - Transaction = (OdbcTransaction)value; - } - else - { - throw new ArgumentException (); - } + throw new NotImplementedException ();
}
}
@@ -349,12 +342,11 @@ namespace System.Data.Odbc public object ExecuteScalar ()
{
- object val = null;
+ object val;
OdbcDataReader reader=ExecuteReader();
try
{
- if (reader.Read ())
- val=reader[0];
+ val=reader[0];
}
finally
{
diff --git a/mcs/class/System.Data/System.Data.Odbc/OdbcConnection.cs b/mcs/class/System.Data/System.Data.Odbc/OdbcConnection.cs index 919ee0606d7..e6bd6ff0441 100644 --- a/mcs/class/System.Data/System.Data.Odbc/OdbcConnection.cs +++ b/mcs/class/System.Data/System.Data.Odbc/OdbcConnection.cs @@ -46,7 +46,6 @@ namespace System.Data.Odbc int connectionTimeout; internal OdbcTransaction transaction; IntPtr henv=IntPtr.Zero, hdbc=IntPtr.Zero; - bool disposed = false; #endregion @@ -217,6 +216,8 @@ namespace System.Data.Odbc transaction = null; } + else + throw new InvalidOperationException (); } public OdbcCommand CreateCommand () @@ -230,23 +231,10 @@ namespace System.Data.Odbc throw new NotImplementedException (); } + [MonoTODO] protected override void Dispose (bool disposing) - { - if (!this.disposed) { - try - { - // release the native unmananged resources - this.Close(); - this.disposed = true; - } - finally - { - // call Dispose on the base class - base.Dispose(disposing); - } - } - } - + { + } [MonoTODO] object ICloneable.Clone () diff --git a/mcs/class/System.Data/System.Data.Odbc/OdbcParameter.cs b/mcs/class/System.Data/System.Data.Odbc/OdbcParameter.cs index 11153197ca7..51df821d86f 100644 --- a/mcs/class/System.Data/System.Data.Odbc/OdbcParameter.cs +++ b/mcs/class/System.Data/System.Data.Odbc/OdbcParameter.cs @@ -261,9 +261,6 @@ namespace System.Data.Odbc string paramValueString = ParamValue.ToString();
// Treat everything else as a string
// Init string buffer
- if (ParamValue is String) - paramValueString = "\'"+paramValueString+"\'"; - if (buffer == null || buffer.Length < ((size > 20) ? size : 20))
buffer = new byte[(size > 20) ? size : 20];
else
diff --git a/mcs/class/System.Data/System.Data.SqlClient/ChangeLog b/mcs/class/System.Data/System.Data.SqlClient/ChangeLog index 14efc7d3b1e..5576c7f7c6b 100755 --- a/mcs/class/System.Data/System.Data.SqlClient/ChangeLog +++ b/mcs/class/System.Data/System.Data.SqlClient/ChangeLog @@ -1,3 +1,7 @@ +2004-06-30 Umadevi S <sumadevi@novell.com> + * SqlCommand.cs : In the Execute Method the commandbehavior parameters were ignored correct +these + 2004-06-22 Atsushi Enomoto <atsushi@ximian.com> * SqlCommandBuilder.cs : Avoid cast exception caused by DbNull. diff --git a/mcs/class/System.Data/System.Data.SqlClient/SqlCommand.cs b/mcs/class/System.Data/System.Data.SqlClient/SqlCommand.cs index 366b381b54d..21978c14cf2 100644 --- a/mcs/class/System.Data/System.Data.SqlClient/SqlCommand.cs +++ b/mcs/class/System.Data/System.Data.SqlClient/SqlCommand.cs @@ -268,8 +268,8 @@ namespace System.Data.SqlClient { { TdsMetaParameterCollection parms = Parameters.MetaParameters; if (preparedStatement == null) { - bool schemaOnly = ((CommandBehavior & CommandBehavior.SchemaOnly) > 0); - bool keyInfo = ((CommandBehavior & CommandBehavior.KeyInfo) > 0); + bool schemaOnly = ((behavior & CommandBehavior.SchemaOnly) > 0); + bool keyInfo = ((behavior & CommandBehavior.KeyInfo) > 0); StringBuilder sql1 = new StringBuilder (); StringBuilder sql2 = new StringBuilder (); diff --git a/mcs/class/System.Data/System.Data/ChangeLog b/mcs/class/System.Data/System.Data/ChangeLog index 19a97068767..5477819e402 100644 --- a/mcs/class/System.Data/System.Data/ChangeLog +++ b/mcs/class/System.Data/System.Data/ChangeLog @@ -1,8 +1,3 @@ -2004-07-27 Atsushi Enomoto <atsushi@ximian.com> - - * DataSet.cs : on serialization to XmlWriter, XmlConvert should be - used. There were also some culture dependency problems to write int. - 2004-06-27 Atsushi Enomoto <atsushi@ximian.com> * XmlDataInferenceLoader.cs : It was not always filling relation diff --git a/mcs/class/System.Data/System.Data/DataSet.cs b/mcs/class/System.Data/System.Data/DataSet.cs index 49ae0f024f9..34f9f8f4c80 100644 --- a/mcs/class/System.Data/System.Data/DataSet.cs +++ b/mcs/class/System.Data/System.Data/DataSet.cs @@ -1270,7 +1270,7 @@ namespace System.Data { private void WriteColumnAsAttribute (XmlWriter writer, XmlWriteMode mode, DataColumn col, DataRow row, DataRowVersion version) { - WriteAttributeString (writer, mode, col.Namespace, col.Prefix, XmlConvert.EncodeLocalName (col.ColumnName), WriteObjectXml (row[col, version])); + WriteAttributeString (writer, mode, col.Namespace, col.Prefix, XmlConvert.EncodeLocalName (col.ColumnName), row[col, version].ToString ()); } private void WriteTableElement (XmlWriter writer, XmlWriteMode mode, DataTable table, DataRow row, DataRowVersion version) @@ -1282,7 +1282,7 @@ namespace System.Data { if (mode == XmlWriteMode.DiffGram) { WriteAttributeString (writer, mode, XmlConstants.DiffgrNamespace, XmlConstants.DiffgrPrefix, "id", table.TableName + (row.XmlRowID + 1)); - WriteAttributeString (writer, mode, XmlConstants.MsdataNamespace, XmlConstants.MsdataPrefix, "rowOrder", XmlConvert.ToString (row.XmlRowID)); + WriteAttributeString (writer, mode, XmlConstants.MsdataNamespace, XmlConstants.MsdataPrefix, "rowOrder", row.XmlRowID.ToString()); string modeName = null; if (row.RowState == DataRowState.Modified) modeName = "modified"; @@ -1618,7 +1618,7 @@ namespace System.Data { // add ordinal attribute xlmAttrs[1] = doc.CreateAttribute (XmlConstants.MsdataPrefix, XmlConstants.Ordinal, XmlConstants.MsdataNamespace); - xlmAttrs[1].Value = XmlConvert.ToString (simple.Ordinal); + xlmAttrs[1].Value = simple.Ordinal.ToString(); simpleContent.UnhandledAttributes = xlmAttrs; @@ -1655,12 +1655,12 @@ namespace System.Data { if (col.AutoIncrementSeed != 0) { xattr = doc.CreateAttribute (XmlConstants.MsdataPrefix, XmlConstants.AutoIncrementSeed, XmlConstants.MsdataNamespace); - xattr.Value = XmlConvert.ToString (col.AutoIncrementSeed); + xattr.Value = col.AutoIncrementSeed.ToString(); xattrs.Add (xattr); } if (col.DefaultValue.ToString () != String.Empty) - colElem.DefaultValue = WriteObjectXml (col.DefaultValue); + colElem.DefaultValue = col.DefaultValue.ToString (); if (col.MaxLength < 0) colElem.SchemaTypeName = MapType (col.DataType); diff --git a/mcs/class/System.Data/Test/System.Data.Odbc/ChangeLog b/mcs/class/System.Data/Test/System.Data.Odbc/ChangeLog index ccaede486d2..bd7b77d4f19 100644 --- a/mcs/class/System.Data/Test/System.Data.Odbc/ChangeLog +++ b/mcs/class/System.Data/Test/System.Data.Odbc/ChangeLog @@ -1,11 +1,3 @@ -2004-07-28 Umadevi S <sumadevi@novell.com> - * OdbcCommandTest.cs - Added testcase for bug 61968. String values passed with quotes - -2004-07-01 Sureshkumar T <tsureshkumar@novell.com> - * Added test case for OdbcCommand.ExecuteScalar Method - * New files: - OdbcCommandTest.cs - test suite for OdbcCommand class. - 2004-06-23 Sureshkumar T <TSureshkumar@novell.com> * Added test to check whether the OdbcConnection.Close method closes all the handles. diff --git a/mcs/class/System.Data/Test/System.Data.Odbc/OdbcCommandTest.cs b/mcs/class/System.Data/Test/System.Data.Odbc/OdbcCommandTest.cs deleted file mode 100644 index b7b8bdb4130..00000000000 --- a/mcs/class/System.Data/Test/System.Data.Odbc/OdbcCommandTest.cs +++ /dev/null @@ -1,90 +0,0 @@ -//
-// OdbcCommandTest.cs - NUnit Test Cases for testing the
-// OdbcCommand class
-//
-// Author:
-// Sureshkumar T (TSureshkumar@novell.com)
-//
-// Copyright (c) 2004 Novell Inc., and the individuals listed
-// on the ChangeLog entries.
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System;
-using System.Data;
-using System.Data.Odbc;
-
-using NUnit.Framework;
-
-namespace MonoTests.System.Data.Odbc
-{
-
- [TestFixture]
- public class OdbcCommandTest : MySqlOdbcBaseClient
- {
-
- [SetUp]
- public void GetReady () {
- OpenConnection ();
- CreateTestSetup (); // create database & test tables
- }
-
- [TearDown]
- public void Clean () {
- CleanTestSetup (); // clean test database;
- CloseConnection ();
- }
-
- /// <summary>
- /// Test Execute Scalar Method
- /// </summary>
- [Test]
- public void ExecuteScalarTest ()
- {
- OdbcCommand cmd = conn.CreateCommand ();
- string query = "select count(*) from test order by col_int;";
- cmd.CommandText = query;
- object objCount = cmd.ExecuteScalar ();
- Assertion.AssertEquals( "ExecuteScalar does not return int type", 5, Convert.ToInt32(objCount));
- }
-
- /// <summary>
- /// Test String parameters to ODBC Command
- /// </summary>
- [Test]
- public void ExecuteStringParameterTest()
- {
-
- OdbcCommand dbcmd = new OdbcCommand();
- dbcmd.Connection = conn;
- dbcmd.CommandType = CommandType.Text;
- dbcmd.CommandText = "select count(*) from test where col_char=?;";
- string colvalue = "mono test";
- dbcmd.Parameters.Add("@un",colvalue);
- Object obj = dbcmd.ExecuteScalar();
- Assertion.AssertEquals( "String parameter not passed correctly",5, Convert.ToInt32(obj));
-
-
- }
-
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing/ChangeLog b/mcs/class/System.Drawing/System.Drawing/ChangeLog index ee4e72e3e57..941f5db4a6c 100644 --- a/mcs/class/System.Drawing/System.Drawing/ChangeLog +++ b/mcs/class/System.Drawing/System.Drawing/ChangeLog @@ -1,7 +1,3 @@ -2004-07-02 Jordi Mas i Hernandez <jordi@ximian.com> - - * gdipFunctions.cs: fixes bug 61050 - 2004-06-24 Sanjay Gupta <gsanjay@novell.com> * ImageAnimator.cs: Rewrote complete implementation. diff --git a/mcs/class/System.Drawing/System.Drawing/gdipFunctions.cs b/mcs/class/System.Drawing/System.Drawing/gdipFunctions.cs index 5244cd50235..8db7223a85c 100644 --- a/mcs/class/System.Drawing/System.Drawing/gdipFunctions.cs +++ b/mcs/class/System.Drawing/System.Drawing/gdipFunctions.cs @@ -1418,11 +1418,7 @@ namespace System.Drawing { public Stream stream; - public GdiPlusStreamHelper (Stream s) - { - stream = s; - stream.Seek(0, SeekOrigin.Begin); - } + public GdiPlusStreamHelper (Stream s) { stream = s; } public int StreamGetBytesImpl (IntPtr buf, int bufsz, bool peek) { diff --git a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels.Tcp/ChangeLog b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels.Tcp/ChangeLog index a638962017f..42d69cb17d6 100644 --- a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels.Tcp/ChangeLog +++ b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels.Tcp/ChangeLog @@ -1,8 +1,3 @@ -2004-07-15 Lluis Sanchez Gual <lluis@novell.com> - - * TcpServerChannel.cs: Set channel name from the provided properties. - This fixes bug #61592. - 2004-05-13 Lluis Sanchez Gual <lluis@ximian.com> * TcpChannel.cs: Made Init private. diff --git a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels.Tcp/TcpServerChannel.cs b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels.Tcp/TcpServerChannel.cs index 6e3aba6f960..945dff1e278 100644 --- a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels.Tcp/TcpServerChannel.cs +++ b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels.Tcp/TcpServerChannel.cs @@ -106,9 +106,6 @@ namespace System.Runtime.Remoting.Channels.Tcp {
switch((string)property.Key)
{
- case "name": - name = property.Value.ToString(); - break; case "port":
port = Convert.ToInt32(property.Value); break;
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 47d41efa66e..c2ea35962b2 100644 --- a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/ChangeLog +++ b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/ChangeLog @@ -1,14 +1,3 @@ -2004-07-26 Lluis Sanchez Gual <lluis@ximian.com> - - * SoapMessageFormater.cs: In BuildSoapMessageFromMethodResponse, add the - return value to the SoapMessage even if it is null. This fixes bug #61837. - -2004-07-06 Lluis Sanchez Gual <lluis@ximian.com> - - * SoapMessageFormatter.cs: In BuildMethodCallFromSoapMessage, set get the - parameters from the SoapMessage by position, not by name, since names - may be different. This fixes bug #60427. - 2004-06-16 Lluis Sanchez Gual <lluis@ximian.com> * SoapServerFormatterSink.cs: Removed unneded method. 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 2de868c9bee..e0508f1cb82 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 @@ -222,21 +222,21 @@ namespace System.Runtime.Remoting.Channels { // have to add them here
_methodCallParameters = _methodCallInfo.GetParameters();
object[] args = new object[_methodCallParameters.Length];
- int sn = 0;
- for (int n=0; n<_methodCallParameters.Length; n++)
+
+ foreach(ParameterInfo paramInfo in _methodCallParameters)
{
- ParameterInfo paramInfo = _methodCallParameters [n];
Type paramType = (paramInfo.ParameterType.IsByRef ? paramInfo.ParameterType.GetElementType() : paramInfo.ParameterType);
if (paramInfo.IsOut && paramInfo.ParameterType.IsByRef) {
- args [n] = GetNullValue (paramType);
+ args [paramInfo.Position] = GetNullValue (paramType);
}
else{
- object val = soapMessage.ParamValues[sn++];
- if(val is IConvertible)
- args [n] = Convert.ChangeType (val, paramType);
- else
- args [n] = val;
+ 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];
}
}
@@ -267,16 +267,10 @@ namespace System.Runtime.Remoting.Channels { ArrayList paramValues = new ArrayList();
ArrayList paramTypes = new ArrayList();
soapMessage.MethodName = mrm.MethodName+"Response";
-
- Type retType = ((MethodInfo)mrm.MethodBase).ReturnType;
-
- if(retType != typeof(void)) {
+ if(mrm.ReturnValue != null && mrm.ReturnValue.GetType() != typeof(void)) {
paramNames.Add("return");
paramValues.Add(mrm.ReturnValue);
- if (mrm.ReturnValue != null)
- paramTypes.Add(mrm.ReturnValue.GetType());
- else
- paramTypes.Add(retType);
+ paramTypes.Add(mrm.ReturnValue.GetType());
}
for(int i = 0; i < mrm.OutArgCount; i++){
diff --git a/mcs/class/System.Security/System.Security.Cryptography.Xml/ChangeLog b/mcs/class/System.Security/System.Security.Cryptography.Xml/ChangeLog index 4fbb13a002a..a0b692b21d0 100644 --- a/mcs/class/System.Security/System.Security.Cryptography.Xml/ChangeLog +++ b/mcs/class/System.Security/System.Security.Cryptography.Xml/ChangeLog @@ -1,8 +1,3 @@ -2004-07-20 Atsushi Enomoto <atsushi@ximian.com> - - * Signature.cs : Fixed NextElementPos() that incorrectly examined - node matching. - 2004-06-17 Sebastien Pouliot <sebastien@ximian.com> * KeyInfoX509Data.cs: Removed old internal IssuerSerial for the diff --git a/mcs/class/System.Security/System.Security.Cryptography.Xml/Signature.cs b/mcs/class/System.Security/System.Security.Cryptography.Xml/Signature.cs index 9aab99f8386..72e5088ed38 100644 --- a/mcs/class/System.Security/System.Security.Cryptography.Xml/Signature.cs +++ b/mcs/class/System.Security/System.Security.Cryptography.Xml/Signature.cs @@ -192,14 +192,13 @@ namespace System.Security.Cryptography.Xml { { while (pos < nl.Count) { if (nl [pos].NodeType == XmlNodeType.Element) { - if (nl [pos].LocalName != name || nl [pos].NamespaceURI != ns) { + if (nl [pos].LocalName != name && nl [pos].NamespaceURI != ns) { if (required) throw new CryptographicException ("Malformed element " + name); else return -2; } - else - return pos; + return pos; } else pos++; diff --git a/mcs/class/System.Web.Services/System.Web.Services.Protocols/ChangeLog b/mcs/class/System.Web.Services/System.Web.Services.Protocols/ChangeLog index 3b3ed1be736..01f02c69e94 100644 --- a/mcs/class/System.Web.Services/System.Web.Services.Protocols/ChangeLog +++ b/mcs/class/System.Web.Services/System.Web.Services.Protocols/ChangeLog @@ -1,8 +1,3 @@ -2004-07-20 Lluis Sanchez Gual <lluis@ximian.com> - - * HttpWebClientProtocol.cs: Add received cookies to cookieContainer when - getting the response, do not wait for the next request to do it. - 2004-06-22 Lluis Sanchez Gual <lluis@ximian.com> * XmlReturnReader.cs, XmlReturnWriter.cs: Generate the serializer with diff --git a/mcs/class/System.Web.Services/System.Web.Services.Protocols/HttpWebClientProtocol.cs b/mcs/class/System.Web.Services/System.Web.Services.Protocols/HttpWebClientProtocol.cs index 722f1d2a681..3be915cfbc8 100644 --- a/mcs/class/System.Web.Services/System.Web.Services.Protocols/HttpWebClientProtocol.cs +++ b/mcs/class/System.Web.Services/System.Web.Services.Protocols/HttpWebClientProtocol.cs @@ -45,6 +45,7 @@ namespace System.Web.Services.Protocols { CookieContainer cookieContainer;
IWebProxy proxy;
string userAgent;
+ CookieCollection prevCookies;
#if NET_1_1
bool _unsafeAuthenticated;
@@ -116,25 +117,41 @@ namespace System.Web.Services.Protocols { #region Methods
- internal virtual void CheckForCookies (HttpWebResponse response)
+ internal virtual void AddCookies (Uri uri)
{
- CookieCollection cookies = response.Cookies;
- if (cookieContainer == null || cookies.Count == 0)
+ if (cookieContainer == null)
+ cookieContainer = new CookieContainer ();
+
+ if (prevCookies == null || prevCookies.Count == 0)
return;
CookieCollection coll = cookieContainer.GetCookies (uri);
- foreach (Cookie c in cookies) {
- bool add = true;
- foreach (Cookie prev in coll) {
+ foreach (Cookie prev in prevCookies) {
+ bool dont = false;
+ foreach (Cookie c in coll) {
if (c.Equals (prev)) {
- add = false;
+ dont = true;
break;
}
}
- if (add)
- cookieContainer.Add (c);
+
+ if (dont == false)
+ cookieContainer.Add (prev);
}
}
+
+ internal virtual void CheckForCookies (HttpWebResponse response)
+ {
+ CookieCollection cookies = response.Cookies;
+ if (cookies.Count == 0)
+ return;
+
+ if (prevCookies == null)
+ prevCookies = new CookieCollection ();
+
+ foreach (Cookie c in cookies)
+ prevCookies.Add (c);
+ }
protected override WebRequest GetWebRequest (Uri uri)
{
@@ -147,6 +164,7 @@ namespace System.Web.Services.Protocols { if (clientCertificates != null)
request.ClientCertificates.AddRange (clientCertificates);
+ AddCookies (uri);
request.CookieContainer = cookieContainer;
if (proxy != null)
request.Proxy = proxy;
diff --git a/mcs/class/System.Web/System.Web.Compilation/AspGenerator.cs b/mcs/class/System.Web/System.Web.Compilation/AspGenerator.cs index 9e53465f583..4a2cb6502af 100644 --- a/mcs/class/System.Web/System.Web.Compilation/AspGenerator.cs +++ b/mcs/class/System.Web/System.Web.Compilation/AspGenerator.cs @@ -319,8 +319,8 @@ namespace System.Web.Compilation if (isvirtual) { file = tparser.MapPath (file); - } else { - file = GetIncludeFilePath (tparser.BaseDir, file); + } else if (!Path.IsPathRooted (file)) { + file = UrlUtils.Combine (tparser.BaseVirtualDir, file); } InitParser (file); @@ -332,14 +332,6 @@ namespace System.Web.Compilation //PrintLocation (location); } - static string GetIncludeFilePath (string basedir, string filename) - { - if (Path.DirectorySeparatorChar == '/') - filename = filename.Replace ("\\", "/"); - - return Path.GetFullPath (Path.Combine (basedir, filename)); - } - void TextParsed (ILocation location, string text) { if (text.IndexOf ("<%") != -1 && !inScript) { diff --git a/mcs/class/System.Web/System.Web.Compilation/AspParser.cs b/mcs/class/System.Web/System.Web.Compilation/AspParser.cs index 28c357ce3c5..8f199c12de8 100644 --- a/mcs/class/System.Web/System.Web.Compilation/AspParser.cs +++ b/mcs/class/System.Web/System.Web.Compilation/AspParser.cs @@ -184,15 +184,12 @@ namespace System.Web.Compilation str = str.Substring (2).Trim (); int len = str.Length; int lastQuote = str.LastIndexOf ('"'); - if (len < 10 || lastQuote != len - 1) - return false; - - if (!str.ToLower ().StartsWith ("#include ")) + if (len < 10 || lastQuote != len - 1 || !str.StartsWith ("#include ")) return false; str = str.Substring (9).Trim (); - bool isfile = (str.ToLower ().StartsWith ("file")); - if (!isfile && !str.ToLower ().StartsWith ("virtual")) + bool isfile = (str.StartsWith ("file")); + if (!isfile && !str.StartsWith ("virtual")) return false; pathType = (isfile) ? "file" : "virtual"; diff --git a/mcs/class/System.Web/System.Web.Compilation/BaseCompiler.cs b/mcs/class/System.Web/System.Web.Compilation/BaseCompiler.cs index c5f1c410923..5036f5db094 100644 --- a/mcs/class/System.Web/System.Web.Compilation/BaseCompiler.cs +++ b/mcs/class/System.Web/System.Web.Compilation/BaseCompiler.cs @@ -309,7 +309,7 @@ namespace System.Web.Compilation bool keepFiles = (Environment.GetEnvironmentVariable ("MONO_ASPNET_NODELETE") != null); TempFileCollection tempcoll = new TempFileCollection (config.TempDirectory, keepFiles); compilerParameters.TempFiles = tempcoll; - string dllfilename = Path.GetFileName (tempcoll.AddExtension ("dll", true)); + string dllfilename = tempcoll.AddExtension ("dll", true); if (!Directory.Exists (dynamicBase)) Directory.CreateDirectory (dynamicBase); diff --git a/mcs/class/System.Web/System.Web.Compilation/ChangeLog b/mcs/class/System.Web/System.Web.Compilation/ChangeLog index 80ce8459331..1bd493966e2 100644 --- a/mcs/class/System.Web/System.Web.Compilation/ChangeLog +++ b/mcs/class/System.Web/System.Web.Compilation/ChangeLog @@ -1,18 +1,3 @@ -2004-07-21 Gonzalo Paniagua Javier <gonzalo@ximian.com> - - * AspGenerator.cs: the path for file was treated as virtual, but it's - physical. Fixes bug #61524. - -2004-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com> - - * AspParser.cs: fixed case-sensitivity issues with #include and its - attributes. Closes #61429. - -2004-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com> - - * BaseCompiler.cs: - * WebServiceCompiler.cs: really create the dlls under DynamicBase - 2004-06-19 Gonzalo Paniagua Javier <gonzalo@ximian.com> * TemplateControlCompiler.cs: for system colors, use SystemColors class diff --git a/mcs/class/System.Web/System.Web.Compilation/WebServiceCompiler.cs b/mcs/class/System.Web/System.Web.Compilation/WebServiceCompiler.cs index f6884bf428b..20b87415730 100644 --- a/mcs/class/System.Web/System.Web.Compilation/WebServiceCompiler.cs +++ b/mcs/class/System.Web/System.Web.Compilation/WebServiceCompiler.cs @@ -93,7 +93,7 @@ namespace System.Web.Compilation sw.WriteLine (parser.Program); sw.Close (); - string dllfilename = Path.GetFileName (tempcoll.AddExtension ("dll", true)); + string dllfilename = tempcoll.AddExtension ("dll", true); if (!Directory.Exists (dynamicBase)) Directory.CreateDirectory (dynamicBase); diff --git a/mcs/class/System.Web/System.Web.Handlers/ChangeLog b/mcs/class/System.Web/System.Web.Handlers/ChangeLog index 50459bd9024..ebddbc1e4ba 100644 --- a/mcs/class/System.Web/System.Web.Handlers/ChangeLog +++ b/mcs/class/System.Web/System.Web.Handlers/ChangeLog @@ -1,7 +1,3 @@ -2004-07-02 Gonzalo Paniagua Javier <gonzalo@ximian.com> - - * TraceHandler.cs: check that trace is enabled or throw. - 2004-06-03 Gonzalo Paniagua Javier <gonzalo@ximian.com> * TraceHandler.cs: Added protected missing members and attributes. diff --git a/mcs/class/System.Web/System.Web.Handlers/TraceHandler.cs b/mcs/class/System.Web/System.Web.Handlers/TraceHandler.cs index 343aa5957a7..33385dbf5fb 100644 --- a/mcs/class/System.Web/System.Web.Handlers/TraceHandler.cs +++ b/mcs/class/System.Web/System.Web.Handlers/TraceHandler.cs @@ -39,27 +39,16 @@ using System.Web.UI.WebControls; namespace System.Web.Handlers { -#if NET_2_0 - [Serializable] -#endif - class TraceNotAvailableException : HttpException - { - public TraceNotAvailableException () : - base ("Trace Error") {} - - internal override string Description { - get { return "Trace.axd is not enabled in the configuration file for this application."; } - } - } - public class TraceHandler : IHttpHandler { void IHttpHandler.ProcessRequest (HttpContext context) { TraceManager manager = HttpRuntime.TraceManager; - if (!manager.Enabled || manager.LocalOnly && !context.Request.IsLocal) { - throw new TraceNotAvailableException (); + if (manager.LocalOnly && !context.Request.IsLocal) { + // Need to figure out the error message that goes here + // but I only have cassini for testing + return; } HtmlTextWriter output = new HtmlTextWriter (context.Response.Output); diff --git a/mcs/class/System.Web/System.Web.SessionState/ChangeLog b/mcs/class/System.Web/System.Web.SessionState/ChangeLog index 3e70b628dc9..58135e9f7d0 100644 --- a/mcs/class/System.Web/System.Web.SessionState/ChangeLog +++ b/mcs/class/System.Web/System.Web.SessionState/ChangeLog @@ -1,8 +1,3 @@ -2004-07-07 Juraj Skripsky <juraj@hotfeet.ch> - - * SessionStateModule.cs: set path in session cookie to application - path. - 2004-06-18 Gert Driesen <drieseng@users.sourceforge.net> * IStateRuntime.cs: added missing marshalling attributes diff --git a/mcs/class/System.Web/System.Web.SessionState/SessionStateModule.cs b/mcs/class/System.Web/System.Web.SessionState/SessionStateModule.cs index cbee9af88f8..70c4a566129 100644 --- a/mcs/class/System.Web/System.Web.SessionState/SessionStateModule.cs +++ b/mcs/class/System.Web/System.Web.SessionState/SessionStateModule.cs @@ -158,7 +158,7 @@ namespace System.Web.SessionState } else if (isNew) { string id = context.Session.SessionID; HttpCookie cookie = new HttpCookie (CookieName, id); - cookie.Path = UrlUtils.GetDirectory (context.Request.ApplicationPath); + cookie.Path = UrlUtils.GetDirectory (context.Request.Path); context.Response.AppendCookie (cookie); } } diff --git a/mcs/class/System.Web/System.Web.UI/ChangeLog b/mcs/class/System.Web/System.Web.UI/ChangeLog index dd08b76969d..07d62fd2c33 100644 --- a/mcs/class/System.Web/System.Web.UI/ChangeLog +++ b/mcs/class/System.Web/System.Web.UI/ChangeLog @@ -1,19 +1,3 @@ -2004-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com> - - * TemplateControl.cs: don't include private methods of base classes when - auto-attaching events. Fixes bug 61569. - -2004-07-08 Pablo Baena <pbaena@gmail.com> - - * Page.cs: added workaround for __doPostBack script on Netscape 4.xx - -2004-07-02 Gonzalo Paniagua Javier <gonzalo@ximian.com> - - * Page.cs: added additional checks for saving/displaying trace data. - - * PageParser.cs: removed checks for trace enabled in configuration - files. - 2004-06-29 Gonzalo Paniagua Javier <gonzalo@ximian.com> * ControlCollection.cs: when clearing the control collection, tell the diff --git a/mcs/class/System.Web/System.Web.UI/Page.cs b/mcs/class/System.Web/System.Web.UI/Page.cs index 53b89d28854..3887c9c35e0 100755 --- a/mcs/class/System.Web/System.Web.UI/Page.cs +++ b/mcs/class/System.Web/System.Web.UI/Page.cs @@ -526,12 +526,7 @@ public class Page : TemplateControl, IHttpHandler writer.WriteLine ("<script language=\"javascript\">"); writer.WriteLine ("<!--"); writer.WriteLine ("\tfunction __doPostBack(eventTarget, eventArgument) {"); - - if (Request.Browser.Browser == ("Netscape") && Request.Browser.MajorVersion == 4) - writer.WriteLine ("\t\tvar theform = document.{0};", formUniqueID); - else - writer.WriteLine ("\t\tvar theform = document.getElementById ('{0}');", formUniqueID); - + writer.WriteLine ("\t\tvar theform = document.getElementById ('{0}');", formUniqueID); writer.WriteLine ("\t\ttheform.{0}.value = eventTarget;", postEventSourceID); writer.WriteLine ("\t\ttheform.{0}.value = eventArgument;", postEventArgumentID); writer.WriteLine ("\t\ttheform.submit();"); @@ -774,18 +769,11 @@ public class Page : TemplateControl, IHttpHandler private void RenderTrace (HtmlTextWriter output) { - TraceManager traceManager = HttpRuntime.TraceManager; - - if (Trace.HaveTrace && !Trace.IsEnabled || !Trace.HaveTrace && !traceManager.Enabled) + if (!Trace.IsEnabled) return; Trace.SaveData (); - - if (!Trace.HaveTrace && traceManager.Enabled && !traceManager.PageOutput) - return; - - if (!traceManager.LocalOnly || Context.Request.IsLocal) - Trace.Render (output); + Trace.Render (output); } internal void RaisePostBackEvents () diff --git a/mcs/class/System.Web/System.Web.UI/PageParser.cs b/mcs/class/System.Web/System.Web.UI/PageParser.cs index 571edf2997a..816d83c0bc8 100644 --- a/mcs/class/System.Web/System.Web.UI/PageParser.cs +++ b/mcs/class/System.Web/System.Web.UI/PageParser.cs @@ -199,6 +199,13 @@ namespace System.Web.UI } } + TraceConfig traceConfig = (TraceConfig) Context.GetConfig ("system.web/trace"); + if (traceConfig != null) { + trace = traceConfig.Enabled; + if (trace) + haveTrace = true; + } + string tracestr = GetString (atts, "Trace", null); if (tracestr != null) { haveTrace = true; @@ -220,6 +227,13 @@ namespace System.Web.UI "one of the following values: SortByTime, SortByCategory."); } + if (traceConfig != null) { + if (traceConfig.LocalOnly && !Context.Request.IsLocal) { + haveTrace = false; + trace = false; + } + } + errorPage = GetString (atts, "ErrorPage", null); validateRequest = GetBool (atts, "ValidateRequest", PagesConfig.ValidateRequest); clientTarget = GetString (atts, "ClientTarget", null); diff --git a/mcs/class/System.Web/System.Web.UI/TemplateControl.cs b/mcs/class/System.Web/System.Web.UI/TemplateControl.cs index 1014c3792f9..7b1e85f94fb 100755 --- a/mcs/class/System.Web/System.Web.UI/TemplateControl.cs +++ b/mcs/class/System.Web/System.Web.UI/TemplateControl.cs @@ -106,12 +106,6 @@ namespace System.Web.UI { if (method == null) continue; - if (method.DeclaringType != type) { - if (!method.IsPublic && !method.IsFamilyOrAssembly && - !method.IsFamilyAndAssembly && !method.IsFamily) - continue; - } - if (method.ReturnType != typeof (void)) continue; diff --git a/mcs/class/System.Web/System.Web.Util/ChangeLog b/mcs/class/System.Web/System.Web.Util/ChangeLog index f293a48cb13..4d57c166561 100644 --- a/mcs/class/System.Web/System.Web.Util/ChangeLog +++ b/mcs/class/System.Web/System.Web.Util/ChangeLog @@ -1,8 +1,3 @@ -2004-07-20 Gonzalo Paniagua Javier <gonzalo@ximian.com> - - * UrlUtils.cs: don't pass double slash when the path begins with a - tilde. Fixes bug #61654. - 2004-05-26 Gonzalo Paniagua Javier <gonzalo@ximian.com> * UrlUtils.cs: diff --git a/mcs/class/System.Web/System.Web.Util/UrlUtils.cs b/mcs/class/System.Web/System.Web.Util/UrlUtils.cs index a8f60ff3159..955c8d9a17b 100644 --- a/mcs/class/System.Web/System.Web.Util/UrlUtils.cs +++ b/mcs/class/System.Web/System.Web.Util/UrlUtils.cs @@ -154,11 +154,7 @@ namespace System.Web.Util slash = "/"; } - string appvpath = HttpRuntime.AppDomainAppVirtualPath; - if (appvpath.EndsWith ("/")) - slash = ""; - - return Reduce (appvpath + slash + relPath); + return Reduce (HttpRuntime.AppDomainAppVirtualPath + slash + relPath); } return Reduce (basePath + slash + relPath); diff --git a/mcs/class/System.Web/System.Web/ChangeLog b/mcs/class/System.Web/System.Web/ChangeLog index c783b045319..93cc846bb86 100644 --- a/mcs/class/System.Web/System.Web/ChangeLog +++ b/mcs/class/System.Web/System.Web/ChangeLog @@ -1,27 +1,3 @@ -2004-07-21 Gonzalo Paniagua Javier <gonzalo@ximian.com> - - * HttpApplication.cs: the file not found might be a dependency. - -2004-07-20 Gonzalo Paniagua Javier <gonzalo@ximian.com> - - * HttpCookie.cs: use invariant when formatting expires date. Fixes bug - #61690. - -2004-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com> - - * HttpApplication.cs: don't keep the session around if we got it from - the context. Fixes bug #61232. - -2004-07-06 Gonzalo Paniagua Javier <gonzalo@ximian.com> - - * HttpUtility.cs: fixed stupid bug in UrlDecode from bytes. Closes bug - #61181. - -2004-07-02 Gonzalo Paniagua Javier <gonzalo@ximian.com> - - * TraceContext.cs: added internal HaveTrace property whose - value is true when the page has a Trace attribute. - 2004-06-15 Gonzalo Paniagua Javier <gonzalo@ximian.com> * TraceData.cs: fixed <br> output. Closes bug #60181. diff --git a/mcs/class/System.Web/System.Web/HttpApplication.cs b/mcs/class/System.Web/System.Web/HttpApplication.cs index 09288727b8f..0f8aaa3759b 100644 --- a/mcs/class/System.Web/System.Web/HttpApplication.cs +++ b/mcs/class/System.Web/System.Web/HttpApplication.cs @@ -805,12 +805,7 @@ namespace System.Web return ret; } catch (DirectoryNotFoundException) { throw new HttpException (404, "Cannot find '" + file + "'."); - } catch (FileNotFoundException fnf) { - string fname = fnf.FileName; - if (fname != null && fname != "") { - file = Path.GetFileName (fname); - } - + } catch (FileNotFoundException) { throw new HttpException (404, "Cannot find '" + file + "'."); } } @@ -1150,8 +1145,10 @@ namespace System.Web if (null != _Session) return _Session; - if (null != _Context && null != _Context.Session) - return _Context.Session; + if (null != _Context && null != _Context.Session) { + _Session = _Context.Session; + return _Session; + } throw new HttpException ("Failed to get session object"); } diff --git a/mcs/class/System.Web/System.Web/HttpCookie.cs b/mcs/class/System.Web/System.Web/HttpCookie.cs index c121772be1b..32fdf84261b 100644 --- a/mcs/class/System.Web/System.Web/HttpCookie.cs +++ b/mcs/class/System.Web/System.Web/HttpCookie.cs @@ -26,7 +26,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; -using System.Globalization; using System.Text; using System.Web; using System.Collections.Specialized; @@ -99,9 +98,7 @@ namespace System.Web if (_ExpiresSet && _Expires != DateTime.MinValue) { oSetCookie.Append ("; expires="); - DateTime ut = _Expires.ToUniversalTime (); - oSetCookie.Append (ut.ToString ("ddd, dd-MMM-yyyy HH':'mm':'ss 'GMT'", - DateTimeFormatInfo.InvariantInfo)); + oSetCookie.Append (_Expires.ToUniversalTime ().ToString ("ddd, dd-MMM-yyyy HH':'mm':'ss '+0000'")); } if (_Secure) diff --git a/mcs/class/System.Web/System.Web/HttpUtility.cs b/mcs/class/System.Web/System.Web/HttpUtility.cs index d1a2d0dbb07..d70b32d8f92 100644 --- a/mcs/class/System.Web/System.Web/HttpUtility.cs +++ b/mcs/class/System.Web/System.Web/HttpUtility.cs @@ -444,7 +444,7 @@ namespace System.Web { int value = 0;
int end = length + offset;
for (int i = offset; i < end; i++)
- value = (value << 4) + GetInt (bytes [i]);
+ value = (value << 4) + GetInt (bytes [offset]);
return (char) value;
}
@@ -474,10 +474,10 @@ namespace System.Web { output.Append (GetChars (acc, e));
acc.SetLength (0);
}
- output.Append (GetChar (bytes, i + 2, 4));
+ output.Append (GetChar (bytes, offset + 2, 4));
i += 5;
} else {
- acc.WriteByte ((byte) GetChar (bytes, i + 1, 2));
+ acc.WriteByte ((byte) GetChar (bytes, offset + 1, 2));
i += 2;
}
continue;
diff --git a/mcs/class/System.Web/System.Web/TraceContext.cs b/mcs/class/System.Web/System.Web/TraceContext.cs index f939add498b..6d7a7c68608 100644 --- a/mcs/class/System.Web/System.Web/TraceContext.cs +++ b/mcs/class/System.Web/System.Web/TraceContext.cs @@ -42,19 +42,11 @@ namespace System.Web { private TraceMode _Mode;
private TraceData data;
private bool data_saved;
- private bool _haveTrace = false; public TraceContext(HttpContext Context) {
_Context = Context;
_Enabled = false;
}
- - - internal bool HaveTrace { - get { - return _haveTrace; - } - } public bool IsEnabled {
get {
@@ -64,7 +56,6 @@ namespace System.Web { set {
if (value && data == null)
data = new TraceData ();
- _haveTrace = true; _Enabled = value;
}
}
diff --git a/mcs/class/System.XML/System.Xml.Serialization/ChangeLog b/mcs/class/System.XML/System.Xml.Serialization/ChangeLog index e542d6a843d..f98edd97e7f 100755 --- a/mcs/class/System.XML/System.Xml.Serialization/ChangeLog +++ b/mcs/class/System.XML/System.Xml.Serialization/ChangeLog @@ -1,9 +1,3 @@ -2004-07-15 Lluis Sanchez Gual <lluis@novell.com> - - * TypeTranslator.cs, XmlCustomFormatter.cs: Added support for base64. This - xsd type is not part of the last schema specification, but the google api - uses it and ms.net accepts it. - 2004-06-22 Lluis Sanchez Gual <lluis@ximian.com> * ReflectionHelper.cs: Correctly detect private types. diff --git a/mcs/class/System.XML/System.Xml.Serialization/TypeTranslator.cs b/mcs/class/System.XML/System.Xml.Serialization/TypeTranslator.cs index fc71eeea981..cffcb1567a1 100644 --- a/mcs/class/System.XML/System.Xml.Serialization/TypeTranslator.cs +++ b/mcs/class/System.XML/System.Xml.Serialization/TypeTranslator.cs @@ -106,7 +106,6 @@ namespace System.Xml.Serialization primitiveTypes.Add ("token", new TypeData (typeof (string), "token", true)); primitiveTypes.Add ("normalizedString", new TypeData (typeof (string), "normalizedString", true)); primitiveTypes.Add ("anyURI", new TypeData (typeof (string), "anyURI", true)); - primitiveTypes.Add ("base64", new TypeData (typeof (byte[]), "base64", true)); } public static TypeData GetTypeData (Type type) diff --git a/mcs/class/System.XML/System.Xml.Serialization/XmlCustomFormatter.cs b/mcs/class/System.XML/System.Xml.Serialization/XmlCustomFormatter.cs index 60b4f282cab..17514268a90 100644 --- a/mcs/class/System.XML/System.Xml.Serialization/XmlCustomFormatter.cs +++ b/mcs/class/System.XML/System.Xml.Serialization/XmlCustomFormatter.cs @@ -195,7 +195,6 @@ namespace System.Xml.Serialization { case "unsignedInt": return XmlConvert.ToString ((UInt32)value); case "unsignedLong": return XmlConvert.ToString ((UInt64)value); case "guid": return XmlConvert.ToString ((Guid)value); - case "base64": case "base64Binary": return Convert.ToBase64String ((byte[])value); default: return value is IFormattable ? ((IFormattable) value).ToString (null, CultureInfo.InvariantCulture) : value.ToString (); } @@ -224,7 +223,6 @@ namespace System.Xml.Serialization { case "unsignedInt": return XmlConvert.ToUInt32 (value); case "unsignedLong": return XmlConvert.ToUInt64 (value); case "guid": return XmlConvert.ToGuid (value); - case "base64": case "base64Binary": return Convert.FromBase64String (value); default: if (type.Type != null) @@ -255,7 +253,6 @@ namespace System.Xml.Serialization { case "unsignedInt": return value + ".ToString(CultureInfo.InvariantCulture)"; case "unsignedLong": return value + ".ToString(CultureInfo.InvariantCulture)"; case "guid": return "XmlConvert.ToString (" + value + ")"; - case "base64": case "base64Binary": return "Convert.ToBase64String (" + value + ")"; case "NMTOKEN": case "Name": @@ -293,7 +290,6 @@ namespace System.Xml.Serialization { case "unsignedInt": return "UInt32.Parse (" + value + ", CultureInfo.InvariantCulture)"; case "unsignedLong": return "UInt64.Parse (" + value + ", CultureInfo.InvariantCulture)"; case "guid": return "XmlConvert.ToGuid (" + value + ")"; - case "base64:": case "base64Binary": return "Convert.FromBase64String (" + value + ")"; default: return value; } diff --git a/mcs/class/System.XML/System.Xml/ChangeLog b/mcs/class/System.XML/System.Xml/ChangeLog index 21d51c9e061..04516da68e3 100644 --- a/mcs/class/System.XML/System.Xml/ChangeLog +++ b/mcs/class/System.XML/System.Xml/ChangeLog @@ -1,15 +1,3 @@ -2004-07-20 Atsushi Enomoto <atsushi@ximian.com> - - * XmlNode.cs : When the argument node being inserted is the existing - document element, it should not result in an error (since it should - be first removed from document, thus no error should happen). - -2004-07-16 Atsushi Enomoto <atsushi@ximian.com> - - * XmlTextReader.cs : Fixed several problems on ReadBase64(); - Whitespaces should be ignored, and '=' was not skipped correctly. - It caused "unexpected end of document" error at immediate close tag. - 2004-06-18 Atsushi Enomoto <atsushi@ximian.com> * DTDObjectModel.cs, DTDReader.cs, XmlConvert.cs, XmlDocument.cs, diff --git a/mcs/class/System.XML/System.Xml/XmlNode.cs b/mcs/class/System.XML/System.Xml/XmlNode.cs index 7eaa7285c8e..52c6b21c794 100644 --- a/mcs/class/System.XML/System.Xml/XmlNode.cs +++ b/mcs/class/System.XML/System.Xml/XmlNode.cs @@ -524,7 +524,7 @@ namespace System.Xml throw new ArgumentException ("The reference node is not a child of this node."); } - if(this == ownerDoc && ownerDoc.DocumentElement != null && (newChild is XmlElement) && newChild != ownerDoc.DocumentElement) + if(this == ownerDoc && ownerDoc.DocumentElement != null && (newChild is XmlElement)) throw new XmlException ("multiple document element not allowed."); // checking validity finished. then appending... diff --git a/mcs/class/System.XML/System.Xml/XmlTextReader.cs b/mcs/class/System.XML/System.Xml/XmlTextReader.cs index 9da63c2fc0f..ea3b4e9cd51 100644 --- a/mcs/class/System.XML/System.Xml/XmlTextReader.cs +++ b/mcs/class/System.XML/System.Xml/XmlTextReader.cs @@ -531,14 +531,6 @@ namespace System.Xml return false; } - private int SkipIgnorableBase64Chars (char [] chars, int charsLength, int i) - { - while (chars [i] == '=' || XmlChar.IsWhitespace (chars [i])) - if (charsLength == ++i) - break; - return i; - } - public int ReadBase64 (byte [] buffer, int offset, int length) { if (offset < 0) @@ -575,9 +567,7 @@ namespace System.Xml byte b = 0; byte work = 0; - for (int i = 0; i < charsLength - 3; i++) { - if ((i = SkipIgnorableBase64Chars (chars, charsLength, i)) == charsLength) - break; + for (int i = 0; i < charsLength - 3; i += 4) { b = (byte) (GetBase64Byte (chars [i]) << 2); if (bufIndex < bufLast) buffer [bufIndex] = b; @@ -587,11 +577,9 @@ namespace System.Xml base64Cache [0] = b; } // charsLength mod 4 might not equals to 0. - if (++i == charsLength) - break; - if ((i = SkipIgnorableBase64Chars (chars, charsLength, i)) == charsLength) + if (i + 1 == charsLength) break; - b = GetBase64Byte (chars [i]); + b = GetBase64Byte (chars [i + 1]); work = (byte) (b >> 4); if (bufIndex < bufLast) { buffer [bufIndex] += work; @@ -610,11 +598,9 @@ namespace System.Xml base64Cache [1] = work; } - if (++i == charsLength) - break; - if ((i = SkipIgnorableBase64Chars (chars, charsLength, i)) == charsLength) + if (i + 2 == charsLength) break; - b = GetBase64Byte (chars [i]); + b = GetBase64Byte (chars [i + 2]); work = (byte) (b >> 2); if (bufIndex < bufLast) { buffer [bufIndex] += work; @@ -631,11 +617,9 @@ namespace System.Xml base64CacheStartsAt = 2; base64Cache [2] = work; } - if (++i == charsLength) + if (i + 3 == charsLength) break; - if ((i = SkipIgnorableBase64Chars (chars, charsLength, i)) == charsLength) - break; - work = GetBase64Byte (chars [i]); + work = GetBase64Byte (chars [i + 3]); if (bufIndex < bufLast) { buffer [bufIndex] += work; bufIndex++; @@ -2564,8 +2548,6 @@ namespace System.Xml return; } - // Since ReadBase64() is processed for every 4 chars, it does - // not handle '=' here. private byte GetBase64Byte (char ch) { switch (ch) { @@ -2573,6 +2555,8 @@ namespace System.Xml return 62; case '/': return 63; + case '=': + return 0; default: if (ch >= 'A' && ch <= 'Z') return (byte) (ch - 'A'); @@ -2593,6 +2577,8 @@ namespace System.Xml return 0; } + shouldSkipUntilEndTag = true; + if (offset < 0) throw new ArgumentOutOfRangeException ("offset", offset, "Offset must be non-negative integer."); else if (length < 0) @@ -2603,8 +2589,6 @@ namespace System.Xml if (NodeType != XmlNodeType.Element) return 0; - shouldSkipUntilEndTag = true; - int bufIndex = offset; for (int i = 0; i < length; i++) { int c = PeekChar (); @@ -2623,9 +2607,9 @@ namespace System.Xml depth++; depthUp = false; } - ReadEndTag (); + ReadEndTag(); shouldSkipUntilEndTag = false; - Read (); // move to the next node + Read (); return i; default: ReadChar (); diff --git a/mcs/class/System/Microsoft.CSharp/CSharpCodeCompiler.cs b/mcs/class/System/Microsoft.CSharp/CSharpCodeCompiler.cs index edc8da68872..a09a812bedc 100644 --- a/mcs/class/System/Microsoft.CSharp/CSharpCodeCompiler.cs +++ b/mcs/class/System/Microsoft.CSharp/CSharpCodeCompiler.cs @@ -97,7 +97,7 @@ namespace Mono.CSharp StringCollection assemblies = options.ReferencedAssemblies; foreach (CodeCompileUnit e in ea) { - fileNames [i] = GetTempFileNameWithExtension (options.TempFiles, i.ToString () + ".cs"); + fileNames [i] = GetTempFileNameWithExtension (options.TempFiles, "cs"); FileStream f=new FileStream(fileNames[i],FileMode.OpenOrCreate); StreamWriter s=new StreamWriter(f, Encoding.UTF8); if (e.ReferencedAssemblies != null) { @@ -183,7 +183,7 @@ namespace Mono.CSharp string[] fileNames=new string[sources.Length]; int i=0; foreach (string source in sources) { - fileNames [i] = GetTempFileNameWithExtension (options.TempFiles, i.ToString () + ".cs"); + fileNames [i] = GetTempFileNameWithExtension (options.TempFiles, "cs"); FileStream f=new FileStream(fileNames[i],FileMode.OpenOrCreate); StreamWriter s=new StreamWriter(f); s.Write(source); diff --git a/mcs/class/System/Microsoft.CSharp/CSharpCodeGenerator.cs b/mcs/class/System/Microsoft.CSharp/CSharpCodeGenerator.cs index c22c8fc653d..4be6da4cf77 100644 --- a/mcs/class/System/Microsoft.CSharp/CSharpCodeGenerator.cs +++ b/mcs/class/System/Microsoft.CSharp/CSharpCodeGenerator.cs @@ -503,10 +503,7 @@ namespace Mono.CSharp OutputMemberAccessModifier( attributes ); OutputFieldScopeModifier( attributes ); - if (IsCurrentEnum) - Output.Write(field.Name); - else - OutputTypeNamePair( field.Type, GetSafeName (field.Name) ); + OutputTypeNamePair( field.Type, GetSafeName (field.Name) ); CodeExpression initExpression = field.InitExpression; if ( initExpression != null ) { diff --git a/mcs/class/System/Microsoft.CSharp/ChangeLog b/mcs/class/System/Microsoft.CSharp/ChangeLog index 6fbed3e9cc0..b9e06652430 100644 --- a/mcs/class/System/Microsoft.CSharp/ChangeLog +++ b/mcs/class/System/Microsoft.CSharp/ChangeLog @@ -1,13 +1,3 @@ -2004-07-13 Peter Williams <peter@newton.cx> - - * CSharpCodeCompiler.cs (CompileAssemblyFromDomBatch): Include - counter in the extension so that batch compilations work. - (CompileAssemblyFromSourceBatch): Same. - -2004-07-12 Fawad Halim <fawad@fawad.net> - - * CSharpCodeGenerator.cs : Have GenerateField generate field sans the type for enums. - 2004-06-28 Atsushi Enomoto <atsushi@ximian.com> * CSharpCodeCompiler.cs : (only for windows) First check mcs.bat, then diff --git a/mcs/class/System/System.CodeDom.Compiler/ChangeLog b/mcs/class/System/System.CodeDom.Compiler/ChangeLog index 3968ed4480d..a91f5c6b3f9 100755 --- a/mcs/class/System/System.CodeDom.Compiler/ChangeLog +++ b/mcs/class/System/System.CodeDom.Compiler/ChangeLog @@ -1,9 +1,3 @@ -2004-07-15 Peter Williams <peter@newton.cx> - - * CodeGenerator.cs: Have the basic generator create line pragmas - for NamespaceImports, SnippetCompileUnits, and TypeMembers, all of - which had LinePragma members which were going unused. - 2004-06-17 Jackson Harper <jackson@ximian.com> * CompilerError.cs: diff --git a/mcs/class/System/System.CodeDom.Compiler/CodeGenerator.cs b/mcs/class/System/System.CodeDom.Compiler/CodeGenerator.cs index d3b0c052fde..7d42931b6d1 100755 --- a/mcs/class/System/System.CodeDom.Compiler/CodeGenerator.cs +++ b/mcs/class/System/System.CodeDom.Compiler/CodeGenerator.cs @@ -392,16 +392,9 @@ namespace System.CodeDom.Compiler { GenerateNamespaceStart (ns); - foreach (CodeNamespaceImport import in ns.Imports) { - if (import.LinePragma != null) - GenerateLinePragmaStart (import.LinePragma); - + foreach (CodeNamespaceImport import in ns.Imports) GenerateNamespaceImport (import); - if (import.LinePragma != null) - GenerateLinePragmaEnd (import.LinePragma); - } - output.WriteLine(); foreach (CodeTypeDeclaration type in ns.Types) { @@ -417,15 +410,8 @@ namespace System.CodeDom.Compiler { protected abstract void GenerateNamespaceImport (CodeNamespaceImport i); protected void GenerateNamespaceImports (CodeNamespace e) { - foreach (CodeNamespaceImport import in e.Imports) { - if (import.LinePragma != null) - GenerateLinePragmaStart (import.LinePragma); - + foreach (CodeNamespaceImport import in e.Imports) GenerateNamespaceImport (import); - - if (import.LinePragma != null) - GenerateLinePragmaEnd (import.LinePragma); - } } protected void GenerateNamespaces (CodeCompileUnit e) @@ -486,14 +472,7 @@ namespace System.CodeDom.Compiler { protected virtual void GenerateSnippetCompileUnit (CodeSnippetCompileUnit e) { - if (e.LinePragma != null) - GenerateLinePragmaStart (e.LinePragma); - output.WriteLine (e.Value); - - if (e.LinePragma != null) - GenerateLinePragmaEnd (e.LinePragma); - } protected abstract void GenerateSnippetExpression (CodeSnippetExpression e); @@ -990,17 +969,11 @@ namespace System.CodeDom.Compiler { private void GenerateType (CodeTypeDeclaration type) { - if (type.LinePragma != null) - GenerateLinePragmaStart (type.LinePragma); - CodeTypeDelegate del = type as CodeTypeDelegate; if (del != null) GenerateDelegate (del); else GenerateNonDelegateType (type); - - if (type.LinePragma != null) - GenerateLinePragmaEnd (type.LinePragma); } private void GenerateDelegate (CodeTypeDelegate type) @@ -1051,18 +1024,12 @@ namespace System.CodeDom.Compiler { CodeTypeMember prevMember = this.currentMember; this.currentMember = member; - if (prevMember != null && prevMember.LinePragma != null) - GenerateLinePragmaEnd (prevMember.LinePragma); - if (options.BlankLinesBetweenMembers) output.WriteLine (); foreach (CodeCommentStatement statement in member.Comments) GenerateCommentStatement (statement); - if (member.LinePragma != null) - GenerateLinePragmaStart (member.LinePragma); - CodeMemberEvent eventm = member as CodeMemberEvent; if (eventm != null) { @@ -1120,9 +1087,6 @@ namespace System.CodeDom.Compiler { this.currentMember = prevMember; } - - if (currentMember != null && currentMember.LinePragma != null) - GenerateLinePragmaEnd (currentMember.LinePragma); GenerateTypeEnd (type); this.currentType = prevType; diff --git a/mcs/class/System/System.Net.Sockets/ChangeLog b/mcs/class/System/System.Net.Sockets/ChangeLog index ecedce486d6..3b7aeaf5da9 100644 --- a/mcs/class/System/System.Net.Sockets/ChangeLog +++ b/mcs/class/System/System.Net.Sockets/ChangeLog @@ -1,18 +1,3 @@ -2004-07-15 Dick Porter <dick@ximian.com> - - * Socket.cs: Don't try and dereference a null array in Select() - (possible if a descriptor list of length 0 was passed.) Patch by - Nick Vaughan (dev@6wardlaw.freeserve.co.uk), fixes bug 61595. - -2004-07-12 Gonzalo Paniagua Javier <gonzalo@ximian.com> - - * Socket.cs: if'ed RemoveReferences calls. - -2004-07-09 Dick Porter <dick@ximian.com> - - * Socket.cs: Slight tweak to allow unknown objects to be returned - by GetSocketOption(). - 2004-06-28 Gonzalo Paniagua Javier <gonzalo@ximian.com> * Socket.cs: connect on non-blocking sockets returns EINPROGRESS. Fixes diff --git a/mcs/class/System/System.Net.Sockets/Socket.cs b/mcs/class/System/System.Net.Sockets/Socket.cs index 544597f9545..a7fa184ccae 100644 --- a/mcs/class/System/System.Net.Sockets/Socket.cs +++ b/mcs/class/System/System.Net.Sockets/Socket.cs @@ -424,28 +424,22 @@ namespace System.Net.Sockets if(read_list!=null) { read_list.Clear(); - if (read_arr != null) { - for(i=0; i<read_arr.Length; i++) { - read_list.Add(read_arr[i]); - } + for(i=0; i<read_arr.Length; i++) { + read_list.Add(read_arr[i]); } } if(write_list!=null) { write_list.Clear(); - if (write_arr != null) { - for(i=0; i<write_arr.Length; i++) { - write_list.Add(write_arr[i]); - } + for(i=0; i<write_arr.Length; i++) { + write_list.Add(write_arr[i]); } } if(err_list!=null) { err_list.Clear(); - if (err_arr != null) { - for(i=0; i<err_arr.Length; i++) { - err_list.Add(err_arr[i]); - } + for(i=0; i<err_arr.Length; i++) { + err_list.Add(err_arr[i]); } } } @@ -1026,9 +1020,7 @@ namespace System.Net.Sockets if (req == null) throw new ArgumentException ("Invalid IAsyncResult", "result"); - if (supportsAsync && socket_type == SocketType.Stream) - RemoveReference (req); - + RemoveReference (req); if (!result.IsCompleted) result.AsyncWaitHandle.WaitOne(); @@ -1071,9 +1063,7 @@ namespace System.Net.Sockets if (req == null) throw new ArgumentException ("Invalid IAsyncResult", "result"); - if (supportsAsync && socket_type == SocketType.Stream) - RemoveReference (req); - + RemoveReference (req); if (!result.IsCompleted) result.AsyncWaitHandle.WaitOne(); @@ -1141,10 +1131,8 @@ namespace System.Net.Sockets } else if (name==SocketOptionName.AddMembership || name==SocketOptionName.DropMembership) { return((MulticastOption)obj_val); - } else if (obj_val is int) { - return((int)obj_val); } else { - return(obj_val); + return((int)obj_val); } } diff --git a/mcs/class/System/System.Net/ChangeLog b/mcs/class/System/System.Net/ChangeLog index 3b0d90e1494..2b470e6423b 100644 --- a/mcs/class/System/System.Net/ChangeLog +++ b/mcs/class/System/System.Net/ChangeLog @@ -1,35 +1,3 @@ -2004-07-26 Gonzalo Paniagua Javier <gonzalo@ximian.com> - - * WebProxy.cs: fix scheme detection. Patch by Konstantin Triger - (kostat@mainsoft.com). - -2004-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com> - - * HttpWebRequest.cs: detect changes in scheme or port when redirecting. - Fixes las take on bug 61218. - -2004-07-14 Gonzalo Paniagua Javier <gonzalo@ximian.com> - - * WebConnection.cs: moved loading of the ssl stream Type to its own - method. Don't create a new ssl stream if we're reusing the connection. - - * WebConnectionStream.cs: ensure the number of bytes copied in ReadAll - is the expected even if the dta from the server has extra bytes. - -2004-07-12 Gonzalo Paniagua Javier <gonzalo@ximian.com> - - * WebConnection.cs: - * WebConnectionStream.cs: when the status code is 1xx, 204 or 304, - "responses MUST NOT include a message-body". We tried to read the - stream even when getting those codes and considered the 0 length - read as a failure. - -2004-07-09 Gonzalo Paniagua Javier <gonzalo@ximian.com> - - * HttpWebRequest.cs: removed bogus Monitor.Exit. - * WebConnection.cs: use Address instead of RequestUri when checking for - the scheme in order to select the stream type. Fixes bug #61218. - 2004-06-06 Gonzalo Paniagua Javier <gonzalo@ximian.com> * ChunkStream.cs: added ChunkLeft property. diff --git a/mcs/class/System/System.Net/HttpWebRequest.cs b/mcs/class/System/System.Net/HttpWebRequest.cs index f20a0747a3f..40dfe26a546 100644 --- a/mcs/class/System/System.Net/HttpWebRequest.cs +++ b/mcs/class/System/System.Net/HttpWebRequest.cs @@ -584,6 +584,7 @@ namespace System.Net initialMethod = method; if (haveRequest) { if (writeStream != null) { + Monitor.Exit (this); asyncWrite.SetCompleted (true, writeStream); asyncWrite.DoCallback (); return asyncWrite; @@ -829,7 +830,7 @@ namespace System.Net throw new WebException ("No Location header found for " + (int) code, WebExceptionStatus.ProtocolError); - Uri prev = actualUri; + string host = actualUri.Host; try { actualUri = new Uri (actualUri, uriString); } catch (Exception) { @@ -838,8 +839,7 @@ namespace System.Net WebExceptionStatus.ProtocolError); } - hostChanged = (actualUri.Scheme != prev.Scheme || actualUri.Host != prev.Host || - actualUri.Port != prev.Port); + hostChanged = (actualUri.Host != host); return true; } diff --git a/mcs/class/System/System.Net/WebConnection.cs b/mcs/class/System/System.Net/WebConnection.cs index f3ef1d22076..c4b08a363d1 100644 --- a/mcs/class/System/System.Net/WebConnection.cs +++ b/mcs/class/System/System.Net/WebConnection.cs @@ -71,7 +71,7 @@ namespace System.Net bool ssl; bool certsAvailable; - static object classLock = new object (); + static bool sslCheck; static Type sslStream; static PropertyInfo piClient; static PropertyInfo piServer; @@ -127,48 +127,36 @@ namespace System.Net } } - static void EnsureSSLStreamAvailable () - { - lock (classLock) { - if (sslStream != null) - return; - - // HttpsClientStream is an internal glue class in Mono.Security.dll - sslStream = Type.GetType ("Mono.Security.Protocol.Tls.HttpsClientStream, " + - Consts.AssemblyMono_Security, false); - - if (sslStream == null) { - string msg = "Missing Mono.Security.dll assembly. " + - "Support for SSL/TLS is unavailable."; - - throw new NotSupportedException (msg); - } - piClient = sslStream.GetProperty ("SelectedClientCertificate"); - piServer = sslStream.GetProperty ("ServerCertificate"); - } - } - bool CreateStream (HttpWebRequest request) { try { NetworkStream serverStream = new NetworkStream (socket, false); - if (request.Address.Scheme == Uri.UriSchemeHttps) { + if (request.RequestUri.Scheme == Uri.UriSchemeHttps) { ssl = true; - EnsureSSLStreamAvailable (); - if (!reused || nstream == null || nstream.GetType () != sslStream) { - object[] args = new object [3] { serverStream, - request.ClientCertificates, - request }; - nstream = (Stream) Activator.CreateInstance (sslStream, args); + if (!sslCheck) { + lock (typeof (WebConnection)) { + sslCheck = true; + // HttpsClientStream is an internal glue class in Mono.Security.dll + sslStream = Type.GetType ("Mono.Security.Protocol.Tls.HttpsClientStream, " + Consts.AssemblyMono_Security, false); + if (sslStream != null) { + piClient = sslStream.GetProperty ("SelectedClientCertificate"); + piServer = sslStream.GetProperty ("ServerCertificate"); + } + } } + if (sslStream == null) + throw new NotSupportedException ("Missing Mono.Security.dll assembly. Support for SSL/TLS is unavailable."); + + object[] args = new object [4] { serverStream, request.RequestUri.Host, request.ClientCertificates, request }; + nstream = (Stream) Activator.CreateInstance (sslStream, args); + // we also need to set ServicePoint.Certificate // and ServicePoint.ClientCertificate but this can // only be done later (after handshake - which is // done only after a read operation). - } else { - ssl = false; - nstream = serverStream; } + else + nstream = serverStream; } catch (Exception) { status = WebExceptionStatus.ConnectFailure; return false; @@ -280,9 +268,6 @@ namespace System.Net data.stream = stream; - if (!ExpectContent (data.StatusCode)) - stream.ForceCompletion (); - lock (cnc) { lock (cnc.queue) { if (cnc.queue.Count > 0) { @@ -297,11 +282,6 @@ namespace System.Net data.request.SetResponseData (data); } - static bool ExpectContent (int statusCode) - { - return (statusCode >= 200 && statusCode != 204 && statusCode != 304); - } - internal void GetCertificates () { // here the SSL negotiation have been done diff --git a/mcs/class/System/System.Net/WebConnectionStream.cs b/mcs/class/System/System.Net/WebConnectionStream.cs index c609455f32f..703f35d42b4 100644 --- a/mcs/class/System/System.Net/WebConnectionStream.cs +++ b/mcs/class/System/System.Net/WebConnectionStream.cs @@ -57,7 +57,6 @@ namespace System.Net byte [] headers; bool disposed; bool headersSent; - bool forceCompletion; public WebConnectionStream (WebConnection cnc) { @@ -114,15 +113,9 @@ namespace System.Net get { return (int) writeBuffer.Length; } } - internal void ForceCompletion () - { - forceCompletion = true; - } - internal void CheckComplete () { - bool nrc = nextReadCalled; - if (forceCompletion || (!nrc && readBufferSize - readBufferOffset == contentLength)) { + if (!nextReadCalled && readBufferSize - readBufferOffset == contentLength) { nextReadCalled = true; cnc.NextRead (); } @@ -158,12 +151,8 @@ namespace System.Net } else { new_size = contentLength - totalRead; b = new byte [new_size]; - if (readBuffer != null && diff > 0) { - if (diff > new_size) - diff = new_size; - + if (readBuffer != null && diff > 0) Buffer.BlockCopy (readBuffer, readBufferOffset, b, 0, diff); - } int remaining = new_size - diff; int r = -1; diff --git a/mcs/class/System/System.Net/WebProxy.cs b/mcs/class/System/System.Net/WebProxy.cs index df8976c6966..b0299575f60 100644 --- a/mcs/class/System/System.Net/WebProxy.cs +++ b/mcs/class/System/System.Net/WebProxy.cs @@ -208,7 +208,7 @@ namespace System.Net if (address == null)
return null;
- if (address.IndexOf ("://") == -1)
+ if (address.IndexOf (':') == -1)
address = "http://" + address;
return new Uri (address);
diff --git a/mcs/class/corlib/System.Collections/ChangeLog b/mcs/class/corlib/System.Collections/ChangeLog index f269e646470..8782bc457f8 100644 --- a/mcs/class/corlib/System.Collections/ChangeLog +++ b/mcs/class/corlib/System.Collections/ChangeLog @@ -1,13 +1,3 @@ -2004-07-21 Geoff Norton <gnorton@customerdna.com> - - * Hashtable.cs: lock the SyncRoot when Cloning a Synchronized hashtable to avoid - a snapshot out of sync error. - -2004-07-21 Duncan Mak <duncan@ximian.com> - - * DictionaryBase.cs: Rename the dictionary field to hashtable, - which causes a serialization interop bug. Fixes bug #61721. - 2004-06-18 Ben Maurer <bmaurer@ximian.com> * IKeyComparer.cs: v2 class diff --git a/mcs/class/corlib/System.Collections/DictionaryBase.cs b/mcs/class/corlib/System.Collections/DictionaryBase.cs index 9e814d1fab9..af6b19f2617 100755 --- a/mcs/class/corlib/System.Collections/DictionaryBase.cs +++ b/mcs/class/corlib/System.Collections/DictionaryBase.cs @@ -51,11 +51,11 @@ namespace System.Collections { [Serializable] public abstract class DictionaryBase : IDictionary, ICollection, IEnumerable { - Hashtable hashtable; + Hashtable dictionary; protected DictionaryBase () { - hashtable = new Hashtable (); + dictionary = new Hashtable (); } /// <summary> @@ -64,7 +64,7 @@ namespace System.Collections { public void Clear () { OnClear (); - hashtable.Clear (); + dictionary.Clear (); OnClearComplete (); } @@ -73,7 +73,7 @@ namespace System.Collections { /// </summary> public int Count { get { - return hashtable.Count; + return dictionary.Count; } } @@ -91,7 +91,7 @@ namespace System.Collections { /// </summary> protected Hashtable InnerHashtable { get { - return hashtable; + return dictionary; } } @@ -129,7 +129,7 @@ namespace System.Collections { /// </summary> private void DoCopy (Array array, int index) { - foreach (DictionaryEntry de in hashtable) + foreach (DictionaryEntry de in dictionary) array.SetValue (de, index++); } @@ -138,7 +138,7 @@ namespace System.Collections { /// </summary> public IDictionaryEnumerator GetEnumerator () { - return hashtable.GetEnumerator (); + return dictionary.GetEnumerator (); } /// <summary> @@ -311,20 +311,20 @@ namespace System.Collections { object IDictionary.this [object key] { get { - OnGet (key, hashtable [key]); - object value = hashtable [key]; + OnGet (key, dictionary[key]); + object value = dictionary [key]; return value; } set { OnValidate (key, value); - object current_value = hashtable [key]; + object current_value = dictionary [key]; OnSet (key, current_value, value); - hashtable [key] = value; + dictionary [key] = value; try { OnSetComplete (key, current_value, value); } catch { - hashtable [key] = current_value; + dictionary [key] = current_value; throw; } } @@ -332,13 +332,13 @@ namespace System.Collections { ICollection IDictionary.Keys { get { - return hashtable.Keys; + return dictionary.Keys; } } ICollection IDictionary.Values { get { - return hashtable.Values; + return dictionary.Values; } } @@ -349,11 +349,11 @@ namespace System.Collections { { OnValidate (key, value); OnInsert (key, value); - hashtable.Add (key, value); + dictionary.Add (key, value); try { OnInsertComplete (key, value); } catch { - hashtable.Remove (key); + dictionary.Remove(key); throw; } } @@ -363,10 +363,10 @@ namespace System.Collections { /// </summary> void IDictionary.Remove (object key) { - object value = hashtable [key]; + object value = dictionary [key]; OnValidate (key, value); OnRemove (key, value); - hashtable.Remove (key); + dictionary.Remove (key); OnRemoveComplete (key, value); } @@ -375,24 +375,24 @@ namespace System.Collections { /// </summary> bool IDictionary.Contains (object key) { - return hashtable.Contains (key); + return dictionary.Contains (key); } bool ICollection.IsSynchronized { get { - return hashtable.IsSynchronized; + return dictionary.IsSynchronized; } } object ICollection.SyncRoot { get { - return hashtable.SyncRoot; + return dictionary.SyncRoot; } } IEnumerator IEnumerable.GetEnumerator () { - return hashtable.GetEnumerator (); + return dictionary.GetEnumerator (); } } } diff --git a/mcs/class/corlib/System.Collections/Hashtable.cs b/mcs/class/corlib/System.Collections/Hashtable.cs index 270bbef13ca..36575c8e024 100644 --- a/mcs/class/corlib/System.Collections/Hashtable.cs +++ b/mcs/class/corlib/System.Collections/Hashtable.cs @@ -1114,9 +1114,8 @@ namespace System.Collections { public override object Clone () { - lock(host.SyncRoot) { - return new SyncHashtable( (Hashtable) host.Clone () ); - } + Hashtable ht = (Hashtable) host.Clone (); + return new SyncHashtable (ht); } } // SyncHashtable diff --git a/mcs/class/corlib/System.Globalization/ChangeLog b/mcs/class/corlib/System.Globalization/ChangeLog index 95392d51e96..533cc9d4dc7 100644 --- a/mcs/class/corlib/System.Globalization/ChangeLog +++ b/mcs/class/corlib/System.Globalization/ChangeLog @@ -1,3 +1,8 @@ + +Wed Jun 30 17:06:43 CEST 2004 Paolo Molaro <lupus@ximian.com> + + * NumberFormatInfo.cs: workaround for bug 55978. + 2004-06-17 Atsushi Enomoto <atsushi@ximian.com> * DateTimeFormatInfo.cs : check if pattern array is empty or not. Now diff --git a/mcs/class/corlib/System.Globalization/NumberFormatInfo.cs b/mcs/class/corlib/System.Globalization/NumberFormatInfo.cs index 169ad6c2f9e..e884daad5a7 100644 --- a/mcs/class/corlib/System.Globalization/NumberFormatInfo.cs +++ b/mcs/class/corlib/System.Globalization/NumberFormatInfo.cs @@ -851,7 +851,10 @@ throw new Exception ("HERE the value was modified"); public object GetFormat (Type formatType) { - return (formatType == typeof (NumberFormatInfo)) ? this : null; + // work around http://bugzilla.ximian.com/show_bug.cgi?id=55978 + // the comparison fails because formatType likely comes from another domain + //return (formatType == typeof (NumberFormatInfo)) ? this : null; + return this; } public object Clone () diff --git a/mcs/class/corlib/System.IO.IsolatedStorage/ChangeLog b/mcs/class/corlib/System.IO.IsolatedStorage/ChangeLog index c27c01f582e..2b295ce72fa 100644 --- a/mcs/class/corlib/System.IO.IsolatedStorage/ChangeLog +++ b/mcs/class/corlib/System.IO.IsolatedStorage/ChangeLog @@ -1,7 +1,3 @@ -2004-07-11 Gonzalo Paniagua Javier <gonzalo@ximian.com> - - * IsolatedStorageInfo.cs: useGetFolderPath instead of getting "HOME". - 2004-06-13 Gert Driesen <drieseng@users.sourceforge.net> * IsolatedStorage.cs: really mark the storage_scope field private diff --git a/mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorageInfo.cs b/mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorageInfo.cs index d1107269a1b..a3a1ae0e8a3 100644 --- a/mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorageInfo.cs +++ b/mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorageInfo.cs @@ -37,7 +37,7 @@ namespace System.IO.IsolatedStorage { [MonoTODO("Unix Specific; generalize for Win32")] internal static string GetIsolatedStorageDirectory () { - string home = Environment.GetFolderPath (Environment.SpecialFolder.Personal); + string home = Environment.GetEnvironmentVariable ("HOME"); if (home == null) home = "~"; diff --git a/mcs/class/corlib/System.IO/ChangeLog b/mcs/class/corlib/System.IO/ChangeLog index 2c281d7651c..6818c37ad82 100644 --- a/mcs/class/corlib/System.IO/ChangeLog +++ b/mcs/class/corlib/System.IO/ChangeLog @@ -1,25 +1,3 @@ -2004-07-06 Dick Porter <dick@ximian.com> - - * MonoIO.cs: Add ERROR_INVALID_PARAMETER to the exception list. - Don't blow away the SetFileTime() error before the caller gets to - see it. Part of the bug fix to 60970. - -2004-07-05 Dick Porter <dick@ximian.com> - - * CheckPermission.cs: - * File.cs: - * FileInfo.cs: - * MonoIO.cs: - * FileStream.cs: Give the filename when throwing - FileNotFoundException. Fixes bug 61120, based on patch from - Carlos Alberto Cesario <carloscesario@gmail.com>. - -2004-07-05 Dick Porter <dick@ximian.com> - - * File.cs: File.Move() should check that the destination doesn't - already exist. Fixes bug 60915, patch based on one from Carlos - Alberto Cesario <carloscesario@gmail.com>. - 2004-06-24 Gonzalo Paniagua Javier <gonzalo@ximian.com> * Directory.cs: implemented GetLogicalDrives. diff --git a/mcs/class/corlib/System.IO/CheckPermission.cs b/mcs/class/corlib/System.IO/CheckPermission.cs index 232b1350af4..2b31cab7e01 100644 --- a/mcs/class/corlib/System.IO/CheckPermission.cs +++ b/mcs/class/corlib/System.IO/CheckPermission.cs @@ -102,7 +102,7 @@ namespace System.IO } else { - throw new FileNotFoundException("File not found", path); + throw new FileNotFoundException(); } #endif } diff --git a/mcs/class/corlib/System.IO/File.cs b/mcs/class/corlib/System.IO/File.cs index 3dcf8213759..c45dea6aecb 100644 --- a/mcs/class/corlib/System.IO/File.cs +++ b/mcs/class/corlib/System.IO/File.cs @@ -70,7 +70,7 @@ namespace System.IO if (dest.Trim () == "" || dest.IndexOfAny (Path.InvalidPathChars) != -1) throw new ArgumentException ("dest"); if (!Exists (src)) - throw new FileNotFoundException (src + " does not exist", src); + throw new FileNotFoundException (src + " does not exist"); if ((GetAttributes(src) & FileAttributes.Directory) == FileAttributes.Directory){ throw new ArgumentException(src + " is a directory"); @@ -261,11 +261,9 @@ namespace System.IO if (dest.Trim () == "" || dest.IndexOfAny (Path.InvalidPathChars) != -1) throw new ArgumentException ("dest"); if (!MonoIO.Exists (src, out error)) - throw new FileNotFoundException (src + " does not exist", src); + throw new FileNotFoundException (src + " does not exist"); if (MonoIO.ExistsDirectory (dest, out error)) throw new IOException (dest + " is a directory"); - if (MonoIO.Exists (dest, out error)) - throw new IOException (dest + " already exists"); string DirName; DirName = Path.GetDirectoryName(src); diff --git a/mcs/class/corlib/System.IO/FileInfo.cs b/mcs/class/corlib/System.IO/FileInfo.cs index 3345f61dc79..c98cf6feaec 100644 --- a/mcs/class/corlib/System.IO/FileInfo.cs +++ b/mcs/class/corlib/System.IO/FileInfo.cs @@ -81,7 +81,7 @@ namespace System.IO { public long Length {
get {
if (!Exists)
- throw new FileNotFoundException ("Could not find file \"" + OriginalPath + "\".", OriginalPath);
+ throw new FileNotFoundException ("Could not find file \"" + OriginalPath + "\".");
return stat.Length;
}
diff --git a/mcs/class/corlib/System.IO/FileStream.cs b/mcs/class/corlib/System.IO/FileStream.cs index 01b726a0b92..3024bf35d04 100644 --- a/mcs/class/corlib/System.IO/FileStream.cs +++ b/mcs/class/corlib/System.IO/FileStream.cs @@ -155,7 +155,7 @@ namespace System.IO if (access == FileAccess.Read && mode != FileMode.Create && mode != FileMode.OpenOrCreate && mode != FileMode.CreateNew && !File.Exists (name)) - throw new FileNotFoundException ("Could not find file \"" + name + "\".", name); + throw new FileNotFoundException ("Could not find file \"" + name + "\"."); if (mode == FileMode.CreateNew) { string dname = Path.GetDirectoryName (name); diff --git a/mcs/class/corlib/System.IO/MonoIO.cs b/mcs/class/corlib/System.IO/MonoIO.cs index a32e6ed5408..47fd104fdc3 100644 --- a/mcs/class/corlib/System.IO/MonoIO.cs +++ b/mcs/class/corlib/System.IO/MonoIO.cs @@ -63,8 +63,7 @@ namespace System.IO // FIXME: add more exception mappings here case MonoIOError.ERROR_FILE_NOT_FOUND: message = String.Format ("Could not find file \"{0}\"", path); - return new FileNotFoundException (message, - path); + return new FileNotFoundException (message); case MonoIOError.ERROR_PATH_NOT_FOUND: message = String.Format ("Could not find a part of the path \"{0}\"", path); @@ -82,10 +81,6 @@ namespace System.IO message = String.Format ("Path is too long. Path: {0}", path); return new PathTooLongException (message); - case MonoIOError.ERROR_INVALID_PARAMETER: - message = String.Format ("Invalid parameter"); - return new IOException (message); - default: message = String.Format ("Win32 IO returned {0}. Path: {1}", error, path); return new IOException (message); @@ -309,9 +304,7 @@ namespace System.IO result = SetFileTime (handle, creation_time, last_access_time, last_write_time, out error); - - MonoIOError ignore_error; - Close (handle, out ignore_error); + Close (handle, out error); return result; } diff --git a/mcs/class/corlib/System.Reflection.Emit/ChangeLog b/mcs/class/corlib/System.Reflection.Emit/ChangeLog index 4a3fa12c3b0..5aeec6cdae4 100644 --- a/mcs/class/corlib/System.Reflection.Emit/ChangeLog +++ b/mcs/class/corlib/System.Reflection.Emit/ChangeLog @@ -1,7 +1,3 @@ -2004-07-24 Martin Baulig <martin@ximian.com> - - * TypeBuilder.cs (TypeBuilder.UnspecifiedTypeSize): Set this to 0 - and initialize it to 0 everywhere. Thu Jun 24 15:33:04 CEST 2004 Paolo Molaro <lupus@ximian.com> diff --git a/mcs/class/corlib/System.Reflection.Emit/TypeBuilder.cs b/mcs/class/corlib/System.Reflection.Emit/TypeBuilder.cs index c0059b54286..1f6884bdc12 100644 --- a/mcs/class/corlib/System.Reflection.Emit/TypeBuilder.cs +++ b/mcs/class/corlib/System.Reflection.Emit/TypeBuilder.cs @@ -95,7 +95,7 @@ namespace System.Reflection.Emit { internal TypeBuilder (ModuleBuilder mb, TypeAttributes attr) { this.parent = null; this.attrs = attr; - this.class_size = 0; + this.class_size = -1; fullname = this.tname = "<Module>"; this.nspace = ""; pmodule = mb; diff --git a/mcs/class/corlib/System.Reflection/ChangeLog b/mcs/class/corlib/System.Reflection/ChangeLog index 2ceab253beb..8a7945e688e 100644 --- a/mcs/class/corlib/System.Reflection/ChangeLog +++ b/mcs/class/corlib/System.Reflection/ChangeLog @@ -1,12 +1,3 @@ - -Sat Jul 10 15:48:34 CEST 2004 Paolo Molaro <lupus@ximian.com> - - * Modulec.s: return just name in ToString (bug #61287). - -2004-07-03 Zoltan Varga <vargaz@freemail.hu> - - * Module.cs: Initialize FilterTypeName[IgnoreCase]. Fixes #61048. - 2004-06-17 Gert Driesen <drieseng@users.sourceforge.net> * Pointer.cs: remove serializable attribute to match MS.NET diff --git a/mcs/class/corlib/System.Reflection/Module.cs b/mcs/class/corlib/System.Reflection/Module.cs index 876967a50c0..01dc55f9be6 100644 --- a/mcs/class/corlib/System.Reflection/Module.cs +++ b/mcs/class/corlib/System.Reflection/Module.cs @@ -55,11 +55,6 @@ namespace System.Reflection { const BindingFlags defaultBindingFlags = BindingFlags.Public | BindingFlags.Static | BindingFlags.Instance; - static Module () { - FilterTypeName = new TypeFilter (filter_by_type_name); - FilterTypeNameIgnoreCase = new TypeFilter (filter_by_type_name_ignore_case); - } - internal Module () { } ~Module () { @@ -211,7 +206,7 @@ namespace System.Reflection { public override string ToString () { - return name; + return "Reflection.Module: " + name; } // Mono Extension: returns the GUID of this module @@ -220,22 +215,6 @@ namespace System.Reflection { return new Guid (GetGuidInternal ()); } - private static bool filter_by_type_name (Type m, object filterCriteria) { - string s = (string)filterCriteria; - if (s.EndsWith ("*")) - return m.Name.StartsWith (s.Substring (0, s.Length - 1)); - else - return m.Name == s; - } - - private static bool filter_by_type_name_ignore_case (Type m, object filterCriteria) { - string s = (string)filterCriteria; - if (s.EndsWith ("*")) - return m.Name.ToLower ().StartsWith (s.Substring (0, s.Length - 1).ToLower ()); - else - return String.Compare (m.Name, s, true) == 0; - } - [MethodImplAttribute (MethodImplOptions.InternalCall)] private extern string GetGuidInternal (); diff --git a/mcs/class/corlib/System.Reflection/common.src b/mcs/class/corlib/System.Reflection/common.src new file mode 100644 index 00000000000..022b6768fcc --- /dev/null +++ b/mcs/class/corlib/System.Reflection/common.src @@ -0,0 +1,25 @@ +Assembly.cs +AssemblyNameFlags.cs +BindingFlags.cs +CallingConventions.cs +ConstructorInfo.cs +DefaultMemberAttribute.cs +EventAttributes.cs +EventInfo.cs +FieldAttributes.cs +FieldInfo.cs +ICustomAttributeProvider.cs +MemberFilter.cs +MemberInfo.cs +MemberTypes.cs +MethodAttributes.cs +MethodBase.cs +MethodImplAttributes.cs +MethodInfo.cs +Module.cs +ParameterAttributes.cs +PropertyAttributes.cs +PropertyInfo.cs +ResourceAttributes.cs +ResourceLocation.cs +TypeAttributes.cs diff --git a/mcs/class/corlib/System.Runtime.Remoting.Channels/ChangeLog b/mcs/class/corlib/System.Runtime.Remoting.Channels/ChangeLog index 35352b211ea..aafa83f9899 100644 --- a/mcs/class/corlib/System.Runtime.Remoting.Channels/ChangeLog +++ b/mcs/class/corlib/System.Runtime.Remoting.Channels/ChangeLog @@ -1,8 +1,3 @@ -2004-07-02 Lluis Sanchez Gual <lluis@novell.com> - - * ChannelServices.cs: In RegisterChannel, ignore name colisions if the - channel name is "". This fixes bug #61592. - 2004-06-15 Gert Driesen <drieseng@users.sourceforge.net> * TransportHeaders.cs: added TODO for serialization diff --git a/mcs/class/corlib/System.Runtime.Remoting.Channels/ChannelServices.cs b/mcs/class/corlib/System.Runtime.Remoting.Channels/ChannelServices.cs index f2f21baf53e..98629c496f4 100644 --- a/mcs/class/corlib/System.Runtime.Remoting.Channels/ChannelServices.cs +++ b/mcs/class/corlib/System.Runtime.Remoting.Channels/ChannelServices.cs @@ -254,7 +254,7 @@ namespace System.Runtime.Remoting.Channels { IChannel regc = (IChannel) registeredChannels[n]; - if (regc.ChannelName == chnl.ChannelName && chnl.ChannelName != "") + if (regc.ChannelName == chnl.ChannelName) throw new RemotingException ("Channel " + regc.ChannelName + " already registered"); if (regc.ChannelPriority < chnl.ChannelPriority && pos==-1) diff --git a/mcs/class/corlib/System.Runtime.Remoting.Messaging/ChangeLog b/mcs/class/corlib/System.Runtime.Remoting.Messaging/ChangeLog index 31b0acd440c..87e4e0902e6 100644 --- a/mcs/class/corlib/System.Runtime.Remoting.Messaging/ChangeLog +++ b/mcs/class/corlib/System.Runtime.Remoting.Messaging/ChangeLog @@ -1,8 +1,3 @@ -2004-07-22 Lluis Sanchez Gual <lluis@novell.com> - - * MethodCall.cs: Use RemotingServices.GetMethodBaseFromName to get the - MethodBase from the method name. This fixes bug #61774. - 2004-06-18 Sebastien Pouliot <sebastien@ximian.com> * ReturnMessage.cs: Added IMessage interface to class definition. diff --git a/mcs/class/corlib/System.Runtime.Remoting.Messaging/MethodCall.cs b/mcs/class/corlib/System.Runtime.Remoting.Messaging/MethodCall.cs index 47dbb9d0beb..9313d3aa0cb 100644 --- a/mcs/class/corlib/System.Runtime.Remoting.Messaging/MethodCall.cs +++ b/mcs/class/corlib/System.Runtime.Remoting.Messaging/MethodCall.cs @@ -288,8 +288,11 @@ namespace System.Runtime.Remoting.Messaging { Type type = RemotingServices.GetServerTypeForUri (_uri); if (type == null) throw new RemotingException ("Requested service not found. No receiver for uri " + _uri); - if (CanCastTo (_typeName, type)) { - _methodBase = RemotingServices.GetMethodBaseFromName (type, _methodName, _methodSignature); + if (CanCastTo (_typeName, type)) + { + BindingFlags bflags = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic; + if (_methodSignature == null) _methodBase = type.GetMethod (_methodName, bflags); + else _methodBase = type.GetMethod (_methodName, bflags, null, _methodSignature, null); return; } else diff --git a/mcs/class/corlib/System.Runtime.Remoting/ChangeLog b/mcs/class/corlib/System.Runtime.Remoting/ChangeLog index 14aa52173f9..1fc62be042d 100755 --- a/mcs/class/corlib/System.Runtime.Remoting/ChangeLog +++ b/mcs/class/corlib/System.Runtime.Remoting/ChangeLog @@ -1,21 +1,3 @@ -2004-07-22 Lluis Sanchez Gual <lluis@novell.com> - - * ObjRef.cs: Fixed type check in in ObjRef constructor. The requested class - must be the object class or a base class. This fixes bug #61249. - -2004-07-22 Lluis Sanchez Gual <lluis@novell.com> - - * RemotingServices.cs: Changed GetMethodBaseFromMethodMessage so its code - can be reused internally. Also fixed bug when gettting a method from an - interface. - -2004-07-02 Lluis Sanchez Gual <lluis@ximian.com> - - * RemotingConfiguration.cs: Avoid adding "id" and "type" as custom - properties of providers. This fixes bug #60934. - * ServerIdentity.cs, RemotingServices.cs: When disposing an identity, detach - the identity from the object, so it can be safely marshalled again. - 2004-06-15 Gert Driesen <drieseng@users.sourceforge.net> * RemotingTimeoutException.cs: added missing serialization ctor diff --git a/mcs/class/corlib/System.Runtime.Remoting/ObjRef.cs b/mcs/class/corlib/System.Runtime.Remoting/ObjRef.cs index 30234367827..90db146c267 100644 --- a/mcs/class/corlib/System.Runtime.Remoting/ObjRef.cs +++ b/mcs/class/corlib/System.Runtime.Remoting/ObjRef.cs @@ -92,7 +92,7 @@ namespace System.Runtime.Remoting { uri = RemotingServices.GetObjectUri(mbr); typeInfo = new TypeInfo(type); - if (!type.IsAssignableFrom (mbr.GetType())) + if (!typeInfo.CanCastTo(mbr.GetType(), mbr)) throw new RemotingException ("The server object type cannot be cast to the requested type " + type.FullName + "."); UpdateChannelInfo(); diff --git a/mcs/class/corlib/System.Runtime.Remoting/RemotingConfiguration.cs b/mcs/class/corlib/System.Runtime.Remoting/RemotingConfiguration.cs index 2cbe62dff51..204bc6b4368 100644 --- a/mcs/class/corlib/System.Runtime.Remoting/RemotingConfiguration.cs +++ b/mcs/class/corlib/System.Runtime.Remoting/RemotingConfiguration.cs @@ -721,9 +721,9 @@ namespace System.Runtime.Remoting if (at == "id" && isTemplate) prov.Id = val; - else if (at == "type") + if (at == "type") prov.Type = val; - else if (at == "ref" && !isTemplate) + if (at == "ref" && !isTemplate) prov.Ref = val; else prov.CustomProperties.Add (at, val); diff --git a/mcs/class/corlib/System.Runtime.Remoting/RemotingServices.cs b/mcs/class/corlib/System.Runtime.Remoting/RemotingServices.cs index 6d4b810ed13..aa694cbb3b6 100644 --- a/mcs/class/corlib/System.Runtime.Remoting/RemotingServices.cs +++ b/mcs/class/corlib/System.Runtime.Remoting/RemotingServices.cs @@ -57,7 +57,6 @@ namespace System.Runtime.Remoting internal static string app_id; static int next_id = 1; - static readonly BindingFlags methodBindings = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic; static RemotingServices () { @@ -160,10 +159,8 @@ namespace System.Runtime.Remoting else throw new ArgumentException ("The obj parameter is a proxy."); } - else { + else identity = obj.ObjectIdentity; - obj.ObjectIdentity = null; - } if (identity == null || !identity.IsConnected) return false; @@ -291,49 +288,22 @@ namespace System.Runtime.Remoting Type type = Type.GetType (msg.TypeName); if (type == null) throw new RemotingException ("Type '" + msg.TypeName + "' not found."); - - return GetMethodBaseFromName (type, msg.MethodName, (Type[]) msg.MethodSignature); - } - - internal static MethodBase GetMethodBaseFromName (Type type, string methodName, Type[] signature) - { - if (type.IsInterface) { - return FindInterfaceMethod (type, methodName, signature); - } - else { - MethodBase method = null; - if (signature == null) - method = type.GetMethod (methodName, methodBindings); - else - method = type.GetMethod (methodName, methodBindings, null, (Type[]) signature, null); - - if (method != null) - return method; - - if (signature == null) - return type.GetConstructor (methodBindings, null, Type.EmptyTypes, null); - else - return type.GetConstructor (methodBindings, null, signature, null); - } - } - - static MethodBase FindInterfaceMethod (Type type, string methodName, Type[] signature) - { - MethodBase method = null; + + BindingFlags bflags = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic; - if (signature == null) - method = type.GetMethod (methodName, methodBindings); + MethodBase method; + if (msg.MethodSignature == null) + method = type.GetMethod (msg.MethodName, bflags); else - method = type.GetMethod (methodName, methodBindings, null, signature, null); - - if (method != null) return method; + method = type.GetMethod (msg.MethodName, bflags, null, (Type[]) msg.MethodSignature, null); - foreach (Type t in type.GetInterfaces ()) { - method = FindInterfaceMethod (t, methodName, signature); - if (method != null) return method; - } + if (method != null) + return method; - return null; + if (msg.MethodSignature == null) + return type.GetConstructor (bflags, null, Type.EmptyTypes, null); + else + return type.GetConstructor (bflags, null, (Type[]) msg.MethodSignature, null); } public static void GetObjectData(object obj, SerializationInfo info, StreamingContext context) diff --git a/mcs/class/corlib/System.Runtime.Remoting/ServerIdentity.cs b/mcs/class/corlib/System.Runtime.Remoting/ServerIdentity.cs index 72c025121d0..f5ed96a066b 100644 --- a/mcs/class/corlib/System.Runtime.Remoting/ServerIdentity.cs +++ b/mcs/class/corlib/System.Runtime.Remoting/ServerIdentity.cs @@ -136,13 +136,7 @@ namespace System.Runtime.Remoting protected void DisposeServerObject() { - // Detach identity from server object to avoid problems if the - // object is marshalled again. - - if (_serverObject != null) { - _serverObject.ObjectIdentity = null; - _serverObject = null; - } + _serverObject = null; } } diff --git a/mcs/class/corlib/System.Security.Cryptography/ChangeLog b/mcs/class/corlib/System.Security.Cryptography/ChangeLog index f087b452504..59642bc66bc 100644 --- a/mcs/class/corlib/System.Security.Cryptography/ChangeLog +++ b/mcs/class/corlib/System.Security.Cryptography/ChangeLog @@ -1,9 +1,3 @@ -2004-07-15 Sebastien Pouliot <sebastien@ximian.com> - - * DES.cs: Fixed FeedbackSizeValue to 8. - * RC2.cs: Fixed FeedbackSizeValue to 8. - * TripleDES.cs: Fixed FeedbackSizeValue to 8. - 2004-06-23 Sebastien Pouliot <sebastien@ximian.com> * CryptoStream.cs: Removed the block reduction. This seems to be done diff --git a/mcs/class/corlib/System.Security.Cryptography/DES.cs b/mcs/class/corlib/System.Security.Cryptography/DES.cs index cb678113d6c..a775477b436 100644 --- a/mcs/class/corlib/System.Security.Cryptography/DES.cs +++ b/mcs/class/corlib/System.Security.Cryptography/DES.cs @@ -6,6 +6,10 @@ // Sebastien Pouliot <sebastien@ximian.com> // // Portions (C) 2002 Motus Technologies Inc. (http://www.motus.com) +// (C) 2004 Novell (http://www.novell.com) +// + +// // Copyright (C) 2004 Novell, Inc (http://www.novell.com) // // Permission is hereby granted, free of charge, to any person obtaining @@ -46,7 +50,7 @@ public abstract class DES : SymmetricAlgorithm { { KeySizeValue = 64; BlockSizeValue = 64; - FeedbackSizeValue = 8; + FeedbackSizeValue = 64; LegalKeySizesValue = new KeySizes[1]; LegalKeySizesValue[0] = new KeySizes(64, 64, 0); diff --git a/mcs/class/corlib/System.Security.Cryptography/RC2.cs b/mcs/class/corlib/System.Security.Cryptography/RC2.cs index 70119078722..58566078d5f 100644 --- a/mcs/class/corlib/System.Security.Cryptography/RC2.cs +++ b/mcs/class/corlib/System.Security.Cryptography/RC2.cs @@ -5,6 +5,10 @@ // Andrew Birkett (andy@nobugs.org) // Sebastien Pouliot (sebastien@ximian.com) // +// (C) 2004 Novell (http://www.novell.com) +// + +// // Copyright (C) 2004 Novell, Inc (http://www.novell.com) // // Permission is hereby granted, free of charge, to any person obtaining @@ -73,7 +77,7 @@ namespace System.Security.Cryptography { { KeySizeValue = 128; BlockSizeValue = 64; - FeedbackSizeValue = 8; + FeedbackSizeValue = 64; // The RFC allows keys of 1 to 128 bytes, but MS impl only supports // 40 to 128 bits, sigh. diff --git a/mcs/class/corlib/System.Security.Cryptography/TripleDES.cs b/mcs/class/corlib/System.Security.Cryptography/TripleDES.cs index add883b6ce8..54969879d16 100644 --- a/mcs/class/corlib/System.Security.Cryptography/TripleDES.cs +++ b/mcs/class/corlib/System.Security.Cryptography/TripleDES.cs @@ -5,6 +5,10 @@ // Sebastien Pouliot <sebastien@ximian.com> // // (C) 2002, 2003 Motus Technologies Inc. (http://www.motus.com) +// (C) 2004 Novell (http://www.novell.com) +// + +// // Copyright (C) 2004 Novell, Inc (http://www.novell.com) // // Permission is hereby granted, free of charge, to any person obtaining @@ -47,7 +51,7 @@ public abstract class TripleDES : SymmetricAlgorithm { // from SymmetricAlgorithm KeySizeValue = 192; BlockSizeValue = 64; - FeedbackSizeValue = 8; + FeedbackSizeValue = 64; LegalKeySizesValue = new KeySizes [1]; LegalKeySizesValue [0] = new KeySizes (128, 192, 64); diff --git a/mcs/class/corlib/System.Threading/ChangeLog b/mcs/class/corlib/System.Threading/ChangeLog index 66587ac7c11..ba1a9664f98 100644 --- a/mcs/class/corlib/System.Threading/ChangeLog +++ b/mcs/class/corlib/System.Threading/ChangeLog @@ -1,10 +1,3 @@ -2004-07-15 Dick Porter <dick@ximian.com> - - * Thread.cs: Hold a lock in GetNamedDataSlot. Fixes bug 61582, - based on patch by Sébastien Robitaille - (sebastien.robitaille@croesus.com). Also fix instances of - lock(typeof(Thread)) to lock a private object instead. - 2004-06-24 Dick Porter <dick@ximian.com> * Mutex.cs: Implement the createdNew parameter diff --git a/mcs/class/corlib/System.Threading/Thread.cs b/mcs/class/corlib/System.Threading/Thread.cs index 911fb1dbe12..66826e12d40 100755 --- a/mcs/class/corlib/System.Threading/Thread.cs +++ b/mcs/class/corlib/System.Threading/Thread.cs @@ -157,10 +157,9 @@ namespace System.Threading // Stores a hash keyed by strings of LocalDataStoreSlot objects static Hashtable datastorehash; - private static object datastore_lock = new object (); - + private static void InitDataStoreHash () { - lock (datastore_lock) { + lock (typeof (Thread)) { if (datastorehash == null) { datastorehash = Hashtable.Synchronized(new Hashtable()); } @@ -168,7 +167,7 @@ namespace System.Threading } public static LocalDataStoreSlot AllocateNamedDataSlot(string name) { - lock (datastore_lock) { + lock (typeof (Thread)) { if (datastorehash == null) InitDataStoreHash (); LocalDataStoreSlot slot = (LocalDataStoreSlot)datastorehash[name]; @@ -187,7 +186,7 @@ namespace System.Threading } public static void FreeNamedDataSlot(string name) { - lock (datastore_lock) { + lock (typeof (Thread)) { if (datastorehash == null) InitDataStoreHash (); LocalDataStoreSlot slot=(LocalDataStoreSlot)datastorehash[name]; @@ -211,17 +210,15 @@ namespace System.Threading public extern static int GetDomainID(); public static LocalDataStoreSlot GetNamedDataSlot(string name) { - lock (datastore_lock) { - if (datastorehash == null) - InitDataStoreHash (); - LocalDataStoreSlot slot=(LocalDataStoreSlot)datastorehash[name]; + if (datastorehash == null) + InitDataStoreHash (); + LocalDataStoreSlot slot=(LocalDataStoreSlot)datastorehash[name]; - if(slot==null) { - slot=AllocateNamedDataSlot(name); - } - - return(slot); + if(slot==null) { + slot=AllocateNamedDataSlot(name); } + + return(slot); } [MethodImplAttribute(MethodImplOptions.InternalCall)] diff --git a/mcs/class/corlib/System/ChangeLog b/mcs/class/corlib/System/ChangeLog index 8e4560b1bea..b345b93f069 100644 --- a/mcs/class/corlib/System/ChangeLog +++ b/mcs/class/corlib/System/ChangeLog @@ -1,13 +1,3 @@ -2004-07-07 Geoff Norton <gnorton@customerdna.com> - - * Monotype.cs: Patch for bug #58844. Dont throw exceptions right away; - pass through all the possibly BindingInfo's and keep a bool value as to the type - of exception we might need to throw; - -2004-07-07 Geoff Norton <gnorton@customerdna.com> - - * Patch to fix bug #58973 - 2004-06-25 Ben Maurer <bmaurer@ximian.com> * Environment.cs: GetFolderPath has new behavior. r=miguel diff --git a/mcs/class/corlib/System/Double.cs b/mcs/class/corlib/System/Double.cs index 47f0d406531..a52c482792a 100644 --- a/mcs/class/corlib/System/Double.cs +++ b/mcs/class/corlib/System/Double.cs @@ -207,10 +207,6 @@ namespace System { for (; sidx < len; sidx++){ c = s [sidx]; - if (c == '\0') { - sidx = len; - continue; - } switch (state){ case State_AllowSign: if ((style & NumberStyles.AllowLeadingSign) != 0){ diff --git a/mcs/class/corlib/System/MonoType.cs b/mcs/class/corlib/System/MonoType.cs index 395332cf459..a04eeb93877 100644 --- a/mcs/class/corlib/System/MonoType.cs +++ b/mcs/class/corlib/System/MonoType.cs @@ -340,26 +340,22 @@ namespace System name = attr.MemberName; } bool ignoreCase = (invokeAttr & BindingFlags.IgnoreCase) != 0; - bool throwMissingMethodException = false; - bool throwMissingFieldException = false; if ((invokeAttr & BindingFlags.InvokeMethod) != 0) { MethodInfo[] methods = GetMethodsByName (name, invokeAttr, ignoreCase, this); object state = null; MethodBase m = binder.BindToMethod (invokeAttr, methods, ref args, modifiers, culture, namedParameters, out state); - if (m == null) { - throwMissingMethodException = true; - } else { - object result = m.Invoke (target, invokeAttr, binder, args, culture); - binder.ReorderArgumentArray (ref args, state); - return result; - } + if (m == null) + throw new MissingMethodException (); + object result = m.Invoke (target, invokeAttr, binder, args, culture); + binder.ReorderArgumentArray (ref args, state); + return result; } if ((invokeAttr & BindingFlags.GetField) != 0) { FieldInfo f = GetField (name, invokeAttr); if (f != null) { return f.GetValue (target); } else if ((invokeAttr & BindingFlags.GetProperty) == 0) { - throwMissingFieldException = true; + throw new MissingFieldException (); } /* try GetProperty */ } else if ((invokeAttr & BindingFlags.SetField) != 0) { @@ -368,7 +364,7 @@ namespace System f.SetValue (target, args [0]); return null; } else if ((invokeAttr & BindingFlags.SetProperty) == 0) { - throwMissingFieldException = true; + throw new MissingFieldException (); } /* try SetProperty */ } @@ -388,13 +384,11 @@ namespace System smethods [count++] = mb; } MethodBase m = binder.BindToMethod (invokeAttr, smethods, ref args, modifiers, culture, namedParameters, out state); - if (m == null) { - throwMissingFieldException = true; - } else { - object result = m.Invoke (target, invokeAttr, binder, args, culture); - binder.ReorderArgumentArray (ref args, state); - return result; - } + if (m == null) + throw new MissingFieldException (); + object result = m.Invoke (target, invokeAttr, binder, args, culture); + binder.ReorderArgumentArray (ref args, state); + return result; } else if ((invokeAttr & BindingFlags.SetProperty) != 0) { PropertyInfo[] properties = GetPropertiesByName (name, invokeAttr, ignoreCase, this); object state = null; @@ -411,19 +405,12 @@ namespace System smethods [count++] = mb; } MethodBase m = binder.BindToMethod (invokeAttr, smethods, ref args, modifiers, culture, namedParameters, out state); - if (m == null) { - throwMissingFieldException = true; - } else { - object result = m.Invoke (target, invokeAttr, binder, args, culture); - binder.ReorderArgumentArray (ref args, state); - return result; - } + if (m == null) + throw new MissingFieldException (); + object result = m.Invoke (target, invokeAttr, binder, args, culture); + binder.ReorderArgumentArray (ref args, state); + return result; } - if (throwMissingMethodException) - throw new MissingMethodException(); - if (throwMissingFieldException) - throw new MissingFieldException(); - return null; } diff --git a/mcs/class/corlib/Test/System.Collections/ChangeLog b/mcs/class/corlib/Test/System.Collections/ChangeLog index 885360ab080..5e7760f0fad 100644 --- a/mcs/class/corlib/Test/System.Collections/ChangeLog +++ b/mcs/class/corlib/Test/System.Collections/ChangeLog @@ -1,7 +1,3 @@ -2004-07-28 Dick Porter <dick@ximian.com> - - * ComparerTest.cs: Test for invariant compares (bug 61458.) - 2004-06-14 Sebastien Pouliot <sebastien@ximian.com> * HashtableTest.cs: Added new case to CopyTo(Array,int) an empty diff --git a/mcs/class/corlib/Test/System.Collections/ComparerTest.cs b/mcs/class/corlib/Test/System.Collections/ComparerTest.cs index c1591fc3402..c6353f4ec6a 100644 --- a/mcs/class/corlib/Test/System.Collections/ComparerTest.cs +++ b/mcs/class/corlib/Test/System.Collections/ComparerTest.cs @@ -42,16 +42,7 @@ namespace MonoTests.System.Collections { Assert(c.Compare (3, 2) > 0);
}
- - [Test] - public void Invariant () - { - Comparer c = Comparer.DefaultInvariant; - - Assert (c.Compare ("a", "A") > 0); - } - - +
}
}
diff --git a/mcs/class/corlib/Test/System.Reflection/ChangeLog b/mcs/class/corlib/Test/System.Reflection/ChangeLog index fd367c75537..2c5110a6ee3 100644 --- a/mcs/class/corlib/Test/System.Reflection/ChangeLog +++ b/mcs/class/corlib/Test/System.Reflection/ChangeLog @@ -1,7 +1,3 @@ -2004-07-03 Zoltan Varga <vargaz@freemail.hu> - - * ModuleTest.cs: New tests for FindTypes. - 2004-06-10 Lluis Sanchez <lluis@ximian.com> * AssemblyNameTest.cs: AssertEqualsByteArrays(): don't crash if arrays are diff --git a/mcs/errors/cs0502.cs b/mcs/errors/cs0502.cs index e2232ec0c29..b589cba2f75 100644 --- a/mcs/errors/cs0502.cs +++ b/mcs/errors/cs0502.cs @@ -1,6 +1,5 @@ -// cs0502.cs: The class 'Sample' is abstract and sealed
-// Line: 4
-
-abstract sealed class Sample {
-}
-
+// cs0502.cs: 'Sample' cannot be both abstract and sealed +// Line: 4 + +abstract sealed class Sample { +} diff --git a/mcs/mcs/ChangeLog b/mcs/mcs/ChangeLog index 2404c0bd78b..0e090e70feb 100755 --- a/mcs/mcs/ChangeLog +++ b/mcs/mcs/ChangeLog @@ -1,62 +1,3 @@ -2004-07-19 Miguel de Icaza <miguel@ximian.com> - - * expression.cs: Resolve the constant expression before returning - it. Fixes: 61702 - -2004-07-17 Miguel de Icaza <miguel@ximian.com> - - * cs-tokenizer.cs (handle_preprocessing_directive): Do not return - `true' for preprocessing directives that we parse. The return - value indicates whether we should return to regular tokenizing or - not, not whether it was parsed successfully. - - In the past if we were in: #if false ... #line #endif, we would - resume parsing after `#line'. See bug 61604. - * typemanager.cs: Removed an old hack from Gonzalo to get corlib - building: IsEnumType should return true only for enums, not for - enums or System.Enum itself. This fixes #61593. - - Likely what happened is that corlib was wrong: mcs depended on - this bug in some places. The bug got fixed, we had to add the - hack, which caused bug 61593. - - * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack - that was a workaround for the older conditions. - -2004-07-14 Martin Baulig <martin@ximian.com> - - * iterators.cs: Use real error numbers. - -2004-07-14 Martin Baulig <martin@ximian.com> - - * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly - requires this to be a System.Collection.IEnumerable and not a - class implementing that interface. - (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator. - -2004-07-13 Marek Safar <marek.safar@seznam.cz> - - * class.cs: Fixed previous fix, it broke some error tests. - -2004-07-12 Martin Baulig <martin@ximian.com> - - * enum.cs (Enum.Define): Call Emit() to emit the attributes. - Fixes #61293. - -2004-07-09 Miguel de Icaza <miguel@ximian.com> - - * assign.cs (LocalTemporary): Add new argument: is_address,If - `is_address' is true, then the value that we store is the address - to the real value, and not the value itself. - - * ecore.cs (PropertyExpr): use the new local temporary - stuff to allow us to handle X.Y += z (where X is a struct) - -2004-07-08 Martin Baulig <martin@ximian.com> - - * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do - not always return, just like we're doing in Using.Resolve(). - 2004-06-24 Raja R Harinath <rharinath@novell.com> * expression.cs (BetterConversion): Remove buggy special-case @@ -157,6 +98,12 @@ * cs-parser.jay: Added error CS1669 test for indexers. +2004-06-13 Martin Baulig <martin@ximian.com> + + Merged latest changes into gmcs. Please keep this comment in + here, it makes it easier for me to see what changed in MCS since + the last time I merged. + 2004-06-11 Martin Baulig <martin@ximian.com> * expression.cs (Invocation.IsParamsMethodApplicable): We need to diff --git a/mcs/mcs/assign.cs b/mcs/mcs/assign.cs index 94467b2cabb..ecabbcad461 100755 --- a/mcs/mcs/assign.cs +++ b/mcs/mcs/assign.cs @@ -55,34 +55,24 @@ namespace Mono.CSharp { /// The local temporary is used to alter the normal flow of code generation /// basically it creates a local variable, and its emit instruction generates /// code to access this value, return its address or save its value. - /// - /// If `is_address' is true, then the value that we store is the address to the - /// real value, and not the value itself. - /// - /// This is needed for a value type, because otherwise you just end up making a - /// copy of the value on the stack and modifying it. You really need a pointer - /// to the origional value so that you can modify it in that location. This - /// Does not happen with a class because a class is a pointer -- so you always - /// get the indirection. - /// - /// The `is_address' stuff is really just a hack. We need to come up with a better - /// way to handle it. /// </remarks> public class LocalTemporary : Expression, IMemoryLocation { LocalBuilder builder; - bool is_address; - public LocalTemporary (EmitContext ec, Type t) : this (ec, t, false) {} - - public LocalTemporary (EmitContext ec, Type t, bool is_address) + public LocalTemporary (EmitContext ec, Type t) { type = t; eclass = ExprClass.Value; loc = Location.Null; - builder = ec.GetTemporaryLocal (is_address ? TypeManager.GetReferenceType (t): t); - this.is_address = is_address; + builder = ec.GetTemporaryLocal (t); } + public void Release (EmitContext ec) + { + ec.FreeTemporaryLocal (builder, type); + builder = null; + } + public LocalTemporary (LocalBuilder b, Type t) { type = t; @@ -90,12 +80,6 @@ namespace Mono.CSharp { loc = Location.Null; builder = b; } - - public void Release (EmitContext ec) - { - ec.FreeTemporaryLocal (builder, type); - builder = null; - } public override Expression DoResolve (EmitContext ec) { @@ -104,39 +88,17 @@ namespace Mono.CSharp { public override void Emit (EmitContext ec) { - ILGenerator ig = ec.ig; - - ig.Emit (OpCodes.Ldloc, builder); - // we need to copy from the pointer - if (is_address) - LoadFromPtr (ig, type); + ec.ig.Emit (OpCodes.Ldloc, builder); } - // NB: if you have `is_address' on the stack there must - // be a managed pointer. Otherwise, it is the type from - // the ctor. public void Store (EmitContext ec) { - ILGenerator ig = ec.ig; - ig.Emit (OpCodes.Stloc, builder); + ec.ig.Emit (OpCodes.Stloc, builder); } public void AddressOf (EmitContext ec, AddressOp mode) { - // if is_address, than this is just the address anyways, - // so we just return this. - ILGenerator ig = ec.ig; - - if (is_address) - ig.Emit (OpCodes.Ldloc, builder); - else - ig.Emit (OpCodes.Ldloca, builder); - } - - public bool PointsToAddress { - get { - return is_address; - } + ec.ig.Emit (OpCodes.Ldloca, builder); } } @@ -424,7 +386,7 @@ namespace Mono.CSharp { // just use `dup' to propagate the result // IAssignMethod am = (IAssignMethod) target; - + if (this is CompoundAssign) am.CacheTemporaries (ec); diff --git a/mcs/mcs/class.cs b/mcs/mcs/class.cs index 213b3d671c1..ef925659b3d 100755 --- a/mcs/mcs/class.cs +++ b/mcs/mcs/class.cs @@ -1835,12 +1835,6 @@ namespace Mono.CSharp { } } - if (enums != null) { - foreach (Enum e in enums) { - e.Emit (this); - } - } - if (Pending != null) if (Pending.VerifyPendingMethods ()) return; diff --git a/mcs/mcs/cs-tokenizer.cs b/mcs/mcs/cs-tokenizer.cs index c3a116bc835..5191948f407 100755 --- a/mcs/mcs/cs-tokenizer.cs +++ b/mcs/mcs/cs-tokenizer.cs @@ -1461,7 +1461,7 @@ namespace Mono.CSharp switch (cmd){
case "pragma":
if (RootContext.V2)
- return caller_is_taking;
+ return true;
break;
case "line":
@@ -1469,7 +1469,7 @@ namespace Mono.CSharp Report.Error (
1576, Location,
"Argument to #line directive is missing or invalid");
- return caller_is_taking;
+ return true;
case "region":
region_directive = true;
diff --git a/mcs/mcs/ecore.cs b/mcs/mcs/ecore.cs index 6a3e6912602..f9ef75c6fc1 100755 --- a/mcs/mcs/ecore.cs +++ b/mcs/mcs/ecore.cs @@ -3226,40 +3226,21 @@ namespace Mono.CSharp { PropertyInfo.DeclaringType + "." +PropertyInfo.Name); return null; } - - // - // Check that we are not making changes to a temporary memory location - // - if (instance_expr != null && instance_expr.Type.IsValueType && !(instance_expr is IMemoryLocation)) { - // FIXME: Provide better error reporting. - Error (1612, "Cannot modify expression because it is not a variable."); - return null; - } - return this; } public override void CacheTemporaries (EmitContext ec) { - if (!is_static){ - // we need to do indirection on the pointer - bool need_address = instance_expr.Type.IsValueType; - temporary = new LocalTemporary (ec, instance_expr.Type, need_address); - } + if (!is_static) + temporary = new LocalTemporary (ec, instance_expr.Type); } Expression EmitInstance (EmitContext ec) { if (temporary != null){ if (!have_temporary){ - if (temporary.PointsToAddress){ - // must store the managed pointer - IMemoryLocation loc = instance_expr as IMemoryLocation; - loc.AddressOf (ec, AddressOp.LoadStore); - } else - instance_expr.Emit (ec); + instance_expr.Emit (ec); temporary.Store (ec); - have_temporary = true; } return temporary; diff --git a/mcs/mcs/enum.cs b/mcs/mcs/enum.cs index bc84775ad94..ac9ef2b4305 100755 --- a/mcs/mcs/enum.cs +++ b/mcs/mcs/enum.cs @@ -685,7 +685,6 @@ namespace Mono.CSharp { default_value = GetNextDefaultValue (default_value); } - return true; } diff --git a/mcs/mcs/expression.cs b/mcs/mcs/expression.cs index 251c40dbdd5..8d2ff2b3aeb 100755 --- a/mcs/mcs/expression.cs +++ b/mcs/mcs/expression.cs @@ -3672,7 +3672,7 @@ namespace Mono.CSharp { if (e != null) { local_info.Used = true; eclass = ExprClass.Value; - return e.Resolve (ec); + return e; } VariableInfo variable_info = local_info.VariableInfo; @@ -7556,7 +7556,7 @@ namespace Mono.CSharp { //Console.WriteLine (new System.Diagnostics.StackTrace ()); is_stobj = false; t = TypeManager.TypeToCoreType (t); - if (TypeManager.IsEnumType (t)) + if (TypeManager.IsEnumType (t) && t != TypeManager.enum_type) t = TypeManager.EnumToUnderlying (t); if (t == TypeManager.byte_type || t == TypeManager.sbyte_type || t == TypeManager.bool_type) diff --git a/mcs/mcs/iterators.cs b/mcs/mcs/iterators.cs index 0b44fd57350..6f2d32ab29e 100644 --- a/mcs/mcs/iterators.cs +++ b/mcs/mcs/iterators.cs @@ -42,18 +42,15 @@ namespace Mono.CSharp { public static bool CheckContext (EmitContext ec, Location loc) { if (ec.CurrentBranching.InFinally (true)){ - Report.Error (1625, loc, "Cannot yield in the body of a " + - "finally clause"); + Report.Error (-208, loc, "yield statement can not appear in finally clause"); return false; } if (ec.CurrentBranching.InCatch ()){ - Report.Error (1631, loc, "Cannot yield in the body of a " + - "catch clause"); + Report.Error (-209, loc, "yield statement can not appear in the catch clause"); return false; } if (ec.InAnonymousMethod){ - Report.Error (1621, loc, "yield statement can not appear " + - "inside an anonymoud method"); + Report.Error (-209, loc, "yield statement can not appear inside an anonymoud method"); return false; } @@ -654,12 +651,12 @@ namespace Mono.CSharp { static bool IsIEnumerable (Type t) { - return t == TypeManager.ienumerable_type; + return t == TypeManager.ienumerable_type || TypeManager.ImplementsInterface (t, TypeManager.ienumerable_type); } static bool IsIEnumerator (Type t) { - return t == TypeManager.ienumerator_type; + return t == TypeManager.ienumerator_type || TypeManager.ImplementsInterface (t, TypeManager.ienumerator_type); } // @@ -669,17 +666,18 @@ namespace Mono.CSharp { { if (!(IsIEnumerator (return_type) || IsIEnumerable (return_type))){ Report.Error ( - 1624, loc, "The body of `{0}' cannot be an iterator " + - "block because '{1}' is not an iterator interface type", - name, TypeManager.CSharpName (return_type)); + -205, loc, String.Format ( + "The method `{0}' contains a yield statement, but has an invalid return type for an iterator `{1}'", + name, TypeManager.CSharpName (return_type))); return null; } for (int i = 0; i < parameters.Count; i++){ Parameter.Modifier mod = parameters.ParameterModifier (i); if ((mod & (Parameter.Modifier.REF | Parameter.Modifier.OUT)) != 0){ - Report.Error (1623, loc, "Iterators cannot have ref " + - "or out parameters"); + Report.Error (-207, loc, String.Format ( + "Parameter {0} of `{1}' is {2} and not allowed for an iterator method", + i+1, name, parameters.ParameterDesc (i))); return null; } } diff --git a/mcs/mcs/statement.cs b/mcs/mcs/statement.cs index 8b0db129f82..7b0bcca47ea 100755 --- a/mcs/mcs/statement.cs +++ b/mcs/mcs/statement.cs @@ -2734,22 +2734,9 @@ namespace Mono.CSharp { ec.StartFlowBranching (FlowBranching.BranchingType.Exception, loc); bool ok = Statement.Resolve (ec); - if (!ok) { - ec.KillFlowBranching (); - return false; - } - - FlowBranching.Reachability reachability = ec.EndFlowBranching (); - if (reachability.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.NeedReturnLabel (); - } + ec.EndFlowBranching (); - return true; + return ok; } protected override void DoEmit (EmitContext ec) diff --git a/mcs/mcs/typemanager.cs b/mcs/mcs/typemanager.cs index d488979601f..2c2cb05b669 100755 --- a/mcs/mcs/typemanager.cs +++ b/mcs/mcs/typemanager.cs @@ -1495,7 +1495,7 @@ public class TypeManager { public static bool IsEnumType (Type t) { - if (t.IsSubclassOf (TypeManager.enum_type)) + if (t == TypeManager.enum_type || t.IsSubclassOf (TypeManager.enum_type)) return true; else return false; diff --git a/mcs/tests/Makefile b/mcs/tests/Makefile index eda4d87e639..2ccfb9d1614 100644 --- a/mcs/tests/Makefile +++ b/mcs/tests/Makefile @@ -43,7 +43,7 @@ TEST_SOURCES = \ test-241 test-242 test-243 test-244 test-245 test-246 test-247 test-248 test-249 test-250 \ test-251 test-252 test-253 test-254 test-255 test-256 test-257 test-258 test-259 test-260 \ test-261 test-262 test-263 test-264 test-265 test-266 test-267 test-268 test-269 test-270 \ - test-271 test-272 test-273 test-274 test-275 test-276 test-277 test-280 \ + test-271 test-272 test-273 test-274 test-275 test-276 test-277 \ cls-test-0 cls-test-1 cls-test-2 cls-test-3 cls-test-5 cls-test-6 cls-test-7 cls-test-10 \ cls-test-11 cls-test-14 cls-test-15 cls-test-16 diff --git a/mcs/tests/test-280.cs b/mcs/tests/test-280.cs deleted file mode 100644 index 8713c078ae2..00000000000 --- a/mcs/tests/test-280.cs +++ /dev/null @@ -1,23 +0,0 @@ -// -// Thisis just a compilation test for bug 61593 -using System; -namespace AppFramework.Util -{ - public class Logic - { - static public bool EnumInSet(Enum anEnum, Enum[] checkSet) - { - foreach(Enum aVal in checkSet) - { - if (aVal == anEnum) - { - return true; - } - } - return false; - } - } - - static void Main () {} -} - diff --git a/mono/metadata/ChangeLog b/mono/metadata/ChangeLog index 48f6cd2c8c2..4aad6add664 100644 --- a/mono/metadata/ChangeLog +++ b/mono/metadata/ChangeLog @@ -1,3 +1,24 @@ + +Tue Aug 3 17:54:17 CEST 2004 Paolo Molaro <lupus@ximian.com> + + * gc.c: make GC warning messages use the trace API, they are just + noise to most of the users. + +Tue Aug 3 16:40:17 CEST 2004 Paolo Molaro <lupus@ximian.com> + + * gc.c, object.h: mono_gc_handle_*() interface and + AddrOfPinnedObject fixes. GC handle support even without GC. + +Fri Jul 30 16:49:05 CEST 2004 Paolo Molaro <lupus@ximian.com> + + * object.c: always create an object if null is passed + to Invoke() where a valuetype is expected. + +2004-07-29 Gonzalo Paniagua Javier <gonzalo@ximian.com> + + * appdomain.c: hack to build correctly the private bin path on windows. + Fixes bug #61991. + 2004-07-28 Dick Porter <dick@ximian.com> * socket-io.c diff --git a/mono/metadata/appdomain.c b/mono/metadata/appdomain.c index a917a9ecd19..af00a3510d2 100644 --- a/mono/metadata/appdomain.c +++ b/mono/metadata/appdomain.c @@ -547,9 +547,17 @@ reduce_path (const gchar *dirname) for (tmp = list; tmp; tmp = tmp->next) { gchar *data = (gchar *) tmp->data; - if (data && *data) - g_string_append_printf (result, "%c%s", G_DIR_SEPARATOR, - (char *) tmp->data); + if (data && *data) { +#ifdef PLATFORM_WIN32 + if (result->len == 0) + g_string_append_printf (result, "%s\\", data); + else if (result->str [result->len - 1] == '\\') + g_string_append_printf (result, "%s", data); + else +#endif + g_string_append_printf (result, "%c%s", + G_DIR_SEPARATOR, data); + } } res = result->str; diff --git a/mono/metadata/gc.c b/mono/metadata/gc.c index 4695c8c1a2a..73167d0e9dc 100644 --- a/mono/metadata/gc.c +++ b/mono/metadata/gc.c @@ -16,6 +16,7 @@ #include <mono/metadata/exception.h> #include <mono/metadata/domain-internals.h> #include <mono/metadata/class-internals.h> +#include <mono/utils/mono-logger.h> #define GC_I_HIDE_POINTERS #include <mono/os/gc_wrapper.h> @@ -347,13 +348,17 @@ ves_icall_System_GCHandle_GetTargetHandle (MonoObject *obj, guint32 handle, gint /* Indexes start from 1 since 0 means the handle is not allocated */ idx = ++next_handle; if (idx >= array_size) { -#if HAVE_BOEHM_GC gpointer *new_array; guint8 *new_type_array; if (!array_size) array_size = 16; +#if HAVE_BOEHM_GC new_array = GC_MALLOC (sizeof (gpointer) * (array_size * 2)); new_type_array = GC_MALLOC (sizeof (guint8) * (array_size * 2)); +#else + new_array = g_malloc0 (sizeof (gpointer) * (array_size * 2)); + new_type_array = g_malloc0 (sizeof (guint8) * (array_size * 2)); +#endif if (gc_handles) { int i; memcpy (new_array, gc_handles, sizeof (gpointer) * array_size); @@ -370,20 +375,22 @@ ves_icall_System_GCHandle_GetTargetHandle (MonoObject *obj, guint32 handle, gint #else if (((gulong)new_array [i]) & 0x1) { #endif +#if HAVE_BOEHM_GC if (gc_handles [i] != (gpointer)-1) GC_unregister_disappearing_link (&(gc_handles [i])); if (new_array [i] != (gpointer)-1) GC_GENERAL_REGISTER_DISAPPEARING_LINK (&(new_array [i]), REVEAL_POINTER (new_array [i])); +#endif } } } array_size *= 2; +#ifndef HAVE_BOEHM_GC + g_free (gc_handles); + g_free (gc_handle_types); +#endif gc_handles = new_array; gc_handle_types = new_type_array; -#else - LeaveCriticalSection (&handle_section); - mono_raise_exception (mono_get_exception_execution_engine ("No GCHandle support built-in")); -#endif } /* resuse the type from the old target */ @@ -399,9 +406,6 @@ ves_icall_System_GCHandle_GetTargetHandle (MonoObject *obj, guint32 handle, gint #if HAVE_BOEHM_GC if (gc_handles [idx] != (gpointer)-1) GC_GENERAL_REGISTER_DISAPPEARING_LINK (&(gc_handles [idx]), obj); -#else - LeaveCriticalSection (&handle_section); - mono_raise_exception (mono_get_exception_execution_engine ("No weakref support")); #endif break; default: @@ -429,9 +433,6 @@ ves_icall_System_GCHandle_FreeHandle (guint32 handle) if (gc_handles [idx] != (gpointer)-1) GC_unregister_disappearing_link (&(gc_handles [idx])); } -#else - LeaveCriticalSection (&handle_section); - mono_raise_exception (mono_get_exception_execution_engine ("No GCHandle support")); #endif gc_handles [idx] = (gpointer)-1; @@ -457,11 +458,50 @@ ves_icall_System_GCHandle_GetAddrOfPinnedObject (guint32 handle) if (obj == (MonoObject *) -1) return NULL; } - return obj; + if (obj) { + MonoClass *klass = mono_object_class (obj); + if (klass == mono_defaults.string_class) { + return mono_string_chars ((MonoString*)obj); + } else if (klass->rank) { + return mono_array_addr ((MonoArray*)obj, char, 0); + } else { + /* the C# code will check and throw the exception */ + /* FIXME: missing !klass->blittable test, see bug #61134, + * disabled in 1.0 untill the blittable-using code is audited. + if ((klass->flags & TYPE_ATTRIBUTE_LAYOUT_MASK) == TYPE_ATTRIBUTE_AUTO_LAYOUT) + return (gpointer)-1; */ + return (char*)obj + sizeof (MonoObject); + } + } } return NULL; } +guint32 +mono_gchandle_new (MonoObject *obj, gboolean pinned) +{ + return ves_icall_System_GCHandle_GetTargetHandle (obj, 0, pinned? HANDLE_PINNED: HANDLE_NORMAL); +} + +guint32 +mono_gchandle_new_weakref (MonoObject *obj, gboolean track_resurrection) +{ + return ves_icall_System_GCHandle_GetTargetHandle (obj, 0, track_resurrection? HANDLE_WEAK_TRACK: HANDLE_WEAK); +} + +/* This will return NULL for a collected object if using a weakref handle */ +MonoObject* +mono_gchandle_get_target (guint32 gchandle) +{ + return ves_icall_System_GCHandle_GetTarget (gchandle); +} + +void +mono_gchandle_free (guint32 gchandle) +{ + ves_icall_System_GCHandle_FreeHandle (gchandle); +} + #if HAVE_BOEHM_GC static HANDLE finalizer_event; @@ -606,6 +646,12 @@ static GCThreadFunctions mono_gc_thread_vtable = { }; #endif /* WITH_INCLUDED_LIBGC */ +static void +mono_gc_warning (char *msg, GC_word arg) +{ + mono_trace (G_LOG_LEVEL_WARNING, MONO_TRACE_GC, msg, (unsigned long)arg); +} + void mono_gc_init (void) { InitializeCriticalSection (&handle_section); diff --git a/mono/metadata/object.c b/mono/metadata/object.c index bdf832baa6d..65176ce2435 100644 --- a/mono/metadata/object.c +++ b/mono/metadata/object.c @@ -1586,13 +1586,9 @@ mono_runtime_invoke_array (MonoMethod *method, void *obj, MonoArray *params, case MONO_TYPE_R4: case MONO_TYPE_R8: case MONO_TYPE_VALUETYPE: - if (sig->params [i]->byref) { - /* MS seems to create the objects if a null is passed in */ - if (! ((gpointer *)params->vector)[i]) - ((gpointer*)params->vector)[i] = mono_object_new (mono_domain_get (), mono_class_from_mono_type (sig->params [i])); - } - else - g_assert (((gpointer*)params->vector) [i]); + /* MS seems to create the objects if a null is passed in */ + if (! ((gpointer *)params->vector)[i]) + ((gpointer*)params->vector)[i] = mono_object_new (mono_domain_get (), mono_class_from_mono_type (sig->params [i])); pa [i] = (char *)(((gpointer *)params->vector)[i]) + sizeof (MonoObject); break; case MONO_TYPE_STRING: diff --git a/mono/metadata/object.h b/mono/metadata/object.h index c1ffc3c4c2d..2413cc7a346 100644 --- a/mono/metadata/object.h +++ b/mono/metadata/object.h @@ -252,5 +252,11 @@ mono_property_set_value (MonoProperty *prop, void *obj, void **params, MonoObjec MonoObject* mono_property_get_value (MonoProperty *prop, void *obj, void **params, MonoObject **exc); +/* GC handles support */ +guint32 mono_gchandle_new (MonoObject *obj, gboolean pinned); +guint32 mono_gchandle_new_weakref (MonoObject *obj, gboolean track_resurrection); +MonoObject* mono_gchandle_get_target (guint32 gchandle); +void mono_gchandle_free (guint32 gchandle); + #endif diff --git a/mono/mini/ChangeLog b/mono/mini/ChangeLog index 0898c23df87..bd12b2ad5e5 100644 --- a/mono/mini/ChangeLog +++ b/mono/mini/ChangeLog @@ -1,4 +1,17 @@ +Tue Aug 3 11:20:09 CEST 2004 Paolo Molaro <lupus@ximian.com> + + * mini-ppc.c: mul.ovf.un exception name fix. + +Tue Aug 3 11:19:07 CEST 2004 Paolo Molaro <lupus@ximian.com> + + * mini-ppc.c: reg allocator fix. + +Tue Aug 3 11:17:07 CEST 2004 Paolo Molaro <lupus@ximian.com> + + * mini-ppc.c: make sure temp regs are not used for global reg + allocation. + Tue Jul 27 16:05:19 CEST 2004 Paolo Molaro <lupus@ximian.com> * mini-ppc.c, mini-sparc.c, mini-s390.c: keep track of line diff --git a/mono/mini/mini-ppc.c b/mono/mini/mini-ppc.c index 1e8d877b3c9..537cefb50a7 100644 --- a/mono/mini/mini-ppc.c +++ b/mono/mini/mini-ppc.c @@ -209,7 +209,7 @@ mono_arch_get_global_int_regs (MonoCompile *cfg) if (cfg->frame_reg != ppc_sp) top = 31; #if USE_EXTRA_TEMPS - top -= 2; + top = 29; #endif for (i = 13; i < top; ++i) regs = g_list_prepend (regs, GUINT_TO_POINTER (i)); @@ -1296,7 +1296,11 @@ mono_spillvar_offset_float (MonoCompile *cfg, int spillvar) #undef DEBUG #define DEBUG(a) if (cfg->verbose_level > 1) a //#define DEBUG(a) -#define reg_is_freeable(r) ((r) >= 3 && (r) <= 10) +/* use ppc_r3-ppc_10,ppc_r12 as temp registers, f1-f13 for FP registers */ +#define PPC_CALLER_REGS ((0xff<<3) | (1<<12) | USE_EXTRA_TEMPS) +#define PPC_CALLER_FREGS (0x3ffe) + +#define reg_is_freeable(r) (PPC_CALLER_REGS & 1 << (r)) #define freg_is_freeable(r) ((r) >= 1 && (r) <= 13) typedef struct { @@ -1631,10 +1635,6 @@ alloc_int_reg (MonoCompile *cfg, InstList *curinst, MonoInst *ins, int sym_reg, return val; } -/* use ppc_r3-ppc_10,ppc_r12 as temp registers, f1-f13 for FP registers */ -#define PPC_CALLER_REGS ((0xff<<3) | (1<<12) | USE_EXTRA_TEMPS) -#define PPC_CALLER_FREGS (0x3ffe) - /* * Local register allocation. * We first scan the list of instructions and we save the liveness info of @@ -2687,7 +2687,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) */ ppc_mulhwu (code, ppc_r0, ins->sreg1, ins->sreg2); ppc_cmpi (code, 0, 0, ppc_r0, 0); - EMIT_COND_SYSTEM_EXCEPTION (CEE_BNE_UN - CEE_BEQ, ins->inst_p1); + EMIT_COND_SYSTEM_EXCEPTION (CEE_BNE_UN - CEE_BEQ, "OverflowException"); ppc_mullw (code, ins->dreg, ins->sreg1, ins->sreg2); break; case OP_ICONST: @@ -3410,6 +3410,8 @@ mono_arch_emit_prolog (MonoCompile *cfg) ArgInfo *ainfo = cinfo->args + i; inst = cfg->varinfo [pos]; + if (cfg->verbose_level > 2) + g_print ("Saving argument %d (type: %d)\n", i, ainfo->regtype); if (inst->opcode == OP_REGVAR) { if (ainfo->regtype == RegTypeGeneral) ppc_mr (code, inst->dreg, ainfo->reg); diff --git a/web/download b/web/download index 6a9789d3744..3992312f61f 100644 --- a/web/download +++ b/web/download @@ -14,21 +14,123 @@ Online API documentation for Mono is available in the `monodoc' package. - Gtk-sharp is package to build GUI applications with the Gtk toolkit. - + Gtk# is package to build GUI applications with the Gtk+ toolkit. The software is also available on the `Mono' channel in <a href="http://www.ximian.com/products/redcarpet/">Red Carpet</a>. - Some useful links: the <a - href="http://www.go-mono.org/faq.html">FAQ</a>. - - Packages can find RPM Spec files and other resources in the <a + Packagers can find RPM Spec files and other resources in the <a href="http://www.go-mono.com/packagers/">packagers page</a>. <table> <tbody> <tr bgcolor="#DDDDDD"> <td> + <b>Mono 1.0</b><br> + <a href="archive/1.0/index.html">Release notes</a><br> + June 30th, 2004 + </td> + <td> + <table cellspacing="1" cellpadding="3"> + <tr bgcolor="#BBBBBB"> + <td> + <b>Source Code</b> + </td> + <td> + <ul> + <li><a href="archive/1.0/mono-1.0.tar.gz">Mono Runtime 1.0</a> + <li><a href="archive/1.0/mcs-1.0.tar.gz">Mono Class Libraries and C# Compiler 1.0</a> + <li><a href="archive/1.0/libgdiplus-1.0.tar.gz">libgdiplus 1.0</a> + <p> + <li><a href="archive/1.0/monodoc-1.0.tar.gz">MonoDoc 1.0</a> + <li><a href="archive/1.0/xsp-1.0.tar.gz">XSP web server 1.0</a> + <li><a href="archive/1.0/mod_mono-1.0.tar.gz">Apache Mono module 1.0</a> + <p> + <li><a href="archive/1.0/winelib-0.3.tar.gz">Winelib 0.3</a> + <p> + <li><a href="archive/1.0/gtk-sharp-1.0.tar.gz">Gtk# 1.0</a> + <li><a href="archive/1.0/gecko-sharp-0.5.tar.gz">Gecko# 0.5</a> + <li><a href="archive/1.0/gtksourceview-sharp-0.5.tar.gz">Gtk SourceView# 0.5</a> + <li><a href="archive/1.0/monodevelop-0.5.tar.gz">MonoDevelop IDE 0.5</a> + </ul> + </td> + </tr> + <tr bgcolor="#bbbbbb"> + <td bgcolor="#999999"> + <img src="images/redhat-36.gif"><b>Red Hat 9.0/x86</b><br> + </td> + <td> + <a href="archive/1.0/redhat-9-i386">Packages</a> + </td> + </tr> + <tr bgcolor="#bbbbbb"> + <td bgcolor="#999999"> + <img src="images/redhat-36.gif"><b>Fedora Core 1/x86</b><br> + </td> + <td> + <a href="archive/1.0/fedora-1-i386">Packages</a> + <p><a href="http://www.go-mono.com/archive/yum-repository/fedora-1-i386">YUM Repository</a> + </td> + </tr> + <tr bgcolor="#bbbbbb"> + <td bgcolor="#999999"> + <img src="images/redhat-36.gif"><b>Fedora Core 2/x86</b><br> + </td> + <td> + <a href="archive/1.0/fedora-2-i386">Packages</a> + <p><a href="http://www.go-mono.com/archive/yum-repository/fedora-2-i386">YUM Repository</a> + </td> + </tr> + <tr bgcolor="#bbbbbb"> + <td bgcolor="#999999"> + <img src="images/suse-36.gif"><b>SLES 8/x86</b><br> + </td> + <td> + <a href="archive/1.0/sles-8-i386/">Packages</a> + </td> + </tr> + <tr bgcolor="#bbbbbb"> + <td bgcolor="#999999"> + <img src="images/suse-36.gif"><b>SUSE 9/x86</b><br> + </td> + <td> + <a href="archive/1.0/suse-90-i586/">Packages</a> + </td> + </tr> + <tr bgcolor="#bbbbbb"> + <td bgcolor="#999999"> + <img src="images/suse-36.gif"><b>SUSE 9.1/x86</b><br> + </td> + <td> + <a href="archive/1.0/suse-91-i586/">Packages</a> + </td> + </tr> + <tr> + <td bgcolor="#999999"> + <div align="left"><img src="images/windows-36.gif"></div> + <div align="right"><b>Windows installer</b><br><small>Win2k and above</small></div> + </td> + <td> + <a href="archive/1.0/windows/mono-1.0-win32-1.exe">Mono Setup</a> + </td> + </tr> + <tr> + <td bgcolor="#999999"> + <img src="images/macos-36.gif"><b>Mac OS X package</b> + </td> + <td> + <a href="archive/1.0/macos/MonoFramework-1.0.dmg">MonoFramework-1.0.dmg</a> in /Library/Framework + </td> + </tr> + </table> + </td> + </table> + + <hr> + + <table> + <tbody> + <tr bgcolor="#DDDDDD"> + <td> <b>Release Candidate</b><br> <!-- <a href="archive/beta3/beta3.html">Release notes</a><br> --> June 25th, 2004 diff --git a/web/index b/web/index index d701c09c4d5..52a8ced8b09 100644 --- a/web/index +++ b/web/index @@ -1,3 +1,4 @@ +<meta http-equiv="Refresh" content="0"; URL=http://www.mono-project.com/"> <link rel="alternate" type="application/rss+xml" title="RSS" href="index.rss"/> @@ -174,6 +175,26 @@ </a> Wikis. </p> +@item Jun 30th, 2004: Mono 1.0 + + <table> + <tr> + <td> + <img + src="http://www.go-mono.com/archive/1.0/mono1.gif"></td> + <td> + <b>Mono 1.0 has been released!</b><br/> + + <p>Be the first kid in your block to install the + <i>it-took-us-three-years-but-we-did-it</i> development platform. + + <p>Read the <a + href="http://www.go-mono.com/archive/1.0/index.html">release notes</a> + or <a href="http://www.go-mono.com/download.html">download it</a></p> + </td> + </tr> + </table> + @item Jun 23rd, 2004: The Mono Hackers Hall of Fame welcomes John Luke, Dan Morgan and Tim Coleman. The <a href="http://www.go-mono.com/hackers.html">Mono Hackers Hall Of Fame</a> |