| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -498,7 +498,7 @@ private static bool ToPrimitive(IntPtr value, Type obType, out object result, bo | |||
| 498 | 498 | { | |
| 499 | 499 | if (Runtime.PyString_Size(value) == 1) | |
| 500 | 500 | { | |
| 501 | - op = Runtime.PyString_AS_STRING(value); | ||
| 501 | + op = Runtime.PyString_AsString(value); | ||
| 502 | 502 | result = (byte)Marshal.ReadByte(op); | |
| 503 | 503 | return true; | |
| 504 | 504 | } | |
@@ -543,7 +543,7 @@ private static bool ToPrimitive(IntPtr value, Type obType, out object result, bo | |||
| 543 | 543 | { | |
| 544 | 544 | if (Runtime.PyString_Size(value) == 1) | |
| 545 | 545 | { | |
| 546 | - op = Runtime.PyString_AS_STRING(value); | ||
| 546 | + op = Runtime.PyString_AsString(value); | ||
| 547 | 547 | result = (sbyte)Marshal.ReadByte(op); | |
| 548 | 548 | return true; | |
| 549 | 549 | } | |
@@ -588,7 +588,7 @@ private static bool ToPrimitive(IntPtr value, Type obType, out object result, bo | |||
| 588 | 588 | { | |
| 589 | 589 | if (Runtime.PyString_Size(value) == 1) | |
| 590 | 590 | { | |
| 591 | - op = Runtime.PyString_AS_STRING(value); | ||
| 591 | + op = Runtime.PyString_AsString(value); | ||
| 592 | 592 | result = (char)Marshal.ReadByte(op); | |
| 593 | 593 | return true; | |
| 594 | 594 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1243,8 +1243,8 @@ int size | |||
| 1243 | 1243 | [DllImport(PythonDll)] | |
| 1244 | 1244 | internal static extern IntPtr PyString_FromStringAndSize(string value, int size); | |
| 1245 | 1245 | ||
| 1246 | - [DllImport(PythonDll, EntryPoint = "PyString_AsString")] | ||
| 1247 | - internal static extern IntPtr PyString_AS_STRING(IntPtr op); | ||
| 1246 | + [DllImport(PythonDll)] | ||
| 1247 | + internal static extern IntPtr PyString_AsString(IntPtr op); | ||
| 1248 | 1248 | ||
| 1249 | 1249 | [DllImport(PythonDll)] | |
| 1250 | 1250 | internal static extern int PyString_Size(IntPtr pointer); | |
@@ -1262,16 +1262,16 @@ internal static bool PyUnicode_Check(IntPtr ob) | |||
| 1262 | 1262 | [DllImport(PythonDll)] | |
| 1263 | 1263 | internal static extern IntPtr PyUnicode_FromEncodedObject(IntPtr ob, IntPtr enc, IntPtr err); | |
| 1264 | 1264 | ||
| 1265 | - [DllImport(PythonDll, EntryPoint = "PyUnicode_FromKindAndData")] | ||
| 1266 | - internal static extern IntPtr PyUnicode_FromKindAndString( | ||
| 1265 | + [DllImport(PythonDll)] | ||
| 1266 | + internal static extern IntPtr PyUnicode_FromKindAndData( | ||
| 1267 | 1267 | int kind, | |
| 1268 | 1268 | [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(StrMarshaler))] string s, | |
| 1269 | 1269 | int size | |
| 1270 | 1270 | ); | |
| 1271 | 1271 | ||
| 1272 | 1272 | internal static IntPtr PyUnicode_FromUnicode(string s, int size) | |
| 1273 | 1273 | { | |
| 1274 | - return PyUnicode_FromKindAndString(UCS, s, size); | ||
| 1274 | + return PyUnicode_FromKindAndData(UCS, s, size); | ||
| 1275 | 1275 | } | |
| 1276 | 1276 | ||
| 1277 | 1277 | [DllImport(PythonDll)] | |
@@ -1330,7 +1330,7 @@ internal static string GetManagedString(IntPtr op) | |||
| 1330 | 1330 | #if PYTHON2 // Python 3 strings are all Unicode | |
| 1331 | 1331 | if (type == PyStringType) | |
| 1332 | 1332 | { | |
| 1333 | - return Marshal.PtrToStringAnsi(PyString_AS_STRING(op), PyString_Size(op)); | ||
| 1333 | + return Marshal.PtrToStringAnsi(PyString_AsString(op), PyString_Size(op)); | ||
| 1334 | 1334 | } | |
| 1335 | 1335 | #endif | |
| 1336 | 1336 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -415,7 +415,7 @@ internal static IntPtr AllocateTypeObject(string name) | |||
| 415 | 415 | temp = Runtime.PyUnicode_FromString(name); | |
| 416 | 416 | #elif PYTHON2 | |
| 417 | 417 | IntPtr temp = Runtime.PyString_FromString(name); | |
| 418 | - IntPtr raw = Runtime.PyString_AS_STRING(temp); | ||
| 418 | + IntPtr raw = Runtime.PyString_AsString(temp); | ||
| 419 | 419 | #endif | |
| 420 | 420 | Marshal.WriteIntPtr(type, TypeOffset.tp_name, raw); | |
| 421 | 421 | Marshal.WriteIntPtr(type, TypeOffset.name, temp); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments