Skip to content

Commit 54996ed

Browse files
MisterDAraphael-proust
authored andcommitted
Fix a warning when compiling the C stubs with OCaml 5
1 parent c97b887 commit 54996ed

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/unix/unix_c/unix_tcsetattr_job.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ CAMLprim value lwt_unix_tcsetattr_job(value fd, value when, value termios)
5656
LWT_UNIX_INIT_JOB(job, tcsetattr, 0);
5757
job->fd = Int_val(fd);
5858
job->when = when_flag_table[Int_val(when)];
59-
memcpy(&job->termios, &Field(termios, 0), NFIELDS * sizeof(value));
59+
memcpy(&job->termios, (value *)&Field(termios, 0), NFIELDS * sizeof(value));
6060
return lwt_unix_alloc_job(&job->job);
6161
}
6262
#endif

src/unix/unix_c/unix_termios_conversion.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ static tcflag_t *choose_field(struct termios *terminal_status, long field)
150150
}
151151
}
152152

153-
void encode_terminal_status(struct termios *terminal_status, value *dst)
153+
void encode_terminal_status(struct termios *terminal_status, volatile value *dst)
154154
{
155155
long *pc;
156156
int i;
@@ -207,7 +207,7 @@ void encode_terminal_status(struct termios *terminal_status, value *dst)
207207
}
208208
}
209209

210-
int decode_terminal_status(struct termios *terminal_status, value *src)
210+
int decode_terminal_status(struct termios *terminal_status, volatile value *src)
211211
{
212212
long *pc;
213213
int i;

src/unix/unix_c/unix_termios_conversion.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@
2424

2525
#define NFIELDS 38
2626

27-
void encode_terminal_status(struct termios *terminal_status, value *dst);
28-
int decode_terminal_status(struct termios *terminal_status, value *src);
27+
void encode_terminal_status(struct termios *terminal_status, volatile value *dst);
28+
int decode_terminal_status(struct termios *terminal_status, volatile value *src);
2929
#endif

0 commit comments

Comments
 (0)