[gtk+] cssvalue: Don't allow empty arrays anymore



commit fd7668bfb54674bda04cc74c2a6ad571939943e9
Author: Benjamin Otte <otte redhat com>
Date:   Wed Aug 29 12:37:16 2012 +0200

    cssvalue: Don't allow empty arrays anymore
    
    CSS arrays aren't empty, even the ones that appear empty contain one
    "none" element.

 gtk/gtkcssarrayvalue.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkcssarrayvalue.c b/gtk/gtkcssarrayvalue.c
index 6c3cb4e..fb22294 100644
--- a/gtk/gtkcssarrayvalue.c
+++ b/gtk/gtkcssarrayvalue.c
@@ -128,13 +128,10 @@ static const GtkCssValueClass GTK_CSS_VALUE_ARRAY = {
   gtk_css_value_array_print
 };
 
-static GtkCssValue none_singleton = { &GTK_CSS_VALUE_ARRAY, 1, 0, { NULL } };
-
 GtkCssValue *
 _gtk_css_array_value_new (GtkCssValue *content)
 {
-  if (content == NULL)
-    return _gtk_css_value_ref (&none_singleton);
+  g_return_val_if_fail (content != NULL, NULL);
 
   return _gtk_css_array_value_new_from_array (&content, 1);
 }



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