Remove unused variables and disable warnings that we know are

innocuous.
This commit is contained in:
2015-02-20 01:34:22 +00:00
parent 4706f16cab
commit b03717e877
8 changed files with 37 additions and 16 deletions

View File

@@ -1,3 +1,9 @@
2015-02-20 Natalia Portillo <claunia@claunia.com>
* IssueTest.cs:
Remove unused variables and disable warnings that we know
are innocuous.
2015-02-20 Natalia Portillo <claunia@claunia.com> 2015-02-20 Natalia Portillo <claunia@claunia.com>
* plist-cil.test.csproj: * plist-cil.test.csproj:

View File

@@ -99,13 +99,17 @@ namespace plistcil.test
[Test] [Test]
public static void TestIssue30() public static void TestIssue30()
{ {
#pragma warning disable 219
NSArray arr = (NSArray)PropertyListParser.Parse(new FileInfo("test-files/issue30.plist")); NSArray arr = (NSArray)PropertyListParser.Parse(new FileInfo("test-files/issue30.plist"));
#pragma warning restore 219
} }
[Test] [Test]
public static void TestIssue33() public static void TestIssue33()
{ {
#pragma warning disable 219
NSDictionary dict = (NSDictionary)PropertyListParser.Parse(new FileInfo("test-files/issue33.pbxproj")); NSDictionary dict = (NSDictionary)PropertyListParser.Parse(new FileInfo("test-files/issue33.pbxproj"));
#pragma warning restore 219
} }
[Test] [Test]

View File

@@ -343,7 +343,7 @@ namespace Claunia.PropertyList
{ {
return ParseObject(); return ParseObject();
} }
catch (IndexOutOfRangeException ex) catch (IndexOutOfRangeException)
{ {
throw new FormatException(String.Format("Reached end of input unexpectedly at {0}.", index)); throw new FormatException(String.Format("Reached end of input unexpectedly at {0}.", index));
} }
@@ -381,7 +381,7 @@ namespace Claunia.PropertyList
{ {
return new NSDate(quotedString); return new NSDate(quotedString);
} }
catch (Exception ex) catch (Exception)
{ {
//not a date? --> return string //not a date? --> return string
return new NSString(quotedString); return new NSString(quotedString);
@@ -552,7 +552,7 @@ namespace Claunia.PropertyList
{ {
return new NSDate(numericalString); return new NSDate(numericalString);
} }
catch (Exception ex) catch (Exception)
{ {
//An exception occurs if the string is not a date but just a string //An exception occurs if the string is not a date but just a string
} }
@@ -598,7 +598,7 @@ namespace Claunia.PropertyList
{ {
unescapedString = ParseQuotedString(quotedString); unescapedString = ParseQuotedString(quotedString);
} }
catch (Exception ex) catch (Exception)
{ {
throw new FormatException(String.Format("The quoted string could not be parsed at {0}.", index)); throw new FormatException(String.Format("The quoted string could not be parsed at {0}.", index));
} }
@@ -607,11 +607,6 @@ namespace Claunia.PropertyList
return unescapedString; return unescapedString;
} }
/**
* Used to encode the parsed strings
*/
static Encoding asciiEncoder;
/// <summary> /// <summary>
/// Parses a string according to the format specified for ASCII property lists. /// Parses a string according to the format specified for ASCII property lists.
/// Such strings can contain escape sequences which are unescaped in this method. /// Such strings can contain escape sequences which are unescaped in this method.

View File

@@ -445,7 +445,9 @@ namespace Claunia.PropertyList
foreach (byte b in bytes) foreach (byte b in bytes)
{ {
l <<= 8; l <<= 8;
#pragma warning disable 675
l |= b & 0xFF; l |= b & 0xFF;
#pragma warning restore 675
} }
l &= 0xFFFFFFFFL; l &= 0xFFFFFFFFL;
return l; return l;
@@ -464,7 +466,9 @@ namespace Claunia.PropertyList
for (int i = startIndex; i < endIndex; i++) for (int i = startIndex; i < endIndex; i++)
{ {
l <<= 8; l <<= 8;
#pragma warning disable 675
l |= bytes[i] & 0xFF; l |= bytes[i] & 0xFF;
#pragma warning restore 675
} }
l &= 0xFFFFFFFFL; l &= 0xFFFFFFFFL;
return l; return l;
@@ -481,7 +485,9 @@ namespace Claunia.PropertyList
foreach (byte b in bytes) foreach (byte b in bytes)
{ {
l <<= 8; l <<= 8;
#pragma warning disable 675
l |= b & 0xFF; l |= b & 0xFF;
#pragma warning restore 675
} }
return l; return l;
} }
@@ -499,7 +505,9 @@ namespace Claunia.PropertyList
for (int i = startIndex; i < endIndex; i++) for (int i = startIndex; i < endIndex; i++)
{ {
l <<= 8; l <<= 8;
#pragma warning disable 675
l |= bytes[i] & 0xFF; l |= bytes[i] & 0xFF;
#pragma warning restore 675
} }
return l; return l;
} }

View File

@@ -1,3 +1,13 @@
2015-02-20 Natalia Portillo <claunia@claunia.com>
* NSDate.cs:
* NSObject.cs:
* NSNumber.cs:
* ASCIIPropertyListParser.cs:
* BinaryPropertyListParser.cs:
Remove unused variables and disable warnings that we know
are innocuous.
2015-02-20 Natalia Portillo <claunia@claunia.com> 2015-02-20 Natalia Portillo <claunia@claunia.com>
* plist-cil.csproj: * plist-cil.csproj:

View File

@@ -55,7 +55,7 @@ namespace Claunia.PropertyList
{ {
return DateTime.ParseExact(textRepresentation, sdfDefault, provider); return DateTime.ParseExact(textRepresentation, sdfDefault, provider);
} }
catch (FormatException ex) catch (FormatException)
{ {
return DateTime.ParseExact(textRepresentation, sdfGnuStep, provider); return DateTime.ParseExact(textRepresentation, sdfGnuStep, provider);
} }
@@ -111,8 +111,6 @@ namespace Claunia.PropertyList
/// <param name="d">The date</param> /// <param name="d">The date</param>
public NSDate(DateTime d) public NSDate(DateTime d)
{ {
if (d == null)
throw new ArgumentException("Date cannot be null", "d");
date = d; date = d;
} }

View File

@@ -109,7 +109,7 @@ namespace Claunia.PropertyList
doubleValue = longValue = l; doubleValue = longValue = l;
type = INTEGER; type = INTEGER;
} }
catch (Exception ex) catch (Exception)
{ {
try try
{ {
@@ -117,7 +117,7 @@ namespace Claunia.PropertyList
longValue = (long)Math.Round(doubleValue); longValue = (long)Math.Round(doubleValue);
type = REAL; type = REAL;
} }
catch (Exception ex2) catch (Exception)
{ {
try try
{ {
@@ -129,7 +129,7 @@ namespace Claunia.PropertyList
type = BOOLEAN; type = BOOLEAN;
doubleValue = longValue = boolValue ? 1 : 0; doubleValue = longValue = boolValue ? 1 : 0;
} }
catch (Exception ex3) catch (Exception)
{ {
throw new ArgumentException("The given string neither represents a double, an int nor a bool value."); throw new ArgumentException("The given string neither represents a double, an int nor a bool value.");
} }

View File

@@ -366,7 +366,7 @@ namespace Claunia.PropertyList
return new NSData(ms.ToArray()); return new NSData(ms.ToArray());
} }
} }
catch (IOException ex) catch (IOException)
{ {
throw new SystemException("The given object of class " + o.GetType() + " could not be serialized and stored in a NSData object."); throw new SystemException("The given object of class " + o.GetType() + " could not be serialized and stored in a NSData object.");
} }