Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
HJLebbink committed Oct 26, 2019
1 parent 4fe3bcc commit ad39c40
Show file tree
Hide file tree
Showing 15 changed files with 75 additions and 50 deletions.
6 changes: 6 additions & 0 deletions VS/CSHARP/asm-dude-vsix/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,9 @@ dotnet_diagnostic.CA1714.severity = silent

# CA1303: Do not pass literals as localized parameters
dotnet_diagnostic.CA1303.severity = silent

# SA1307: Accessible fields should begin with upper-case letter
dotnet_diagnostic.SA1307.severity = none

# SA1404: Code analysis suppression should have justification
dotnet_diagnostic.SA1404.severity = none
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ private IEnumerable<Completion> Selected_Completions(bool useCapitals, ISet<AsmT
//Debug.WriteLine("INFO: CompletionSource:AugmentCompletionSession: name keyword \"" + entry.Key + "\"");

// by default, the entry.Key is with capitals
string insertionText = useCapitals ? keyword : keyword.ToLower(CultureInfo.InvariantCulture);
string insertionText = useCapitals ? keyword : keyword.ToLowerInvariant();
string archStr = (arch == Arch.ARCH_NONE) ? string.Empty : " [" + ArchTools.ToString(arch) + "]";
string descriptionStr = this.asmDudeTools_.Get_Description(keyword);
descriptionStr = (string.IsNullOrEmpty(descriptionStr)) ? string.Empty : " - " + descriptionStr;
Expand Down
2 changes: 2 additions & 0 deletions VS/CSHARP/asm-dude-vsix/CodeFolding/CodeFoldingTagger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,7 @@ private void Parse()
}
}

[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "<Pending>")]
private static void Add_Start_Region(
string lineContent,
int regionStart,
Expand Down Expand Up @@ -579,6 +580,7 @@ private static void Add_Start_Region(
}
}

[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "<Pending>")]
private static void Add_End_Region(
string lineContent,
int regionEnd,
Expand Down
9 changes: 9 additions & 0 deletions VS/CSHARP/asm-sim-lib/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,12 @@ dotnet_diagnostic.SA1601.severity = silent

# SA1602: Enumeration items should be documented
dotnet_diagnostic.SA1602.severity = silent

# CA1051: Do not declare visible instance fields
dotnet_diagnostic.CA1051.severity = none

# SA1307: Accessible fields should begin with upper-case letter
dotnet_diagnostic.SA1307.severity = none

# IDE0060: Remove unused parameter
dotnet_code_quality_unused_parameters = all:silent
22 changes: 11 additions & 11 deletions VS/CSHARP/asm-sim-lib/Runner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@
// 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:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// 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.

namespace AsmSim
{
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.

// 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.

using System;
using System.Diagnostics.Contracts;
using AsmSim.Mnemonics;
Expand Down
1 change: 1 addition & 0 deletions VS/CSHARP/asm-sim-lib/Tools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,7 @@ public static State Collapse(IEnumerable<State> previousStates)
State result2 = new State(result, prev, true);
if (counter > 2)
{
//TODO HJ 26 okt 2019 investigate dispose
result.Dispose();
}

Expand Down
2 changes: 1 addition & 1 deletion VS/CSHARP/asm-sim-main/DotVisualizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ private static void MyEdgeFormatter(object sender, FormatEdgeEventArgs<string, T
private static void VizFormatVertex(object sender, FormatVertexEventArgs<string> e)
{
Contract.Requires(e != null);
e.VertexFormatter.Label = e.Vertex.ToString();
e.VertexFormatter.Label = e.Vertex.ToString(CultureInfo.InvariantCulture);
}

private sealed class FileDotEngine : IDotEngine
Expand Down
18 changes: 9 additions & 9 deletions VS/CSHARP/asm-sim-main/ProgramZ3.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ global and module parameters. For this purpose we should now use
{ "unsat_core", "false" }, // enable generation of unsat cores
{ "model", "false" }, // enable model generation
{ "proof", "false" }, // enable proof generation
{ "timeout", timeOut.ToString() },
{ "timeout", timeOut.ToString(CultureInfo.InvariantCulture) },
};
return new Tools(settings);
}
Expand Down Expand Up @@ -777,7 +777,7 @@ private static void TestMnemonic()
tools.Quiet = false;
DynamicFlow tree1 = new DynamicFlow(tools);
tree1.Reset(sFlow1, false);
Console.WriteLine(tree1.EndState);
Console.WriteLine(tree1.Create_EndState);
}
if (false)
{
Expand Down Expand Up @@ -809,7 +809,7 @@ private static void TestMnemonic()
State state_FirstLine = tree0.Create_States_Before(lineNumber_JZ, 0);
BranchInfo branchInfo = new BranchInfo(state_FirstLine.Create(Flags.ZF), true);

State state0 = tree0.EndState;
State state0 = tree0.Create_EndState;
state0.BranchInfoStore.Add(branchInfo, true);
Console.WriteLine("State0:" + state0);
}
Expand All @@ -822,7 +822,7 @@ private static void TestMnemonic()
State state_FirstLine = tree1.Create_States_Before(lineNumber_JZ, 0);
BranchInfo branchInfo = new BranchInfo(state_FirstLine.Create(Flags.ZF), false);

State state1 = tree1.EndState;
State state1 = tree1.Create_EndState;
state1.BranchInfoStore.Add(branchInfo, true);
Console.WriteLine("State1:" + state1);
}
Expand Down Expand Up @@ -852,8 +852,8 @@ private static void TestMnemonic()
DynamicFlow tree2 = Runner.Construct_DynamicFlow_Forward(sFlow2, tools);

// Console.WriteLine(tree1.ToString(flow1));
State state1 = tree1.EndState;
State state2 = tree2.EndState;
State state1 = tree1.Create_EndState;
State state2 = tree2.Create_EndState;

Console.WriteLine("state1:" + state1);
Console.WriteLine("state2:" + state2);
Expand Down Expand Up @@ -882,8 +882,8 @@ private static void TestMnemonic()

// Console.WriteLine(tree1.ToString(flow1));

State state1 = tree1.Leafs.ElementAt(0);
State state2 = tree2.Leafs.ElementAt(0);
State state1 = tree1.Create_Leafs.ElementAt(0);
State state2 = tree2.Create_Leafs.ElementAt(0);

Console.WriteLine("state1:" + state1);
Console.WriteLine("state2:" + state2);
Expand Down Expand Up @@ -1020,7 +1020,7 @@ private static void TestDynamicFlow()
}
if (true)
{
State endState = dFlow.EndState;
State endState = dFlow.Create_EndState;
Console.WriteLine("in endState we know:\n" + endState);
}
}
Expand Down
3 changes: 3 additions & 0 deletions VS/CSHARP/asm-tools-lib/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,6 @@ dotnet_diagnostic.SA1516.severity = none

# SA1649: File name should match first type name
dotnet_diagnostic.SA1649.severity = silent

# SA1214: Readonly fields should appear before non-readonly fields
dotnet_diagnostic.SA1214.severity = none
5 changes: 3 additions & 2 deletions VS/CSHARP/unit-tests-asm-sim/Test_BitTricks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ namespace unit_tests_asm_z3
{
using System;
using System.Collections.Generic;
using System.Globalization;
using AsmSim;
using AsmTools;
using Microsoft.VisualStudio.TestTools.UnitTesting;
Expand Down Expand Up @@ -58,7 +59,7 @@ global and module parameters. For this purpose we should now use
{ "unsat_core", "false" }, // enable generation of unsat cores
{ "model", "true" }, // enable model generation
{ "proof", "false" }, // enable proof generation
{ "timeout", timeOut.ToString() },
{ "timeout", timeOut.ToString(CultureInfo.InvariantCulture) },
};
return new Tools(settings);
}
Expand Down Expand Up @@ -119,7 +120,7 @@ public void Test_BitTricks_LegatosMultiplier()
Console.WriteLine("DynamicFlow:\n" + dFlow.ToString(sFlow));
}

State state = dFlow.EndState;
State state = dFlow.Create_EndState;
}

[TestMethod]
Expand Down
3 changes: 2 additions & 1 deletion VS/CSHARP/unit-tests-asm-sim/Test_ExecutionTree.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ namespace unit_tests_asm_z3
{
using System;
using System.Collections.Generic;
using System.Globalization;
using AsmSim;
using AsmTools;
using Microsoft.VisualStudio.TestTools.UnitTesting;
Expand All @@ -40,7 +41,7 @@ private Tools CreateTools(int timeOut = AsmTestTools.DEFAULT_TIMEOUT)
{ "unsat-core", "false" }, // enable generation of unsat cores
{ "model", "false" }, // enable model generation
{ "proof", "false" }, // enable proof generation
{ "timeout", timeOut.ToString() },
{ "timeout", timeOut.ToString(CultureInfo.InvariantCulture) },
};
return new Tools(settings);
}
Expand Down
3 changes: 2 additions & 1 deletion VS/CSHARP/unit-tests-asm-sim/Test_MemZ3.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ namespace unit_tests_asm_z3
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using AsmSim;
using AsmTools;
using Microsoft.VisualStudio.TestTools.UnitTesting;
Expand Down Expand Up @@ -59,7 +60,7 @@ global and module parameters. For this purpose we should now use
{ "unsat_core", "false" }, // enable generation of unsat cores
{ "model", "false" }, // enable model generation
{ "proof", "false" }, // enable proof generation
{ "timeout", timeOut.ToString() },
{ "timeout", timeOut.ToString(CultureInfo.InvariantCulture) },
};
return new Tools(settings);
}
Expand Down
3 changes: 2 additions & 1 deletion VS/CSHARP/unit-tests-asm-sim/Test_Mnemonic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ namespace unit_tests_asm_z3
{
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Numerics; // for BigInt
using AsmSim;
using AsmTools;
Expand Down Expand Up @@ -64,7 +65,7 @@ global and module parameters. For this purpose we should now use
{ "unsat_core", "false" }, // enable generation of unsat cores
{ "model", "false" }, // enable model generation
{ "proof", "false" }, // enable proof generation
{ "timeout", timeOut.ToString() },
{ "timeout", timeOut.ToString(CultureInfo.InvariantCulture) },
{ "parallel", "true" },
};
return new Tools(settings);
Expand Down
Loading

0 comments on commit ad39c40

Please sign in to comment.