Skip to content

Commit

Permalink
Update to the MIT licensed CCI from github.com/microsoft/cci (#615)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbevain committed Aug 29, 2019
1 parent 12da1bf commit 104b797
Show file tree
Hide file tree
Showing 27 changed files with 348 additions and 352 deletions.
16 changes: 7 additions & 9 deletions symbols/pdb/Microsoft.Cci.Pdb/BitAccess.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
//-----------------------------------------------------------------------------
//
// Copyright (c) Microsoft. All rights reserved.
// This code is licensed under the Microsoft Public License.
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//-----------------------------------------------------------------------------
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System;
using System.IO;
using System.Text;
Expand All @@ -19,6 +12,11 @@ internal class BitAccess {
this.buffer = new byte[capacity];
}

internal BitAccess(byte[] buffer) {
this.buffer = buffer;
offset = 0;
}

internal byte[] Buffer {
get { return buffer; }
}
Expand Down
11 changes: 2 additions & 9 deletions symbols/pdb/Microsoft.Cci.Pdb/BitSet.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
//-----------------------------------------------------------------------------
//
// Copyright (c) Microsoft. All rights reserved.
// This code is licensed under the Microsoft Public License.
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//-----------------------------------------------------------------------------
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System;

namespace Microsoft.Cci.Pdb {
Expand Down
30 changes: 2 additions & 28 deletions symbols/pdb/Microsoft.Cci.Pdb/CvInfo.cs
Original file line number Diff line number Diff line change
@@ -1,32 +1,6 @@
//-----------------------------------------------------------------------------
//
// Copyright (c) Microsoft. All rights reserved.
// This code is licensed under the Microsoft Public License.
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//-----------------------------------------------------------------------------
//
// File: CvInfo.cs
//
// Generic CodeView information definitions
//
// Structures, constants, etc. for accessing and interpreting
// CodeView information.
//
// The master copy of this file resides in the langapi project (in C++).
// All Microsoft projects are required to use the master copy without
// modification. Modification of the master version or a copy
// without consultation with all parties concerned is extremely
// risky.
//
// When this file is modified, the corresponding documentation file
// omfdeb.doc in the langapi project must be updated.
//
// This is a read-only copy of the C++ file converted to C#.
//
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System;

namespace Microsoft.Cci.Pdb {
Expand Down
11 changes: 2 additions & 9 deletions symbols/pdb/Microsoft.Cci.Pdb/DataStream.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
//-----------------------------------------------------------------------------
//
// Copyright (c) Microsoft. All rights reserved.
// This code is licensed under the Microsoft Public License.
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//-----------------------------------------------------------------------------
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System;
using System.IO;

Expand Down
11 changes: 2 additions & 9 deletions symbols/pdb/Microsoft.Cci.Pdb/DbiDbgHdr.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
//-----------------------------------------------------------------------------
//
// Copyright (c) Microsoft. All rights reserved.
// This code is licensed under the Microsoft Public License.
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//-----------------------------------------------------------------------------
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System;

namespace Microsoft.Cci.Pdb {
Expand Down
11 changes: 2 additions & 9 deletions symbols/pdb/Microsoft.Cci.Pdb/DbiHeader.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
//-----------------------------------------------------------------------------
//
// Copyright (c) Microsoft. All rights reserved.
// This code is licensed under the Microsoft Public License.
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//-----------------------------------------------------------------------------
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System;

namespace Microsoft.Cci.Pdb {
Expand Down
11 changes: 2 additions & 9 deletions symbols/pdb/Microsoft.Cci.Pdb/DbiModuleInfo.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
//-----------------------------------------------------------------------------
//
// Copyright (c) Microsoft. All rights reserved.
// This code is licensed under the Microsoft Public License.
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//-----------------------------------------------------------------------------
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System;

namespace Microsoft.Cci.Pdb {
Expand Down
11 changes: 2 additions & 9 deletions symbols/pdb/Microsoft.Cci.Pdb/DbiSecCon.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
//-----------------------------------------------------------------------------
//
// Copyright (c) Microsoft. All rights reserved.
// This code is licensed under the Microsoft Public License.
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//-----------------------------------------------------------------------------
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System;

namespace Microsoft.Cci.Pdb {
Expand Down
27 changes: 10 additions & 17 deletions symbols/pdb/Microsoft.Cci.Pdb/IntHashTable.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
//-----------------------------------------------------------------------------
//
// Copyright (c) Microsoft. All rights reserved.
// This code is licensed under the Microsoft Public License.
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//-----------------------------------------------------------------------------
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System;
using System.Collections;

Expand Down Expand Up @@ -114,14 +107,14 @@ you inserted.
*/

// A typical resize algorithm would pick the smallest prime number in this array
// that is larger than twice the previous capacity.
// Suppose our Hashtable currently has capacity x and enough elements are added
// such that a resize needs to occur. Resizing first computes 2x then finds the
// first prime in the table greater than 2x, i.e. if primes are ordered
// p_1, p_2, …, p_i,…, it finds p_n such that p_n-1 < 2x < p_n.
// Doubling is important for preserving the asymptotic complexity of the
// hashtable operations such as add. Having a prime guarantees that double
// hashing does not lead to infinite loops. IE, your hash function will be
// that is larger than twice the previous capacity.
// Suppose our Hashtable currently has capacity x and enough elements are added
// such that a resize needs to occur. Resizing first computes 2x then finds the
// first prime in the table greater than 2x, i.e. if primes are ordered
// p_1, p_2, …, p_i,…, it finds p_n such that p_n-1 < 2x < p_n.
// Doubling is important for preserving the asymptotic complexity of the
// hashtable operations such as add. Having a prime guarantees that double
// hashing does not lead to infinite loops. IE, your hash function will be
// h1(key) + i*h2(key), 0 <= i < size. h2 and the size must be relatively prime.
private static readonly int[] primes = {
3, 7, 11, 17, 23, 29, 37, 47, 59, 71, 89, 107, 131, 163, 197, 239, 293, 353, 431, 521, 631, 761, 919,
Expand Down
35 changes: 17 additions & 18 deletions symbols/pdb/Microsoft.Cci.Pdb/LICENSE
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
Microsoft Public License (Ms-PL)
The MIT License (MIT)

This license governs use of the accompanying software. If you use the software, you
accept this license. If you do not accept the license, do not use the software.
Copyright (c) Microsoft

1. Definitions
The terms "reproduce," "reproduction," "derivative works," and "distribution" have the
same meaning here as under U.S. copyright law.
A "contribution" is the original software, or any additions or changes to the software.
A "contributor" is any person that distributes its contribution under this license.
"Licensed patents" are a contributor's patent claims that read directly on its contribution.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

2. Grant of Rights
(A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create.
(B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

3. Conditions and Limitations
(A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks.
(B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically.
(C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software.
(D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license.
(E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
11 changes: 2 additions & 9 deletions symbols/pdb/Microsoft.Cci.Pdb/MsfDirectory.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
//-----------------------------------------------------------------------------
//
// Copyright (c) Microsoft. All rights reserved.
// This code is licensed under the Microsoft Public License.
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//-----------------------------------------------------------------------------
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System;

namespace Microsoft.Cci.Pdb {
Expand Down
22 changes: 11 additions & 11 deletions symbols/pdb/Microsoft.Cci.Pdb/PdbConstant.cs
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
//-----------------------------------------------------------------------------
//
// Copyright (c) Microsoft. All rights reserved.
// This code is licensed under the Microsoft Public License.
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//-----------------------------------------------------------------------------
// 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.Runtime.InteropServices;

namespace Microsoft.Cci.Pdb {
/// <summary />
internal class PdbConstant {
internal string name;
internal uint token;
internal object value;

internal PdbConstant(string name, uint token, object value) {
this.name = name;
this.token = token;
this.value = value;
}

internal PdbConstant(BitAccess bits) {
bits.ReadUInt32(out this.token);
byte tag1;
Expand Down Expand Up @@ -78,7 +78,7 @@ internal class PdbConstant {
break;
default:
//TODO: error
break;
break;
}
} else {
//TODO: error
Expand Down
11 changes: 2 additions & 9 deletions symbols/pdb/Microsoft.Cci.Pdb/PdbDebugException.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
//-----------------------------------------------------------------------------
//
// Copyright (c) Microsoft. All rights reserved.
// This code is licensed under the Microsoft Public License.
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//-----------------------------------------------------------------------------
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System;
using System.IO;

Expand Down
11 changes: 2 additions & 9 deletions symbols/pdb/Microsoft.Cci.Pdb/PdbException.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
//-----------------------------------------------------------------------------
//
// Copyright (c) Microsoft. All rights reserved.
// This code is licensed under the Microsoft Public License.
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//-----------------------------------------------------------------------------
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System;
using System.IO;

Expand Down

0 comments on commit 104b797

Please sign in to comment.