Skip to content

Commit

Permalink
Use Py_RETURN_NONE macro
Browse files Browse the repository at this point in the history
  • Loading branch information
Flamefire committed Jun 3, 2020
1 parent f1531e9 commit 6970aad
Showing 1 changed file with 11 additions and 22 deletions.
33 changes: 11 additions & 22 deletions src/methods.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,14 @@ extern "C"
static PyObject* enable_recording(PyObject* self, PyObject* args)
{
SCOREP_User_EnableRecording();
Py_INCREF(Py_None);
return Py_None;
Py_RETURN_NONE;
}

static PyObject* disable_recording(PyObject* self, PyObject* args)
{

SCOREP_User_DisableRecording();
Py_INCREF(Py_None);
return Py_None;
Py_RETURN_NONE;
}

/** This code is not thread save. However, this does not matter as the python GIL is not
Expand All @@ -43,8 +41,7 @@ extern "C"
region += region_name;
scorepy::region_begin(region, module, file_name, line_number);

Py_INCREF(Py_None);
return Py_None;
Py_RETURN_NONE;
}

/** This code is not thread save. However, this does not matter as the python GIL is not
Expand All @@ -64,8 +61,7 @@ extern "C"
region += region_name;
scorepy::region_end(region);

Py_INCREF(Py_None);
return Py_None;
Py_RETURN_NONE;
}

static PyObject* rewind_begin(PyObject* self, PyObject* args)
Expand All @@ -79,8 +75,7 @@ extern "C"

scorepy::rewind_begin(region_name, file_name, line_number);

Py_INCREF(Py_None);
return Py_None;
Py_RETURN_NONE;
}

static PyObject* rewind_end(PyObject* self, PyObject* args)
Expand All @@ -94,8 +89,7 @@ extern "C"
// TODO cover PyObject_IsTrue(value) == -1 (error case)
scorepy::rewind_end(region_name, PyObject_IsTrue(value) == 1);

Py_INCREF(Py_None);
return Py_None;
Py_RETURN_NONE;
}

static PyObject* oa_region_begin(PyObject* self, PyObject* args)
Expand All @@ -109,8 +103,7 @@ extern "C"

scorepy::oa_region_begin(region, file_name, line_number);

Py_INCREF(Py_None);
return Py_None;
Py_RETURN_NONE;
}

static PyObject* oa_region_end(PyObject* self, PyObject* args)
Expand All @@ -122,8 +115,7 @@ extern "C"

scorepy::oa_region_end(region);

Py_INCREF(Py_None);
return Py_None;
Py_RETURN_NONE;
}

static PyObject* parameter_string(PyObject* self, PyObject* args)
Expand All @@ -136,8 +128,7 @@ extern "C"

scorepy::parameter_string(name, value);

Py_INCREF(Py_None);
return Py_None;
Py_RETURN_NONE;
}

static PyObject* parameter_int(PyObject* self, PyObject* args)
Expand All @@ -150,8 +141,7 @@ extern "C"

scorepy::parameter_int(name, value);

Py_INCREF(Py_None);
return Py_None;
Py_RETURN_NONE;
}

static PyObject* parameter_uint(PyObject* self, PyObject* args)
Expand All @@ -164,8 +154,7 @@ extern "C"

scorepy::parameter_uint(name, value);

Py_INCREF(Py_None);
return Py_None;
Py_RETURN_NONE;
}

static PyObject* get_expiriment_dir_name(PyObject* self, PyObject* args)
Expand Down

0 comments on commit 6970aad

Please sign in to comment.