gobject-introspection r688 - in trunk: . girepository



Author: tko
Date: Sun Oct 12 21:07:22 2008
New Revision: 688
URL: http://svn.gnome.org/viewvc/gobject-introspection?rev=688&view=rev

Log:
2008-10-12  Tommi Komulainen  <tommi komulainen iki fi>

	* girepository/girparser.c (parse_param_transfer,
	start_parameter): Refactor handling of transfer=none/shallow/full
	to separate function

Modified:
   trunk/ChangeLog
   trunk/girepository/girparser.c

Modified: trunk/girepository/girparser.c
==============================================================================
--- trunk/girepository/girparser.c	(original)
+++ trunk/girepository/girparser.c	Sun Oct 12 21:07:22 2008
@@ -658,6 +658,36 @@
   return TRUE;
 }
 
+static void
+parse_param_transfer (GIrNodeParam *param, const gchar *transfer)
+{
+  if (transfer && strcmp (transfer, "none") == 0)
+    {
+      param->transfer = FALSE;
+      param->shallow_transfer = FALSE;
+    }
+  else if (transfer && strcmp (transfer, "shallow") == 0)
+    {
+      param->transfer = FALSE;
+      param->shallow_transfer = TRUE;
+    }
+  else
+    {
+      if (transfer)
+	{
+	  if (strcmp (transfer, "full") != 0)
+	    g_warning ("Unknown transfer %s", transfer);
+	  else
+	    param->transfer = TRUE;
+	}
+      else if (param->in && !param->out)
+	param->transfer = FALSE;
+      else
+	param->transfer = TRUE;
+      param->shallow_transfer = FALSE;
+    }
+}
+
 static gboolean
 start_parameter (GMarkupParseContext *context,
 		 const gchar         *element_name,
@@ -733,32 +763,8 @@
   else
     param->null_ok = FALSE;
 
-  if (transfer && strcmp (transfer, "none") == 0)
-    {
-      param->transfer = FALSE;
-      param->shallow_transfer = FALSE;
-    }
-  else if (transfer && strcmp (transfer, "shallow") == 0)
-    {
-      param->transfer = FALSE;
-      param->shallow_transfer = TRUE;
-    }
-  else 
-    {
-      if (transfer)
-	{
-	  if (strcmp (transfer, "full") != 0)
-	    g_warning ("Unknown transfer %s", transfer);
-	  else
-	    param->transfer = TRUE;
-	}
-      else if (param->in && !param->out)
-	param->transfer = FALSE;
-      else
-	param->transfer = TRUE;
-      param->shallow_transfer = FALSE;
-    }
-	  
+  parse_param_transfer (param, transfer);
+
   ((GIrNode *)param)->name = g_strdup (name);
 	  
   switch (ctx->current_node->type)



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