| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -93,7 +93,7 @@ public static IntPtr mp_subscript(IntPtr ob, IntPtr idx) | |||
| 93 | 93 | return IntPtr.Zero; | |
| 94 | 94 | } | |
| 95 | 95 | ||
| 96 | - int count = Runtime.PyTuple_Size(idx); | ||
| 96 | + var count = Runtime.PyTuple_Size(idx); | ||
| 97 | 97 | ||
| 98 | 98 | var args = new int[count]; | |
| 99 | 99 | ||
@@ -186,7 +186,7 @@ public static int mp_ass_subscript(IntPtr ob, IntPtr idx, IntPtr v) | |||
| 186 | 186 | return -1; | |
| 187 | 187 | } | |
| 188 | 188 | ||
| 189 | - int count = Runtime.PyTuple_Size(idx); | ||
| 189 | + var count = Runtime.PyTuple_Size(idx); | ||
| 190 | 190 | var args = new int[count]; | |
| 191 | 191 | ||
| 192 | 192 | for (var i = 0; i < count; i++) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -140,7 +140,7 @@ private static Assembly ResolveHandler(object ob, ResolveEventArgs args) | |||
| 140 | 140 | internal static void UpdatePath() | |
| 141 | 141 | { | |
| 142 | 142 | IntPtr list = Runtime.PySys_GetObject("path"); | |
| 143 | - int count = Runtime.PyList_Size(list); | ||
| 143 | + var count = Runtime.PyList_Size(list); | ||
| 144 | 144 | if (count != pypath.Count) | |
| 145 | 145 | { | |
| 146 | 146 | pypath.Clear(); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -230,10 +230,10 @@ public static int mp_ass_subscript(IntPtr ob, IntPtr idx, IntPtr v) | |||
| 230 | 230 | } | |
| 231 | 231 | ||
| 232 | 232 | // Get the args passed in. | |
| 233 | - int i = Runtime.PyTuple_Size(args); | ||
| 233 | + var i = Runtime.PyTuple_Size(args); | ||
| 234 | 234 | IntPtr defaultArgs = cls.indexer.GetDefaultArgs(args); | |
| 235 | - int numOfDefaultArgs = Runtime.PyTuple_Size(defaultArgs); | ||
| 236 | - int temp = i + numOfDefaultArgs; | ||
| 235 | + var numOfDefaultArgs = Runtime.PyTuple_Size(defaultArgs); | ||
| 236 | + var temp = i + numOfDefaultArgs; | ||
| 237 | 237 | IntPtr real = Runtime.PyTuple_New(temp + 1); | |
| 238 | 238 | for (var n = 0; n < i; n++) | |
| 239 | 239 | { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -842,7 +842,7 @@ private static void SetConversionError(IntPtr value, Type target) | |||
| 842 | 842 | private static bool ToArray(IntPtr value, Type obType, out object result, bool setError) | |
| 843 | 843 | { | |
| 844 | 844 | Type elementType = obType.GetElementType(); | |
| 845 | - int size = Runtime.PySequence_Size(value); | ||
| 845 | + var size = Runtime.PySequence_Size(value); | ||
| 846 | 846 | result = null; | |
| 847 | 847 | ||
| 848 | 848 | if (size < 0) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -155,7 +155,7 @@ public static IntPtr __import__(IntPtr self, IntPtr args, IntPtr kw) | |||
| 155 | 155 | // hook is saved as this.py_import. This version handles CLR | |
| 156 | 156 | // import and defers to the normal builtin for everything else. | |
| 157 | 157 | ||
| 158 | - int num_args = Runtime.PyTuple_Size(args); | ||
| 158 | + var num_args = Runtime.PyTuple_Size(args); | ||
| 159 | 159 | if (num_args < 1) | |
| 160 | 160 | { | |
| 161 | 161 | return Exceptions.RaiseTypeError("__import__() takes at least 1 argument (0 given)"); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -56,7 +56,7 @@ internal void SetItem(IntPtr inst, IntPtr args) | |||
| 56 | 56 | ||
| 57 | 57 | internal bool NeedsDefaultArgs(IntPtr args) | |
| 58 | 58 | { | |
| 59 | - int pynargs = Runtime.PyTuple_Size(args); | ||
| 59 | + var pynargs = Runtime.PyTuple_Size(args); | ||
| 60 | 60 | MethodBase[] methods = SetterBinder.GetMethods(); | |
| 61 | 61 | if (methods.Length == 0) | |
| 62 | 62 | { | |
@@ -72,7 +72,7 @@ internal bool NeedsDefaultArgs(IntPtr args) | |||
| 72 | 72 | return false; | |
| 73 | 73 | } | |
| 74 | 74 | ||
| 75 | - for (int v = pynargs; v < clrnargs; v++) | ||
| 75 | + for (var v = pynargs; v < clrnargs; v++) | ||
| 76 | 76 | { | |
| 77 | 77 | if (pi[v].DefaultValue == DBNull.Value) | |
| 78 | 78 | { | |
@@ -95,7 +95,7 @@ internal IntPtr GetDefaultArgs(IntPtr args) | |||
| 95 | 95 | { | |
| 96 | 96 | return Runtime.PyTuple_New(0); | |
| 97 | 97 | } | |
| 98 | - int pynargs = Runtime.PyTuple_Size(args); | ||
| 98 | + var pynargs = Runtime.PyTuple_Size(args); | ||
| 99 | 99 | ||
| 100 | 100 | // Get the default arg tuple | |
| 101 | 101 | MethodBase[] methods = SetterBinder.GetMethods(); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -36,7 +36,7 @@ static InterfaceObject() | |||
| 36 | 36 | public static IntPtr tp_new(IntPtr tp, IntPtr args, IntPtr kw) | |
| 37 | 37 | { | |
| 38 | 38 | var self = (InterfaceObject)GetManagedObject(tp); | |
| 39 | - int nargs = Runtime.PyTuple_Size(args); | ||
| 39 | + var nargs = Runtime.PyTuple_Size(args); | ||
| 40 | 40 | Type type = self.type; | |
| 41 | 41 | object obj; | |
| 42 | 42 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -29,7 +29,7 @@ public static IntPtr Initialize() | |||
| 29 | 29 | /// </summary> | |
| 30 | 30 | public static IntPtr tp_new(IntPtr tp, IntPtr args, IntPtr kw) | |
| 31 | 31 | { | |
| 32 | - int len = Runtime.PyTuple_Size(args); | ||
| 32 | + var len = Runtime.PyTuple_Size(args); | ||
| 33 | 33 | if (len < 3) | |
| 34 | 34 | { | |
| 35 | 35 | return Exceptions.RaiseTypeError("invalid argument list"); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -279,7 +279,7 @@ internal Binding Bind(IntPtr inst, IntPtr args, IntPtr kw, MethodBase info, Meth | |||
| 279 | 279 | { | |
| 280 | 280 | // loop to find match, return invoker w/ or /wo error | |
| 281 | 281 | MethodBase[] _methods = null; | |
| 282 | - int pynargs = Runtime.PyTuple_Size(args); | ||
| 282 | + var pynargs = (int)Runtime.PyTuple_Size(args); | ||
| 283 | 283 | object arg; | |
| 284 | 284 | var isGeneric = false; | |
| 285 | 285 | ArrayList defaultArgList = null; | |
@@ -301,9 +301,9 @@ internal Binding Bind(IntPtr inst, IntPtr args, IntPtr kw, MethodBase info, Meth | |||
| 301 | 301 | isGeneric = true; | |
| 302 | 302 | } | |
| 303 | 303 | ParameterInfo[] pi = mi.GetParameters(); | |
| 304 | - int clrnargs = pi.Length; | ||
| 304 | + var clrnargs = pi.Length; | ||
| 305 | 305 | var match = false; | |
| 306 | - int arrayStart = -1; | ||
| 306 | + var arrayStart = -1; | ||
| 307 | 307 | var outs = 0; | |
| 308 | 308 | ||
| 309 | 309 | if (pynargs == clrnargs) | |
@@ -314,7 +314,7 @@ internal Binding Bind(IntPtr inst, IntPtr args, IntPtr kw, MethodBase info, Meth | |||
| 314 | 314 | { | |
| 315 | 315 | match = true; | |
| 316 | 316 | defaultArgList = new ArrayList(); | |
| 317 | - for (int v = pynargs; v < clrnargs; v++) | ||
| 317 | + for (var v = pynargs; v < clrnargs; v++) | ||
| 318 | 318 | { | |
| 319 | 319 | if (pi[v].DefaultValue == DBNull.Value) | |
| 320 | 320 | { | |
@@ -338,7 +338,7 @@ internal Binding Bind(IntPtr inst, IntPtr args, IntPtr kw, MethodBase info, Meth | |||
| 338 | 338 | { | |
| 339 | 339 | var margs = new object[clrnargs]; | |
| 340 | 340 | ||
| 341 | - for (var n = 0; n < clrnargs; n++) | ||
| 341 | + for (int n = 0; n < clrnargs; n++) | ||
| 342 | 342 | { | |
| 343 | 343 | IntPtr op; | |
| 344 | 344 | if (n < pynargs) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -104,7 +104,7 @@ public static IntPtr tp_call(IntPtr ob, IntPtr args, IntPtr kw) | |||
| 104 | 104 | { | |
| 105 | 105 | if (self.info.IsGenericMethod) | |
| 106 | 106 | { | |
| 107 | - int len = Runtime.PyTuple_Size(args); //FIXME: Never used | ||
| 107 | + var len = Runtime.PyTuple_Size(args); //FIXME: Never used | ||
| 108 | 108 | Type[] sigTp = Runtime.PythonArgsToTypeArray(args, true); | |
| 109 | 109 | if (sigTp != null) | |
| 110 | 110 | { | |
@@ -129,7 +129,7 @@ public static IntPtr tp_call(IntPtr ob, IntPtr args, IntPtr kw) | |||
| 129 | 129 | ||
| 130 | 130 | if (target == IntPtr.Zero && !self.m.IsStatic()) | |
| 131 | 131 | { | |
| 132 | - int len = Runtime.PyTuple_Size(args); | ||
| 132 | + var len = Runtime.PyTuple_Size(args); | ||
| 133 | 133 | if (len < 1) | |
| 134 | 134 | { | |
| 135 | 135 | Exceptions.SetError(Exceptions.TypeError, "not enough arguments"); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments