refactoring, const

This commit is contained in:
Maxim Devaev
2022-07-20 06:42:18 +03:00
parent 5c747a5b5d
commit 2c9334d53f
35 changed files with 246 additions and 258 deletions

View File

@@ -48,7 +48,7 @@ static void _MemsinkObject_destroy_internals(_MemsinkObject *self) {
close(self->fd);
self->fd = -1;
}
if (self->frame) {
if (self->frame != NULL) {
us_frame_destroy(self->frame);
self->frame = NULL;
}
@@ -123,7 +123,7 @@ static PyObject *_MemsinkObject_exit(_MemsinkObject *self, PyObject *Py_UNUSED(i
}
static int _wait_frame(_MemsinkObject *self) {
long double deadline_ts = us_get_now_monotonic() + self->wait_timeout;
const long double deadline_ts = us_get_now_monotonic() + self->wait_timeout;
# define RETURN_OS_ERROR { \
Py_BLOCK_THREADS \
@@ -135,7 +135,7 @@ static int _wait_frame(_MemsinkObject *self) {
do {
Py_BEGIN_ALLOW_THREADS
int retval = us_flock_timedwait_monotonic(self->fd, self->lock_timeout);
const int retval = us_flock_timedwait_monotonic(self->fd, self->lock_timeout);
now = us_get_now_monotonic();
if (retval < 0 && errno != EWOULDBLOCK) {