From d6310ac8c94dbb9d104702a34a143d19daf9ee7f Mon Sep 17 00:00:00 2001 From: Eric Mellino Date: Mon, 10 Nov 2014 13:44:50 -0800 Subject: [PATCH] Fix License wording, extra line break, and delete unused file --- .../src/System/Numerics/ConstantHelper.cs | 4 +- .../Numerics/GenerationConfig.ttinclude | 4 +- .../src/System/Numerics/Plane.cs | 1 - .../src/System/Numerics/Quaternion.cs | 1 - .../src/System/Numerics/Register.cs | 4 +- .../src/System/Numerics/Vector.cs | 4 +- .../src/System/Numerics/VectorHelper.cs | 161 ------------------ .../tests/GenericVectorTests.cs | 4 +- 8 files changed, 10 insertions(+), 173 deletions(-) delete mode 100644 src/System.Numerics.Vectors/src/System/Numerics/VectorHelper.cs diff --git a/src/System.Numerics.Vectors/src/System/Numerics/ConstantHelper.cs b/src/System.Numerics.Vectors/src/System/Numerics/ConstantHelper.cs index 1ecb55316..826d0d3d4 100644 --- a/src/System.Numerics.Vectors/src/System/Numerics/ConstantHelper.cs +++ b/src/System.Numerics.Vectors/src/System/Numerics/ConstantHelper.cs @@ -1,5 +1,5 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under MIT. See LICENSE in the project root for license information. +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. // This file is auto-generated, do not make permanent modifications. using System.Runtime.CompilerServices; diff --git a/src/System.Numerics.Vectors/src/System/Numerics/GenerationConfig.ttinclude b/src/System.Numerics.Vectors/src/System/Numerics/GenerationConfig.ttinclude index f5af3b757..ac4f272ae 100644 --- a/src/System.Numerics.Vectors/src/System/Numerics/GenerationConfig.ttinclude +++ b/src/System.Numerics.Vectors/src/System/Numerics/GenerationConfig.ttinclude @@ -49,8 +49,8 @@ public void GenerateCopyrightHeader() { -#>// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under MIT. See LICENSE in the project root for license information. +#>// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. // This file is auto-generated, do not make permanent modifications. <#+ } diff --git a/src/System.Numerics.Vectors/src/System/Numerics/Plane.cs b/src/System.Numerics.Vectors/src/System/Numerics/Plane.cs index 598e784f0..f8ff6a057 100644 --- a/src/System.Numerics.Vectors/src/System/Numerics/Plane.cs +++ b/src/System.Numerics.Vectors/src/System/Numerics/Plane.cs @@ -1,7 +1,6 @@ // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. - using System; using System.Globalization; using System.Runtime.CompilerServices; diff --git a/src/System.Numerics.Vectors/src/System/Numerics/Quaternion.cs b/src/System.Numerics.Vectors/src/System/Numerics/Quaternion.cs index 92f402de6..166392594 100644 --- a/src/System.Numerics.Vectors/src/System/Numerics/Quaternion.cs +++ b/src/System.Numerics.Vectors/src/System/Numerics/Quaternion.cs @@ -1,7 +1,6 @@ // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. - using System; using System.Globalization; diff --git a/src/System.Numerics.Vectors/src/System/Numerics/Register.cs b/src/System.Numerics.Vectors/src/System/Numerics/Register.cs index 187d004ee..24f573690 100644 --- a/src/System.Numerics.Vectors/src/System/Numerics/Register.cs +++ b/src/System.Numerics.Vectors/src/System/Numerics/Register.cs @@ -1,5 +1,5 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under MIT. See LICENSE in the project root for license information. +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. // This file is auto-generated, do not make permanent modifications. using System.Runtime.InteropServices; diff --git a/src/System.Numerics.Vectors/src/System/Numerics/Vector.cs b/src/System.Numerics.Vectors/src/System/Numerics/Vector.cs index 8be844d0e..588e0187c 100644 --- a/src/System.Numerics.Vectors/src/System/Numerics/Vector.cs +++ b/src/System.Numerics.Vectors/src/System/Numerics/Vector.cs @@ -1,5 +1,5 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under MIT. See LICENSE in the project root for license information. +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. // This file is auto-generated, do not make permanent modifications. using System; diff --git a/src/System.Numerics.Vectors/src/System/Numerics/VectorHelper.cs b/src/System.Numerics.Vectors/src/System/Numerics/VectorHelper.cs deleted file mode 100644 index 6fe36dc9e..000000000 --- a/src/System.Numerics.Vectors/src/System/Numerics/VectorHelper.cs +++ /dev/null @@ -1,161 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -namespace System.Numerics { - using System.Globalization; - using System.Runtime.CompilerServices; - using System.Text; - /// - /// This class contains some helper methods for generic and fixed type vectors. - /// The intent of this class is to allow for code sharing and in cases where it is not trivial to keep - /// similar implementations of the same method localized (for generic and fixed type vectors). - /// - internal static class VectorHelper { - - public static string FixedVectorToString(string format, IFormatProvider formatProvider, params Single[] components) { - StringBuilder ret = new StringBuilder(); - string separator = NumberFormatInfo.GetInstance(formatProvider).NumberGroupSeparator + " "; - ret.Append("<"); - for (int i = 0; i < components.Length; i++) { - ret.Append(components[i].ToString(format, formatProvider)); - if (i != components.Length - 1) - ret.Append(separator); - } - ret.Append(">"); - return ret.ToString(); - } - - public static string GenericVectorToString(string format, IFormatProvider formatProvider, Vector values) where T : struct { - StringBuilder ret = new StringBuilder(); - string separator = NumberFormatInfo.GetInstance(formatProvider).NumberGroupSeparator + " "; - ret.Append("<"); - for (int i = 0; i < Vector.Length; i++) { - ret.Append(((IFormattable)values[i]).ToString(format, formatProvider)); - if (i != Vector.Length - 1) - ret.Append(separator); - } - ret.Append(">"); - return ret.ToString(); - } - - public static int FixedVectorHashCode(params Single[] components) { - int hash = 0; - for (int i = 0; i < components.Length; i++) { - hash = CombineHashCodes(hash, components[i].GetHashCode()); - } - return hash; - } - - public static int GenericVectorHashCode(Vector values) where T : struct { - int hash = 0; - for (int i = 0; i < Vector.Length; i++) { - hash = CombineHashCodes(hash, values[i].GetHashCode()); - } - return hash; - } - - private static int CombineHashCodes(int h1, int h2) { - return (((h1 << 5) + h1) ^ h2); - } - - [MethodImplAttribute(MethodImplOptions.AggressiveInlining)] - public static Byte GetByteWithAllBitsSet() - { - Byte f = 0; - unsafe - { - unchecked - { - *((byte*)&f) = 0xff; - } - } - return f; - } - - [MethodImplAttribute(MethodImplOptions.AggressiveInlining)] - public static SByte GetSByteWithAllBitsSet() - { - SByte f = 0; - unsafe - { - unchecked - { - *((byte*)&f) = 0xff; - } - } - return f; - } - - [MethodImplAttribute(MethodImplOptions.AggressiveInlining)] - public static UInt16 GetUInt16WithAllBitsSet() - { - UInt16 f = 0; - unsafe - { - unchecked - { - *((UInt16*)&f) = (UInt16)0xffff; - } - } - return f; - } - - [MethodImplAttribute(MethodImplOptions.AggressiveInlining)] - public static Int16 GetInt16WithAllBitsSet() - { - Int16 f = 0; - unsafe - { - unchecked - { - *((UInt16*)&f) = (UInt16)0xffff; - } - } - return f; - } - - [MethodImplAttribute(MethodImplOptions.AggressiveInlining)] - public static Single GetSingleWithAllBitsSet() { - Single f = 0.0f; - unsafe { - unchecked { - *((int*)&f) = (int)0xffffffff; - } - } - return f; - } - - [MethodImplAttribute(MethodImplOptions.AggressiveInlining)] - public static Int32 GetInt32WithAllBitsSet() { - Int32 f = 0; - unsafe { - unchecked { - *((int*)&f) = (int)0xffffffff; - } - } - return f; - } - - [MethodImplAttribute(MethodImplOptions.AggressiveInlining)] - public static Int64 GetInt64WithAllBitsSet() { - Int64 f = 0L; - unsafe { - unchecked { - *((Int64*)&f) = (Int64)(0xffffffffffffffff); - } - } - return f; - } - - [MethodImplAttribute(MethodImplOptions.AggressiveInlining)] - public static Double GetDoubleWithAllBitsSet() { - Double f = 0.0; - unsafe { - unchecked { - *((Int64*)&f) = (Int64)(0xffffffffffffffff); - } - } - return f; - } - } -} diff --git a/src/System.Numerics.Vectors/tests/GenericVectorTests.cs b/src/System.Numerics.Vectors/tests/GenericVectorTests.cs index 821fea6e3..71cb9fcac 100644 --- a/src/System.Numerics.Vectors/tests/GenericVectorTests.cs +++ b/src/System.Numerics.Vectors/tests/GenericVectorTests.cs @@ -1,5 +1,5 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under MIT. See LICENSE in the project root for license information. +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. // This file is auto-generated, do not make permanent modifications. using System;