[gtk/wip/otte/colorspace: 32/50] cssparser: Remove unused argument




commit c97a758aa772fc6411a7fa88fdcda49dcdba132e
Author: Benjamin Otte <otte redhat com>
Date:   Thu Oct 28 03:13:28 2021 +0200

    cssparser: Remove unused argument
    
    The base_directory argument is never used. So don't have it.

 gsk/gskrendernodeparser.c     |  2 +-
 gsk/gsktransform.c            |  2 +-
 gtk/css/gtkcssparser.c        | 16 +++++++---------
 gtk/css/gtkcssparserprivate.h |  1 -
 gtk/gtkcssprovider.c          |  1 -
 testsuite/css/transition.c    |  2 +-
 6 files changed, 10 insertions(+), 14 deletions(-)
---
diff --git a/gsk/gskrendernodeparser.c b/gsk/gskrendernodeparser.c
index ed08bd4431..11d5e61d70 100644
--- a/gsk/gskrendernodeparser.c
+++ b/gsk/gskrendernodeparser.c
@@ -1918,7 +1918,7 @@ gsk_render_node_deserialize_from_bytes (GBytes            *bytes,
     gpointer user_data;
   } error_func_pair = { error_func, user_data };
 
-  parser = gtk_css_parser_new_for_bytes (bytes, NULL, NULL, gsk_render_node_parser_error,
+  parser = gtk_css_parser_new_for_bytes (bytes, NULL, gsk_render_node_parser_error,
                                          &error_func_pair, NULL);
   root = parse_container_node (parser);
 
diff --git a/gsk/gsktransform.c b/gsk/gsktransform.c
index 9eeab2d66a..b690cec714 100644
--- a/gsk/gsktransform.c
+++ b/gsk/gsktransform.c
@@ -2391,7 +2391,7 @@ gsk_transform_parse (const char    *string,
   g_return_val_if_fail (out_transform != NULL, FALSE);
 
   bytes = g_bytes_new_static (string, strlen (string));
-  parser = gtk_css_parser_new_for_bytes (bytes, NULL, NULL, NULL, NULL, NULL);
+  parser = gtk_css_parser_new_for_bytes (bytes, NULL, NULL, NULL, NULL);
 
   result = gsk_transform_parser_parse (parser, out_transform);
 
diff --git a/gtk/css/gtkcssparser.c b/gtk/css/gtkcssparser.c
index 3026fb1c78..7668bfc70e 100644
--- a/gtk/css/gtkcssparser.c
+++ b/gtk/css/gtkcssparser.c
@@ -55,7 +55,6 @@ struct _GtkCssParserBlock
 static GtkCssParser *
 gtk_css_parser_new (GtkCssTokenizer       *tokenizer,
                     GFile                 *file,
-                    GFile                 *base_directory,
                     GtkCssParserErrorFunc  error_func,
                     gpointer               user_data,
                     GDestroyNotify         user_destroy)
@@ -67,11 +66,11 @@ gtk_css_parser_new (GtkCssTokenizer       *tokenizer,
   self->ref_count = 1;
   self->tokenizer = gtk_css_tokenizer_ref (tokenizer);
   if (file)
-    self->file = g_object_ref (file);
-  if (base_directory)
-    self->directory = g_object_ref (base_directory);
-  else if (file)
-    self->directory = g_file_get_parent (file);
+    {
+      self->file = g_object_ref (file);
+      self->directory = g_file_get_parent (file);
+    }
+
   self->error_func = error_func;
   self->user_data = user_data;
   self->user_destroy = user_destroy;
@@ -94,7 +93,7 @@ gtk_css_parser_new_for_file (GFile                 *file,
   if (bytes == NULL)
     return NULL;
 
-  result = gtk_css_parser_new_for_bytes (bytes, file, NULL, error_func, user_data, user_destroy);
+  result = gtk_css_parser_new_for_bytes (bytes, file, error_func, user_data, user_destroy);
 
   g_bytes_unref (bytes);
 
@@ -104,7 +103,6 @@ gtk_css_parser_new_for_file (GFile                 *file,
 GtkCssParser *
 gtk_css_parser_new_for_bytes (GBytes                *bytes,
                               GFile                 *file,
-                              GFile                 *base_directory,
                               GtkCssParserErrorFunc  error_func,
                               gpointer               user_data,
                               GDestroyNotify         user_destroy)
@@ -113,7 +111,7 @@ gtk_css_parser_new_for_bytes (GBytes                *bytes,
   GtkCssParser *result;
   
   tokenizer = gtk_css_tokenizer_new (bytes);
-  result = gtk_css_parser_new (tokenizer, file, base_directory, error_func, user_data, user_destroy);
+  result = gtk_css_parser_new (tokenizer, file, error_func, user_data, user_destroy);
   gtk_css_tokenizer_unref (tokenizer);
 
   return result;
diff --git a/gtk/css/gtkcssparserprivate.h b/gtk/css/gtkcssparserprivate.h
index 9a22264a7e..5659fe0c45 100644
--- a/gtk/css/gtkcssparserprivate.h
+++ b/gtk/css/gtkcssparserprivate.h
@@ -56,7 +56,6 @@ GtkCssParser *          gtk_css_parser_new_for_file             (GFile
                                                                  GError                        **error);
 GtkCssParser *          gtk_css_parser_new_for_bytes            (GBytes                         *bytes,
                                                                  GFile                          *file,
-                                                                 GFile                          
*base_directory,
                                                                  GtkCssParserErrorFunc           error_func,
                                                                  gpointer                        user_data,
                                                                  GDestroyNotify                  
user_destroy);
diff --git a/gtk/gtkcssprovider.c b/gtk/gtkcssprovider.c
index 591e49e69d..5359ea714d 100644
--- a/gtk/gtkcssprovider.c
+++ b/gtk/gtkcssprovider.c
@@ -365,7 +365,6 @@ gtk_css_scanner_new (GtkCssProvider *provider,
 
   scanner->parser = gtk_css_parser_new_for_bytes (bytes,
                                                   file,
-                                                  NULL,
                                                   gtk_css_scanner_parser_error,
                                                   scanner,
                                                   NULL);
diff --git a/testsuite/css/transition.c b/testsuite/css/transition.c
index 6d180b0b7d..991e1581a6 100644
--- a/testsuite/css/transition.c
+++ b/testsuite/css/transition.c
@@ -142,7 +142,7 @@ value_from_string (GtkStyleProperty *prop,
   GtkCssValue *value;
 
   bytes = g_bytes_new_static (str, strlen (str));
-  parser = gtk_css_parser_new_for_bytes (bytes, NULL, NULL, NULL, NULL, NULL);
+  parser = gtk_css_parser_new_for_bytes (bytes, NULL, NULL, NULL, NULL);
   value = _gtk_style_property_parse_value (prop, parser);
   gtk_css_parser_unref (parser);
   g_bytes_unref (bytes);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]