Skip to content

Commit 12c1fa8

Browse files
committed
Code style fixes
***NO_CI***
1 parent 9fc213c commit 12c1fa8

11 files changed

+88
-96
lines changed

MetadataProcessor.Shared/Utility/LoadHintsAssemblyResolver.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public override AssemblyDefinition Resolve(AssemblyNameReference name)
4646
return null;
4747
}
4848
}
49-
catch(System.IO.DirectoryNotFoundException)
49+
catch (System.IO.DirectoryNotFoundException)
5050
{
5151
Console.Error.WriteLine(
5252
$"Unable to find assembly '{name.Name}' in load hints collection.");
@@ -58,7 +58,7 @@ public override AssemblyDefinition Resolve(AssemblyNameReference name)
5858
throw;
5959
}
6060
}
61-
61+
6262
/// <inheritdoc/>
6363
public override AssemblyDefinition Resolve(AssemblyNameReference name, ReaderParameters parameters)
6464
{

MetadataProcessor.Shared/Utility/NativeMethodsCrc.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public uint CurrentCrc
4444
{
4545
get
4646
{
47-
if(_methodsWithNativeImplementation > 0)
47+
if (_methodsWithNativeImplementation > 0)
4848
{
4949
return _currentCrc;
5050
}
@@ -60,7 +60,7 @@ public void UpdateCrc(MethodDefinition method)
6060
var type = method.DeclaringType;
6161

6262
if (type.IncludeInStub() &&
63-
(method.RVA == 0 && !method.IsAbstract) )
63+
(method.RVA == 0 && !method.IsAbstract))
6464
{
6565
_currentCrc = Crc32.Compute(_name, CurrentCrc);
6666
_currentCrc = Crc32.Compute(Encoding.ASCII.GetBytes(GetClassName(type)), CurrentCrc);
@@ -116,7 +116,7 @@ private static string GetParameterType(
116116
bool continueProcessing = true;
117117

118118
// special processing for arrays
119-
if(parameterType.IsArray)
119+
if (parameterType.IsArray)
120120
{
121121
typeName += nanoCLR_DataType.DATATYPE_SZARRAY + "_" + GetParameterType(parameterType.GetElementType());
122122
continueProcessing = false;
@@ -137,7 +137,7 @@ private static string GetParameterType(
137137
}
138138
continueProcessing = false;
139139
}
140-
else if(!parameterType.IsPrimitive)
140+
else if (!parameterType.IsPrimitive)
141141
{
142142
// TBD
143143
continueProcessing = true;
@@ -158,7 +158,7 @@ internal static string GetnanoClrTypeName(TypeReference parameterType)
158158
// try getting primitive type
159159

160160
nanoCLR_DataType myType;
161-
if(nanoSignaturesTable.PrimitiveTypes.TryGetValue(parameterType.FullName, out myType))
161+
if (nanoSignaturesTable.PrimitiveTypes.TryGetValue(parameterType.FullName, out myType))
162162
{
163163
if (myType == nanoCLR_DataType.DATATYPE_LAST_PRIMITIVE)
164164
{
@@ -184,14 +184,14 @@ internal static string GetnanoClrTypeName(TypeReference parameterType)
184184
else
185185
{
186186
// type is not primitive
187-
187+
188188
if (parameterType.IsGenericParameter)
189189
{
190190
// check if it's generic
191191
return "DATATYPE_GENERICTYPE";
192192
}
193193
else
194-
{
194+
{
195195
// this is not a generic, get full qualified type name
196196
return parameterType.FullName.Replace(".", String.Empty);
197197
}

MetadataProcessor.Shared/Utility/nanoBitmapProcessor.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ private enum BitmapType
2929
WindowsBmp = 3,
3030
// Not supported or unknown bitmap type
3131
UnKnown = 255
32-
}
32+
}
3333

34-
public nanoBitmapProcessor(
35-
Bitmap bitmap)
34+
public nanoBitmapProcessor(
35+
Bitmap bitmap)
3636
{
3737
_bitmap = bitmap;
3838
}
3939

40-
public void Process(
40+
public void Process(
4141
nanoBinaryWriter writer)
4242
{
4343
// CLR_GFX_BitmapDescription header as required by the native side
@@ -87,7 +87,7 @@ public void Process(
8787
}
8888
}
8989

90-
private BitmapType GetnanoImageFormat(
90+
private BitmapType GetnanoImageFormat(
9191
ImageFormat rawFormat)
9292
{
9393
// Any windows bitmap format is marked for conversion to nanoCLRBitmap ( i.e. Format16bppRgb565 )

MetadataProcessor.Shared/Utility/nanoDependencyGeneratorWriter.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ internal sealed class nanoDependencyGeneratorWriter
1919
private readonly AssemblyDefinition _assemblyDefinition;
2020

2121
public nanoDependencyGeneratorWriter(
22-
AssemblyDefinition assemblyDefinition,
22+
AssemblyDefinition assemblyDefinition,
2323
nanoTablesContext context)
2424
{
2525
_context = context;
2626
_assemblyDefinition = assemblyDefinition;
27-
}
27+
}
2828

29-
public void Write(
30-
XmlWriter writer)
29+
public void Write(
30+
XmlWriter writer)
3131
{
3232
writer.WriteStartElement("AssemblyGraph");
3333

@@ -38,7 +38,7 @@ public void Write(
3838
writer.WriteAttributeString("Flags", "0x00000000");
3939

4040
// references
41-
foreach(var a in _context.AssemblyDefinition.MainModule.AssemblyReferences)
41+
foreach (var a in _context.AssemblyDefinition.MainModule.AssemblyReferences)
4242
{
4343
writer.WriteStartElement("AssemblyRef");
4444
writer.WriteAttributeString("Name", a.Name);
@@ -105,7 +105,7 @@ public void Write(
105105
//writer.WriteStartElement("Classes");
106106
//_context.TypeDefinitionTable.ForEachItems((token, item) => WriteClassInfo(writer, token, item));
107107

108-
writer.WriteEndDocument();
108+
writer.WriteEndDocument();
109109
}
110110

111111
private string ComputeAssemblyHash(ModuleDefinition module)

MetadataProcessor.Shared/Utility/nanoPdbxFileWriter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public void Write(
3838

3939
_context.TypeDefinitionTable.ForEachItems((token, item) => WriteClassInfo(writer, token, item));
4040

41-
writer.WriteEndDocument();
41+
writer.WriteEndDocument();
4242
}
4343

4444
private void WriteVersionInfo(

MetadataProcessor.Shared/Utility/nanoStringsConstants.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -903,7 +903,7 @@ public static string TryGetString(ushort index)
903903
/* 035A */ "value__",
904904
/* 035B */ "yearMonthPattern",
905905
}
906-
.Select((value, index) => new {value, index = (ushort) (0xFFFF - index)})
906+
.Select((value, index) => new { value, index = (ushort)(0xFFFF - index) })
907907
.ToDictionary(item => item.value, item => item.index, StringComparer.Ordinal);
908908
}
909909
}

MetadataProcessor.Shared/Utility/nanoTypeDefinitionFlags.cs

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -17,64 +17,64 @@ internal enum nanoTypeDefinitionFlags : ushort
1717
TD_Scope_None = 0x0000,
1818

1919
// Class is public scope.
20-
TD_Scope_NotPublic = 0x0000,
20+
TD_Scope_NotPublic = 0x0000,
2121

2222
// Class is public scope.
23-
TD_Scope_Public = 0x0001,
23+
TD_Scope_Public = 0x0001,
2424
// Class is nested with public visibility.
25-
TD_Scope_NestedPublic = 0x0002,
25+
TD_Scope_NestedPublic = 0x0002,
2626
// Class is nested with private visibility.
27-
TD_Scope_NestedPrivate = 0x0003,
27+
TD_Scope_NestedPrivate = 0x0003,
2828
// Class is nested with family visibility.
29-
TD_Scope_NestedFamily = 0x0004,
29+
TD_Scope_NestedFamily = 0x0004,
3030
// Class is nested with assembly visibility.
31-
TD_Scope_NestedAssembly = 0x0005,
31+
TD_Scope_NestedAssembly = 0x0005,
3232
// Class is nested with family and assembly visibility.
33-
TD_Scope_NestedFamANDAssem = 0x0006,
33+
TD_Scope_NestedFamANDAssem = 0x0006,
3434
// Class is nested with family or assembly visibility.
35-
TD_Scope_NestedFamORAssem = 0x0007,
35+
TD_Scope_NestedFamORAssem = 0x0007,
3636

3737
/// <summary>
3838
/// Mask for scope flags
3939
/// </summary>
4040
TD_Scope =
41-
TD_Scope_NotPublic |
42-
TD_Scope_Public |
43-
TD_Scope_NestedPublic |
44-
TD_Scope_NestedPrivate |
45-
TD_Scope_NestedFamily |
46-
TD_Scope_NestedAssembly |
47-
TD_Scope_NestedFamANDAssem |
41+
TD_Scope_NotPublic |
42+
TD_Scope_Public |
43+
TD_Scope_NestedPublic |
44+
TD_Scope_NestedPrivate |
45+
TD_Scope_NestedFamily |
46+
TD_Scope_NestedAssembly |
47+
TD_Scope_NestedFamANDAssem |
4848
TD_Scope_NestedFamORAssem,
4949

50-
TD_Serializable = 0x0008,
50+
TD_Serializable = 0x0008,
5151

52-
TD_Semantics_Class = 0x0000,
53-
TD_Semantics_ValueType = 0x0010,
54-
TD_Semantics_Interface = 0x0020,
55-
TD_Semantics_Enum = 0x0030,
52+
TD_Semantics_Class = 0x0000,
53+
TD_Semantics_ValueType = 0x0010,
54+
TD_Semantics_Interface = 0x0020,
55+
TD_Semantics_Enum = 0x0030,
5656

5757
/// <summary>
5858
/// Mask for semantics flags
5959
/// </summary>
6060
TD_Semantics =
61-
TD_Semantics_Class |
62-
TD_Semantics_ValueType |
63-
TD_Semantics_Interface |
61+
TD_Semantics_Class |
62+
TD_Semantics_ValueType |
63+
TD_Semantics_Interface |
6464
TD_Semantics_Enum,
6565

66-
TD_Abstract = 0x0040,
67-
TD_Sealed = 0x0080,
66+
TD_Abstract = 0x0040,
67+
TD_Sealed = 0x0080,
6868

69-
TD_SpecialName = 0x0100,
70-
TD_Delegate = 0x0200,
71-
TD_MulticastDelegate = 0x0400,
69+
TD_SpecialName = 0x0100,
70+
TD_Delegate = 0x0200,
71+
TD_MulticastDelegate = 0x0400,
7272

73-
TD_Patched = 0x0800,
73+
TD_Patched = 0x0800,
7474

75-
TD_BeforeFieldInit = 0x1000,
76-
TD_HasSecurity = 0x2000,
77-
TD_HasFinalizer = 0x4000,
78-
TD_HasAttributes = 0x8000,
75+
TD_BeforeFieldInit = 0x1000,
76+
TD_HasSecurity = 0x2000,
77+
TD_HasFinalizer = 0x4000,
78+
TD_HasAttributes = 0x8000,
7979
}
8080
}

MetadataProcessor.Shared/nanoAssemblyDefinition.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
//
66

77
using System.IO;
8-
using System.Linq;
98

109
namespace nanoFramework.Tools.MetadataProcessor
1110
{
@@ -84,12 +83,12 @@ public void Write(
8483
writer.WriteUInt32(0);
8584

8685
// assembly CRC32
87-
writer.WriteUInt32(0);
86+
writer.WriteUInt32(0);
8887

8988
// current builds are for little endian targets only
9089
// keeping this here for now, just for compatibility
9190
writer.WriteUInt32(0);
92-
91+
9392
writer.WriteUInt32(_context.NativeMethodsCrc.CurrentCrc);
9493

9594
// Native methods offset
@@ -98,7 +97,7 @@ public void Write(
9897
writer.WriteVersion(_context.AssemblyDefinition.Name.Version);
9998

10099
writer.WriteUInt16(isPreAllocationCall
101-
? (ushort) 0x0000
100+
? (ushort)0x0000
102101
: _context.StringTable.GetOrCreateStringId(_context.AssemblyDefinition.Name.Name));
103102
writer.WriteUInt16(1); // String table version
104103

@@ -135,16 +134,16 @@ public void Write(
135134

136135
var assemblyCrc32 = ComputeCrc32(
137136
writer.BaseStream,
138-
_paddingsOffset,
137+
_paddingsOffset,
139138
writer.BaseStream.Length - _paddingsOffset);
140139
writer.WriteUInt32(assemblyCrc32);
141140

142141
// set writer position at Header CRC32 position
143142
writer.BaseStream.Seek(c_HeaderCrc32Position, SeekOrigin.Begin);
144143

145144
var headerCrc32 = ComputeCrc32(
146-
writer.BaseStream,
147-
0,
145+
writer.BaseStream,
146+
0,
148147
_paddingsOffset);
149148
writer.WriteUInt32(headerCrc32);
150149
}

MetadataProcessor.Shared/nanoDependencyGenerator.cs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@
44
//
55

66
using Mono.Cecil;
7-
using nanoFramework.Tools.MetadataProcessor.Core.Extensions;
8-
using System;
9-
using System.IO;
10-
using System.Linq;
11-
using System.Text;
127
using System.Xml;
138

149
namespace nanoFramework.Tools.MetadataProcessor.Core
@@ -29,8 +24,8 @@ public sealed class nanoDependencyGenerator
2924
private string _fileName;
3025

3126
public nanoDependencyGenerator(
32-
AssemblyDefinition assemblyDefinition,
33-
nanoTablesContext tablesContext,
27+
AssemblyDefinition assemblyDefinition,
28+
nanoTablesContext tablesContext,
3429
string fileName)
3530
{
3631
_assemblyDefinition = assemblyDefinition;

0 commit comments

Comments
 (0)