diff --git a/plist-cil.test/ChangeLog b/plist-cil.test/ChangeLog index 1b3df4f..1189d38 100644 --- a/plist-cil.test/ChangeLog +++ b/plist-cil.test/ChangeLog @@ -1,3 +1,9 @@ +2015-02-20 Natalia Portillo + + * IssueTest.cs: + Remove unused variables and disable warnings that we know + are innocuous. + 2015-02-20 Natalia Portillo * plist-cil.test.csproj: diff --git a/plist-cil.test/IssueTest.cs b/plist-cil.test/IssueTest.cs index b31615c..134cb53 100644 --- a/plist-cil.test/IssueTest.cs +++ b/plist-cil.test/IssueTest.cs @@ -99,13 +99,17 @@ namespace plistcil.test [Test] public static void TestIssue30() { + #pragma warning disable 219 NSArray arr = (NSArray)PropertyListParser.Parse(new FileInfo("test-files/issue30.plist")); + #pragma warning restore 219 } [Test] public static void TestIssue33() { + #pragma warning disable 219 NSDictionary dict = (NSDictionary)PropertyListParser.Parse(new FileInfo("test-files/issue33.pbxproj")); + #pragma warning restore 219 } [Test] diff --git a/plist-cil/ASCIIPropertyListParser.cs b/plist-cil/ASCIIPropertyListParser.cs index e1af2af..de8590e 100644 --- a/plist-cil/ASCIIPropertyListParser.cs +++ b/plist-cil/ASCIIPropertyListParser.cs @@ -343,7 +343,7 @@ namespace Claunia.PropertyList { return ParseObject(); } - catch (IndexOutOfRangeException ex) + catch (IndexOutOfRangeException) { throw new FormatException(String.Format("Reached end of input unexpectedly at {0}.", index)); } @@ -381,7 +381,7 @@ namespace Claunia.PropertyList { return new NSDate(quotedString); } - catch (Exception ex) + catch (Exception) { //not a date? --> return string return new NSString(quotedString); @@ -552,7 +552,7 @@ namespace Claunia.PropertyList { return new NSDate(numericalString); } - catch (Exception ex) + catch (Exception) { //An exception occurs if the string is not a date but just a string } @@ -598,7 +598,7 @@ namespace Claunia.PropertyList { unescapedString = ParseQuotedString(quotedString); } - catch (Exception ex) + catch (Exception) { throw new FormatException(String.Format("The quoted string could not be parsed at {0}.", index)); } @@ -607,11 +607,6 @@ namespace Claunia.PropertyList return unescapedString; } - /** - * Used to encode the parsed strings - */ - static Encoding asciiEncoder; - /// /// Parses a string according to the format specified for ASCII property lists. /// Such strings can contain escape sequences which are unescaped in this method. diff --git a/plist-cil/BinaryPropertyListParser.cs b/plist-cil/BinaryPropertyListParser.cs index 337b619..99adf94 100644 --- a/plist-cil/BinaryPropertyListParser.cs +++ b/plist-cil/BinaryPropertyListParser.cs @@ -445,7 +445,9 @@ namespace Claunia.PropertyList foreach (byte b in bytes) { l <<= 8; + #pragma warning disable 675 l |= b & 0xFF; + #pragma warning restore 675 } l &= 0xFFFFFFFFL; return l; @@ -464,7 +466,9 @@ namespace Claunia.PropertyList for (int i = startIndex; i < endIndex; i++) { l <<= 8; + #pragma warning disable 675 l |= bytes[i] & 0xFF; + #pragma warning restore 675 } l &= 0xFFFFFFFFL; return l; @@ -481,7 +485,9 @@ namespace Claunia.PropertyList foreach (byte b in bytes) { l <<= 8; + #pragma warning disable 675 l |= b & 0xFF; + #pragma warning restore 675 } return l; } @@ -499,7 +505,9 @@ namespace Claunia.PropertyList for (int i = startIndex; i < endIndex; i++) { l <<= 8; + #pragma warning disable 675 l |= bytes[i] & 0xFF; + #pragma warning restore 675 } return l; } diff --git a/plist-cil/ChangeLog b/plist-cil/ChangeLog index bd80484..d12e4f7 100644 --- a/plist-cil/ChangeLog +++ b/plist-cil/ChangeLog @@ -1,3 +1,13 @@ +2015-02-20 Natalia Portillo + + * 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 * plist-cil.csproj: diff --git a/plist-cil/NSDate.cs b/plist-cil/NSDate.cs index 045f72f..3732ea0 100644 --- a/plist-cil/NSDate.cs +++ b/plist-cil/NSDate.cs @@ -55,7 +55,7 @@ namespace Claunia.PropertyList { return DateTime.ParseExact(textRepresentation, sdfDefault, provider); } - catch (FormatException ex) + catch (FormatException) { return DateTime.ParseExact(textRepresentation, sdfGnuStep, provider); } @@ -111,8 +111,6 @@ namespace Claunia.PropertyList /// The date public NSDate(DateTime d) { - if (d == null) - throw new ArgumentException("Date cannot be null", "d"); date = d; } diff --git a/plist-cil/NSNumber.cs b/plist-cil/NSNumber.cs index bb5b098..9a4e4df 100644 --- a/plist-cil/NSNumber.cs +++ b/plist-cil/NSNumber.cs @@ -109,7 +109,7 @@ namespace Claunia.PropertyList doubleValue = longValue = l; type = INTEGER; } - catch (Exception ex) + catch (Exception) { try { @@ -117,7 +117,7 @@ namespace Claunia.PropertyList longValue = (long)Math.Round(doubleValue); type = REAL; } - catch (Exception ex2) + catch (Exception) { try { @@ -129,7 +129,7 @@ namespace Claunia.PropertyList type = BOOLEAN; 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."); } diff --git a/plist-cil/NSObject.cs b/plist-cil/NSObject.cs index f78c36e..49a2383 100644 --- a/plist-cil/NSObject.cs +++ b/plist-cil/NSObject.cs @@ -366,7 +366,7 @@ namespace Claunia.PropertyList 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."); }