Browse Source

Fixing default value type constructor warnings.

pull/49/head
Olivia 9 years ago
parent
commit
09f75f4ac2
  1. 2
      src/ImageSharp/Bootstrapper.cs
  2. 1
      src/ImageSharp/Common/Helpers/Guard.cs
  3. 2
      src/ImageSharp/Formats/Jpg/Components/Block8x8F.cs
  4. 8
      src/ImageSharp/Formats/Jpg/JpegDecoderCore.cs

2
src/ImageSharp/Bootstrapper.cs

@ -71,7 +71,7 @@ namespace ImageSharp
Guard.NotNullOrEmpty(format.Extension, nameof(format), "The extension should not be null or empty.");
Guard.NotNullOrEmpty(format.SupportedExtensions, nameof(format), "The supported extensions not be null or empty.");
GuardDuplicate(format);
this.GuardDuplicate(format);
this.imageFormats.Add(format);
}

1
src/ImageSharp/Common/Helpers/Guard.cs

@ -65,6 +65,7 @@ namespace ImageSharp
/// <summary>
/// Verifies, that the enumeration is not null and not empty.
/// </summary>
/// <typeparam name="T">The type of objects in the <paramref name="target"/></typeparam>
/// <param name="target">The target enumeration, which should be checked against being null or empty.</param>
/// <param name="parameterName">Name of the parameter.</param>
/// <param name="message">The error message, if any to add to the exception.</param>

2
src/ImageSharp/Formats/Jpg/Components/Block8x8F.cs

@ -381,7 +381,7 @@ namespace ImageSharp.Formats
internal void Clear()
{
// The cheapest way to do this in C#:
this = new Block8x8F();
this = default(Block8x8F);
}
/// <summary>

8
src/ImageSharp/Formats/Jpg/JpegDecoderCore.cs

@ -1533,12 +1533,12 @@ namespace ImageSharp.Formats
// blocks: the third block in the first row has (bx, by) = (2, 0).
int bx, by, blockCount = 0;
Block8x8F b = new Block8x8F();
Block8x8F temp1 = new Block8x8F();
Block8x8F temp2 = new Block8x8F();
Block8x8F b = default(Block8x8F);
Block8x8F temp1 = default(Block8x8F);
Block8x8F temp2 = default(Block8x8F);
// Tricky way to copy contents of the Unzig static variable to the stack:
StackallocUnzigData unzigOnStack = new StackallocUnzigData();
StackallocUnzigData unzigOnStack = default(StackallocUnzigData);
int* unzigPtr = unzigOnStack.Data;
Marshal.Copy(Unzig, 0, (IntPtr)unzigPtr, 64);

Loading…
Cancel
Save