Fix some compiler warnings
authorMarek Safar <marek.safar@gmail.com>
Thu, 16 Feb 2012 17:10:57 +0000 (17:10 +0000)
committerMarek Safar <marek.safar@gmail.com>
Fri, 17 Feb 2012 12:37:25 +0000 (12:37 +0000)
19 files changed:
mcs/class/Mono.CompilerServices.SymbolWriter/MonoSymbolTable.cs
mcs/class/Mono.Messaging.RabbitMQ/Makefile
mcs/class/Mono.Posix/Mono.Unix/UnixSymbolicLinkInfo.cs
mcs/class/Mono.Security/Makefile
mcs/class/Novell.Directory.Ldap/Makefile
mcs/class/RabbitMQ.Client/src/client/Makefile
mcs/class/System.Configuration/Makefile
mcs/class/System.Configuration/System.Configuration/ConfigurationManager.cs
mcs/class/System.Configuration/System.Configuration/ConfigurationSectionGroup.cs
mcs/class/System.Configuration/System.Configuration/SectionInformation.cs
mcs/class/System.Data.Linq/Makefile
mcs/class/System.ServiceModel.Web/System.Runtime.Serialization.Json/JavaScriptReader.cs
mcs/class/System.Xaml/System.Xaml/XamlObjectReader.cs
mcs/class/System.Xaml/System.Xaml/XamlObjectWriter.cs
mcs/class/System.Xaml/System.Xaml/XamlSubtreeReader.cs
mcs/class/System.Xaml/System.Xaml/XamlType.cs
mcs/class/System.Xaml/System.Xaml/XamlXmlWriter.cs
mcs/class/System/System.Net.Sockets/Socket_2_1.cs
mcs/class/System/System.Net/HttpWebRequest.cs

index ef40dfbfe631b8f82cd17de9ccf7bc63ffe42669..f92c8d4840fd480c10007ba00f7986f9b75aa633 100644 (file)
@@ -551,7 +551,6 @@ namespace Mono.CompilerServices.SymbolWriter
                        }
                }
 
-               [Obsolete]
                public int DefineNamespace (string name, string[] using_clauses, int parent)
                {
                        if (!creating)
index 03b5bb38f53a96cb25c81ad72a067f33474a68c8..dea85f1cd3933ecdd137571ac045486ee38b7640 100644 (file)
@@ -6,7 +6,8 @@ LIBRARY = Mono.Messaging.RabbitMQ.dll
 LIB_MCS_FLAGS = /r:System.dll \
                /r:System.Messaging.dll \
                /r:Mono.Messaging.dll \
-               /r:RabbitMQ.Client
+               /r:RabbitMQ.Client \
+               -nowarn:618
 
 TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:0618 -nowarn:219 -nowarn:169 \
        /r:nunit.mocks.dll
index 5a612de7c25395f46fc08d25f8d93173e4eb0990..d0026d2b46ab8333b4cd8562f5057f825879f9db 100644 (file)
@@ -68,7 +68,7 @@ namespace Mono.Unix {
 
                public UnixFileSystemInfo GetContents ()
                {
-                       string path = ReadLink ();
+                       ReadLink ();
                        return UnixFileSystemInfo.GetFileSystemEntry (
                                                UnixPath.Combine (UnixPath.GetDirectoryName (FullPath), 
                                                        ContentsPath));
index e3286f288a5f78ab1375b0dedfc85fd2dc57e487..9ff6355b5e5ec6ad8ed5d49a51f276d1e9e63a07 100644 (file)
@@ -3,7 +3,7 @@ SUBDIRS =
 include ../../build/rules.make
 
 LIBRARY = Mono.Security.dll
-LIB_MCS_FLAGS = -r:System.dll -unsafe
+LIB_MCS_FLAGS = -r:System.dll -unsafe -nowarn:618,1033
 LIBRARY_USE_INTERMEDIATE_FILE = yes
 TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:169,219,618,672
 
index 5ba7d6540297432641afdc011b30dd09e5cf8dea..678b60557793982f3796bf2dc611fde2287b7e1c 100644 (file)
@@ -14,7 +14,7 @@ LIB_MCS_FLAGS = \
        $(RESX_RES:%=/res:%)
 else
 LIB_MCS_FLAGS = \
-       -warn:1 \
+       -warn:1 -nowarn:612 \
        -r:$(corlib)                            \
        -r:System.dll                           \
        -r:Mono.Security.dll                    \
index 633bd781cacc61c7c1e1b856a0cab72606658a4c..72e278b7400139438da5e013f9de28e66554495d 100644 (file)
@@ -3,7 +3,7 @@ SUBDIRS =
 include ../../../../build/rules.make
 
 LIBRARY = RabbitMQ.Client.dll
-LIB_MCS_FLAGS = -r:System.dll -r:System.Xml.dll
+LIB_MCS_FLAGS = -r:System.dll -r:System.Xml.dll -nowarn:618
 NO_TEST = yes
 
 include ../../../../build/library.make
index 743008e82ba2a8aa65b5f2c30f8033f417f24d92..9f27fac08452d5da03f8eccb66416abd88c5cff3 100644 (file)
@@ -5,7 +5,7 @@ include ../../build/rules.make
 LIBRARY = System.Configuration.dll
 LIBRARY_USE_INTERMEDIATE_FILE = yes
 
-LIB_MCS_FLAGS = -r:$(corlib) -r:System.dll -r:System.Xml.dll -r:System.Security.dll
+LIB_MCS_FLAGS = -r:$(corlib) -r:System.dll -r:System.Xml.dll -r:System.Security.dll -nowarn:618
 TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
 
 # This is a .NET 2.0+ only assembly
index 9785b38353470002e454259f3ab439b4e4417d11..53e31515c143456f20794a90c455e13e85fa0e35 100644 (file)
@@ -43,7 +43,7 @@ namespace System.Configuration {
 
        public static class ConfigurationManager
        {
-               static bool systemWebInUse;
+//             static bool systemWebInUse;
                static InternalConfigurationFactory configFactory = new InternalConfigurationFactory ();
                static IInternalConfigSystem configSystem = new ClientConfigurationSystem ();
                static object lockobj = new object ();
@@ -195,12 +195,13 @@ namespace System.Configuration {
                                // KLUDGE!! We need that when an assembly loaded inside an ASP.NET
                                // domain does OpenExeConfiguration ("") - we must return the path
                                // to web.config in that instance.
+                               /*
                                string t = newSystem.GetType ().ToString ();
                                if (String.Compare (t, "System.Web.Configuration.HttpConfigurationSystem", StringComparison.OrdinalIgnoreCase) == 0)
                                        systemWebInUse = true;
                                else
                                        systemWebInUse = false;
-
+                               */
                                IInternalConfigSystem old = configSystem;
                                configSystem = newSystem;
                                return old;
index 454003a4b3110fa07b4835b4870bac81ff2892c9..4b212c54a499d92e7fe5a3c52b9ac1d2e420dafb 100644 (file)
@@ -34,7 +34,7 @@ namespace System.Configuration
 {
        public class ConfigurationSectionGroup
        {
-               bool require_declaration, declared;
+               bool require_declaration;
                string name, type_name;
 
                ConfigurationSectionCollection sections;
@@ -81,8 +81,9 @@ namespace System.Configuration
                        ForceDeclaration (true);
                }
                
+               [MonoTODO]
                public bool IsDeclared {
-                       get { return declared; }
+                       get { return false; }
                }
 
                [MonoTODO]
index 0ca0d74f6eb231bf076bb10734c7b2bc58d13ea2..24767c62a49525bb9885c2f33ad1f60b1bbe3311 100644 (file)
@@ -45,7 +45,7 @@ namespace System.Configuration
                bool require_permission;
 
                string config_source = String.Empty;
-               bool force_update, is_declared, is_locked;
+               bool force_update;
                string name, type_name;
                string raw_xml;
                
@@ -114,12 +114,12 @@ namespace System.Configuration
 
                [MonoTODO]
                public bool IsDeclared {
-                       get { return is_declared; }
+                       get { return false; }
                }
 
                [MonoTODO]
                public bool IsLocked {
-                       get { return is_locked; }
+                       get { return false; }
                }
 
                public bool IsProtected {
index ab32555196a8fb20fe3e28d2a8f46abbb0ad33d4..ff9dd8fd02b9793ce77ad127926b462375d3e359 100755 (executable)
@@ -10,7 +10,7 @@ LIB_MCS_FLAGS = \
                /r:System.Data.dll \
                /r:System.Runtime.Serialization.dll \
                /resource:./src/DbLinq/Schema/Dbml/DbmlSchema.xsd,DbLinq.Schema.Dbml.DbmlSchema.xsd \
-               /d:MONO_STRICT /d:MONO_DEPLOY
+               /d:MONO_STRICT /d:MONO_DEPLOY -warn:1
 
 ifeq (2.0, $(FRAMEWORK_VERSION))
 # This is a .NET 3.5 only assembly, but built during the 2.0 build
index 84016a990286411cda232dce09c75a5522291716..cb382e59519761084b54c3aee43a2c81da4f6abe 100644 (file)
@@ -12,14 +12,14 @@ namespace System.Runtime.Serialization.Json
        {
                TextReader r;
                int line = 1, column = 0;
-               bool raise_on_number_error; // FIXME: use it
+//             bool raise_on_number_error; // FIXME: use it
 
                public JavaScriptReader (TextReader reader, bool raiseOnNumberError)
                {
                        if (reader == null)
                                throw new ArgumentNullException ("reader");
                        this.r = reader;
-                       raise_on_number_error = raiseOnNumberError;
+//                     raise_on_number_error = raiseOnNumberError;
                }
 
                public object Read ()
@@ -228,11 +228,10 @@ namespace System.Runtime.Serialization.Json
                        int exp = 0;
                        if (PeekChar () < 0)
                                throw new ArgumentException ("Invalid JSON numeric literal; incomplete exponent");
-                       bool negexp = false;
+
                        c = PeekChar ();
                        if (c == '-') {
                                ReadChar ();
-                               negexp = true;
                        }
                        else if (c == '+')
                                ReadChar ();
@@ -326,9 +325,8 @@ namespace System.Runtime.Serialization.Json
 
                void Expect (string expected)
                {
-                       int c;
                        for (int i = 0; i < expected.Length; i++)
-                               if ((c = ReadChar ()) != expected [i])
+                               if (ReadChar () != expected [i])
                                        throw JsonError (String.Format ("Expected '{0}', differed at {1}", expected, i));
                }
 
index 09dee5f1e7f6e8dec535d903159953373b6c6f2b..f0cf6c50543a69b59abe8d51bfb93f6a1415fcb8 100644 (file)
@@ -86,7 +86,7 @@ namespace System.Xaml
                        this.root = instance;
 
                        sctx = schemaContext;
-                       this.settings = settings;
+//                     this.settings = settings;
 
                        // check type validity. Note that some checks also needs done at Read() phase. (it is likely FIXME:)
                        if (instance != null) {
@@ -105,7 +105,7 @@ namespace System.Xaml
                bool is_eof;
                object root, root_raw;
                XamlSchemaContext sctx;
-               XamlObjectReaderSettings settings;
+//             XamlObjectReaderSettings settings;
                IValueSerializerContext value_serializer_context;
 
                IEnumerator<NamespaceDeclaration> ns_iterator;
index edcfeefbafa624c4826746ba5d9a6fd9bf9a7685..28393f2f04c6bb5439e475c465f1c31638553a7c 100644 (file)
@@ -88,7 +88,7 @@ namespace System.Xaml
 
                XamlObjectWriterInternal intl;
 
-               int line, column;
+               //int line, column;
                bool lineinfo_was_given;
 
                internal XamlObjectWriterSettings Settings {
@@ -113,8 +113,8 @@ namespace System.Xaml
 
                public void SetLineInfo (int lineNumber, int linePosition)
                {
-                       line = lineNumber;
-                       column = linePosition;
+//                     line = lineNumber;
+//                     column = linePosition;
                        lineinfo_was_given = true;
                }
                
index f3969015e262cc44213da44aa2cc6eefd8fdd0ee..41fd8571825b40787f4137d6fbe5c2367ab24c8a 100644 (file)
@@ -61,11 +61,6 @@ namespace System.Xaml
                        get { return started ? source.Value : null; }
                }
                
-               public void Close ()
-               {
-                       Dispose (true);
-               }
-               
                protected override void Dispose (bool disposing)
                {
                        while (nest > 0)
index 4bd6e0001ba8995498c1f8e4fa1062257778c47f..5daf424f1942bb54195b218d94ef22ac41a746a9 100755 (executable)
@@ -89,7 +89,7 @@ namespace System.Xaml
                        Name = unknownTypeName;
                        PreferredXamlNamespace = unknownTypeNamespace;
                        TypeArguments = typeArguments != null && typeArguments.Count == 0 ? null : typeArguments;
-                       explicit_ns = unknownTypeNamespace;
+//                     explicit_ns = unknownTypeNamespace;
                }
 
                protected XamlType (string typeName, IList<XamlType> typeArguments, XamlSchemaContext schemaContext)
@@ -107,7 +107,7 @@ namespace System.Xaml
 
                Type type, underlying_type;
 
-               string explicit_ns;
+//             string explicit_ns;
 
                // populated properties
                XamlType base_type;
index e6a35ac367b46195e9f0904f4e041c7eb3bfd7bb..e048c99d92294095230345a0a2f8c995dce75753 100755 (executable)
@@ -173,11 +173,11 @@ namespace System.Xaml
                        : base (schemaContext, manager)
                {
                        this.w = w;
-                       this.sctx = schemaContext;
+//                     this.sctx = schemaContext;
                }
                
                XmlWriter w;
-               XamlSchemaContext sctx;
+//             XamlSchemaContext sctx;
                
                // Here's a complication.
                // - local_nss holds namespace declarations that are written *before* current element.
index 9604fdfa1c0f0731c5154ee4aa0333e57be379fe..0c0bbbaa0d8835c1451d39d5d60a04484a013c9b 100644 (file)
@@ -1635,7 +1635,6 @@ namespace System.Net.Sockets {
 #endif
                                        return false;
                        }
-                       return true; // do not use remote endpoint
 #else
                        return false; // < NET_4_0 -> use remote endpoint
 #endif
index 8b96e1e816913f4b5bdba99866a91f5182ada9bd..4d10f991dfc20fcdbed5c13cd615e8cd86c3da6c 100644 (file)
@@ -306,11 +306,7 @@ namespace System.Net
                                return DateTime.ParseExact (date, "r", CultureInfo.InvariantCulture).ToLocalTime ();
                        }
                        set {
-                               if (value == null) {
-                                       webHeaders.RemoveInternal ("Date");
-                               } else {
-                                       webHeaders.RemoveAndAdd ("Date", value.ToUniversalTime ().ToString ("r", CultureInfo.InvariantCulture));
-                               }
+                               webHeaders.RemoveAndAdd ("Date", value.ToUniversalTime ().ToString ("r", CultureInfo.InvariantCulture));
                        }
                }
 #endif