Skip to content

Commit 3eb4ea0

Browse files
Prerak Singhczgdp1807
Prerak Singh
authored andcommitted
installation error fixing
1 parent c77c0e1 commit 3eb4ea0

File tree

4 files changed

+5
-11
lines changed

4 files changed

+5
-11
lines changed

pydatastructs/utils/_backend/cpp/AdjacencyListGraphNode.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ static void AdjacencyListGraphNode_dealloc(AdjacencyListGraphNode* self) {
2727

2828
static PyObject* AdjacencyListGraphNode_new(PyTypeObject* type, PyObject* args, PyObject* kwds) {
2929
AdjacencyListGraphNode* self;
30-
self = reinterpret_cast<AdjacencyListGraphNode*>(type)->tp_alloc(type, 0);
30+
self = reinterpret_cast<AdjacencyListGraphNode*>(type->tp_alloc(type, 0));
3131
if (!self) return NULL;
3232
new (&self->adjacent) std::unordered_map<std::string, PyObject*>();
3333

pydatastructs/utils/_backend/cpp/AdjacencyMatrixGraphNode.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ typedef struct {
1313
static void AdjacencyMatrixGraphNode_dealloc(AdjacencyMatrixGraphNode* self){
1414
Py_XDECREF(self->super.data);
1515
Py_TYPE(self)->tp_free(reinterpret_cast<PyTypeObject*>(self));
16-
}xf
16+
}
1717

1818
static PyObject* AdjacencyMatrixGraphNode_new(PyTypeObject* type, PyObject* args, PyObject* kwds){
1919
PyObject* base_obj = GraphNode_new(type, args, kwds);

pydatastructs/utils/_backend/cpp/GraphEdge.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ static void GraphEdge_dealloc(GraphEdge* self) {
2424

2525
static PyObject* GraphEdge_new(PyTypeObject* type, PyObject* args, PyObject* kwds) {
2626
GraphEdge* self;
27-
self = reinterpret_cast<GraphEdge*>(type)->tp_alloc(type, 0);
27+
self = reinterpret_cast<GraphEdge*>(type->tp_alloc(type, 0));
2828
if (!self) return NULL;
2929

3030
static char* kwlist[] = {"node1", "node2", "value", NULL};

pydatastructs/utils/_backend/cpp/GraphNode.hpp

+2-8
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ static void GraphNode_dealloc(GraphNode* self){
1818

1919
static PyObject* GraphNode_new(PyTypeObject* type, PyObject* args, PyObject* kwds){
2020
GraphNode* self;
21-
self = reinterpret_cast<GraphNode*>(type)->tp_alloc(type,0);
21+
self = reinterpret_cast<GraphNode*>(type->tp_alloc(type,0));
2222
if (!self) return NULL;
2323

2424
static char* kwlist[] = { "name", "data", NULL };
@@ -79,12 +79,6 @@ static int GraphNode_set(GraphNode* self, PyObject *value, void *closure) {
7979
return 0;
8080
}
8181

82-
static PyGetSetDef GraphNode_get_setters[] = {
83-
{"name", (getter)GraphNode_get, (setter)GraphNode_set, "node name", reinterpret_cast<void*>("name")},
84-
{"data", (getter)GraphNode_get, (setter)GraphNode_set, "node data", reinterpret_cast<void*>("data")},
85-
{NULL},
86-
};
87-
8882
static PyTypeObject GraphNodeType = {
8983
/* tp_name */ PyVarObject_HEAD_INIT(NULL, 0) "GraphNode",
9084
/* tp_basicsize */ sizeof(GraphNode),
@@ -114,7 +108,7 @@ static PyTypeObject GraphNodeType = {
114108
/* tp_iternext */ 0,
115109
/* tp_methods */ 0,
116110
/* tp_members */ 0,
117-
/* tp_getset */ GraphNode_get_setters,
111+
/* tp_getset */ 0,
118112
/* tp_base */ &PyBaseObject_Type,
119113
/* tp_dict */ 0,
120114
/* tp_descr_get */ 0,

0 commit comments

Comments
 (0)