This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Eliminate obstack_printf


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=fdd243b001585c5ca078342608332af77050c867

commit fdd243b001585c5ca078342608332af77050c867
Author: Pedro Alves <palves@redhat.com>
Date:   Tue Apr 18 21:39:25 2017 +0100

    Eliminate obstack_printf
    
    Not used anywhere.
    
    gdb/ChangeLog:
    2017-04-18  Pedro Alves  <palves@redhat.com>
    
    	* xml-support.c (obstack_xml_printf): Delete.
    	* xml-support.h (obstack_xml_printf): Delete.

Diff:
---
 gdb/ChangeLog     |  5 +++++
 gdb/xml-support.c | 40 ----------------------------------------
 gdb/xml-support.h |  7 -------
 3 files changed, 5 insertions(+), 47 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 8026977..b99fedf 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
 2017-04-18  Pedro Alves  <palves@redhat.com>
 
+	* xml-support.c (obstack_xml_printf): Delete.
+	* xml-support.h (obstack_xml_printf): Delete.
+
+2017-04-18  Pedro Alves  <palves@redhat.com>
+
 	* xml-support.c (gdb_xml_parser) <use_dtd, dtd_name, parse,
 	vdebug, verror, body_text, start_element, end_element, name,
 	user_data, set_is_xinclude, set_error, expat_parser>: New methods.
diff --git a/gdb/xml-support.c b/gdb/xml-support.c
index 76c65c6..fff3997 100644
--- a/gdb/xml-support.c
+++ b/gdb/xml-support.c
@@ -997,46 +997,6 @@ show_debug_xml (struct ui_file *file, int from_tty,
   fprintf_filtered (file, _("XML debugging is %s.\n"), value);
 }
 
-void
-obstack_xml_printf (struct obstack *obstack, const char *format, ...)
-{
-  va_list ap;
-  const char *f;
-  const char *prev;
-  int percent = 0;
-
-  va_start (ap, format);
-
-  prev = format;
-  for (f = format; *f; f++)
-    {
-      if (percent)
-       {
-         switch (*f)
-           {
-           case 's':
-             {
-               char *p;
-               char *a = va_arg (ap, char *);
-
-               obstack_grow (obstack, prev, f - prev - 1);
-               p = xml_escape_text (a);
-               obstack_grow_str (obstack, p);
-               xfree (p);
-               prev = f + 1;
-             }
-             break;
-           }
-         percent = 0;
-       }
-      else if (*f == '%')
-       percent = 1;
-    }
-
-  obstack_grow_str (obstack, prev);
-  va_end (ap);
-}
-
 char *
 xml_fetch_content_from_file (const char *filename, void *baton)
 {
diff --git a/gdb/xml-support.h b/gdb/xml-support.h
index f9ea64d..1a1b7fd 100644
--- a/gdb/xml-support.h
+++ b/gdb/xml-support.h
@@ -227,13 +227,6 @@ extern gdb_xml_attribute_handler gdb_xml_parse_attr_enum;
 ULONGEST gdb_xml_parse_ulongest (struct gdb_xml_parser *parser,
 				 const char *value);
 
-/* Simple printf to obstack function.  Current implemented formatters:
-   %s - grow an xml escaped text in OBSTACK.  */
-
-extern void obstack_xml_printf (struct obstack *obstack,
-                               const char *format, ...)
-  ATTRIBUTE_PRINTF_2;
-
 /* Open FILENAME, read all its text into memory, close it, and return
    the text.  If something goes wrong, return NULL and warn.  */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]