Fix warnings
authorGonzalo Paniagua Javier <gonzalo.mono@gmail.com>
Thu, 21 Apr 2005 00:47:25 +0000 (00:47 -0000)
committerGonzalo Paniagua Javier <gonzalo.mono@gmail.com>
Thu, 21 Apr 2005 00:47:25 +0000 (00:47 -0000)
svn path=/trunk/mcs/; revision=43368

18 files changed:
mcs/class/System/Microsoft.CSharp/CSharpCodeGenerator.cs
mcs/class/System/Microsoft.VisualBasic/VBCodeGenerator.cs
mcs/class/System/System.Collections.Specialized/StringEnumerator.cs
mcs/class/System/System.ComponentModel/ListChangedEventArgs.cs
mcs/class/System/System.ComponentModel/ReflectionPropertyDescriptor.cs
mcs/class/System/System.Diagnostics/DiagnosticsConfigurationHandler.cs
mcs/class/System/System.Diagnostics/TraceImpl.cs
mcs/class/System/System.IO/FAMWatcher.cs
mcs/class/System/System.Net.Configuration/DefaultProxyHandler.cs
mcs/class/System/System.Net.Sockets/Socket.cs
mcs/class/System/System.Net/Cookie.cs
mcs/class/System/System.Net/DigestClient.cs
mcs/class/System/System.Net/IPEndPoint.cs
mcs/class/System/System.Net/WebAsyncResult.cs
mcs/class/System/System.Net/WebConnection.cs
mcs/class/System/System.Text.RegularExpressions/interpreter.cs
mcs/class/System/System.Text.RegularExpressions/parser.cs
mcs/class/System/System/UriBuilder.cs

index 6fd236f4bfbdcf697ff9066a0ebf641b5d65242a..1ecfd7c2dfd9b5767a3c2596411d030dbb706474 100644 (file)
@@ -855,29 +855,6 @@ namespace Mono.CSharp
                        return "\"" + output + "\"";
                }
 
-               private void GenerateDeclaration( CodeTypeReference type, string name, CodeExpression initExpression )
-               {
-                       TextWriter output = Output;
-
-                       OutputTypeNamePair( type, GetSafeName (name) );
-
-                       if ( initExpression != null ) {
-                               output.Write( " = " );
-                               GenerateExpression( initExpression );
-                       }
-
-                       output.WriteLine( ';' );
-               }
-               
-               private void GenerateMemberReferenceExpression( CodeExpression targetObject, string memberName )
-               {
-                       if (targetObject != null ) {
-                               GenerateExpression( targetObject );
-                               Output.Write( '.' );
-                       }
-                       Output.Write( GetSafeName (memberName) );
-               }
-                       
                protected override void GenerateParameterDeclarationExpression (CodeParameterDeclarationExpression e)
                {
                        if (e.CustomAttributes != null && e.CustomAttributes.Count > 0)
index ad8b958051f0f93ea34717f1c41036f0df4eb9f2..40deccd6061c1241bfafe47f28ed7d6b0392cb50 100644 (file)
@@ -1120,20 +1120,6 @@ namespace Microsoft.VisualBasic
                        return mySBuilder.ToString();\r
                }\r
 \r
-               private void GenerateDeclaration (CodeTypeReference type, string name, CodeExpression initExpression)\r
-               {\r
-                       TextWriter output = Output;\r
-\r
-                       OutputTypeNamePair (type, name);\r
-\r
-                       if (initExpression != null) {\r
-                               output.Write (" = ");\r
-                               GenerateExpression (initExpression);\r
-                       }\r
-\r
-                       output.WriteLine ();\r
-               }\r
-               \r
                private void GenerateMemberReferenceExpression (CodeExpression targetObject, string memberName)\r
                {\r
                        GenerateExpression (targetObject);\r
index a1108204f6b9ffeb8fb8bbe6c292579b5286ed3a..cae3ac8f395548f9233dc2f531d2232a58313015 100644 (file)
 \r
 namespace System.Collections.Specialized {\r
        public class StringEnumerator {\r
-               private StringCollection coll;\r
                private IEnumerator enumerable;\r
                \r
                // assembly-scoped constructor\r
                internal StringEnumerator(StringCollection coll) {\r
-                       this.coll = coll;\r
                        this.enumerable = ((IEnumerable)coll).GetEnumerator();\r
                }\r
                \r
index fbeff6f8ff0c6327bc1aed6326ed87b7e4092c4e..1999adc0e8a28baf24adc5ef9f2c854fbeffe11f 100755 (executable)
@@ -36,7 +36,7 @@ namespace System.ComponentModel {
                ListChangedType changedType;
                int oldIndex;
                int newIndex;
-               PropertyDescriptor propDesc;    // What to do with this?
+               //PropertyDescriptor propDesc;  // What to do with this?
        
                public ListChangedEventArgs (ListChangedType listChangedType,
                                             int newIndex)
@@ -49,7 +49,7 @@ namespace System.ComponentModel {
                                             PropertyDescriptor propDesc)
                {
                        this.changedType = listChangedType;
-                       this.propDesc = propDesc;
+                       //this.propDesc = propDesc;
                }
        
                public ListChangedEventArgs (ListChangedType listChangedType,
index 78595ac4a3338eb39b23e4f3e75029022ee32fd7..df983a83dfd97612ebd6d7ee2e9193d70e1a3035 100644 (file)
@@ -39,20 +39,17 @@ namespace System.ComponentModel
        internal class ReflectionPropertyDescriptor : PropertyDescriptor
        {
                PropertyInfo _member;
-               Type _type;
                Type _componentType;
                
                public ReflectionPropertyDescriptor (Type componentType, PropertyDescriptor oldPropertyDescriptor, Attribute [] attributes)
                : base (oldPropertyDescriptor, attributes)
                {
-                       _type = oldPropertyDescriptor.PropertyType;
                        _componentType = componentType;
                }
                                                         
                public ReflectionPropertyDescriptor (Type componentType, string name, Type type, Attribute [] attributes)
                : base (name, attributes)
                {
-                       _type = type;
                        _componentType = componentType;
                }
                                                         
index 28ecc78013a1024dc0f4392615720ed3d15ad826..fadbcb6c7d3fe999e215c8b89974b6d4ede85ce8 100644 (file)
@@ -168,8 +168,7 @@ namespace System.Diagnostics
                                                case "add":
                                                        name = GetAttribute (attributes, "name", true, child);
                                                        value = GetAttribute (attributes, "value", true, child);
-                                                       value = AsString (value);
-                                                       ValidateIntegralValue (name, value);
+                                                       value = AsString (value); ValidateIntegralValue (name, value);
                                                        newNodes [name] = value;
                                                        break;
                                                case "remove":
@@ -192,14 +191,11 @@ namespace System.Diagnostics
                        d [node.Name] = newNodes;
                }
 
-               private static void ValidateIntegralValue (string name, string value)
+               private static int ValidateIntegralValue (string name, string value)
                {
                        try {
-                               int n = int.Parse (value);
-                               // remove warning about unused variable.
-                               n = n;
-                       }
-                       catch {
+                               return int.Parse (value);
+                       } catch {
                                throw new ConfigurationException (string.Format (
                                                        "Error in '{0}': " + 
                                                        "The value of a switch must be integral", name));
index 10f22ed2764dc63cfa0d415ec9dd82e9b7cabbe3..3f070c6766e1cf5eaba7f8279b96329fe5e844d5 100644 (file)
@@ -126,8 +126,9 @@ namespace System.Diagnostics {
                // The DiagnosticsConfigurationHandler assumes that the TraceImpl.Listeners
                // collection exists (so it can initialize the DefaultTraceListener and
                // add/remove existing listeners).
-               private static void InitOnce ()
+               private static object InitOnce ()
                {
+                       object d = null;
 #if !NO_LOCK_FREE
                        // The lock-free version
                        if (listeners == null) {
@@ -135,10 +136,7 @@ namespace System.Diagnostics {
                                Thread.MemoryBarrier ();
                                while (Interlocked.CompareExchange (ref listeners, c, null) == null) {
                                        // Read in the .config file and get the ball rolling...
-                                       System.Collections.IDictionary d = DiagnosticsConfiguration.Settings;
-
-                                       // remove warning about unused temporary
-                                       d = d;
+                                       d = DiagnosticsConfiguration.Settings;
                                }
                                Thread.MemoryBarrier ();
                        }
@@ -147,15 +145,12 @@ namespace System.Diagnostics {
                        lock (lock_) {
                                if (listeners == null) {
                                        listeners = new TraceListenerCollection ();
-
                                        // Read in the .config file and get the ball rolling...
-                                       System.Collections.IDictionary d = DiagnosticsConfiguration.Settings;
-
-                                       // remove warning about unused temporary
-                                       d = d;
+                                       d = DiagnosticsConfiguration.Settings;
                                }
                        }
 #endif
+                       return d;
                }
 
                // FIXME: According to MSDN, this method should display a dialog box
index 3c3f14021df46ead9eb41c78dd82f4a49815bca1..c6d1a61aad8335067f2e386adb0464e25d818b70 100644 (file)
@@ -39,7 +39,7 @@ using System.Threading;
 namespace System.IO {
        struct FAMConnection {
                public int FD;
-               IntPtr opaque;
+               public IntPtr opaque;
        }
 
        struct FAMRequest {
@@ -320,6 +320,11 @@ namespace System.IO {
                        }
                }
 
+               ~FAMWatcher ()
+               {
+                       FAMClose (ref conn);
+               }
+
                [DllImport ("libfam.so.0")]
                extern static int FAMOpen (out FAMConnection fc);
 
index 49e4c315db84f1308892f66988259634a04e2685..293193197dd539d3934dc88aacb6a8597626cb10 100644 (file)
@@ -57,7 +57,8 @@ namespace System.Net.Configuration
                                
                                string name = child.Name;
                                if (name == "proxy") {
-                                       string deflt = HandlersUtil.ExtractAttributeValue ("usesystemdefault", child, true);
+                                       // ignored
+                                       HandlersUtil.ExtractAttributeValue ("usesystemdefault", child, true);
                                        string bypass = HandlersUtil.ExtractAttributeValue ("bypassonlocal", child, true);
                                        string address = HandlersUtil.ExtractAttributeValue ("proxyaddress", child, true);
                                        if (child.Attributes != null && child.Attributes.Count != 0) {
index d8bf62185e2aa5927d9efe3c8825465ce76ae35e..a24ae8a6ddd985d54d64d570fdcb07aa6d598250 100644 (file)
@@ -58,7 +58,7 @@ namespace System.Net.Sockets
                {
                        /* Same structure in the runtime */
                        public Socket Sock;
-                       IntPtr handle;
+                       public IntPtr handle;
                        object state;
                        AsyncCallback callback;
                        WaitHandle waithandle;
@@ -77,10 +77,10 @@ namespace System.Net.Sockets
 
                        bool completed_sync;
                        bool completed;
-                       bool blocking;
+                       public bool blocking;
                        internal int error;
                        SocketOperation operation;
-                       object ares;
+                       public object ares;
 
                        public SocketAsyncResult (Socket sock, object state, AsyncCallback callback, SocketOperation operation)
                        {
@@ -1204,7 +1204,6 @@ namespace System.Net.Sockets
                public void GetSocketOption(SocketOptionLevel level,
                                            SocketOptionName name,
                                            byte[] opt_value) {
-                       int opt_value_len=opt_value.Length;
                        int error;
                        
                        GetSocketOption_arr_internal(socket, level, name,
index 07174c602286e33898140c449451f61a56bdde27..dcc56400a75b9ae4057a554af34c40006557b964 100644 (file)
@@ -58,7 +58,6 @@ namespace System.Net {
                int version;
                
                static char [] reservedCharsName = new char [] {' ', '=', ';', ',', '\n', '\r', '\t'};
-               static char [] reservedCharsValue = new char [] {';', ','};
                static char [] portSeparators = new char [] {'"', ','};
                 static string tspecials = "()<>@,;:\\\"/[]?={} \t";   // from RFC 2965, 2068
 
index 30c84273bd251b6ef444654143005203753313cd..46650a76438e8689d75c5e7b076aa0d8a1d90702 100644 (file)
@@ -61,7 +61,6 @@ namespace System.Net
                int length;
                int pos;
                static string [] keywords = { "realm", "opaque", "nonce", "algorithm", "qop" };
-               static char [] endSeparator = new char[] { '"', ',' };
                string [] values = new string [keywords.Length];
 
                public DigestHeaderParser (string header)
@@ -130,15 +129,6 @@ namespace System.Net
                        pos--;
                }
                
-               void SkipNonWhitespace ()
-               {
-                       char c = 'a';
-                       while (pos < length && c != ' ' && c != '\t' && c != '\r' && c != '\n') {
-                               c = header [pos++];
-                       }
-                       pos--;
-               }
-               
                string GetKey ()
                {
                        SkipWhitespace ();
index d0b89caa5d89f6787ee98bc60f4b0db068fd548c..2e81c62a2ea4e3bc268ab2cef842d67253dd7db7 100755 (executable)
@@ -116,10 +116,12 @@ namespace System.Net {
                                        port    = (((int)sockaddr[2])<<8) + (int)sockaddr[3];
 
                                        /// maybe flowid ?
+                                       /*
                                        int unknown     = (int)sockaddr[4] +
                                                (((int)sockaddr[5])<<8) +
                                                (((int)sockaddr[6])<<16) +
                                                (((int)sockaddr[7])<<24);
+                                       */
 
                                        int scopeId     = (int)sockaddr[24] +
                                                (((int)sockaddr[25])<<8) +
index 7480d19ccbf314cf884ed1468697f9733655550e..6d0a3f431ee357ef6d6b2d8b4e389889d9610066 100644 (file)
@@ -44,7 +44,6 @@ namespace System.Net
                IAsyncResult innerAsyncResult;
                bool callbackDone;
                Exception exc;
-               HttpWebRequest request;
                HttpWebResponse response;
                Stream writeStream;
                byte [] buffer;
@@ -61,7 +60,6 @@ namespace System.Net
 
                public WebAsyncResult (HttpWebRequest request, AsyncCallback cb, object state)
                {
-                       this.request = request;
                        this.cb = cb;
                        this.state = state;
                }
@@ -90,7 +88,6 @@ namespace System.Net
                {
                        callbackDone = false;
                        exc = null;
-                       request = null;
                        response = null;
                        writeStream = null;
                        exc = null;
index 0dd720a3d96abc0decfa73a8286dbd6afe4ccf48..39dbfae3c485df2aed5d320a9923aa19431df5e2 100644 (file)
@@ -53,7 +53,6 @@ namespace System.Net
                Socket socket;
                object socketLock = new object ();
                WebExceptionStatus status;
-               WebConnectionGroup group;
                bool busy;
                WaitOrTimerCallback initConn;
                bool keepAlive;
@@ -79,7 +78,6 @@ namespace System.Net
 
                public WebConnection (WebConnectionGroup group, ServicePoint sPoint)
                {
-                       this.group = group;
                        this.sPoint = sPoint;
                        buffer = new byte [4096];
                        readState = ReadState.None;
index e107c24e3e6026d3350ebe7b272152f7a714ae32..78bd6856d1c588eebc2709b844ae225ad3a7459a 100644 (file)
@@ -45,7 +45,7 @@ namespace System.Text.RegularExpressions {
 
                        this.group_count = program[1] + 1;
                        this.match_min = program[2];
-                       this.match_max = program[3];
+                       //this.match_max = program[3];
 
                        // setup
 
@@ -953,7 +953,7 @@ namespace System.Text.RegularExpressions {
                private string text;                    // input text
                private int text_end;                   // end of input text (last character + 1)
                private int group_count;                // number of capturing groups
-               private int match_min, match_max;       // match width information
+               private int match_min;//, match_max;    // match width information
                private QuickSearch qs;                 // fast substring matcher
 
                // match state
index ef3e782c4c47bc2186c778ec3f47859fb9d33f58..b056dd5a6674f2d3b91b6791ab1cec44daf89787 100644 (file)
@@ -1004,10 +1004,6 @@ namespace System.Text.RegularExpressions.Syntax {
                        return Parser.ParseNumber (pattern, ref ptr, b, min, max);
                }
 
-               private int ParseDecimal () {
-                       return Parser.ParseDecimal (pattern, ref ptr);
-               }
-
                private static int ParseDigit (char c, int b, int n) {
                        switch (b) {
                        case 8:
@@ -1159,10 +1155,6 @@ namespace System.Text.RegularExpressions.Syntax {
                        return (options & RegexOptions.IgnorePatternWhitespace) != 0;
                }
 
-               private static bool IsRightToLeft (RegexOptions options) {
-                       return (options & RegexOptions.RightToLeft) != 0;
-               }
-
                private static bool IsECMAScript (RegexOptions options) {
                        return (options & RegexOptions.ECMAScript) != 0;
                }
index d334ef26a804a22d022efa44f290f15fed5c45bd..77dce03deef1e9036ad2818dc3a28995fb462e32 100644 (file)
@@ -256,18 +256,6 @@ namespace System
 \r
                        return builder.ToString ();\r
                }\r
-\r
-               private string EncodeUtf8 (string str)\r
-               {\r
-                       byte [] data = Encoding.UTF8.GetBytes (str);\r
-                       int len = data.Length;\r
-                       char [] res = new char [len];\r
-\r
-                       for (int i=0; i<len; i++)\r
-                               res [i] = (char) data [i];\r
-\r
-                       return new string (res);\r
-               }\r
        } \r
 } \r
 \r