Skip to content
This repository was archived by the owner on Jul 22, 2023. It is now read-only.

Commit cb6ec6d

Browse files
committed
Format & Whitespace
*.cs linelength 120 Allman
1 parent 78fb457 commit cb6ec6d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+647
-766
lines changed

src/console/assemblyinfo.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
[assembly: AssemblyDefaultAlias("python.exe")]
1111
[assembly: CLSCompliant(true)]
1212
[assembly: ComVisible(false)]
13-
[assembly: PermissionSet(SecurityAction.RequestMinimum,
14-
Name = "FullTrust")]
13+
[assembly: PermissionSet(SecurityAction.RequestMinimum, Name = "FullTrust")]
1514
[assembly: AssemblyDescription("")]
1615
[assembly: AssemblyCopyright("MIT License")]
1716
[assembly: AssemblyFileVersion("2.0.0.4")]

src/runtime/arrayobject.cs

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,7 @@ public static IntPtr mp_subscript(IntPtr ob, IntPtr idx)
8080
}
8181
catch (IndexOutOfRangeException)
8282
{
83-
Exceptions.SetError(Exceptions.IndexError,
84-
"array index out of range"
85-
);
83+
Exceptions.SetError(Exceptions.IndexError, "array index out of range");
8684
return IntPtr.Zero;
8785
}
8886

@@ -93,9 +91,7 @@ public static IntPtr mp_subscript(IntPtr ob, IntPtr idx)
9391

9492
if (!Runtime.PyTuple_Check(idx))
9593
{
96-
Exceptions.SetError(Exceptions.TypeError,
97-
"invalid index value"
98-
);
94+
Exceptions.SetError(Exceptions.TypeError, "invalid index value");
9995
return IntPtr.Zero;
10096
}
10197

@@ -127,9 +123,7 @@ public static IntPtr mp_subscript(IntPtr ob, IntPtr idx)
127123
}
128124
catch (IndexOutOfRangeException)
129125
{
130-
Exceptions.SetError(Exceptions.IndexError,
131-
"array index out of range"
132-
);
126+
Exceptions.SetError(Exceptions.IndexError, "array index out of range");
133127
return IntPtr.Zero;
134128
}
135129

@@ -182,9 +176,7 @@ public static int mp_ass_subscript(IntPtr ob, IntPtr idx, IntPtr v)
182176
}
183177
catch (IndexOutOfRangeException)
184178
{
185-
Exceptions.SetError(Exceptions.IndexError,
186-
"array index out of range"
187-
);
179+
Exceptions.SetError(Exceptions.IndexError, "array index out of range");
188180
return -1;
189181
}
190182

@@ -226,9 +218,7 @@ public static int mp_ass_subscript(IntPtr ob, IntPtr idx, IntPtr v)
226218
}
227219
catch (IndexOutOfRangeException)
228220
{
229-
Exceptions.SetError(Exceptions.IndexError,
230-
"array index out of range"
231-
);
221+
Exceptions.SetError(Exceptions.IndexError, "array index out of range");
232222
return -1;
233223
}
234224

@@ -272,4 +262,4 @@ public static int mp_length(IntPtr ob)
272262
return items.Length;
273263
}
274264
}
275-
}
265+
}

src/runtime/assemblymanager.cs

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ private AssemblyManager()
3939

4040
internal static void Initialize()
4141
{
42-
namespaces = new
43-
ConcurrentDictionary<string, ConcurrentDictionary<Assembly, string>>();
42+
namespaces = new ConcurrentDictionary<string, ConcurrentDictionary<Assembly, string>>();
4443
probed = new Dictionary<string, int>(32);
4544
//generics = new Dictionary<string, Dictionary<string, string>>();
4645
assemblies = new AssemblyList(16);
@@ -206,9 +205,10 @@ public static Assembly LoadAssembly(string name)
206205
{
207206
assembly = Assembly.Load(name);
208207
}
209-
catch (System.Exception e)
208+
catch (System.Exception)
210209
{
211-
//if (!(e is System.IO.FileNotFoundException)) {
210+
//if (!(e is System.IO.FileNotFoundException))
211+
//{
212212
// throw;
213213
//}
214214
}
@@ -480,13 +480,15 @@ public static Type LookupType(string qname)
480480
}
481481

482482
/// <summary>
483-
/// Wrapper around List<Assembly> for thread safe access
483+
/// Wrapper around List&lt;Assembly&gt; for thread safe access
484484
/// </summary>
485-
private class AssemblyList : IEnumerable<Assembly>{
485+
private class AssemblyList : IEnumerable<Assembly>
486+
{
486487
private readonly List<Assembly> _list;
487488
private readonly ReaderWriterLockSlim _lock;
488489

489-
public AssemblyList(int capacity) {
490+
public AssemblyList(int capacity)
491+
{
490492
_list = new List<Assembly>(capacity);
491493
_lock = new ReaderWriterLockSlim();
492494
}
@@ -496,16 +498,19 @@ public int Count
496498
get
497499
{
498500
_lock.EnterReadLock();
499-
try {
501+
try
502+
{
500503
return _list.Count;
501504
}
502-
finally {
505+
finally
506+
{
503507
_lock.ExitReadLock();
504508
}
505509
}
506510
}
507511

508-
public void Add(Assembly assembly) {
512+
public void Add(Assembly assembly)
513+
{
509514
_lock.EnterWriteLock();
510515
try
511516
{
@@ -519,7 +524,7 @@ public void Add(Assembly assembly) {
519524

520525
public IEnumerator GetEnumerator()
521526
{
522-
return ((IEnumerable<Assembly>) this).GetEnumerator();
527+
return ((IEnumerable<Assembly>)this).GetEnumerator();
523528
}
524529

525530
/// <summary>
@@ -555,9 +560,15 @@ public void Reset()
555560
_listEnumerator.Reset();
556561
}
557562

558-
public Assembly Current { get { return _listEnumerator.Current; } }
563+
public Assembly Current
564+
{
565+
get { return _listEnumerator.Current; }
566+
}
559567

560-
object IEnumerator.Current { get { return Current; } }
568+
object IEnumerator.Current
569+
{
570+
get { return Current; }
571+
}
561572
}
562573

563574
IEnumerator<Assembly> IEnumerable<Assembly>.GetEnumerator()

src/runtime/classbase.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ public virtual IntPtr type_subscript(IntPtr idx)
6868
// Standard comparison implementation for instances of reflected types.
6969
//====================================================================
7070

71-
public static IntPtr tp_richcompare(IntPtr ob, IntPtr other, int op) {
71+
public static IntPtr tp_richcompare(IntPtr ob, IntPtr other, int op)
72+
{
7273
CLRObject co1;
7374
CLRObject co2;
7475
switch (op)
@@ -116,7 +117,7 @@ public static IntPtr tp_richcompare(IntPtr ob, IntPtr other, int op) {
116117
case Runtime.Py_GE:
117118
co1 = GetManagedObject(ob) as CLRObject;
118119
co2 = GetManagedObject(other) as CLRObject;
119-
if(co1 == null || co2 == null)
120+
if (co1 == null || co2 == null)
120121
return Exceptions.RaiseTypeError("Cannot get managed object");
121122
var co1Comp = co1.inst as IComparable;
122123
if (co1Comp == null)
@@ -150,10 +151,12 @@ public static IntPtr tp_richcompare(IntPtr ob, IntPtr other, int op) {
150151
}
151152
else
152153
{
153-
if (op == Runtime.Py_GE || op == Runtime.Py_GT) {
154+
if (op == Runtime.Py_GE || op == Runtime.Py_GT)
155+
{
154156
pyCmp = Runtime.PyTrue;
155157
}
156-
else {
158+
else
159+
{
157160
pyCmp = Runtime.PyFalse;
158161
}
159162
}
@@ -285,4 +288,4 @@ public static void tp_dealloc(IntPtr ob)
285288
self.gcHandle.Free();
286289
}
287290
}
288-
}
291+
}

src/runtime/classderived.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ static ClassDerivedObject()
3333
moduleBuilders = new Dictionary<Tuple<string, string>, ModuleBuilder>();
3434
}
3535

36-
internal ClassDerivedObject(Type tp)
37-
: base(tp)
36+
internal ClassDerivedObject(Type tp): base(tp)
3837
{
3938
}
4039

src/runtime/classmanager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,4 +397,4 @@ internal ClassInfo(Type t)
397397
public Hashtable members;
398398
public Indexer indexer;
399399
}
400-
}
400+
}

src/runtime/classobject.cs

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,7 @@ public static IntPtr tp_new(IntPtr tp, IntPtr args, IntPtr kw)
7171
{
7272
if (Runtime.PyTuple_Size(args) != 1)
7373
{
74-
Exceptions.SetError(Exceptions.TypeError,
75-
"no constructors match given arguments"
76-
);
74+
Exceptions.SetError(Exceptions.TypeError, "no constructors match given arguments");
7775
return IntPtr.Zero;
7876
}
7977

@@ -90,17 +88,13 @@ public static IntPtr tp_new(IntPtr tp, IntPtr args, IntPtr kw)
9088

9189
if (type.IsAbstract)
9290
{
93-
Exceptions.SetError(Exceptions.TypeError,
94-
"cannot instantiate abstract class"
95-
);
91+
Exceptions.SetError(Exceptions.TypeError, "cannot instantiate abstract class");
9692
return IntPtr.Zero;
9793
}
9894

9995
if (type.IsEnum)
10096
{
101-
Exceptions.SetError(Exceptions.TypeError,
102-
"cannot instantiate enumeration"
103-
);
97+
Exceptions.SetError(Exceptions.TypeError, "cannot instantiate enumeration");
10498
return IntPtr.Zero;
10599
}
106100

@@ -178,9 +172,7 @@ public static IntPtr mp_subscript(IntPtr ob, IntPtr idx)
178172

179173
if (cls.indexer == null || !cls.indexer.CanGet)
180174
{
181-
Exceptions.SetError(Exceptions.TypeError,
182-
"unindexable object"
183-
);
175+
Exceptions.SetError(Exceptions.TypeError, "unindexable object");
184176
return IntPtr.Zero;
185177
}
186178

@@ -228,9 +220,7 @@ public static int mp_ass_subscript(IntPtr ob, IntPtr idx, IntPtr v)
228220

229221
if (cls.indexer == null || !cls.indexer.CanSet)
230222
{
231-
Exceptions.SetError(Exceptions.TypeError,
232-
"object doesn't support item assignment"
233-
);
223+
Exceptions.SetError(Exceptions.TypeError, "object doesn't support item assignment");
234224
return -1;
235225
}
236226

@@ -314,8 +304,7 @@ public static IntPtr tp_call(IntPtr ob, IntPtr args, IntPtr kw)
314304

315305
if (cb.type != typeof(System.Delegate))
316306
{
317-
Exceptions.SetError(Exceptions.TypeError,
318-
"object is not callable");
307+
Exceptions.SetError(Exceptions.TypeError, "object is not callable");
319308
return IntPtr.Zero;
320309
}
321310

@@ -331,4 +320,4 @@ public static IntPtr tp_call(IntPtr ob, IntPtr args, IntPtr kw)
331320
return binder.Invoke(ob, args, kw);
332321
}
333322
}
334-
}
323+
}

src/runtime/codegenerator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,4 @@ internal TypeBuilder DefineType(string name, Type basetype)
4949
return mBuilder.DefineType(name, attrs, basetype);
5050
}
5151
}
52-
}
52+
}

src/runtime/constructorbinder.cs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ internal object InvokeRaw(IntPtr inst, IntPtr args, IntPtr kw)
4949
/// Binding binding = this.Bind(inst, args, kw, info);
5050
/// to take advantage of Bind()'s ability to use a single MethodBase (CI or MI).
5151
/// </remarks>
52-
internal object InvokeRaw(IntPtr inst, IntPtr args, IntPtr kw,
53-
MethodBase info)
52+
internal object InvokeRaw(IntPtr inst, IntPtr args, IntPtr kw, MethodBase info)
5453
{
5554
Object result;
5655

@@ -96,9 +95,7 @@ internal object InvokeRaw(IntPtr inst, IntPtr args, IntPtr kw,
9695

9796
if (binding == null)
9897
{
99-
Exceptions.SetError(Exceptions.TypeError,
100-
"no constructor matches given arguments"
101-
);
98+
Exceptions.SetError(Exceptions.TypeError, "no constructor matches given arguments");
10299
return null;
103100
}
104101
}
@@ -123,4 +120,4 @@ internal object InvokeRaw(IntPtr inst, IntPtr args, IntPtr kw,
123120
return result;
124121
}
125122
}
126-
}
123+
}

src/runtime/constructorbinding.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,7 @@ internal class BoundContructor : ExtensionType
169169
ConstructorInfo ctorInfo;
170170
IntPtr repr;
171171

172-
public BoundContructor(Type type, IntPtr pyTypeHndl, ConstructorBinder ctorBinder, ConstructorInfo ci)
173-
: base()
172+
public BoundContructor(Type type, IntPtr pyTypeHndl, ConstructorBinder ctorBinder, ConstructorInfo ci) : base()
174173
{
175174
this.type = type;
176175
Runtime.XIncref(pyTypeHndl);

0 commit comments

Comments
 (0)