Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e2b7e9c

Browse files
committed
Format interop files
1 parent 8972b15 commit e2b7e9c

11 files changed

+110
-82
lines changed

src/runtime/converter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,7 @@ static bool ToPrimitive(IntPtr value, Type obType, out Object result,
626626
if (Runtime.PyUnicode_GetSize(value) == 1)
627627
{
628628
op = Runtime.PyUnicode_AS_UNICODE(value);
629-
#if (!UCS4)
629+
#if !UCS4
630630
// 2011-01-02: Marshal as character array because the cast
631631
// result = (char)Marshal.ReadInt16(op); throws an OverflowException
632632
// on negative numbers with Check Overflow option set on the project

src/runtime/interop.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ static ObjectOffset()
7676
{
7777
int size = IntPtr.Size;
7878
int n = 0; // Py_TRACE_REFS add two pointers to PyObject_HEAD
79-
#if (Py_DEBUG)
79+
#if Py_DEBUG
8080
_ob_next = 0;
8181
_ob_prev = 1 * size;
8282
n = 2;
@@ -114,14 +114,14 @@ public static int Size(IntPtr ob)
114114
{
115115
return ExceptionOffset.Size();
116116
}
117-
#if (Py_DEBUG)
117+
#if Py_DEBUG
118118
return 6 * IntPtr.Size;
119119
#else
120120
return 4 * IntPtr.Size;
121121
#endif
122122
}
123123

124-
#if (Py_DEBUG)
124+
#if Py_DEBUG
125125
public static int _ob_next;
126126
public static int _ob_prev;
127127
#endif
@@ -186,7 +186,7 @@ static BytesOffset()
186186

187187
/* The *real* layout of a type object when allocated on the heap */
188188
//typedef struct _heaptypeobject {
189-
#if (Py_DEBUG) // #ifdef Py_TRACE_REFS
189+
#if Py_DEBUG // #ifdef Py_TRACE_REFS
190190
/* _PyObject_HEAD_EXTRA defines pointers to support a doubly-linked list of all live heap objects. */
191191
public static int _ob_next = 0;
192192
public static int _ob_prev = 0;

src/runtime/interop26.cs

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,32 @@
22
// DO NOT MODIFIY BY HAND.
33

44

5-
6-
#if (PYTHON26)
5+
#if PYTHON26
76
using System;
87
using System.Collections;
98
using System.Collections.Specialized;
109
using System.Runtime.InteropServices;
1110
using System.Reflection;
1211
using System.Text;
1312

14-
namespace Python.Runtime {
15-
16-
[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Ansi)]
17-
internal class TypeOffset {
18-
19-
static TypeOffset() {
13+
namespace Python.Runtime
14+
{
15+
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
16+
internal class TypeOffset
17+
{
18+
static TypeOffset()
19+
{
2020
Type type = typeof(TypeOffset);
2121
FieldInfo[] fi = type.GetFields();
2222
int size = IntPtr.Size;
23-
for (int i = 0; i < fi.Length; i++) {
23+
for (int i = 0; i < fi.Length; i++)
24+
{
2425
fi[i].SetValue(null, i * size);
2526
}
2627
}
2728

28-
public static int magic() {
29+
public static int magic()
30+
{
2931
return ob_size;
3032
}
3133

@@ -144,4 +146,5 @@ public static int magic() {
144146
public static int members = 0;
145147
}
146148
}
147-
#endif
149+
150+
#endif

src/runtime/interop27.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
// Auto-generated by geninterop.py.
22
// DO NOT MODIFIY BY HAND.
33

4-
#if (PYTHON27)
4+
5+
#if PYTHON27
56
using System;
67
using System.Collections;
78
using System.Collections.Specialized;
@@ -21,7 +22,7 @@ static TypeOffset()
2122
int size = IntPtr.Size;
2223
for (int i = 0; i < fi.Length; i++)
2324
{
24-
fi[i].SetValue(null, i*size);
25+
fi[i].SetValue(null, i * size);
2526
}
2627
}
2728

@@ -146,4 +147,4 @@ public static int magic()
146147
}
147148
}
148149

149-
#endif
150+
#endif

src/runtime/interop32.cs

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,32 @@
22
// DO NOT MODIFIY BY HAND.
33

44

5-
6-
#if (PYTHON32)
5+
#if PYTHON32
76
using System;
87
using System.Collections;
98
using System.Collections.Specialized;
109
using System.Runtime.InteropServices;
1110
using System.Reflection;
1211
using System.Text;
1312

14-
namespace Python.Runtime {
15-
16-
[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Ansi)]
17-
internal class TypeOffset {
18-
19-
static TypeOffset() {
13+
namespace Python.Runtime
14+
{
15+
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
16+
internal class TypeOffset
17+
{
18+
static TypeOffset()
19+
{
2020
Type type = typeof(TypeOffset);
2121
FieldInfo[] fi = type.GetFields();
2222
int size = IntPtr.Size;
23-
for (int i = 0; i < fi.Length; i++) {
23+
for (int i = 0; i < fi.Length; i++)
24+
{
2425
fi[i].SetValue(null, i * size);
2526
}
2627
}
2728

28-
public static int magic() {
29+
public static int magic()
30+
{
2931
return ob_size;
3032
}
3133

@@ -135,4 +137,5 @@ public static int magic() {
135137
public static int members = 0;
136138
}
137139
}
138-
#endif
140+
141+
#endif

src/runtime/interop33.cs

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,33 @@
1-
21
// Auto-generated by geninterop.py.
32
// DO NOT MODIFIY BY HAND.
43

5-
#if (PYTHON33)
4+
5+
#if PYTHON33
66
using System;
77
using System.Collections;
88
using System.Collections.Specialized;
99
using System.Runtime.InteropServices;
1010
using System.Reflection;
1111
using System.Text;
1212

13-
namespace Python.Runtime {
14-
15-
[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Ansi)]
16-
internal class TypeOffset {
17-
18-
static TypeOffset() {
13+
namespace Python.Runtime
14+
{
15+
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
16+
internal class TypeOffset
17+
{
18+
static TypeOffset()
19+
{
1920
Type type = typeof(TypeOffset);
2021
FieldInfo[] fi = type.GetFields();
2122
int size = IntPtr.Size;
22-
for (int i = 0; i < fi.Length; i++) {
23+
for (int i = 0; i < fi.Length; i++)
24+
{
2325
fi[i].SetValue(null, i * size);
2426
}
2527
}
2628

27-
public static int magic() {
29+
public static int magic()
30+
{
2831
return ob_size;
2932
}
3033

@@ -136,4 +139,5 @@ public static int magic() {
136139
public static int members = 0;
137140
}
138141
}
142+
139143
#endif

src/runtime/interop34.cs

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,32 @@
22
// DO NOT MODIFIY BY HAND.
33

44

5-
6-
#if (PYTHON34)
5+
#if PYTHON34
76
using System;
87
using System.Collections;
98
using System.Collections.Specialized;
109
using System.Runtime.InteropServices;
1110
using System.Reflection;
1211
using System.Text;
1312

14-
namespace Python.Runtime {
15-
16-
[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Ansi)]
17-
internal class TypeOffset {
18-
19-
static TypeOffset() {
13+
namespace Python.Runtime
14+
{
15+
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
16+
internal class TypeOffset
17+
{
18+
static TypeOffset()
19+
{
2020
Type type = typeof(TypeOffset);
2121
FieldInfo[] fi = type.GetFields();
2222
int size = IntPtr.Size;
23-
for (int i = 0; i < fi.Length; i++) {
23+
for (int i = 0; i < fi.Length; i++)
24+
{
2425
fi[i].SetValue(null, i * size);
2526
}
2627
}
2728

28-
public static int magic() {
29+
public static int magic()
30+
{
2931
return ob_size;
3032
}
3133

@@ -138,4 +140,5 @@ public static int magic() {
138140
public static int members = 0;
139141
}
140142
}
141-
#endif
143+
144+
#endif

src/runtime/interop35.cs

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,32 @@
22
// DO NOT MODIFIY BY HAND.
33

44

5-
6-
#if (PYTHON35)
5+
#if PYTHON35
76
using System;
87
using System.Collections;
98
using System.Collections.Specialized;
109
using System.Runtime.InteropServices;
1110
using System.Reflection;
1211
using System.Text;
1312

14-
namespace Python.Runtime {
15-
16-
[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Ansi)]
17-
internal class TypeOffset {
18-
19-
static TypeOffset() {
13+
namespace Python.Runtime
14+
{
15+
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
16+
internal class TypeOffset
17+
{
18+
static TypeOffset()
19+
{
2020
Type type = typeof(TypeOffset);
2121
FieldInfo[] fi = type.GetFields();
2222
int size = IntPtr.Size;
23-
for (int i = 0; i < fi.Length; i++) {
23+
for (int i = 0; i < fi.Length; i++)
24+
{
2425
fi[i].SetValue(null, i * size);
2526
}
2627
}
2728

28-
public static int magic() {
29+
public static int magic()
30+
{
2931
return ob_size;
3032
}
3133

@@ -143,4 +145,5 @@ public static int magic() {
143145
public static int members = 0;
144146
}
145147
}
148+
146149
#endif

src/runtime/interop36.cs

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,33 @@
1-
21
// Auto-generated by geninterop.py.
32
// DO NOT MODIFIY BY HAND.
4-
#if (PYTHON36)
3+
4+
5+
#if PYTHON36
56
using System;
67
using System.Collections;
78
using System.Collections.Specialized;
89
using System.Runtime.InteropServices;
910
using System.Reflection;
1011
using System.Text;
1112

12-
namespace Python.Runtime {
13-
14-
[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Ansi)]
15-
internal class TypeOffset {
16-
17-
static TypeOffset() {
13+
namespace Python.Runtime
14+
{
15+
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
16+
internal class TypeOffset
17+
{
18+
static TypeOffset()
19+
{
1820
Type type = typeof(TypeOffset);
1921
FieldInfo[] fi = type.GetFields();
2022
int size = IntPtr.Size;
21-
for (int i = 0; i < fi.Length; i++) {
23+
for (int i = 0; i < fi.Length; i++)
24+
{
2225
fi[i].SetValue(null, i * size);
2326
}
2427
}
2528

26-
public static int magic() {
29+
public static int magic()
30+
{
2731
return ob_size;
2832
}
2933

@@ -141,4 +145,5 @@ public static int magic() {
141145
public static int members = 0;
142146
}
143147
}
148+
144149
#endif

src/runtime/monosupport.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if (UCS4)
1+
#if UCS4
22
using System;
33
using System.Runtime.InteropServices;
44
using System.Text;
@@ -50,4 +50,4 @@ public object MarshalNativeToManaged(IntPtr
5050
}
5151
}
5252

53-
#endif
53+
#endif

0 commit comments

Comments
 (0)