Eliminate dead code
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 4 Apr 2013 16:55:54 +0000 (12:55 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 4 Apr 2013 16:55:54 +0000 (12:55 -0400)
This code is now unused after
commit d876a5baf224612e7e44d3cfda2dc1d57ea91ea4

Suggested-by: Etienne Bergeron <etienneb@google.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
formats/ctf/metadata/ctf-parser.y

index a31e9637e24b930d8060fffe988035a282d2e6bf..4d1017391cb0e30d20c755ad59f2215a6a89de04 100644 (file)
@@ -109,41 +109,6 @@ static struct gc_string *gc_string_alloc(struct ctf_scanner *scanner,
        return gstr;
 }
 
-/*
- * note: never use gc_string_append on a string that has external references.
- * gsrc will be garbage collected immediately, and gstr might be.
- * Should only be used to append characters to a string literal or constant.
- */
-BT_HIDDEN
-struct gc_string *gc_string_append(struct ctf_scanner *scanner,
-                                  struct gc_string *gstr,
-                                  struct gc_string *gsrc)
-{
-       size_t newlen = strlen(gsrc->s) + strlen(gstr->s) + 1;
-       size_t alloclen;
-
-       /* TODO: could be faster with find first bit or glib Gstring */
-       /* sizeof long to account for malloc header (int or long ?) */
-       for (alloclen = 8; alloclen < sizeof(long) + sizeof(*gstr) + newlen;
-            alloclen *= 2);
-
-       if (alloclen > gstr->alloclen) {
-               struct gc_string *newgstr;
-
-               newgstr = gc_string_alloc(scanner, newlen);
-               strcpy(newgstr->s, gstr->s);
-               strcat(newgstr->s, gsrc->s);
-               bt_list_del(&gstr->gc);
-               free(gstr);
-               gstr = newgstr;
-       } else {
-               strcat(gstr->s, gsrc->s);
-       }
-       bt_list_del(&gsrc->gc);
-       free(gsrc);
-       return gstr;
-}
-
 void setstring(struct ctf_scanner *scanner, YYSTYPE *lvalp, const char *src)
 {
        lvalp->gs = gc_string_alloc(scanner, strlen(src) + 1);
This page took 0.025526 seconds and 4 git commands to generate.