aboutsummaryrefslogtreecommitdiff
path: root/libiberty
diff options
context:
space:
mode:
authordnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4>2003-11-13 02:40:39 +0000
committerdnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4>2003-11-13 02:40:39 +0000
commite66401a7b5672b5f6d55302dc80aac33552e4b87 (patch)
treefdc8302cdc786b6da0ac882119a21eda4c69c6cf /libiberty
parentf3f3f8d60c8bdbeb393ef04d42396e1abab2d771 (diff)
Mainline merge as of 2003-11-11.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/tree-ssa-20020619-branch@73535 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libiberty')
-rw-r--r--libiberty/ChangeLog16
-rw-r--r--libiberty/floatformat.c4
-rw-r--r--libiberty/hashtab.c4
-rw-r--r--libiberty/vasprintf.c17
4 files changed, 32 insertions, 9 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index 6264fbf5a0b..19129f7437b 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,19 @@
+2003-10-31 Andreas Jaeger <aj@suse.de>
+
+ * floatformat.c (floatformat_always_valid): Add unused attribute.
+
+2003-10-30 Josef Zlomek <zlomekj@suse.cz>
+
+ Jan Hubicka <jh@suse.cz>
+ * vasprintf.c (int_vasprintf): Pass va_list by value.
+ Use va_copy for copying va_list.
+ (vasprintf): Pass va_list by value.
+
+2003-10-30 Josef Zlomek <zlomekj@suse.cz>
+
+ * hashtab.c (htab_find_slot_with_hash): Decrease n_deleted
+ instead of increasing n_elements when inserting to deleted slot.
+
2003-10-20 J. Brobecker <brobecker@gnat.com>
* cplus-dem.c (demangle_template): Register a new Btype only
diff --git a/libiberty/floatformat.c b/libiberty/floatformat.c
index 3589caad2d8..daac6616639 100644
--- a/libiberty/floatformat.c
+++ b/libiberty/floatformat.c
@@ -39,8 +39,8 @@ static int floatformat_always_valid PARAMS ((const struct floatformat *fmt,
static int
floatformat_always_valid (fmt, from)
- const struct floatformat *fmt;
- const char *from;
+ const struct floatformat *fmt ATTRIBUTE_UNUSED;
+ const char *from ATTRIBUTE_UNUSED;
{
return 1;
}
diff --git a/libiberty/hashtab.c b/libiberty/hashtab.c
index cbf82592be1..231fbc0dd7a 100644
--- a/libiberty/hashtab.c
+++ b/libiberty/hashtab.c
@@ -535,14 +535,14 @@ htab_find_slot_with_hash (htab, element, hash, insert)
if (insert == NO_INSERT)
return NULL;
- htab->n_elements++;
-
if (first_deleted_slot)
{
+ htab->n_deleted--;
*first_deleted_slot = EMPTY_ENTRY;
return first_deleted_slot;
}
+ htab->n_elements++;
return &htab->entries[index];
}
diff --git a/libiberty/vasprintf.c b/libiberty/vasprintf.c
index 775260475cb..d3d4f3a1553 100644
--- a/libiberty/vasprintf.c
+++ b/libiberty/vasprintf.c
@@ -59,13 +59,13 @@ not be allocated, minus one is returned and @code{NULL} is stored in
*/
-static int int_vasprintf PARAMS ((char **, const char *, va_list *));
+static int int_vasprintf PARAMS ((char **, const char *, va_list));
static int
int_vasprintf (result, format, args)
char **result;
const char *format;
- va_list *args;
+ va_list args;
{
const char *p = format;
/* Add one to make sure that it is never zero, which might cause malloc
@@ -73,7 +73,11 @@ int_vasprintf (result, format, args)
int total_width = strlen (format) + 1;
va_list ap;
- memcpy ((PTR) &ap, (PTR) args, sizeof (va_list));
+#ifdef va_copy
+ va_copy (ap, args);
+#else
+ memcpy ((PTR) &ap, (PTR) &args, sizeof (va_list));
+#endif
while (*p != '\0')
{
@@ -135,12 +139,15 @@ int_vasprintf (result, format, args)
p++;
}
}
+#ifdef va_copy
+ va_end (ap);
+#endif
#ifdef TEST
global_total_width = total_width;
#endif
*result = (char *) malloc (total_width);
if (*result != NULL)
- return vsprintf (*result, format, *args);
+ return vsprintf (*result, format, args);
else
return -1;
}
@@ -155,7 +162,7 @@ vasprintf (result, format, args)
va_list args;
#endif
{
- return int_vasprintf (result, format, &args);
+ return int_vasprintf (result, format, args);
}
#ifdef TEST