projects
/
deliverable
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Change `function_symbols' to std::vector
[deliverable/binutils-gdb.git]
/
gas
/
sb.c
diff --git
a/gas/sb.c
b/gas/sb.c
index f68402fc470f6af031241d32f62d7388e1af6246..9bb0744d9b7e17cdde2fe7cc1d6e3e10f69aaa00 100644
(file)
--- a/
gas/sb.c
+++ b/
gas/sb.c
@@
-1,6
+1,5
@@
/* sb.c - string buffer manipulation routines
/* sb.c - string buffer manipulation routines
- Copyright 1994, 1995, 2000, 2003, 2005, 2006, 2007, 2009, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 1994-2018 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
@@
-60,7
+59,7
@@
static void sb_check (sb *, size_t);
void
sb_build (sb *ptr, size_t size)
{
void
sb_build (sb *ptr, size_t size)
{
- ptr->ptr =
xmalloc (
size + 1);
+ ptr->ptr =
XNEWVEC (char,
size + 1);
ptr->max = size;
ptr->len = 0;
}
ptr->max = size;
ptr->len = 0;
}
@@
-113,7
+112,7
@@
sb_scrub_and_add_sb (sb *ptr, sb *s)
{
sb_to_scrub = s;
scrub_position = s->ptr;
{
sb_to_scrub = s;
scrub_position = s->ptr;
-
+
sb_check (ptr, s->len);
ptr->len += do_scrub_chars (scrub_from_sb, ptr->ptr + ptr->len, s->len);
sb_check (ptr, s->len);
ptr->len += do_scrub_chars (scrub_from_sb, ptr->ptr + ptr->len, s->len);
@@
-137,7
+136,10
@@
sb_check (sb *ptr, size_t len)
if ((ssize_t) want < 0)
as_fatal ("string buffer overflow");
#if GCC_VERSION >= 3004
if ((ssize_t) want < 0)
as_fatal ("string buffer overflow");
#if GCC_VERSION >= 3004
- max = (size_t) 1 << (CHAR_BIT * sizeof (want) - __builtin_clzl (want));
+ max = (size_t) 1 << (CHAR_BIT * sizeof (want)
+ - (sizeof (want) <= sizeof (long)
+ ? __builtin_clzl ((long) want)
+ : __builtin_clzll ((long long) want)));
#else
max = 128;
while (want > max)
#else
max = 128;
while (want > max)
@@
-145,7
+147,7
@@
sb_check (sb *ptr, size_t len)
#endif
max -= MALLOC_OVERHEAD + 1;
ptr->max = max;
#endif
max -= MALLOC_OVERHEAD + 1;
ptr->max = max;
- ptr->ptr =
xrealloc (
ptr->ptr, max + 1);
+ ptr->ptr =
XRESIZEVEC (char,
ptr->ptr, max + 1);
}
}
}
}
This page took
0.024316 seconds
and
4
git commands to generate.