Fix djgpp gdb build
authorPedro Alves <palves@redhat.com>
Thu, 21 Jul 2016 12:02:34 +0000 (13:02 +0100)
committerPedro Alves <palves@redhat.com>
Thu, 21 Jul 2016 14:40:44 +0000 (15:40 +0100)
 - 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.

gdb/ChangeLog
gdb/go32-nat.c
gdb/ser-go32.c
gdb/top.c

index 5eeec97f8ecc460902b4b2eb58be94208fe1dde2..47faef2054d996ad7cebac8b44cd8b452437171f 100644 (file)
@@ -1,3 +1,14 @@
+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.
+
 2016-07-21  Pedro Alves  <palves@redhat.com>
 
        * windows-nat.c (handle_exception): Remove "th".
index 91c6d1e5f12f130a646ac7e97875a4aa4463fe13..6e608e2e83b3f9123bede33338b4f5f9b7e9c98e 100644 (file)
@@ -677,7 +677,7 @@ go32_create_inferior (struct target_ops *ops, char *exec_file,
   if (cmdlen > 1024*1024)
     error (_("Command line too long."));
 
-  cmdline = xmalloc (cmdlen + 4);
+  cmdline = (char *) xmalloc (cmdlen + 4);
   strcpy (cmdline + 1, args);
   /* If the command-line length fits into DOS 126-char limits, use the
      DOS command tail format; otherwise, tell v2loadimage to pass it
index 10c79bacc05f5750b9854e14b97c00b4a5ac2c2d..a9c3d91020307380e1d8854291f648ccdd072f19 100644 (file)
@@ -593,9 +593,26 @@ dos_close (struct serial *scb)
 }
 \f
 
+/* 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.  */
 };
 
index 3174f3c62f09d5f028fae75bfb5485e9e6554fb6..d56667787330e75fbfd091627e00c81c18c99427 100644 (file)
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -470,7 +470,7 @@ void (*pre_init_ui_hook) (void);
 static void
 do_chdir_cleanup (void *old_dir)
 {
-  chdir (old_dir);
+  chdir ((const char *) old_dir);
   xfree (old_dir);
 }
 #endif
This page took 0.032359 seconds and 4 git commands to generate.