Skip to content

Commit

Permalink
[System] Fix build warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
migueldeicaza authored and duncanmak committed Jun 10, 2014
1 parent 16c3b35 commit 833b09f
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 34 deletions.
Expand Up @@ -372,7 +372,6 @@ public static int TakeFromAny (BlockingCollection<T>[] collections, out T item)
CheckArray (collections);
WaitHandle[] wait_table = null;
while (true) {
int index = 0;
for (int i = 0; i < collections.Length; ++i) {
if (collections [i].TryTake (out item))
return i;
Expand All @@ -384,7 +383,6 @@ public static int TakeFromAny (BlockingCollection<T>[] collections, out T item)
}
WaitHandle.WaitAny (wait_table);
}
return -1;
}

public static int TakeFromAny (BlockingCollection<T>[] collections, out T item, CancellationToken cancellationToken)
Expand All @@ -393,7 +391,6 @@ public static int TakeFromAny (BlockingCollection<T>[] collections, out T item,
CheckArray (collections);
WaitHandle[] wait_table = null;
while (true) {
int index = 0;
for (int i = 0; i < collections.Length; ++i) {
if (collections [i].TryTake (out item))
return i;
Expand All @@ -408,8 +405,6 @@ public static int TakeFromAny (BlockingCollection<T>[] collections, out T item,
WaitHandle.WaitAny (wait_table);
cancellationToken.ThrowIfCancellationRequested ();
}

return -1;
}

public static int TryTakeFromAny (BlockingCollection<T>[] collections, out T item)
Expand Down
28 changes: 1 addition & 27 deletions mcs/class/System/System.Diagnostics/TraceImpl.cs
Expand Up @@ -41,7 +41,6 @@ namespace System.Diagnostics {
internal class TraceImplSettings {
public const string Key = ".__TraceInfoSettingsKey__.";

public bool AutoFlush;
//public int IndentLevel;
public int IndentSize = 4;
public TraceListenerCollection Listeners = new TraceListenerCollection (false);
Expand All @@ -61,36 +60,11 @@ static class TraceImpl {

private static bool autoFlush;

#if TARGET_JVM
static readonly LocalDataStoreSlot _indentLevelStore = System.Threading.Thread.AllocateDataSlot ();
static readonly LocalDataStoreSlot _indentSizeStore = System.Threading.Thread.AllocateDataSlot ();

private static int indentLevel {
get {
object o = System.Threading.Thread.GetData (_indentLevelStore);
if (o == null)
return 0;
return (int) o;
}
set { System.Threading.Thread.SetData (_indentLevelStore, value); }
}

private static int indentSize {
get {
object o = System.Threading.Thread.GetData (_indentSizeStore);
if (o == null)
return 0;
return (int) o;
}
set { System.Threading.Thread.SetData (_indentSizeStore, value); }
}
#else
[ThreadStatic]
private static int indentLevel;

[ThreadStatic]
private static int indentSize;
#endif

#if MOBILE
static TraceListenerCollection listeners = new TraceListenerCollection (true);
Expand Down Expand Up @@ -205,7 +179,7 @@ private static void InitOnce ()

d.Remove (TraceImplSettings.Key);

autoFlush = s.AutoFlush;
// autoFlush = s.AutoFlush;
// indentLevel = s.IndentLevel;
indentSize = s.IndentSize;
listeners = s.Listeners;
Expand Down
2 changes: 1 addition & 1 deletion mcs/class/System/System.Net.Mail/SmtpClient.cs
Expand Up @@ -35,6 +35,7 @@
#else
extern alias PrebuiltSystem;
using X509CertificateCollection = PrebuiltSystem::System.Security.Cryptography.X509Certificates.X509CertificateCollection;
using System.Security.Cryptography.X509Certificates;
#endif

#endif
Expand All @@ -47,7 +48,6 @@
using System.Net;
using System.Net.Mime;
using System.Net.Sockets;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading;
using System.Reflection;
Expand Down
Expand Up @@ -93,6 +93,8 @@ internal static string ReadLine (string path)
[MonoTODO("Only works on Linux. Returns 0 on other systems.")]
public static int LoopbackInterfaceIndex {
get {
// Disable warning for code not reachable, due to runningOnUnix being always true on Monotouch
#pragma warning disable 162
if (runningOnUnix) {
try {
return UnixNetworkInterface.IfNameToIndex ("lo");
Expand All @@ -101,6 +103,7 @@ internal static string ReadLine (string path)
}
} else
return 0;
#pragma warning restore 162
}
}

Expand Down
3 changes: 2 additions & 1 deletion mcs/class/System/System.Net/WebConnectionStream.cs
Expand Up @@ -699,7 +699,8 @@ internal WebAsyncResult WriteRequestAsync (AsyncCallback callback, object state)
if (!allowBuffering || writeBuffer == null)
return null;

byte[] bytes = writeBuffer.GetBuffer ();
// Keep the call for a potential side-effect of GetBuffer
writeBuffer.GetBuffer ();
int length = (int)writeBuffer.Length;
if (request.ContentLength != -1 && request.ContentLength < length) {
nextReadCalled = true;
Expand Down

0 comments on commit 833b09f

Please sign in to comment.