Skip to content

Commit

Permalink
Remove pyLayerGlue's custom Rich Compare macro.
Browse files Browse the repository at this point in the history
  • Loading branch information
Deledrius committed Nov 10, 2024
1 parent fc60146 commit a6c66f7
Showing 1 changed file with 1 addition and 34 deletions.
35 changes: 1 addition & 34 deletions Sources/Plasma/FeatureLib/pfPython/pyLayerGlue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,39 +70,6 @@ PYTHON_INIT_DEFINITION(ptLayer, args, keywords)
PYTHON_RETURN_INIT_OK;
}

PYTHON_RICH_COMPARE_DEFINITION(ptLayer, obj1, obj2, compareType)
{
if ((obj1 == Py_None) || (obj2 == Py_None) || !pyLayer::Check(obj1) || !pyLayer::Check(obj2))
{
// if they aren't the same type, they don't match, obviously (we also never equal none)
if (compareType == Py_EQ)
PYTHON_RCOMPARE_FALSE;
else if (compareType == Py_NE)
PYTHON_RCOMPARE_TRUE;
else
{
PyErr_SetString(PyExc_NotImplementedError, "invalid comparison for a ptLayer object");
PYTHON_RCOMPARE_ERROR;
}
}
pyLayer* layer1 = pyLayer::ConvertFrom(obj1);
pyLayer* layer2 = pyLayer::ConvertFrom(obj2);
if (compareType == Py_EQ)
{
if ((*layer1) == (*layer2))
PYTHON_RCOMPARE_TRUE;
PYTHON_RCOMPARE_FALSE;
}
else if (compareType == Py_NE)
{
if ((*layer1) != (*layer2))
PYTHON_RCOMPARE_TRUE;
PYTHON_RCOMPARE_FALSE;
}
PyErr_SetString(PyExc_NotImplementedError, "invalid comparison for a ptLayer object");
PYTHON_RCOMPARE_ERROR;
}

PYTHON_GET_DEFINITION(ptLayer, texture)
{
return self->fThis->GetTexture();
Expand Down Expand Up @@ -133,7 +100,7 @@ PYTHON_END_METHODS_TABLE;
#define ptLayer_STR PYTHON_NO_STR
#define ptLayer_GETATTRO PYTHON_NO_GETATTRO
#define ptLayer_SETATTRO PYTHON_NO_SETATTRO
#define ptLayer_RICH_COMPARE PYTHON_DEFAULT_RICH_COMPARE(ptLayer)
#define ptLayer_RICH_COMPARE PYTHON_NO_RICH_COMPARE
#define ptLayer_GETSET PYTHON_DEFAULT_GETSET(ptLayer)
#define ptLayer_BASE PYTHON_NO_BASE
PLASMA_CUSTOM_TYPE(ptLayer, "Params: layerKey\nPlasma layer class");
Expand Down

0 comments on commit a6c66f7

Please sign in to comment.