Test: modernize C++11
* remove redundant void-arg * use nullptr
This commit is contained in:
@@ -57,7 +57,7 @@ private:
|
||||
}
|
||||
Py::Object setTest(const Py::Tuple& args)
|
||||
{
|
||||
char *pstr=0;
|
||||
char *pstr=nullptr;
|
||||
if (!PyArg_ParseTuple(args.ptr(), "|s", &pstr))
|
||||
throw Py::Exception();
|
||||
|
||||
@@ -70,7 +70,7 @@ private:
|
||||
}
|
||||
Py::Object addTest(const Py::Tuple& args)
|
||||
{
|
||||
char *pstr=0;
|
||||
char *pstr=nullptr;
|
||||
if (!PyArg_ParseTuple(args.ptr(), "|s", &pstr))
|
||||
throw Py::Exception();
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ using namespace TestGui;
|
||||
|
||||
/* TRANSLATOR TestGui::UnitTestDialog */
|
||||
|
||||
UnitTestDialog* UnitTestDialog::_instance=0;
|
||||
UnitTestDialog* UnitTestDialog::_instance=nullptr;
|
||||
|
||||
/**
|
||||
* Creates and returns the one and only instance of this dialog.
|
||||
@@ -58,9 +58,9 @@ UnitTestDialog* UnitTestDialog::instance()
|
||||
*/
|
||||
void UnitTestDialog::destruct ()
|
||||
{
|
||||
if (_instance != 0) {
|
||||
if (_instance != nullptr) {
|
||||
UnitTestDialog *pTmp = _instance;
|
||||
_instance = 0;
|
||||
_instance = nullptr;
|
||||
delete pTmp;
|
||||
}
|
||||
}
|
||||
@@ -70,7 +70,7 @@ void UnitTestDialog::destruct ()
|
||||
*/
|
||||
bool UnitTestDialog::hasInstance()
|
||||
{
|
||||
return _instance != 0;
|
||||
return _instance != nullptr;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -60,7 +60,7 @@ public:
|
||||
static bool hasInstance();
|
||||
|
||||
protected:
|
||||
UnitTestDialog(QWidget* parent = 0, Qt::WindowFlags f = Qt::WindowFlags());
|
||||
UnitTestDialog(QWidget* parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags());
|
||||
~UnitTestDialog();
|
||||
void setProgressColor(const QColor& col);
|
||||
|
||||
|
||||
@@ -96,8 +96,8 @@ Py::Object UnitTestDialogPy::clearErrorList(const Py::Tuple& args)
|
||||
|
||||
Py::Object UnitTestDialogPy::insertError(const Py::Tuple& args)
|
||||
{
|
||||
char *failure=0;
|
||||
char *details=0;
|
||||
char *failure=nullptr;
|
||||
char *details=nullptr;
|
||||
if (!PyArg_ParseTuple(args.ptr(), "ss", &failure,&details))
|
||||
throw Py::Exception();
|
||||
|
||||
@@ -108,7 +108,7 @@ Py::Object UnitTestDialogPy::insertError(const Py::Tuple& args)
|
||||
|
||||
Py::Object UnitTestDialogPy::setUnitTest(const Py::Tuple& args)
|
||||
{
|
||||
char *pstr=0;
|
||||
char *pstr=nullptr;
|
||||
if (!PyArg_ParseTuple(args.ptr(), "s", &pstr))
|
||||
throw Py::Exception();
|
||||
|
||||
@@ -125,7 +125,7 @@ Py::Object UnitTestDialogPy::getUnitTest(const Py::Tuple& args)
|
||||
|
||||
Py::Object UnitTestDialogPy::setStatusText(const Py::Tuple& args)
|
||||
{
|
||||
char *pstr=0;
|
||||
char *pstr=nullptr;
|
||||
if (!PyArg_ParseTuple(args.ptr(), "s", &pstr))
|
||||
throw Py::Exception();
|
||||
|
||||
@@ -136,7 +136,7 @@ Py::Object UnitTestDialogPy::setStatusText(const Py::Tuple& args)
|
||||
Py::Object UnitTestDialogPy::setProgressFrac(const Py::Tuple& args)
|
||||
{
|
||||
float fraction;
|
||||
char* pColor=0;
|
||||
char* pColor=nullptr;
|
||||
if (!PyArg_ParseTuple(args.ptr(), "f|s",&fraction, &pColor))
|
||||
throw Py::Exception();
|
||||
|
||||
@@ -149,8 +149,8 @@ Py::Object UnitTestDialogPy::setProgressFrac(const Py::Tuple& args)
|
||||
|
||||
Py::Object UnitTestDialogPy::errorDialog(const Py::Tuple& args)
|
||||
{
|
||||
char *title=0;
|
||||
char *message=0;
|
||||
char *title=nullptr;
|
||||
char *message=nullptr;
|
||||
if (!PyArg_ParseTuple(args.ptr(), "ss", &title, &message))
|
||||
throw Py::Exception();
|
||||
UnitTestDialog::instance()->showErrorDialog(title,message);
|
||||
|
||||
@@ -35,7 +35,7 @@ class UnitTestDialog;
|
||||
class UnitTestDialogPy : public Py::PythonExtension<UnitTestDialogPy>
|
||||
{
|
||||
public:
|
||||
static void init_type(void); // announce properties and methods
|
||||
static void init_type(); // announce properties and methods
|
||||
|
||||
UnitTestDialogPy();
|
||||
~UnitTestDialogPy();
|
||||
|
||||
Reference in New Issue
Block a user