Skip to content

Commit

Permalink
Small code style changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Safihre committed Aug 18, 2023
1 parent af8224c commit 7b45642
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
1 change: 0 additions & 1 deletion src/sparse.cc
Expand Up @@ -89,7 +89,6 @@ PyObject *sparse(PyObject *self, PyObject *args)
}
#endif

done:
Py_XDECREF(Py_file_fileno);
Py_XDECREF(Py_file_handle);
Py_XDECREF(Py_file_truncate);
Expand Down
10 changes: 5 additions & 5 deletions src/unlocked_ssl.cc
Expand Up @@ -120,12 +120,12 @@ void openssl_init() {
*(void**)&SSL_get_error = dlsym(openssl_handle, "SSL_get_error");
*(void**)&SSL_get_shutdown = dlsym(openssl_handle, "SSL_get_shutdown");

error:
error:
if (!openssl_linked() && openssl_handle) dlclose(openssl_handle);
Py_XDECREF(_ssl_module_path);
#endif

cleanup:
cleanup:
Py_XDECREF(ssl_module);
Py_XDECREF(_ssl_module);
if (!openssl_linked()) {
Expand Down Expand Up @@ -223,11 +223,11 @@ static PyObject* unlocked_ssl_recv_into_impl(PySSLSocket *self, Py_ssize_t len,
goto error;
}

done:
done:
Py_XDECREF(sock);
return PyLong_FromSize_t(count);

error:
error:
Py_XDECREF(sock);
return NULL;
}
Expand Down Expand Up @@ -271,7 +271,7 @@ PyObject* unlocked_ssl_recv_into(PyObject* self, PyObject* args) {

retval = unlocked_ssl_recv_into_impl((PySSLSocket*)Py_ssl_socket, len, &Py_buffer);

error:
error:
PyBuffer_Release(&Py_buffer);
Py_XDECREF(Py_ssl_socket);
Py_XDECREF(blocking);
Expand Down
2 changes: 1 addition & 1 deletion src/yenc.cc
Expand Up @@ -45,6 +45,7 @@ static void* my_memmem(const void* haystack, size_t haystackLen, const void* nee
}
return p;
}

static inline char* my_memstr(const void* haystack, size_t haystackLen, const char* str, int pointToEnd) {
size_t len = strlen(str);
char* p = (char*)my_memmem(haystack, haystackLen, str, len);
Expand All @@ -53,7 +54,6 @@ static inline char* my_memstr(const void* haystack, size_t haystackLen, const ch
return p;
}


PyObject* yenc_decode(PyObject* self, PyObject* Py_bytesarray_obj) {
// The input/output PyObjects
(void)self;
Expand Down

0 comments on commit 7b45642

Please sign in to comment.