Commit 82815b4b authored by Juan Pablo Ugarte's avatar Juan Pablo Ugarte

fixed bogus type punned warnings adding a local variable in

* gladeui/glade-widget-adaptor.[ch]: fixed bogus type punned warnings adding a 
  local variable in gwa_extend_with_node_load_sym() as pointed by galtgendo@o2.pl
  (bug 435912)

* gladeui/glade-xml-utils.[ch]: glade_xml_load_sym_from_node() now returns
   wheater or not the symbol was found.

svn path=/trunk/; revision=1319
parent 079d6956
2007-05-16 Juan Pablo Ugarte <juanpablougarte@gmail.com>
* gladeui/glade-widget-adaptor.[ch]: fixed bogus type punned warnings adding a
local variable in gwa_extend_with_node_load_sym() as pointed by galtgendo@o2.pl
(bug 435912)
* gladeui/glade-xml-utils.[ch]: glade_xml_load_sym_from_node() now returns
wheater or not the symbol was found.
2007-05-16 Tristan Van Berkom <tvb@gnome.org>
* plugins/gtk+/gtk+.xml.in: Set "response-id" property to be "save-always" fixing
......
......@@ -1328,6 +1328,84 @@ gwa_update_actions (GladeWidgetAdaptor *adaptor,
g_free (label);
g_free (stock);
}
static void
gwa_extend_with_node_load_sym (GladeWidgetAdaptorClass *klass,
GladeXmlNode *node,
GModule *module)
{
gpointer symbol;
/*
* We use a temporary variable to avoid a bogus gcc warning.
* the thing it that g_module_symbol() should use a function pointer
* instead of a gpointer!
*/
if (glade_xml_load_sym_from_node (node, module,
GLADE_TAG_POST_CREATE_FUNCTION,
&symbol))
klass->post_create = symbol;
if (glade_xml_load_sym_from_node (node, module,
GLADE_TAG_GET_INTERNAL_CHILD_FUNCTION,
&symbol))
klass->get_internal_child = symbol;
if (glade_xml_load_sym_from_node (node, module,
GLADE_TAG_SET_FUNCTION,
&symbol))
klass->set_property = symbol;
if (glade_xml_load_sym_from_node (node, module,
GLADE_TAG_GET_FUNCTION,
&symbol))
klass->get_property = symbol;
if (glade_xml_load_sym_from_node (node, module,
GLADE_TAG_VERIFY_FUNCTION,
&symbol))
klass->verify_property = symbol;
if (glade_xml_load_sym_from_node (node, module,
GLADE_TAG_ADD_CHILD_FUNCTION,
&symbol))
klass->add = symbol;
if (glade_xml_load_sym_from_node (node, module,
GLADE_TAG_REMOVE_CHILD_FUNCTION,
&symbol))
klass->remove = symbol;
if (glade_xml_load_sym_from_node (node, module,
GLADE_TAG_GET_CHILDREN_FUNCTION,
&symbol))
klass->get_children = symbol;
if (glade_xml_load_sym_from_node (node, module,
GLADE_TAG_CHILD_SET_PROP_FUNCTION,
&symbol))
klass->child_set_property = symbol;
if (glade_xml_load_sym_from_node (node, module,
GLADE_TAG_CHILD_GET_PROP_FUNCTION,
&symbol))
klass->child_get_property = symbol;
if (glade_xml_load_sym_from_node (node, module,
GLADE_TAG_CHILD_VERIFY_FUNCTION,
&symbol))
klass->child_verify_property = symbol;
if (glade_xml_load_sym_from_node (node, module,
GLADE_TAG_REPLACE_CHILD_FUNCTION,
&symbol))
klass->replace_child = symbol;
if (glade_xml_load_sym_from_node (node, module,
GLADE_TAG_ACTION_ACTIVATE_FUNCTION,
&symbol))
klass->action_activate = symbol;
}
static gboolean
......@@ -1340,57 +1418,8 @@ gwa_extend_with_node (GladeWidgetAdaptor *adaptor,
GladeXmlNode *child;
gchar *child_type;
if (module)
{
glade_xml_load_sym_from_node (node, module,
GLADE_TAG_POST_CREATE_FUNCTION,
(gpointer *)&adaptor_class->post_create);
glade_xml_load_sym_from_node (node, module,
GLADE_TAG_GET_INTERNAL_CHILD_FUNCTION,
(gpointer *)&adaptor_class->get_internal_child);
glade_xml_load_sym_from_node (node, module,
GLADE_TAG_SET_FUNCTION,
(gpointer *)&adaptor_class->set_property);
glade_xml_load_sym_from_node (node, module,
GLADE_TAG_GET_FUNCTION,
(gpointer *)&adaptor_class->get_property);
glade_xml_load_sym_from_node (node, module,
GLADE_TAG_VERIFY_FUNCTION,
(gpointer *)&adaptor_class->verify_property);
glade_xml_load_sym_from_node (node, module,
GLADE_TAG_ADD_CHILD_FUNCTION,
(gpointer *)&adaptor_class->add);
glade_xml_load_sym_from_node (node, module,
GLADE_TAG_REMOVE_CHILD_FUNCTION,
(gpointer *)&adaptor_class->remove);
glade_xml_load_sym_from_node (node, module,
GLADE_TAG_GET_CHILDREN_FUNCTION,
(gpointer *)&adaptor_class->get_children);
glade_xml_load_sym_from_node (node, module,
GLADE_TAG_CHILD_SET_PROP_FUNCTION,
(gpointer *)&adaptor_class->child_set_property);
glade_xml_load_sym_from_node (node, module,
GLADE_TAG_CHILD_GET_PROP_FUNCTION,
(gpointer *)&adaptor_class->child_get_property);
glade_xml_load_sym_from_node (node, module,
GLADE_TAG_CHILD_VERIFY_FUNCTION,
(gpointer *)&adaptor_class->child_verify_property);
glade_xml_load_sym_from_node (node, module,
GLADE_TAG_REPLACE_CHILD_FUNCTION,
(gpointer *)&adaptor_class->replace_child);
}
/* Load catalog symbols from module */
if (module) gwa_extend_with_node_load_sym (adaptor_class, node, module);
adaptor_class->fixed =
glade_xml_get_property_boolean
......
......@@ -777,14 +777,14 @@ glade_xml_alloc_propname(GladeInterface *interface, const gchar *string)
return glade_xml_alloc_string(interface, norm_str->str);
}
void
gboolean
glade_xml_load_sym_from_node (GladeXmlNode *node_in,
GModule *module,
gchar *tagname,
gpointer *sym_location)
{
static GModule *self = NULL;
gboolean retval = FALSE;
gchar *buff;
if (!self)
......@@ -798,7 +798,7 @@ glade_xml_load_sym_from_node (GladeXmlNode *node_in,
"no module available to load it from !",
buff, tagname);
g_free (buff);
return;
return FALSE;
}
/* I use here a g_warning to signal these errors instead of a dialog
......@@ -813,10 +813,14 @@ glade_xml_load_sym_from_node (GladeXmlNode *node_in,
*
* XXX http://bugzilla.gnome.org/show_bug.cgi?id=331797
*/
if (!g_module_symbol (module, buff, sym_location))
if (!g_module_symbol (self, buff, sym_location))
g_warning ("Could not find %s in %s or in global namespace\n",
buff, g_module_name (module));
if (g_module_symbol (module, buff, sym_location) ||
g_module_symbol (self, buff, sym_location))
retval = TRUE;
else
g_warning ("Could not find %s in %s or in global namespace\n",
buff, g_module_name (module));
g_free (buff);
}
return retval;
}
......@@ -175,7 +175,7 @@ GladeXmlDoc * glade_xml_context_get_doc (GladeXmlContext *context);
gchar * glade_xml_alloc_string (GladeInterface *interface, const gchar *string);
gchar * glade_xml_alloc_propname (GladeInterface *interface, const gchar *string);
void glade_xml_load_sym_from_node (GladeXmlNode *node_in,
gboolean glade_xml_load_sym_from_node (GladeXmlNode *node_in,
GModule *module,
gchar *tagname,
gpointer *sym_location);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment