aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2016-07-21 13:02:34 +0100
committerPedro Alves <palves@redhat.com>2016-07-21 15:40:44 +0100
commitf515a1d643b599ebb8a23d3d95e9f0dfc8261a11 (patch)
tree578a6610d4bd335ddf4ce7166ee4a0fb9d487669 /gdb/ser-go32.c
parentRemove unused variable in windows-nat.c (diff)
downloadbinutils-gdb-f515a1d643b599ebb8a23d3d95e9f0dfc8261a11.tar.gz
binutils-gdb-f515a1d643b599ebb8a23d3d95e9f0dfc8261a11.tar.bz2
binutils-gdb-f515a1d643b599ebb8a23d3d95e9f0dfc8261a11.zip
Fix djgpp gdb build
- A few missing casts required by C++, resulting in: ../../src/gdb/ser-go32.c:795:21: error: invalid conversion from 'const void*' to 'const char*' [-fpermissive] etc. - dos_noop has an incompatible prototype with struct serial_ops's setparity, resulting in: ../../src/gdb/ser-go32.c:874:1: error: invalid conversion from 'int (*)(serial*)' to 'int (*)(serial*, int)' [-fpermissive] (I thought of calling the ser-base.c default methods, but djgpp doesn't include ser-base.c in the build.) gdb/ChangeLog: 2016-07-21 Pedro Alves <palves@redhat.com> * go32-nat.c (go32_create_inferior): Add cast. * ser-go32.c (dos_noop): Delete. (dos_flush_output, dos_setparity, dos_drain_output): New functions. (dos_write): Add cast. (dos_ops): Use dos_flush_output, dos_setparity and dos_drain_output. * top.c (do_chdir_cleanup): Add cast.
Diffstat (limited to 'gdb/ser-go32.c')
-rw-r--r--gdb/ser-go32.c27
1 files changed, 22 insertions, 5 deletions
diff --git a/gdb/ser-go32.c b/gdb/ser-go32.c
index 10c79bacc05..a9c3d910203 100644
--- a/gdb/ser-go32.c
+++ b/gdb/ser-go32.c
@@ -593,9 +593,26 @@ dos_close (struct serial *scb)
}
+/* Implementation of the serial_ops flush_output method. */
static int
-dos_noop (struct serial *scb)
+dos_flush_output (struct serial *scb)
+{
+ return 0;
+}
+
+/* Implementation of the serial_ops setparity method. */
+
+static int
+dos_setparity (struct serial *scb, int parity)
+{
+ return 0;
+}
+
+/* Implementation of the serial_ops drain_output method. */
+
+static int
+dos_drain_output (struct serial *scb)
{
return 0;
}
@@ -792,7 +809,7 @@ dos_write (struct serial *scb, const void *buf, size_t count)
size_t fifosize = port->fifo ? 16 : 1;
long then;
size_t cnt;
- const char *str = buf;
+ const char *str = (const char *) buf;
while (count > 0)
{
@@ -857,7 +874,7 @@ static const struct serial_ops dos_ops =
NULL, /* fdopen, not implemented */
dos_readchar,
dos_write,
- dos_noop, /* flush output */
+ dos_flush_output,
dos_flush_input,
dos_sendbreak,
dos_raw,
@@ -868,8 +885,8 @@ static const struct serial_ops dos_ops =
dos_noflush_set_tty_state,
dos_setbaudrate,
dos_setstopbits,
- dos_noop,
- dos_noop, /* Wait for output to drain. */
+ dos_setparity,
+ dos_drain_output,
(void (*)(struct serial *, int))NULL /* Change into async mode. */
};