projects
/
deliverable
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[PATCH 1/4]: microblaze: remove duplicate prototypes
[deliverable/binutils-gdb.git]
/
gas
/
macro.c
diff --git
a/gas/macro.c
b/gas/macro.c
index cddf26ab79ea23599d449f5b817f508181aa7907..de6b4172ec292316acf2c5dff8ef8811649e4a94 100644
(file)
--- a/
gas/macro.c
+++ b/
gas/macro.c
@@
-1,5
+1,5
@@
/* macro.c - macro support for gas
/* macro.c - macro support for gas
- Copyright (C) 1994-20
16
Free Software Foundation, Inc.
+ Copyright (C) 1994-20
20
Free Software Foundation, Inc.
Written by Steve and Judy Chamberlain of Cygnus Support,
sac@cygnus.com
Written by Steve and Judy Chamberlain of Cygnus Support,
sac@cygnus.com
@@
-223,14
+223,13
@@
buffer_and_nest (const char *from, const char *to, sb *ptr,
anyway, there's not an obviously better fix here. */
if (strncasecmp (ptr->ptr + i, "linefile", 8) == 0)
{
anyway, there's not an obviously better fix here. */
if (strncasecmp (ptr->ptr + i, "linefile", 8) == 0)
{
- char *saved_input_line_pointer = input_line_pointer;
char saved_eol_char = ptr->ptr[ptr->len];
ptr->ptr[ptr->len] = '\0';
char saved_eol_char = ptr->ptr[ptr->len];
ptr->ptr[ptr->len] = '\0';
-
input_line_pointer = ptr->ptr + i + 8
;
+
temp_ilp (ptr->ptr + i + 8)
;
s_app_line (0);
s_app_line (0);
+ restore_ilp ();
ptr->ptr[ptr->len] = saved_eol_char;
ptr->ptr[ptr->len] = saved_eol_char;
- input_line_pointer = saved_input_line_pointer;
ptr->len = line_start;
}
}
ptr->len = line_start;
}
}
@@
-285,8
+284,8
@@
getstring (size_t idx, sb *in, sb *acc)
{
int nest = 0;
idx++;
{
int nest = 0;
idx++;
- while (
(in->ptr[idx] != '>' || nest)
- &&
idx < in->len
)
+ while (
idx < in->len
+ &&
(in->ptr[idx] != '>' || nest)
)
{
if (in->ptr[idx] == '!')
{
{
if (in->ptr[idx] == '!')
{
@@
-369,13
+368,13
@@
get_any_string (size_t idx, sb *in, sb *out)
{
if (in->len > idx + 2 && in->ptr[idx + 1] == '\'' && ISBASE (in->ptr[idx]))
{
{
if (in->len > idx + 2 && in->ptr[idx + 1] == '\'' && ISBASE (in->ptr[idx]))
{
- while (!ISSEP (in->ptr[idx]))
+ while (
idx < in->len &&
!ISSEP (in->ptr[idx]))
sb_add_char (out, in->ptr[idx++]);
}
else if (in->ptr[idx] == '%' && macro_alternate)
{
offsetT val;
sb_add_char (out, in->ptr[idx++]);
}
else if (in->ptr[idx] == '%' && macro_alternate)
{
offsetT val;
- char buf[
20
];
+ char buf[
64
];
/* Turns the next expression into a string. */
/* xgettext: no-c-format */
/* Turns the next expression into a string. */
/* xgettext: no-c-format */
@@
-404,7
+403,7
@@
get_any_string (size_t idx, sb *in, sb *out)
}
else
{
}
else
{
- char *br_buf =
(char *) xmalloc (
1);
+ char *br_buf =
XNEWVEC (char,
1);
char *in_br = br_buf;
*in_br = '\0';
char *in_br = br_buf;
*in_br = '\0';
@@
-438,7
+437,7
@@
get_any_string (size_t idx, sb *in, sb *out)
--in_br;
else
{
--in_br;
else
{
- br_buf =
(char *) xmalloc (
strlen (in_br) + 2);
+ br_buf =
XNEWVEC (char,
strlen (in_br) + 2);
strcpy (br_buf + 1, in_br);
free (in_br);
in_br = br_buf;
strcpy (br_buf + 1, in_br);
free (in_br);
in_br = br_buf;
@@
-471,7
+470,7
@@
new_formal (void)
{
formal_entry *formal;
{
formal_entry *formal;
- formal =
(formal_entry *) xmalloc (sizeof (formal_entry)
);
+ formal =
XNEW (formal_entry
);
sb_new (&formal->name);
sb_new (&formal->def);
sb_new (&formal->name);
sb_new (&formal->def);
@@
-655,7
+654,7
@@
define_macro (size_t idx, sb *in, sb *label,
sb name;
const char *error = NULL;
sb name;
const char *error = NULL;
- macro =
(macro_entry *) xmalloc (sizeof (macro_entry)
);
+ macro =
XNEW (macro_entry
);
sb_new (¯o->sub);
sb_new (&name);
macro->file = file;
sb_new (¯o->sub);
sb_new (&name);
macro->file = file;
@@
-815,7
+814,7
@@
macro_expand_body (sb *in, sb *out, formal_entry *formals,
}
else
{
}
else
{
- /* Permit macro parameter substition delineated with
+ /* Permit macro parameter substit
ut
ion delineated with
an '&' prefix and optional '&' suffix. */
src = sub_actual (src + 1, in, &t, formal_hash, '&', out, 0);
}
an '&' prefix and optional '&' suffix. */
src = sub_actual (src + 1, in, &t, formal_hash, '&', out, 0);
}
@@
-842,7
+841,7
@@
macro_expand_body (sb *in, sb *out, formal_entry *formals,
{
/* Sub in the macro invocation number. */
{
/* Sub in the macro invocation number. */
- char buffer[1
0
];
+ char buffer[1
2
];
src++;
sprintf (buffer, "%d", macro_number);
sb_add_string (out, buffer);
src++;
sprintf (buffer, "%d", macro_number);
sb_add_string (out, buffer);
@@
-1250,9
+1249,7
@@
check_macro (const char *line, sb *expand,
if (is_name_ender (*s))
++s;
if (is_name_ender (*s))
++s;
- copy = (char *) xmalloc (s - line + 1);
- memcpy (copy, line, s - line);
- copy[s - line] = '\0';
+ copy = xmemdup0 (line, s - line);
for (cls = copy; *cls != '\0'; cls ++)
*cls = TOLOWER (*cls);
for (cls = copy; *cls != '\0'; cls ++)
*cls = TOLOWER (*cls);
@@
-1289,7
+1286,7
@@
delete_macro (const char *name)
macro_entry *macro;
len = strlen (name);
macro_entry *macro;
len = strlen (name);
- copy =
(char *) xmalloc (
len + 1);
+ copy =
XNEWVEC (char,
len + 1);
for (i = 0; i < len; ++i)
copy[i] = TOLOWER (name[i]);
copy[i] = '\0';
for (i = 0; i < len; ++i)
copy[i] = TOLOWER (name[i]);
copy[i] = '\0';
@@
-1303,7
+1300,7
@@
delete_macro (const char *name)
free_macro (macro);
}
else
free_macro (macro);
}
else
- as_warn (_("Attempt to purge non-exist
ant
macro `%s'"), copy);
+ as_warn (_("Attempt to purge non-exist
ing
macro `%s'"), copy);
free (copy);
}
free (copy);
}
This page took
0.027643 seconds
and
4
git commands to generate.