[librsvg] RsvgLoad: Don't store an error field; it's all in local variables now



commit 0b7d6e83dcb1ee6e9488a8d41cc38e3dd3bf5722
Author: Federico Mena Quintero <federico gnome org>
Date:   Wed Dec 5 17:10:28 2018 -0600

    RsvgLoad: Don't store an error field; it's all in local variables now
    
    Before copious amounts of refactoring, it looks like RsvgLoad used to
    lend a GError field to many of its functions.  This is no longer the case.

 librsvg/rsvg-load.c | 15 ---------------
 1 file changed, 15 deletions(-)
---
diff --git a/librsvg/rsvg-load.c b/librsvg/rsvg-load.c
index a42ea715..5c909f3c 100644
--- a/librsvg/rsvg-load.c
+++ b/librsvg/rsvg-load.c
@@ -76,8 +76,6 @@ struct RsvgLoad {
 
     LoadState state;
 
-    GError **error;
-
     GInputStream *compressed_input_stream; /* for rsvg_handle_write of svgz data */
 
     XmlState xml;
@@ -91,7 +89,6 @@ rsvg_load_new (RsvgHandle *handle, gboolean unlimited_size)
     load->handle = handle;
     load->unlimited_size = unlimited_size;
     load->state = LOAD_STATE_START;
-    load->error = NULL;
     load->compressed_input_stream = NULL;
 
     load->xml.ctxt = NULL;
@@ -257,8 +254,6 @@ write_impl (RsvgLoad *load, const guchar * buf, gsize count, GError **error)
     GError *real_error = NULL;
     int result;
 
-    load->error = &real_error;
-
     if (load->xml.ctxt == NULL) {
         load->xml.ctxt = rsvg_create_xml_push_parser (load->xml.rust_state,
                                                       load->unlimited_size,
@@ -276,8 +271,6 @@ write_impl (RsvgLoad *load, const guchar * buf, gsize count, GError **error)
         g_assert (real_error != NULL);
     }
 
-    load->error = NULL;
-
     if (real_error != NULL) {
         g_propagate_error (error, real_error);
         return FALSE;
@@ -291,8 +284,6 @@ close_impl (RsvgLoad *load, GError ** error)
 {
     GError *real_error = NULL;
 
-    load->error = &real_error;
-
     if (load->xml.ctxt != NULL) {
         int result;
 
@@ -306,8 +297,6 @@ close_impl (RsvgLoad *load, GError ** error)
         load->xml.ctxt = free_xml_parser_and_doc (load->xml.ctxt);
     }
 
-    load->error = NULL;
-
     if (real_error != NULL) {
         g_propagate_error (error, real_error);
         return FALSE;
@@ -340,8 +329,6 @@ rsvg_load_read_stream_sync (RsvgLoad     *load,
         return FALSE;
     }
 
-    load->error = &err;
-
     g_assert (load->xml.ctxt == NULL);
 
     res = rsvg_parse_xml_from_stream (load->xml.rust_state,
@@ -353,8 +340,6 @@ rsvg_load_read_stream_sync (RsvgLoad     *load,
         g_propagate_error (error, err);
     }
 
-    load->error = NULL;
-
     g_object_unref (stream);
 
     return res;


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