Lines Matching refs:BInt
45 BInt = new_primitive_type("int")
46 return sizeof(BInt)
53 BInt = new_primitive_type("int")
54 BPtr = new_pointer_type(BInt)
278 BInt = new_primitive_type("int")
279 py.test.raises(TypeError, newp, BInt)
280 py.test.raises(TypeError, newp, BInt, None)
281 BPtr = new_pointer_type(BInt)
297 BInt = new_primitive_type("int")
298 BPtr = new_pointer_type(BInt)
305 BInt = new_primitive_type("int")
306 BPtr = new_pointer_type(BInt)
312 BInt = new_primitive_type("int")
313 BPtr = new_pointer_type(BInt)
393 BInt = new_primitive_type("int")
394 BIntPtr = new_pointer_type(BInt)
453 BInt = new_primitive_type("int")
454 x = cast(BInt, 42)
456 BArray = new_array_type(new_pointer_type(BInt), 10)
461 BInt = new_primitive_type("int")
462 x = cast(BInt, 42)
464 BArray = new_array_type(new_pointer_type(BInt), 10)
469 BInt = new_primitive_type("int")
470 x = cast(BInt, 0)
471 y = cast(new_pointer_type(BInt), x)
474 x = cast(BInt, 42)
475 y = cast(BInt, x)
482 z = cast(BInt, 42.5)
484 z = cast(BInt, y)
603 BInt = new_primitive_type("int")
604 BArray = new_array_type(new_pointer_type(BInt), 5) # int[5]
619 BInt = new_primitive_type("int")
620 BIntPtr = new_pointer_type(BInt)
699 BInt = new_primitive_type("int")
700 assert alignof(BInt) == sizeof(BInt)
701 BPtr = new_pointer_type(BInt)
704 assert alignof(BArray) == alignof(BInt)
776 BInt = new_primitive_type("int")
787 complete_struct_or_union(BStruct, [('a1', BInt, -1),
788 ('a2', BInt, -1)])
805 j = cast(BInt, 42)
810 j = cast(new_pointer_type(BInt), 42)
822 BInt = new_primitive_type("int")
825 complete_struct_or_union(BUnion, [('a1', BInt, -1), ('a2', BUInt, -1)])
839 BInt = new_primitive_type("int")
842 complete_struct_or_union(BStruct, [('a1', BInt, -1),
843 ('a2', BInt, -1)])
852 BInt = new_primitive_type("int")
853 BIntPtr = new_pointer_type(BInt)
856 complete_struct_or_union(BStruct, [('a1', BInt, -1),
857 ('a2', BInt, -1),
858 ('a3', BInt, -1),
887 BInt = new_primitive_type("int")
889 BArrayInt5 = new_array_type(new_pointer_type(BInt), 5)
898 BInt = new_primitive_type("int")
900 py.test.raises(TypeError, offsetof, BInt, "abc")
902 complete_struct_or_union(BStruct, [('abc', BInt, -1), ('def', BInt, -1)])
909 BInt = new_primitive_type("int")
910 BFunc = new_function_type((BInt, BInt), BInt, False)
916 BInt = new_primitive_type("int")
917 BFunc = new_function_type((BInt, BInt), BInt, False)
920 assert BFunc.args == (BInt, BInt)
921 assert BFunc.result is BInt
936 BInt = new_primitive_type("int")
937 BFunc = new_function_type((BInt, BInt), BVoid, False)
942 BInt = new_primitive_type("int")
943 py.test.raises(TypeError, new_function_type, (BVoid,), BInt, False)
964 BInt = new_primitive_type("int")
966 BFunc1 = new_function_type((BInt, BLong), BLong, False)
1009 BInt = new_primitive_type("int")
1010 BIntPtr = new_pointer_type(BInt)
1069 BInt = new_primitive_type("int")
1071 complete_struct_or_union(BStruct, [('a', BInt, -1),
1072 ('b', BInt, -1),
1073 ('c', BInt, -1),
1074 ('d', BInt, -1),
1075 ('e', BInt, -1),
1076 ('f', BInt, -1),
1077 ('g', BInt, -1),
1078 ('h', BInt, -1),
1079 ('i', BInt, -1),
1080 ('j', BInt, -1)])
1081 BFunc21 = new_function_type((BStruct,), BInt, False)
1088 BInt = new_primitive_type("int")
1089 BArray10 = new_array_type(new_pointer_type(BInt), 10)
1104 BInt = new_primitive_type("int")
1105 BFunc23 = new_function_type((BVoidP,), BInt, False)
1119 BInt = new_primitive_type("int")
1120 BFunc23 = new_function_type((BUCharP,), BInt, False)
1129 BInt = new_primitive_type("int")
1130 BFunc23 = new_function_type((BBoolP,), BInt, False)
1137 BInt = new_primitive_type("int")
1138 BArray0 = new_array_type(new_pointer_type(BInt), 0)
1142 BFunc = new_function_type((BStruct,), BInt, False)
1144 BFunc2 = new_function_type((BInt,), BStruct, False)
1148 BInt = new_primitive_type("int")
1149 BFunc9 = new_function_type((BInt,), BInt, True) # vararg
1152 assert f(1, cast(BInt, 42)) == 42
1153 assert f(2, cast(BInt, 40), cast(BInt, 2)) == 42
1278 BInt = new_primitive_type("int")
1282 BFunc = new_function_type((BInt,), BInt, False)
1432 BInt = new_primitive_type("int")
1433 BFunc = new_function_type((BInt,), BInt, False)
1445 BInt = new_primitive_type("int")
1452 BFunc = new_function_type((BStruct,), BInt)
1460 BInt = new_primitive_type("int")
1467 BFunc = new_function_type((BInt,), BStruct)
1477 BInt = new_primitive_type("int")
1485 BFunc = new_function_type((BStruct,), BInt)
1493 BInt = new_primitive_type("int")
1501 BFunc = new_function_type((BInt,), BStruct)
1511 BInt = new_primitive_type("int")
1514 complete_struct_or_union(BStruct, [('a', BInt, -1),
1515 ('b', BInt, -1),
1516 ('c', BInt, -1),
1517 ('d', BInt, -1),
1518 ('e', BInt, -1),
1519 ('f', BInt, -1),
1520 ('g', BInt, -1),
1521 ('h', BInt, -1),
1522 ('i', BInt, -1),
1523 ('j', BInt, -1)])
1528 BFunc = new_function_type((BStruct,), BInt)
1535 BInt = new_primitive_type("int")
1538 complete_struct_or_union(BStruct, [('a', BInt, -1),
1539 ('b', BInt, -1),
1540 ('c', BInt, -1),
1541 ('d', BInt, -1),
1542 ('e', BInt, -1),
1543 ('f', BInt, -1),
1544 ('g', BInt, -1),
1545 ('h', BInt, -1),
1546 ('i', BInt, -1),
1547 ('j', BInt, -1)])
1578 BInt = new_primitive_type("int")
1579 BEnum = new_enum_type("enum foo", ('def', 'c', 'ab'), (0, 1, -20), BInt)
1592 BInt = new_primitive_type("int")
1593 BEnum = new_enum_type("enum foo", ('def', 'c', 'ab'), (0, 1, -20), BInt)
1594 assert sizeof(BEnum) == sizeof(BInt)
1618 BInt = new_primitive_type("int")
1619 BEnum = new_enum_type("enum foo", ('ab', 'cd'), (7, 7), BInt)
1625 BInt = new_primitive_type("int")
1626 BEnum = new_enum_type("enum foo", ('def', 'c', 'ab'), (0, 1, -20), BInt)
1641 BEnum2 = new_enum_type(unicode("foo"), (unicode('abc'),), (5,), BInt)
1667 BInt = new_primitive_type("int")
1668 BEnum = new_enum_type("foo", ('def', 'c', 'ab'), (0, 1, -20), BInt)
1674 BFunc = new_function_type((BInt,), BEnum)
1683 BInt = new_primitive_type("int")
1691 BFunc = new_function_type((BInt,), BEnum)
1700 BInt = new_primitive_type("int")
1704 BFunc = new_function_type((BInt,), BChar)
1714 BInt = new_primitive_type("int")
1722 BFunc = new_function_type((BInt,), BWChar)
1759 BInt = new_primitive_type("int")
1762 complete_struct_or_union(BStruct, [('a1', BInt, 1),
1764 ('a3', BInt, 3)])
1790 BInt = new_primitive_type("int")
1792 complete_struct_or_union(BStruct, [('a1', BInt, 1)])
1799 complete_struct_or_union(BUnion, [('a1', BInt, 1)])
1805 BInt = new_primitive_type("int")
1806 BPtr = new_pointer_type(BInt)
1807 rlist = [_weakref.ref(BInt),
1810 _weakref.ref(cast(BInt, 42)),
1819 BInt = new_primitive_type("int")
1821 class foo(type(BInt)): pass
1826 x = cast(BInt, 42)
1870 BInt = new_primitive_type("int")
1874 BArray = new_array_type(new_pointer_type(BInt), 5)
1888 BInt = new_primitive_type("int")
1889 p = newp(new_pointer_type(BInt), cast(BInt, 42))
1906 complete_struct_or_union(BStruct, [('a1', BInt, -1)])
1911 BArray = new_array_type(new_pointer_type(BInt), None)
1914 BArray6 = new_array_type(new_pointer_type(BInt), 6)
1925 complete_struct_or_union(BUnion, [('a1', BInt, -1)])
1930 BFunc = new_function_type((BInt,), BUInt)
2033 BInt = new_primitive_type("int")
2037 BFunc10 = new_function_type((BInt,), BStruct)
2045 complete_struct_or_union(BStruct11, [('a1', BInt, -1),
2046 ('a2', BInt, -1)])
2047 BFunc11 = new_function_type((BInt,), BStruct11)
2057 BFunc12 = new_function_type((BInt,), BStruct12)
2064 complete_struct_or_union(BStruct13, [('a1', BInt, -1),
2065 ('a2', BInt, -1),
2066 ('a3', BInt, -1)])
2067 BFunc13 = new_function_type((BInt,), BStruct13)
2078 BFunc14 = new_function_type((BInt,), BStruct14)
2086 ('a2', BInt, -1)])
2087 BFunc15 = new_function_type((BInt,), BStruct15)
2097 BFunc16 = new_function_type((BInt,), BStruct16)
2105 complete_struct_or_union(BStruct17, [('a1', BInt, -1),
2107 BFunc17 = new_function_type((BInt,), BStruct17)
2115 BFunc18 = new_function_type((BStruct17Ptr,), BInt)
2157 BInt = new_primitive_type("int")
2240 w = cast(BInt, u+'\u1234')
2249 w = cast(BInt, u+'\U00012345')
2251 py.test.raises(TypeError, cast, BInt, u+'')
2252 py.test.raises(TypeError, cast, BInt, u+'XX')
2253 assert int(cast(BInt, u+'a')) == ord('a')
2274 BFunc = new_function_type((BWCharP,), BInt, False)
2341 BInt = new_primitive_type("int")
2342 BArray = new_array_type(new_pointer_type(BInt), None) # int[]
2347 BArray = new_array_type(new_pointer_type(BInt), 7) # int[7]
2360 BInt = new_primitive_type("int")
2361 BIntP = new_pointer_type(BInt)
2366 py.test.raises(TypeError, iter, cast(BInt, 5))
2370 BInt = new_primitive_type("int")
2371 BIntP = new_pointer_type(BInt)
2374 q = cast(BInt, 124)
2518 BInt = new_primitive_type("int")
2519 BIntP = new_pointer_type(BInt)
2590 BInt = new_primitive_type("int")
2591 BIntPtr = new_pointer_type(BInt)
2595 x = newp(BIntPtr, cast(BInt, 42))
2601 x = newp(BULongLongPtr, cast(BInt, 42))
2603 py.test.raises(OverflowError, newp, BULongLongPtr, cast(BInt, -42))
2604 x = cast(BInt, cast(BInt, 42))
2606 x = cast(BInt, cast(BLongLong, 42))
2608 x = cast(BInt, cast(BULongLong, 42))
2610 x = cast(BULongLong, cast(BInt, 42))
2612 x = cast(BULongLong, cast(BInt, -42))
2614 x = cast(BIntPtr, cast(BInt, 42))
2615 assert int(cast(BInt, x)) == 42
2628 BInt = new_primitive_type("int")
2646 BFunc19 = new_function_type((BLongDouble, BInt), BLongDouble)
2679 BInt = new_primitive_type("int")
2683 complete_struct_or_union(BInnerStruct, [('a1', BInt, -1),
2687 assert sizeof(BInnerStruct) == sizeof(BInt) * 2 # with alignment
2688 assert sizeof(BStruct) == sizeof(BInt) * 3 # 'a3' is placed after
2692 assert d[0][1].type is BInt
2698 assert d[1][1].offset == sizeof(BInt)
2703 assert d[2][1].offset == sizeof(BInt) * 2
2708 BInt = new_primitive_type("int")
2711 complete_struct_or_union(BInnerUnion, [('a1', BInt, -1),
2712 ('a2', BInt, -1)])
2713 complete_struct_or_union(BStruct, [('b1', BInt, -1),
2715 ('b2', BInt, -1)])
2716 assert sizeof(BInnerUnion) == sizeof(BInt)
2717 assert sizeof(BStruct) == sizeof(BInt) * 3
2720 ('b1', 0 * sizeof(BInt), 0),
2721 ('a1', 1 * sizeof(BInt), 0),
2722 ('a2', 1 * sizeof(BInt), 1),
2723 ('b2', 2 * sizeof(BInt), 0),
2745 BInt = new_primitive_type("int")
2747 complete_struct_or_union(BStruct, [('b', BInt, -1, 1)],
2764 BInt = new_primitive_type("int")
2765 BIntP = new_pointer_type(BInt)
2850 BInt = new_primitive_type("int")
2851 BIntP = new_pointer_type(BInt)
2855 assert typeoffsetof(BArray, 51) == (BInt, 51 * size_of_int())
2856 assert typeoffsetof(BIntP, 51) == (BInt, 51 * size_of_int())
2857 assert typeoffsetof(BArray, -51) == (BInt, -51 * size_of_int())
2859 assert typeoffsetof(BArray, MAX) == (BInt, MAX * size_of_int())
2860 assert typeoffsetof(BIntP, MAX) == (BInt, MAX * size_of_int())
2864 BInt = new_primitive_type("int")
2866 complete_struct_or_union(BStruct, [('a1', BInt, 4)])
2955 BInt = new_primitive_type("int")
2956 BFunc = new_function_type((BCharP, BFILEP), BInt, False)
2957 BFunc2 = new_function_type((BFILEP, BCharP), BInt, True)
2987 BInt = new_primitive_type("int")
2988 BFunc = new_function_type((BCharP, B_NOT_FILEP), BInt, False)
3010 BInt = new_primitive_type("int")
3011 BFunc = new_function_type((BCharP, BFILEP), BInt, False)
3012 BFunc2 = new_function_type((BFILEP,), BInt, False)
3047 BInt = new_primitive_type("int")
3049 BFunc1 = new_function_type((BInt,), BVoid, False)
3050 BFunc2 = new_function_type((), BInt, False)
3244 BInt = new_primitive_type("int")
3248 ('b1', BInt, 9),
3303 ('', BInt, 0),
3304 ('', BInt, 0),
3346 BInt = new_primitive_type("int")
3347 BIntP = new_pointer_type(BInt)
3352 ('y', BInt)])
3355 complete_struct_or_union(BStruct, [('x', BInt),
3361 assert d[0][1].type is BInt
3397 assert len(buffer(p)) == sizeof(BInt) * 4
3398 assert sizeof(p[0]) == sizeof(BInt) * 4
3414 sizeof(BStruct) + 3 * sizeof(BInt),)
3416 sizeof(BStruct) + 3 * sizeof(BInt),)
3417 assert sizeof(p[0]) == sizeof(BStruct) + 3 * sizeof(BInt)
3439 ('n', BInt)])
3457 BInt = new_primitive_type("int")
3458 BIntP = new_pointer_type(BInt)
3462 ('y', BInt, -1, 12)])
3499 BInt = new_primitive_type("int")
3503 complete_struct_or_union(BStruct, [('x', BInt),
3544 BInt = new_primitive_type("intptr_t")
3546 assert int(cast(BInt, p)) == 100000
3547 assert int(cast(BInt, p + 42)) == 100042
3548 assert int(cast(BInt, p - (-42))) == 100042
3557 BInt = new_primitive_type("int")
3558 BArray = new_array_type(new_pointer_type(BInt), 10)
3560 assert sizeof(p[2:9]) == 7 * sizeof(BInt)
3757 BInt = new_primitive_type("int")
3758 BIntP = new_pointer_type(BInt)
3772 py.test.raises(TypeError, from_buffer, BInt, bytestring)
3789 complete_struct_or_union(BStruct, [('a1', BInt, -1),
3790 ('a2', BInt, -1)])
3881 BInt = new_primitive_type("int")
3882 p = cast(BInt, 42)
3887 BInt = new_primitive_type("int")
3888 BIntPtr = new_pointer_type(BInt)
3924 BInt = new_primitive_type("int")
3925 BFunc = new_function_type((BInt, BInt), BInt, False, stdcall)
3972 BInt = new_primitive_type("int")
3975 py.test.raises(TypeError, unpack, cast(BInt, 42), 1)
3977 BPtr = new_pointer_type(BInt)
3984 BFunc = new_function_type((BInt, BInt), BInt, False)
3995 complete_struct_or_union(BStruct, [('a1', BInt, -1),
3996 ('a2', BInt, -1)])
4009 BInt = new_primitive_type("int")
4010 p = cast(BInt, 42)
4012 p = newp(new_array_type(new_pointer_type(BInt), None), 5)
4017 complete_struct_or_union(BStruct, [('a2', BInt, -1),
4018 ('a1', BInt, -1)])