FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
cpython/Modules/_testcapi/util.h at main · python/cpython · GitHub
python
cpython
Repository navigation
Code
Issues
5k+
(5k+)
Pull requests
2.7k
(2.7k)
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
cpython
/
Modules
/
_testcapi
/
util.h
Copy path
More file actions
More file actions
Latest commit
History
History
History
53 lines (49 loc) · 2.01 KB
Breadcrumbs
cpython
/
Modules
/
_testcapi
/
util.h
Copy path
File metadata and controls
53 lines (49 loc) · 2.01 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#define
NULLABLE
(
x
) do { \
if (x == Py_None) { \
x = NULL; \
} \
} while (0);
#define
RETURN_INT
(
value
) do { \
int _ret = (value); \
if (_ret == -1) { \
assert(PyErr_Occurred()); \
return NULL; \
} \
assert(!PyErr_Occurred()); \
return PyLong_FromLong(_ret); \
} while (0)
#define
RETURN_UINT
(
value
) do { \
unsigned int _ret = (value); \
if (_ret == (unsigned int)-1) { \
assert(PyErr_Occurred()); \
return NULL; \
} \
assert(!PyErr_Occurred()); \
return PyLong_FromUnsignedLong(_ret); \
} while (0)
#define
RETURN_SIZE
(
value
) do { \
Py_ssize_t _ret = (value); \
if (_ret == -1) { \
assert(PyErr_Occurred()); \
return NULL; \
} \
assert(!PyErr_Occurred()); \
return PyLong_FromSsize_t(_ret); \
} while (0)
/* Marker to check that pointer value was set. */
static
const
char
uninitialized
[]
=
"uninitialized"
;
#define
UNINITIALIZED_PTR
((void *)uninitialized)
/* Marker to check that Py_ssize_t value was set. */
#define
UNINITIALIZED_SIZE
((Py_ssize_t)236892191)
/* Marker to check that integer value was set. */
#define
UNINITIALIZED_INT
(63256717)
/*
* Marker to indicate that a NULL parameter would not be allowed
* at runtime but that the test interface will check that it is
* indeed the case.
*
* Use this macro only if passing NULL to the C API would raise
* a catchable exception (and not a fatal exception that would
* crash the interpreter).
*/
#define
NULL_WOULD_RAISE
(
NAME
) NAME
Back
|
FazBrowse Home
|
New Git URL