soup-uri: Fix clang-analyzer warning by dropping dead code
authorColin Walters <walters@verbum.org>
Tue, 21 Dec 2021 19:23:12 +0000 (14:23 -0500)
committerColin Walters <walters@verbum.org>
Tue, 21 Dec 2021 20:13:56 +0000 (15:13 -0500)
Fixes `Argument with 'nonnull' attribute passed null` by making
the code not exist at all anymore.

In upstream libsoup this code is gone too; it uses `GUri` from glib
which we probably could now too, but one thing at a time.

src/libostree/ostree-soup-uri.c

index ba14e5c6148755f17ee94809a22b371fa2ad6919..bfc5dd1a35bf92a9d9207191ffb29a0efd6e509f 100644 (file)
@@ -16,8 +16,6 @@
 char *soup_uri_decoded_copy (const char *str, int length, int *decoded_length);
 char *soup_uri_to_string_internal (SoupURI *uri, gboolean just_path_and_query,
                                   gboolean force_port);
-gboolean soup_uri_is_http (SoupURI *uri, char **aliases);
-gboolean soup_uri_is_https (SoupURI *uri, char **aliases);
 
 /* OSTREECHANGE: import soup-misc's char helpers */
 #define SOUP_CHAR_URI_PERCENT_ENCODED 0x01
@@ -1436,48 +1434,5 @@ soup_uri_host_equal (gconstpointer v1, gconstpointer v2)
        return g_ascii_strcasecmp (one->host, two->host) == 0;
 }
 
-gboolean
-soup_uri_is_http (SoupURI *uri, char **aliases)
-{
-       int i;
-
-       if (uri->scheme == SOUP_URI_SCHEME_HTTP)
-               return TRUE;
-       else if (uri->scheme == SOUP_URI_SCHEME_HTTPS)
-               return FALSE;
-       else if (!aliases)
-               return FALSE;
-
-       for (i = 0; aliases[i]; i++) {
-               if (uri->scheme == aliases[i])
-                       return TRUE;
-       }
-
-       if (!aliases[1] && !strcmp (aliases[0], "*"))
-               return TRUE;
-       else
-               return FALSE;
-}
-
-gboolean
-soup_uri_is_https (SoupURI *uri, char **aliases)
-{
-       int i;
-
-       if (uri->scheme == SOUP_URI_SCHEME_HTTPS)
-               return TRUE;
-       else if (uri->scheme == SOUP_URI_SCHEME_HTTP)
-               return FALSE;
-       else if (!aliases)
-               return FALSE;
-
-       for (i = 0; aliases[i]; i++) {
-               if (uri->scheme == aliases[i])
-                       return TRUE;
-       }
-
-       return FALSE;
-}
-
 /* OSTREECHANGE: drop boxed type definition */
 /* G_DEFINE_BOXED_TYPE (SoupURI, soup_uri, soup_uri_copy, soup_uri_free) */