Skip to content

Commit

Permalink
Remove pyImageLibMod's custom Rich Compare macro.
Browse files Browse the repository at this point in the history
  • Loading branch information
Deledrius committed Jul 17, 2023
1 parent b5ead56 commit aff3465
Showing 1 changed file with 1 addition and 34 deletions.
35 changes: 1 addition & 34 deletions Sources/Plasma/FeatureLib/pfPython/pyImageLibModGlue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,39 +72,6 @@ PYTHON_INIT_DEFINITION(ptImageLibMod, args, keywords)
PYTHON_RETURN_INIT_OK;
}

PYTHON_RICH_COMPARE_DEFINITION(ptImageLibMod, obj1, obj2, compareType)
{
if ((obj1 == Py_None) || (obj2 == Py_None) || !pyImageLibMod::Check(obj1) || !pyImageLibMod::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 ptImageLibMod object");
PYTHON_RCOMPARE_ERROR;
}
}
pyImageLibMod* ilm1 = pyImageLibMod::ConvertFrom(obj1);
pyImageLibMod* ilm2 = pyImageLibMod::ConvertFrom(obj2);
if (compareType == Py_EQ)
{
if ((*ilm1) == (*ilm2))
PYTHON_RCOMPARE_TRUE;
PYTHON_RCOMPARE_FALSE;
}
else if (compareType == Py_NE)
{
if ((*ilm1) != (*ilm2))
PYTHON_RCOMPARE_TRUE;
PYTHON_RCOMPARE_FALSE;
}
PyErr_SetString(PyExc_NotImplementedError, "invalid comparison for a ptImageLibMod object");
PYTHON_RCOMPARE_ERROR;
}

PYTHON_METHOD_DEFINITION(ptImageLibMod, getImage, args)
{
ST::string name;
Expand Down Expand Up @@ -151,7 +118,7 @@ PYTHON_END_METHODS_TABLE;
#define ptImageLibMod_STR PYTHON_NO_STR
#define ptImageLibMod_GETATTRO PYTHON_NO_GETATTRO
#define ptImageLibMod_SETATTRO PYTHON_NO_SETATTRO
#define ptImageLibMod_RICH_COMPARE PYTHON_DEFAULT_RICH_COMPARE(ptImageLibMod)
#define ptImageLibMod_RICH_COMPARE PYTHON_NO_RICH_COMPARE
#define ptImageLibMod_GETSET PYTHON_NO_GETSET
#define ptImageLibMod_BASE PYTHON_NO_BASE
PLASMA_CUSTOM_TYPE(ptImageLibMod, "Params: ilmKey\nPlasma image library modifier class");
Expand Down

0 comments on commit aff3465

Please sign in to comment.