/* This is the Assembler Pre-Processor
- Copyright 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2007, 2008, 2009, 2010
- Free Software Foundation, Inc.
+ Copyright (C) 1987-2014 Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
for (p = line_comment_chars; *p; p++)
lex[(unsigned char) *p] = LEX_IS_LINE_COMMENT_START;
- for (p = line_separator_chars; *p; p++)
+#ifndef tc_line_separator_chars
+#define tc_line_separator_chars line_separator_chars
+#endif
+ for (p = tc_line_separator_chars; *p; p++)
lex[(unsigned char) *p] = LEX_IS_LINE_SEPARATOR;
#ifdef tc_parallel_separator_chars
static char out_buf[20];
static int add_newlines;
static char *saved_input;
-static int saved_input_len;
+static size_t saved_input_len;
static char input_buffer[32 * 1024];
static const char *mri_state;
static char mri_last_ch;
char out_buf[sizeof (out_buf)];
int add_newlines;
char * saved_input;
- int saved_input_len;
+ size_t saved_input_len;
#ifdef TC_M68K
int scrub_m68k_mri;
#endif
saved_input = NULL;
else
{
- gas_assert (saved->saved_input_len <= (int) (sizeof input_buffer));
+ gas_assert (saved->saved_input_len <= sizeof (input_buffer));
memcpy (input_buffer, saved->saved_input, saved->saved_input_len);
saved_input = input_buffer;
saved_input_len = saved->saved_input_len;
machine, and saves its state so that it may return at any point.
This is the way the old code used to work. */
-int
-do_scrub_chars (int (*get) (char *, int), char *tostart, int tolen)
+size_t
+do_scrub_chars (size_t (*get) (char *, size_t), char *tostart, size_t tolen)
{
char *to = tostart;
char *toend = tostart + tolen;
char *from;
char *fromend;
- int fromlen;
+ size_t fromlen;
register int ch, ch2 = 0;
/* Character that started the string we're working on. */
static char quotechar;
GET and PUT macros. */
{
char *s;
- int len;
+ ptrdiff_t len;
for (s = from; s < fromend; s++)
{
case 16:
/* We have seen an 'a' at the start of a symbol, look for an 'f'. */
ch = GET ();
- if (ch == 'f' || ch == 'F')
+ if (ch == 'f' || ch == 'F')
{
state = 17;
PUT (ch);
while (ch != EOF && !IS_NEWLINE (ch))
ch = GET ();
if (ch == EOF)
- as_warn (_("end of file in comment; newline inserted"));
+ {
+ as_warn (_("end of file in comment; newline inserted"));
+ PUT ('\n');
+ }
+ else /* IS_NEWLINE (ch) */
+ {
+ /* To process non-zero add_newlines. */
+ UNGET (ch);
+ }
state = 0;
- PUT ('\n');
break;
}
/* Looks like `# 123 "filename"' from cpp. */
#ifdef TC_Z80
/* "af'" is a symbol containing '\''. */
- if (state == 3 && (ch == 'a' || ch == 'A'))
+ if (state == 3 && (ch == 'a' || ch == 'A'))
{
state = 16;
PUT (ch);
ch = GET ();
- if (ch == 'f' || ch == 'F')
+ if (ch == 'f' || ch == 'F')
{
state = 17;
PUT (ch);
else
{
state = 9;
- if (!IS_SYMBOL_COMPONENT (ch))
+ if (ch == EOF || !IS_SYMBOL_COMPONENT (ch))
{
if (ch != EOF)
UNGET (ch);
)
{
char *s;
- int len;
+ ptrdiff_t len;
for (s = from; s < fromend; s++)
{