Home
last modified time | relevance | path

Searched refs:c_int (Results 1 – 25 of 56) sorted by relevance

123

/third_party/python/Lib/lib2to3/tests/data/
Dinfinite_recursion.py19 __darwin_nl_item = c_int
20 __darwin_wctrans_t = c_int
26 __int32_t = c_int
32 __darwin_ct_rune_t = c_int
43 __darwin_ptrdiff_t = c_int
46 __darwin_wchar_t = c_int
48 __darwin_wint_t = c_int
53 sig_atomic_t = c_int
57 ('sc_onstack', c_int),
58 ('sc_mask', c_int),
[all …]
/third_party/python/Lib/ctypes/test/
Dtest_functions.py24 _fields_ = [("x", c_int), ("y", c_int)]
26 _fields_ = [("left", c_int), ("top", c_int),
27 ("right", c_int), ("bottom", c_int)]
60 f.argtypes = [c_byte, c_wchar, c_int, c_long, c_float, c_double]
68 f.argtypes = [c_byte, c_short, c_int, c_long, c_float, c_double]
76 f.argtypes = [c_int, c_int, POINTER(c_int)]
77 result = c_int()
83 f.argtypes = [c_byte, c_short, c_int, c_long, c_float, c_double]
84 f.restype = c_int
109 f.argtypes = [c_byte, c_short, c_int, c_long, c_float, c_double]
[all …]
Dtest_funcptr.py15 X = WINFUNCTYPE(c_int, c_int, c_int)
21 self.assertEqual(x.restype, c_int)
22 self.assertEqual(x.argtypes, (c_int, c_int))
27 StdCallback = WINFUNCTYPE(c_int, c_int, c_int)
28 CdeclCallback = CFUNCTYPE(c_int, c_int, c_int)
46 WNDPROC = WINFUNCTYPE(c_long, c_int, c_int, c_int, c_int)
51 HINSTANCE = c_int
52 HICON = c_int
53 HCURSOR = c_int
59 ("cbClsExtra", c_int),
[all …]
Dtest_as_parameter.py15 _fields_ = [("x", c_int), ("y", c_int)]
24 f.argtypes = [c_byte, c_wchar, c_int, c_long, c_float, c_double]
31 f.restype = POINTER(c_int)
32 f.argtypes = [POINTER(c_int)]
38 v = c_int(42)
42 self.assertEqual(type(result), POINTER(c_int))
49 p = pointer(c_int(99))
64 CallBack = CFUNCTYPE(c_int, c_int)
74 f.restype = c_int
77 MyCallback = CFUNCTYPE(c_int, c_int)
[all …]
Dtest_anon.py9 _fields_ = [("a", c_int),
10 ("b", c_int)]
13 _fields_ = [("x", c_int),
15 ("y", c_int)]
18 self.assertEqual(Y.a.offset, sizeof(c_int))
19 self.assertEqual(Y.b.offset, sizeof(c_int))
53 _fields_ = [("a", c_int)]
57 ("b", c_int)]
61 _fields_ = [("x", c_int),
63 ("y", c_int)]
[all …]
Dtest_structures.py18 _fields_ = [("a", c_int)]
21 _fields_ = [("b", c_int)]
26 self.assertEqual(sizeof(X), sizeof(c_int))
27 self.assertEqual(sizeof(Y), sizeof(c_int)*2)
28 self.assertEqual(sizeof(Z), sizeof(c_int))
29 self.assertEqual(X._fields_, [("a", c_int)])
30 self.assertEqual(Y._fields_, [("b", c_int)])
31 self.assertEqual(Z._fields_, [("a", c_int)])
37 X._fields_ = [("a", c_int)]
42 Y._fields_ = [("b", c_int)]
[all …]
Dtest_pointers.py6 ctype_types = [c_byte, c_ubyte, c_short, c_ushort, c_int, c_uint,
30 i = c_int(12345678)
33 self.assertEqual(c_int.from_address(address).value, 12345678)
35 func.restype = POINTER(c_int)
44 i = c_int(87654)
45 func.restype = POINTER(c_int)
46 func.argtypes = (POINTER(c_int),)
59 x = c_int(12321)
68 PROTOTYPE = CFUNCTYPE(c_int, POINTER(c_int))
114 p = POINTER(POINTER(c_int))
[all …]
Dtest_frombuffer.py7 _fields_ = [("c_int", c_int)]
15 x = (c_int * 16).from_buffer(a)
18 self.assertEqual(y.c_int, a[0])
32 x = (c_int * 16).from_buffer(a)
69 x = (c_int * 15).from_buffer(a, sizeof(c_int))
73 c_int.from_buffer(a, -1)
75 (c_int * 16).from_buffer(a, sizeof(c_int))
77 (c_int * 1).from_buffer(a, 16 * sizeof(c_int))
87 x = (c_int * 16).from_buffer_copy(a)
90 self.assertEqual(y.c_int, a[0])
[all …]
Dtest_arrays.py10 formats = c_byte, c_ubyte, c_short, c_ushort, c_int, c_uint, \
73 a = (c_int * 5)()
87 numarray = ARRAY(c_int, alen)
93 na = numarray(*[c_int()] * alen)
101 na = numarray(*map(c_int, (1, 2, 3, 4, 5)))
106 self.assertIsNot(ARRAY(c_int, 3), ARRAY(c_int, 4))
107 self.assertIs(ARRAY(c_int, 3), ARRAY(c_int, 3))
138 class my_int(c_int):
147 _type_ = c_int
161 self.assertEqual(c._type_, c_int)
[all …]
Dtest_varsize_struct.py7 _fields_ = [("item", c_int),
8 ("array", c_int * 1)]
10 self.assertEqual(sizeof(X), sizeof(c_int) * 2)
14 self.assertEqual(sizeof(x), sizeof(c_int) * 2)
17 new_size = sizeof(X) + sizeof(c_int) * 1
23 new_size = sizeof(X) + sizeof(c_int) * 9
29 new_size = sizeof(X) + sizeof(c_int) * 1
36 self.assertRaises(ValueError, lambda: c_int * -1)
37 self.assertRaises(ValueError, lambda: c_int * -3)
40 array = (c_int * 0)()
Dtest_refcounts.py6 MyCallback = ctypes.CFUNCTYPE(ctypes.c_int, ctypes.c_int)
7 OtherCallback = ctypes.CFUNCTYPE(ctypes.c_int, ctypes.c_int, ctypes.c_ulonglong)
19 f.restype = ctypes.c_int
20 f.argtypes = [ctypes.c_int, MyCallback]
91 proto = ctypes.CFUNCTYPE(ctypes.c_int, ctypes.c_int, ctypes.c_int)
96 a = sys.getrefcount(ctypes.c_int)
98 self.assertEqual(sys.getrefcount(ctypes.c_int), a)
Dtest_cast.py9 array = (c_int * 3)(42, 17, 2)
12 ptr = cast(array, POINTER(c_int))
15 if 2*sizeof(c_short) == sizeof(c_int):
25 array = (c_int * 3)(42, 17, 2)
28 ptr = cast(c_void_p(address), POINTER(c_int))
31 ptr = cast(address, POINTER(c_int))
52 p = cast((c_int * 4)(1, 2, 3, 4), POINTER(c_int))
57 c_int()
67 c_int()
87 array_type = c_byte * sizeof(c_int)
[all …]
Dtest_keeprefs.py6 x = c_int()
10 x = c_int(99)
24 _fields_ = [("a", c_int),
25 ("b", c_int)]
46 _fields_ = [("x", c_int), ("y", c_int)]
69 INTARR = c_int * 3
79 _fields_ = [("x", c_int),
92 i = c_int(42)
108 c_int(99)
117 c_int(99)
[all …]
Dtest_callbacks.py54 self.check_type(c_int, 42)
55 self.check_type(c_int, -42)
188 @CFUNCTYPE(c_int, POINTER(c_int), POINTER(c_int))
192 array = (c_int * 5)(5, 1, 99, 7, 33)
194 libc.qsort(array, len(array), sizeof(c_int), cmp_func)
215 CALLBACK = CFUNCTYPE(c_int, c_int, c_int, c_int, c_int, c_int)
218 func.argtypes = (c_int, c_int, c_int, c_int, c_int, CALLBACK)
219 func.restype = c_int
297 proto = CFUNCTYPE(c_int, *(c_int,) * CTYPES_MAX_ARGCOUNT)
310 proto = CFUNCTYPE(c_int)
Dtest_bitfields.py9 _fields_ = [("A", c_int, 1),
10 ("B", c_int, 2),
11 ("C", c_int, 3),
12 ("D", c_int, 4),
13 ("E", c_int, 5),
14 ("F", c_int, 6),
15 ("G", c_int, 7),
16 ("H", c_int, 8),
17 ("I", c_int, 9),
53 signed_int_types = (c_byte, c_short, c_int, c_long, c_longlong)
[all …]
Dtest_parameters.py83 from ctypes import c_short, c_uint, c_int, c_long, POINTER, pointer
84 LPINT = POINTER(c_int)
88 x = LPINT.from_param(pointer(c_int(42)))
90 self.assertEqual(LPINT(c_int(42)).contents.value, 42)
94 if c_int != c_long:
102 from ctypes import c_short, c_uint, c_int, c_long, POINTER, byref
103 LPINT = POINTER(c_int)
105 LPINT.from_param(byref(c_int(42)))
108 if c_int != c_long:
114 from ctypes import c_short, c_uint, c_int, c_long, pointer, POINTER, byref
[all …]
Dtest_byteswap.py28 _fields_ = [("x", c_int), ("y", c_int)]
32 _fields_ = [("x", c_int), ("y", c_int)]
74 self.assertIs(c_int.__ctype_le__, c_int)
75 self.assertIs(c_int.__ctype_be__.__ctype_le__, c_int)
77 self.assertIs(c_int.__ctype_be__, c_int)
78 self.assertIs(c_int.__ctype_le__.__ctype_be__, c_int)
80 s = c_int.__ctype_be__(0x12345678)
85 s = c_int.__ctype_le__(0x12345678)
185 ("e", c_int),
198 ("a", c_int * 3 * 3 * 3)]
[all …]
Dtest_internals.py24 ci = c_int(i)
37 _fields_ = [("a", c_int), ("b", c_int)]
49 _fields_ = [("a", c_int), ("b", c_int)]
87 _fields_ = [("data", POINTER(c_int))]
89 A = c_int*4
Dtest_random_things.py55 cb = CFUNCTYPE(c_int, c_int)(callback_func)
60 cb = CFUNCTYPE(c_int, c_int)(callback_func)
65 cb = CFUNCTYPE(c_int, c_double)(callback_func)
70 cb = CFUNCTYPE(c_int, c_char_p)(callback_func)
Dtest_prototypes.py78 ci = c_int(0)
80 func.argtypes = POINTER(c_int),
138 func(byref(c_int()))
139 func(pointer(c_int()))
140 func((c_int * 3)())
169 func.restype = c_int
209 func.restype = POINTER(c_int)
210 func.argtypes = c_int * 8,
212 func((c_int * 8)(1, 2, 3, 4, 5, 6, 7, 8))
217 CFUNCTYPE(None, c_int * 3)(func)
Dtest_values.py17 an_integer = c_int.in_dll(ctdll, "an_integer")
29 self.assertRaises(ValueError, c_int.in_dll, ctdll, "Undefined_Symbol")
38 opt = c_int.in_dll(pythonapi, "Py_OptimizeFlag").value
53 ("size", c_int)]
97 self.assertRaises(ValueError, c_int.in_dll, pythonapi,
Dtest_struct_fields.py61 _fields_ = (("field", c_int),)
66 _fields_ = (("field", c_int),)
72 _fields_ = (("field", c_int),)
77 _fields_ = (("field", c_int),)
Dtest_pickling.py8 _fields_ = [("a", c_int), ("b", c_double)]
26 c_int(42),
57 prototype = CFUNCTYPE(c_int)
63 pointer(c_int(42)),
Dtest_simplesubclasses.py4 class MyInt(c_int):
38 cb = CFUNCTYPE(c_int, c_int)(func)
/third_party/python/Tools/unicode/
Dgenwincodec.py14 wintypes.LPCSTR, ctypes.c_int,
15 wintypes.LPWSTR, ctypes.c_int]
16 MultiByteToWideChar.restype = ctypes.c_int

123