lib/util: Delete some unused functions

Hooray, dead code.

Closes: #1254
Approved by: jlebon
This commit is contained in:
Colin Walters 2017-10-04 16:55:53 -04:00 committed by Atomic Bot
parent 2e3889a4eb
commit a903f96673
5 changed files with 0 additions and 69 deletions

View 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 \

View 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

View 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,

View File

@ -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);
}

View 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;