Skip to content

Commit

Permalink
Fix gcc 14 errors. Fixes #28
Browse files Browse the repository at this point in the history
  • Loading branch information
mosquito committed May 28, 2024
1 parent 9831e1c commit 2a10ec5
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions caio/linux_aio.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <stdlib.h>
#include <sys/eventfd.h>
#include <sys/syscall.h>
#include <stdint.h>
#include <unistd.h>

#define PY_SSIZE_T_CLEAN
Expand Down Expand Up @@ -387,7 +388,7 @@ static PyObject* AIOContext_process_events(
for (i = 0; i < result; i++) {
ev = &events[i];

op = (AIOOperation*) ev->data;
op = (AIOOperation*)(uintptr_t) ev->data;
if (ev->res >= 0) {
op->iocb.aio_nbytes = ev->res;
} else {
Expand Down Expand Up @@ -574,7 +575,7 @@ static PyObject* AIOOperation_read(

memset(&self->iocb, 0, sizeof(struct iocb));

self->iocb.aio_data = self;
self->iocb.aio_data = (uint64_t)(uintptr_t) self;
self->context = NULL;
self->buffer = NULL;
self->py_buffer = NULL;
Expand Down Expand Up @@ -627,7 +628,7 @@ static PyObject* AIOOperation_write(

memset(&self->iocb, 0, sizeof(struct iocb));

self->iocb.aio_data = self;
self->iocb.aio_data = (uint64_t)(uintptr_t) self;

self->context = NULL;
self->buffer = NULL;
Expand Down Expand Up @@ -703,7 +704,7 @@ static PyObject* AIOOperation_fsync(

memset(&self->iocb, 0, sizeof(struct iocb));

self->iocb.aio_data = self;
self->iocb.aio_data = (uint64_t)(uintptr_t) self;
self->context = NULL;
self->buffer = NULL;
self->py_buffer = NULL;
Expand Down Expand Up @@ -748,7 +749,7 @@ static PyObject* AIOOperation_fdsync(

memset(&self->iocb, 0, sizeof(struct iocb));

self->iocb.aio_data = self;
self->iocb.aio_data = (uint64_t)(uintptr_t) self;
self->buffer = NULL;
self->py_buffer = NULL;

Expand Down Expand Up @@ -876,7 +877,7 @@ static PyMemberDef AIOOperation_members[] = {

/*
AIOOperation methods
*/
*/
static PyMethodDef AIOOperation_methods[] = {
{
"read",
Expand Down Expand Up @@ -917,7 +918,7 @@ static PyMethodDef AIOOperation_methods[] = {

/*
AIOOperation class
*/
*/
static PyTypeObject
AIOOperationType = {
PyVarObject_HEAD_INIT(NULL, 0)
Expand Down

0 comments on commit 2a10ec5

Please sign in to comment.