Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jul 22, 2023. It is now read-only.
/pythonnetPublic archive
forked frompythonnet/pythonnet

Commit445531d

Browse files
committed
Style clean-up runtime.cs
1 parent044edfe commit445531d

File tree

1 file changed

+18
-19
lines changed

1 file changed

+18
-19
lines changed

‎src/runtime/runtime.cs

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public class Runtime
115115
#elifPYTHON36
116116
publicconststringpyversion="3.6";
117117
publicconststringpyver="36";
118-
#elifPYTHON37// TODO: Add interop37 afterPython3.7 is released
118+
#elifPYTHON37// TODO: Add`interop37.cs` afterPY37 is released
119119
publicconststringpyversion="3.7";
120120
publicconststringpyver="37";
121121
#else
@@ -154,7 +154,7 @@ public class Runtime
154154

155155
// set to true when python is finalizing
156156
internalstaticobjectIsFinalizingLock=newobject();
157-
internalstaticboolIsFinalizing=false;
157+
internalstaticboolIsFinalizing;
158158

159159
internalstaticboolIs32Bit;
160160
internalstaticboolIsPython2;
@@ -401,7 +401,7 @@ internal static IntPtr GetBoundArgTuple(IntPtr obj, IntPtr args)
401401
PyTuple_SetItem(items,0,obj);
402402
XIncref(obj);
403403

404-
for(inti=0;i<size;i++)
404+
for(vari=0;i<size;i++)
405405
{
406406
IntPtritem=PyTuple_GetItem(args,i);
407407
XIncref(item);
@@ -419,14 +419,14 @@ internal static IntPtr ExtendTuple(IntPtr t, params IntPtr[] args)
419419
IntPtritem;
420420

421421
IntPtritems=PyTuple_New(size+add);
422-
for(inti=0;i<size;i++)
422+
for(vari=0;i<size;i++)
423423
{
424424
item=PyTuple_GetItem(t,i);
425425
XIncref(item);
426426
PyTuple_SetItem(items,i,item);
427427
}
428428

429-
for(intn=0;n<add;n++)
429+
for(varn=0;n<add;n++)
430430
{
431431
item=args[n];
432432
XIncref(item);
@@ -447,7 +447,7 @@ internal static Type[] PythonArgsToTypeArray(IntPtr arg, bool mangleObjects)
447447
// tuple of (managed or unmanaged) type objects, return a Type[]
448448
// containing the CLR Type objects that map to those types.
449449
IntPtrargs=arg;
450-
boolfree=false;
450+
varfree=false;
451451

452452
if(!PyTuple_Check(arg))
453453
{
@@ -458,10 +458,10 @@ internal static Type[] PythonArgsToTypeArray(IntPtr arg, bool mangleObjects)
458458
}
459459

460460
intn=PyTuple_Size(args);
461-
Type[]types=newType[n];
461+
vartypes=newType[n];
462462
Typet=null;
463463

464-
for(inti=0;i<n;i++)
464+
for(vari=0;i<n;i++)
465465
{
466466
IntPtrop=PyTuple_GetItem(args,i);
467467
if(mangleObjects&&(!PyType_Check(op)))
@@ -513,7 +513,7 @@ internal static unsafe void XIncref(IntPtr op)
513513
Py_IncRef(op);
514514
return;
515515
#else
516-
void*p=(void*)op;
516+
varp=(void*)op;
517517
if((void*)0!=p)
518518
{
519519
if(Is32Bit)
@@ -536,7 +536,7 @@ internal static unsafe void XDecref(IntPtr op)
536536
Py_DecRef(op);
537537
return;
538538
#else
539-
void*p=(void*)op;
539+
varp=(void*)op;
540540
if((void*)0!=p)
541541
{
542542
if(Is32Bit)
@@ -562,15 +562,14 @@ internal static unsafe void XDecref(IntPtr op)
562562
return;
563563
}
564564
NativeCall.Impl.Void_Call_1(newIntPtr(f),op);
565-
return;
566565
}
567566
}
568567
#endif
569568
}
570569

571570
internalstatic unsafelong Refcount(IntPtrop)
572571
{
573-
void*p=(void*)op;
572+
var p=(void*)op;
574573
if((void*)0!=p)
575574
{
576575
if(Is32Bit)
@@ -786,15 +785,15 @@ internal static extern void Py_SetPath(
786785
/// </summary>
787786
internalstatic unsafeIntPtr PyObject_TYPE(IntPtrop)
788787
{
789-
void*p=(void*)op;
788+
var p=(void*)op;
790789
if((void*)0== p)
791790
{
792791
returnIntPtr.Zero;
793792
}
794793
#ifPy_DEBUG
795-
intn=3;
794+
varn=3;
796795
#else
797-
intn=1;
796+
var n=1;
798797
#endif
799798
if(Is32Bit)
800799
{
@@ -966,13 +965,13 @@ internal static bool PyBool_Check(IntPtr ob)
966965

967966
internalstaticIntPtr PyInt_FromInt32(intvalue)
968967
{
969-
IntPtr v=new IntPtr(value);
968+
varv=new IntPtr(value);
970969
return PyInt_FromLong(v);
971970
}
972971

973972
internalstatic IntPtr PyInt_FromInt64(longvalue)
974973
{
975-
IntPtr v=new IntPtr(value);
974+
varv=new IntPtr(value);
976975
return PyInt_FromLong(v);
977976
}
978977

@@ -1285,7 +1284,7 @@ int size
12851284

12861285
internalstatic IntPtr PyUnicode_FromString(string s)
12871286
{
1288-
return PyUnicode_FromUnicode(s,(s.Length));
1287+
return PyUnicode_FromUnicode(s,s.Length);
12891288
}
12901289

12911290
/// <summary>
@@ -1463,7 +1462,7 @@ internal static bool PyTuple_Check(IntPtr ob)
14631462
#elif PYTHON3
14641463
internalstaticbool PyIter_Check(IntPtr pointer)
14651464
{
1466-
IntPtr ob_type=(IntPtr)Marshal.PtrToStructure(pointer+ObjectOffset.ob_type,typeof(IntPtr));
1465+
var ob_type=(IntPtr)Marshal.PtrToStructure(pointer+ ObjectOffset.ob_type,typeof(IntPtr));
14671466
IntPtr tp_iternext= ob_type+ TypeOffset.tp_iternext;
14681467
return tp_iternext!=null&& tp_iternext!= _PyObject_NextNotImplemented;
14691468
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp