Skip to content

Commit

Permalink
Fix a warning when compiling the C stubs with OCaml 5
Browse files Browse the repository at this point in the history
  • Loading branch information
MisterDA committed Jan 17, 2023
1 parent 3d6f0fa commit e5b4d29
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/unix/unix_c/unix_tcsetattr_job.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ CAMLprim value lwt_unix_tcsetattr_job(value fd, value when, value termios)
LWT_UNIX_INIT_JOB(job, tcsetattr, 0);
job->fd = Int_val(fd);
job->when = when_flag_table[Int_val(when)];
memcpy(&job->termios, &Field(termios, 0), NFIELDS * sizeof(value));
memcpy(&job->termios, (value *)&Field(termios, 0), NFIELDS * sizeof(value));
return lwt_unix_alloc_job(&job->job);
}
#endif
4 changes: 2 additions & 2 deletions src/unix/unix_c/unix_termios_conversion.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ static tcflag_t *choose_field(struct termios *terminal_status, long field)
}
}

void encode_terminal_status(struct termios *terminal_status, value *dst)
void encode_terminal_status(struct termios *terminal_status, volatile value *dst)
{
long *pc;
int i;
Expand Down Expand Up @@ -207,7 +207,7 @@ void encode_terminal_status(struct termios *terminal_status, value *dst)
}
}

int decode_terminal_status(struct termios *terminal_status, value *src)
int decode_terminal_status(struct termios *terminal_status, volatile value *src)
{
long *pc;
int i;
Expand Down
4 changes: 2 additions & 2 deletions src/unix/unix_c/unix_termios_conversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@

#define NFIELDS 38

void encode_terminal_status(struct termios *terminal_status, value *dst);
int decode_terminal_status(struct termios *terminal_status, value *src);
void encode_terminal_status(struct termios *terminal_status, volatile value *dst);
int decode_terminal_status(struct termios *terminal_status, volatile value *src);
#endif

0 comments on commit e5b4d29

Please sign in to comment.