Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(625)

Unified Diff: gdb/ser-go32.c

Issue 124383005: GDB 7.6.50 (Closed) Base URL: http://git.chromium.org/native_client/nacl-gdb.git@upstream
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gdb/ser-base.c ('k') | gdb/ser-mingw.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gdb/ser-go32.c
diff --git a/gdb/ser-go32.c b/gdb/ser-go32.c
index ad0119197afb691fb138016effde16747397a27c..4268e2c150a859466f1f0b05dbef2e99e63c961f 100644
--- a/gdb/ser-go32.c
+++ b/gdb/ser-go32.c
@@ -1,6 +1,5 @@
/* Remote serial interface for local (hardwired) serial ports for GO32.
- Copyright (C) 1992-1993, 2000-2001, 2007-2012 Free Software
- Foundation, Inc.
+ Copyright (C) 1992-2013 Free Software Foundation, Inc.
Contributed by Nigel Stephens, Algorithmics Ltd. (nigel@algor.co.uk).
@@ -25,7 +24,7 @@
#include "defs.h"
#include "gdbcmd.h"
#include "serial.h"
-#include "gdb_string.h"
+#include <string.h>
/*
@@ -149,7 +148,7 @@ typedef unsigned long u_long;
#define NCNT 20
static int intrcnt;
-static int cnts[NCNT];
+static size_t cnts[NCNT];
static char *cntnames[NCNT] =
{
/* h/w interrupt counts. */
@@ -231,7 +230,7 @@ static int dos_open (struct serial *scb, const char *name);
static void dos_raw (struct serial *scb);
static int dos_readchar (struct serial *scb, int timeout);
static int dos_setbaudrate (struct serial *scb, int rate);
-static int dos_write (struct serial *scb, const char *str, int len);
+static int dos_write (struct serial *scb, const void *buf, size_t count);
static void dos_close (struct serial *scb);
static serial_ttystate dos_get_tty_state (struct serial *scb);
static int dos_set_tty_state (struct serial *scb, serial_ttystate state);
@@ -788,26 +787,27 @@ dos_setstopbits (struct serial *scb, int num)
}
static int
-dos_write (struct serial *scb, const char *str, int len)
+dos_write (struct serial *scb, const void *buf, size_t count)
{
volatile struct dos_ttystate *port = &ports[scb->fd];
- int fifosize = port->fifo ? 16 : 1;
+ size_t fifosize = port->fifo ? 16 : 1;
long then;
- int cnt;
+ size_t cnt;
+ const char *str = buf;
- while (len > 0)
+ while (count > 0)
{
/* Send the data, fifosize bytes at a time. */
- cnt = fifosize > len ? len : fifosize;
+ cnt = fifosize > count ? count : fifosize;
port->txbusy = 1;
/* Francisco Pastor <fpastor.etra-id@etra.es> says OUTSB messes
up the communications with UARTs with FIFOs. */
#ifdef UART_FIFO_WORKS
outportsb (port->base + com_data, str, cnt);
str += cnt;
- len -= cnt;
+ count -= cnt;
#else
- for ( ; cnt > 0; cnt--, len--)
+ for ( ; cnt > 0; cnt--, count--)
outportb (port->base + com_data, *str++);
#endif
#ifdef DOS_STATS
@@ -905,10 +905,12 @@ dos_info (char *arg, int from_tty)
printf_filtered ("\nTotal interrupts: %d\n", intrcnt);
for (i = 0; i < NCNT; i++)
if (cnts[i])
- printf_filtered ("%s:\t%d\n", cntnames[i], cnts[i]);
+ printf_filtered ("%s:\t%lu\n", cntnames[i], (unsigned long) cnts[i]);
#endif
}
+/* -Wmissing-prototypes */
+extern initialize_file_ftype _initialize_ser_dos;
void
_initialize_ser_dos (void)
« no previous file with comments | « gdb/ser-base.c ('k') | gdb/ser-mingw.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698