diff --git a/kitty/child-monitor.c b/kitty/child-monitor.c index da19570f2..2c4aa91f1 100644 --- a/kitty/child-monitor.c +++ b/kitty/child-monitor.c @@ -153,7 +153,7 @@ mask_kitty_signals_process_wide(PyObject *self UNUSED, PyObject *a UNUSED) { } static PyObject * -new(PyTypeObject *type, PyObject *args, PyObject UNUSED *kwds) { +new_childmonitor_object(PyTypeObject *type, PyObject *args, PyObject UNUSED *kwds) { ChildMonitor *self; PyObject *dump_callback, *death_notify; int talk_fd = -1, listen_fd = -1; @@ -1933,7 +1933,7 @@ PyTypeObject ChildMonitor_Type = { .tp_flags = Py_TPFLAGS_DEFAULT, .tp_doc = "ChildMonitor", .tp_methods = methods, - .tp_new = new, + .tp_new = new_childmonitor_object, }; diff --git a/kitty/cursor.c b/kitty/cursor.c index 23bc04332..b80265e0f 100644 --- a/kitty/cursor.c +++ b/kitty/cursor.c @@ -10,7 +10,7 @@ #include static PyObject * -new(PyTypeObject *type, PyObject UNUSED *args, PyObject UNUSED *kwds) { +new_cursor_object(PyTypeObject *type, PyObject UNUSED *args, PyObject UNUSED *kwds) { Cursor *self; self = (Cursor *)type->tp_alloc(type, 0); @@ -310,7 +310,7 @@ PyTypeObject Cursor_Type = { .tp_methods = methods, .tp_members = members, .tp_getset = getseters, - .tp_new = new, + .tp_new = new_cursor_object, }; RICHCMP(Cursor) @@ -332,7 +332,7 @@ copy(Cursor *self, PyObject *a UNUSED) { } Cursor *alloc_cursor(void) { - return (Cursor*)new(&Cursor_Type, NULL, NULL); + return (Cursor*)new_cursor_object(&Cursor_Type, NULL, NULL); } INIT_TYPE(Cursor) diff --git a/kitty/disk-cache.c b/kitty/disk-cache.c index f36750db3..f84c98754 100644 --- a/kitty/disk-cache.c +++ b/kitty/disk-cache.c @@ -66,7 +66,7 @@ free_cache_entry(CacheEntry *e) { #define mutex(op) pthread_mutex_##op(&self->lock) static PyObject* -new(PyTypeObject *type, PyObject UNUSED *args, PyObject UNUSED *kwds) { +new_diskcache_object(PyTypeObject *type, PyObject UNUSED *args, PyObject UNUSED *kwds) { DiskCache *self; self = (DiskCache*)type->tp_alloc(type, 0); if (self) { @@ -783,7 +783,7 @@ PyTypeObject DiskCache_Type = { .tp_doc = "A disk based secure cache", .tp_methods = methods, .tp_members = members, - .tp_new = new, + .tp_new = new_diskcache_object, }; static PyMethodDef module_methods[] = { @@ -792,4 +792,4 @@ static PyMethodDef module_methods[] = { }; INIT_TYPE(DiskCache) -PyObject* create_disk_cache(void) { return new(&DiskCache_Type, NULL, NULL); } +PyObject* create_disk_cache(void) { return new_diskcache_object(&DiskCache_Type, NULL, NULL); } diff --git a/kitty/graphics.c b/kitty/graphics.c index 5a14d089e..e2ea4a80d 100644 --- a/kitty/graphics.c +++ b/kitty/graphics.c @@ -2210,7 +2210,7 @@ grman_handle_command(GraphicsManager *self, const GraphicsCommand *g, const uint // Boilerplate {{{ static PyObject * -new(PyTypeObject UNUSED *type, PyObject UNUSED *args, PyObject UNUSED *kwds) { +new_graphicsmanager_object(PyTypeObject UNUSED *type, PyObject UNUSED *args, PyObject UNUSED *kwds) { PyObject *ans = (PyObject*)grman_alloc(false); if (ans == NULL) PyErr_NoMemory(); return ans; @@ -2343,7 +2343,7 @@ PyTypeObject GraphicsManager_Type = { .tp_dealloc = (destructor)dealloc, .tp_flags = Py_TPFLAGS_DEFAULT, .tp_doc = "GraphicsManager", - .tp_new = new, + .tp_new = new_graphicsmanager_object, .tp_methods = methods, .tp_members = members, .tp_getset = getsets, diff --git a/kitty/history.c b/kitty/history.c index 6a79cb713..f527f3413 100644 --- a/kitty/history.c +++ b/kitty/history.c @@ -133,7 +133,7 @@ create_historybuf(PyTypeObject *type, unsigned int xnum, unsigned int ynum, unsi } static PyObject * -new(PyTypeObject *type, PyObject *args, PyObject UNUSED *kwds) { +new_history_object(PyTypeObject *type, PyObject *args, PyObject UNUSED *kwds) { unsigned int xnum = 1, ynum = 1, pagerhist_sz = 0; if (!PyArg_ParseTuple(args, "II|I", &ynum, &xnum, &pagerhist_sz)) return NULL; HistoryBuf *ans = create_historybuf(type, xnum, ynum, pagerhist_sz); @@ -569,7 +569,7 @@ PyTypeObject HistoryBuf_Type = { .tp_methods = methods, .tp_members = members, .tp_str = (reprfunc)__str__, - .tp_new = new + .tp_new = new_history_object }; INIT_TYPE(HistoryBuf) diff --git a/kitty/keys.c b/kitty/keys.c index 5de116ec6..b31ec8ed3 100644 --- a/kitty/keys.c +++ b/kitty/keys.c @@ -22,7 +22,7 @@ typedef struct { static PyObject* convert_glfw_key_event_to_python(const GLFWkeyevent *ev); static PyObject* -new(PyTypeObject *type UNUSED, PyObject *args, PyObject *kw) { +new_keyevent_object(PyTypeObject *type UNUSED, PyObject *args, PyObject *kw) { static char *kwds[] = {"key", "shifted_key", "alternate_key", "mods", "action", "native_key", "ime_state", "text", NULL}; GLFWkeyevent ev = {.action=GLFW_PRESS}; if (!PyArg_ParseTupleAndKeywords(args, kw, "I|IIiiiiz", kwds, &ev.key, &ev.shifted_key, &ev.alternate_key, &ev.mods, &ev.action, &ev.native_key, &ev.ime_state, &ev.text)) return NULL; @@ -69,7 +69,7 @@ PyTypeObject PyKeyEvent_Type = { .tp_flags = Py_TPFLAGS_DEFAULT, .tp_doc = "A key event", .tp_members = members, - .tp_new = new, + .tp_new = new_keyevent_object, }; static PyObject* diff --git a/kitty/line-buf.c b/kitty/line-buf.c index 42b30d991..fb5d84fb8 100644 --- a/kitty/line-buf.c +++ b/kitty/line-buf.c @@ -71,7 +71,7 @@ clear(LineBuf *self, PyObject *a UNUSED) { } static PyObject * -new(PyTypeObject *type, PyObject *args, PyObject UNUSED *kwds) { +new_linebuf_object(PyTypeObject *type, PyObject *args, PyObject UNUSED *kwds) { LineBuf *self; unsigned int xnum = 1, ynum = 1; @@ -555,7 +555,7 @@ PyTypeObject LineBuf_Type = { .tp_methods = methods, .tp_members = members, .tp_str = (reprfunc)__str__, - .tp_new = new + .tp_new = new_linebuf_object }; INIT_TYPE(LineBuf) @@ -637,5 +637,5 @@ rewrap(LineBuf *self, PyObject *args) { } LineBuf *alloc_linebuf(unsigned int lines, unsigned int columns) { - return (LineBuf*)new(&LineBuf_Type, Py_BuildValue("II", lines, columns), NULL); + return (LineBuf*)new_linebuf_object(&LineBuf_Type, Py_BuildValue("II", lines, columns), NULL); } diff --git a/kitty/line.c b/kitty/line.c index 229221911..1a1011b10 100644 --- a/kitty/line.c +++ b/kitty/line.c @@ -14,7 +14,7 @@ extern PyTypeObject Cursor_Type; static PyObject * -new(PyTypeObject UNUSED *type, PyObject UNUSED *args, PyObject UNUSED *kwds) { +new_line_object(PyTypeObject UNUSED *type, PyObject UNUSED *args, PyObject UNUSED *kwds) { PyErr_SetString(PyExc_TypeError, "Line objects cannot be instantiated directly, create them using LineBuf.line()"); return NULL; } @@ -955,7 +955,7 @@ PyTypeObject Line_Type = { .tp_richcompare = richcmp, .tp_doc = "Lines", .tp_methods = methods, - .tp_new = new + .tp_new = new_line_object }; Line *alloc_line(void) { diff --git a/kitty/screen.c b/kitty/screen.c index 417c81537..f62db4241 100644 --- a/kitty/screen.c +++ b/kitty/screen.c @@ -90,7 +90,7 @@ static void update_overlay_line_data(Screen *self, uint8_t *data); } static PyObject* -new(PyTypeObject *type, PyObject *args, PyObject UNUSED *kwds) { +new_screen_object(PyTypeObject *type, PyObject *args, PyObject UNUSED *kwds) { Screen *self; int ret = 0; PyObject *callbacks = Py_None, *test_child = Py_None; @@ -4770,7 +4770,7 @@ PyTypeObject Screen_Type = { .tp_doc = "Screen", .tp_methods = methods, .tp_members = members, - .tp_new = new, + .tp_new = new_screen_object, .tp_getset = getsetters, }; diff --git a/kitty/shlex.c b/kitty/shlex.c index fe159a21f..ef3086dbb 100644 --- a/kitty/shlex.c +++ b/kitty/shlex.c @@ -19,7 +19,7 @@ typedef struct { static PyObject * -new(PyTypeObject *type, PyObject *args, PyObject UNUSED *kwds) { +new_shlex_object(PyTypeObject *type, PyObject *args, PyObject UNUSED *kwds) { Shlex *self; self = (Shlex *)type->tp_alloc(type, 0); if (self) { @@ -154,7 +154,7 @@ PyTypeObject Shlex_Type = { .tp_flags = Py_TPFLAGS_DEFAULT, .tp_doc = "Lexing like a shell", .tp_methods = methods, - .tp_new = new, + .tp_new = new_shlex_object, }; INIT_TYPE(Shlex) diff --git a/kitty/vt-parser.c b/kitty/vt-parser.c index cc2b363d8..bbfac77e8 100644 --- a/kitty/vt-parser.c +++ b/kitty/vt-parser.c @@ -1470,7 +1470,7 @@ parse_worker(void *p, ParseData *pd, bool flush) { run_worker(p, pd, flush); } #ifndef DUMP_COMMANDS static PyObject* -new(PyTypeObject *type UNUSED, PyObject *args, PyObject UNUSED *kwds) { +new_vtparser_object(PyTypeObject *type UNUSED, PyObject *args, PyObject UNUSED *kwds) { id_type window_id=0; if (!PyArg_ParseTuple(args, "|K", &window_id)) return NULL; return (PyObject*) alloc_vt_parser(window_id); @@ -1525,7 +1525,7 @@ PyTypeObject Parser_Type = { .tp_doc = "VT Escape code parser", .tp_methods = methods, .tp_getset = getsetters, - .tp_new = new, + .tp_new = new_vtparser_object, }; Parser*