Skip to content

bpo-45459: Use type names in the internal C API #31669

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions Include/internal/pycore_interp.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ struct atexit_state {
*/
struct _is {

struct _is *next;
PyInterpreterState *next;

struct pythreads {
uint64_t next_unique_id;
/* The linked list of threads, newest first. */
struct _ts *head;
PyThreadState *head;
/* Used in Modules/_threadmodule.c. */
long count;
/* Support for runtime thread stack size tuning.
Expand Down Expand Up @@ -190,7 +190,7 @@ struct _is {
*/

/* the initial PyInterpreterState.threads.head */
struct _ts _initial_thread;
PyThreadState _initial_thread;
};


Expand All @@ -214,11 +214,11 @@ struct _xidregitem {
struct _xidregitem *next;
};

PyAPI_FUNC(struct _is*) _PyInterpreterState_LookUpID(int64_t);
PyAPI_FUNC(PyInterpreterState*) _PyInterpreterState_LookUpID(int64_t);

PyAPI_FUNC(int) _PyInterpreterState_IDInitref(struct _is *);
PyAPI_FUNC(int) _PyInterpreterState_IDIncref(struct _is *);
PyAPI_FUNC(void) _PyInterpreterState_IDDecref(struct _is *);
PyAPI_FUNC(int) _PyInterpreterState_IDInitref(PyInterpreterState *);
PyAPI_FUNC(int) _PyInterpreterState_IDIncref(PyInterpreterState *);
PyAPI_FUNC(void) _PyInterpreterState_IDDecref(PyInterpreterState *);

#ifdef __cplusplus
}
Expand Down
2 changes: 1 addition & 1 deletion Include/internal/pycore_moduleobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ extern "C" {
typedef struct {
PyObject_HEAD
PyObject *md_dict;
struct PyModuleDef *md_def;
PyModuleDef *md_def;
void *md_state;
PyObject *md_weaklist;
// for logging purposes after md_dict is cleared
Expand Down
2 changes: 1 addition & 1 deletion Include/internal/pycore_pystate.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ extern void _PySignal_AfterFork(void);
PyAPI_FUNC(int) _PyState_AddModule(
PyThreadState *tstate,
PyObject* module,
struct PyModuleDef* def);
PyModuleDef* def);


PyAPI_FUNC(int) _PyOS_InterruptOccurred(PyThreadState *tstate);
Expand Down
2 changes: 1 addition & 1 deletion Include/internal/pycore_runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ extern "C" {
#include "pycore_atomic.h" /* _Py_atomic_address */
#include "pycore_gil.h" // struct _gil_runtime_state
#include "pycore_global_objects.h" // struct _Py_global_objects
#include "pycore_interp.h" // struct _is
#include "pycore_interp.h" // PyInterpreterState
#include "pycore_unicodeobject.h" // struct _Py_unicode_runtime_ids


Expand Down
5 changes: 1 addition & 4 deletions Include/internal/pycore_traceback.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ extern "C" {
# error "this header requires Py_BUILD_CORE define"
#endif

/* Forward declaration */
struct _is;

/* Write the Python traceback into the file 'fd'. For example:

Traceback (most recent call first):
Expand Down Expand Up @@ -57,7 +54,7 @@ PyAPI_FUNC(void) _Py_DumpTraceback(

PyAPI_FUNC(const char*) _Py_DumpTracebackThreads(
int fd,
struct _is *interp,
PyInterpreterState *interp,
PyThreadState *current_tstate);

/* Write a Unicode object into the file descriptor fd. Encode the string to
Expand Down