lib/util: Delete some unused functions
authorColin Walters <walters@verbum.org>
Wed, 4 Oct 2017 20:55:53 +0000 (16:55 -0400)
committerAtomic Bot <atomic-devel@projectatomic.io>
Thu, 5 Oct 2017 15:41:00 +0000 (15:41 +0000)
Hooray, dead code.

Closes: #1254
Approved by: jlebon

Makefile-otutil.am
src/libotutil/ot-variant-utils.c
src/libotutil/ot-variant-utils.h
src/libotutil/otutil.c [deleted file]
src/libotutil/otutil.h

index ff7533e965ca1524ac9e3a6f7a5da42697d7cacf..c4c0338dadb90c276a940a879037b3e184739b33 100644 (file)
@@ -38,7 +38,6 @@ libotutil_la_SOURCES = \
        src/libotutil/ot-gio-utils.h \
        src/libotutil/ot-gpg-utils.c \
        src/libotutil/ot-gpg-utils.h \
-       src/libotutil/otutil.c \
        src/libotutil/otutil.h \
        src/libotutil/ot-tool-util.c \
        src/libotutil/ot-tool-util.h \
index 1429a3a774ef20ba9c8a9f64e3f24f078460caac..afb80be10713a0ad531dc7f70cc24b079d2e9fc8 100644 (file)
@@ -60,28 +60,6 @@ ot_gvariant_new_ay_bytes (GBytes *bytes)
                                   TRUE, (GDestroyNotify)g_bytes_unref, bytes);
 }
 
-/* Convert a GVariant of type a{sv} to a GHashTable */
-GHashTable *
-ot_util_variant_asv_to_hash_table (GVariant *variant)
-{
-
-  GHashTable *ret = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify)g_variant_unref);
-  g_autoptr(GVariantIter) viter = g_variant_iter_new (variant);
-
-  char *key;
-  GVariant *value;
-  while (g_variant_iter_next (viter, "{s@v}", &key, &value))
-    g_hash_table_replace (ret, key, g_variant_ref_sink (value));
-
-  return ret;
-}
-
-GVariant *
-ot_util_variant_take_ref (GVariant *variant)
-{
-  return g_variant_take_ref (variant);
-}
-
 /* Create a GVariant in @out_variant that is backed by
  * the data from @fd, starting at @start.  If the data is
  * large enough, mmap() may be used.  @trusted is used
index 379e19ac30604158810bec807d2b90ddcfb2e482..e69104704a8f67a077508fc513a1c45d87473449 100644 (file)
@@ -32,10 +32,6 @@ GVariant *ot_gvariant_new_ay_bytes (GBytes *bytes);
 
 GVariant *ot_gvariant_new_empty_string_dict (void);
 
-GHashTable *ot_util_variant_asv_to_hash_table (GVariant *variant);
-
-GVariant * ot_util_variant_take_ref (GVariant *variant);
-
 gboolean ot_variant_read_fd (int                  fd,
                              goffset              offset,
                              const GVariantType  *type,
diff --git a/src/libotutil/otutil.c b/src/libotutil/otutil.c
deleted file mode 100644 (file)
index 26aed9b..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (C) 2011 Colin Walters <walters@verbum.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Colin Walters <walters@verbum.org>
- */
-
-#include "config.h"
-
-#include "otutil.h"
-
-#include <string.h>
-
-void
-ot_ptrarray_add_many (GPtrArray  *a, ...)
-{
-  va_list args;
-  void *p;
-
-  va_start (args, a);
-
-  while ((p = va_arg (args, void *)) != NULL)
-    g_ptr_array_add (a, p);
-
-  va_end (args);
-}
index d6fc603ddfa9fc96c4b89a546f91634ce0b26655..80acb4751c02e712bb2f541b09ee60f1a06fbccb 100644 (file)
@@ -51,5 +51,3 @@
 #include <ot-checksum-utils.h>
 #include <ot-gpg-utils.h>
 #include <ot-checksum-instream.h>
-
-void ot_ptrarray_add_many (GPtrArray  *a, ...) G_GNUC_NULL_TERMINATED;