Commit a09a4c4a authored by Christian Kirbach's avatar Christian Kirbach Committed by Paolo Borelli

fix 27 gcc4 compiler warnings, mostly pointer targets differing in

2006-02-28  Christian Kirbach  <Christian.Kirbach@student.uni-siegen.de>

	* gedit/gedit-metadata-manager.c:
	* gedit/gedit-prefs-manager.c:
	fix 27 gcc4 compiler warnings, mostly pointer targets differing in
	signedness
parent eb6696a8
2006-02-28 Christian Kirbach <Christian.Kirbach@student.uni-siegen.de>
* gedit/gedit-metadata-manager.c:
* gedit/gedit-prefs-manager.c:
fix 27 gcc4 compiler warnings, mostly pointer targets differing in
signedness
2006-02-28 Steve Frécinaux <steve@istique.net>
* plugins/pythonconsole/pythonconsole.py: fix python console history
......
......@@ -154,11 +154,11 @@ parseItem (xmlDocPtr doc, xmlNodePtr cur)
if (xmlStrcmp (cur->name, (const xmlChar *)"document") != 0)
return;
uri = xmlGetProp (cur, "uri");
uri = xmlGetProp (cur, (const xmlChar *)"uri");
if (uri == NULL)
return;
atime = xmlGetProp (cur, "atime");
atime = xmlGetProp (cur, (const xmlChar *)"atime");
if (atime == NULL)
{
xmlFree (uri);
......@@ -168,40 +168,40 @@ parseItem (xmlDocPtr doc, xmlNodePtr cur)
item = g_new0 (Item, 1);
item->atime = g_ascii_strtoull ((char *)atime, NULL, 0);
item->values = g_hash_table_new_full (g_str_hash,
g_str_equal,
g_free,
g_free);
cur = cur->xmlChildrenNode;
while (cur != NULL)
{
if (xmlStrcmp (cur->name, (const xmlChar *)"entry") == 0)
{
xmlChar *key;
xmlChar *value;
key = xmlGetProp (cur, "key");
value = xmlGetProp (cur, "value");
key = xmlGetProp (cur, (const xmlChar *)"key");
value = xmlGetProp (cur, (const xmlChar *)"value");
if ((key != NULL) && (value != NULL))
g_hash_table_insert (item->values,
g_strdup (key),
g_strdup (value));
g_strdup ((gchar *)key),
g_strdup ((gchar *)value));
if (key != NULL)
xmlFree (key);
if (value != NULL)
xmlFree (value);
}
cur = cur->next;
}
g_hash_table_insert (gedit_metadata_manager->items,
g_strdup (uri),
g_strdup ((gchar *)uri),
item);
xmlFree (uri);
......@@ -278,7 +278,7 @@ gedit_metadata_manager_get (const gchar *uri,
{
Item *item;
gchar *value;
gedit_debug (DEBUG_METADATA);
g_return_val_if_fail (uri != NULL, NULL);
......@@ -307,8 +307,8 @@ gedit_metadata_manager_get (const gchar *uri,
if (item->values == NULL)
return NULL;
value = (gchar *)g_hash_table_lookup (item->values, key);
value = g_hash_table_lookup (item->values, key);
if (value == NULL)
return NULL;
......@@ -375,7 +375,7 @@ static void
save_values (const gchar *key, const gchar *value, xmlNodePtr parent)
{
xmlNodePtr xml_node;
gedit_debug (DEBUG_METADATA);
g_return_if_fail (key != NULL);
......@@ -383,17 +383,24 @@ save_values (const gchar *key, const gchar *value, xmlNodePtr parent)
if (value == NULL)
return;
xml_node = xmlNewChild (parent, NULL, "entry", NULL);
xmlSetProp (xml_node, "key", key);
xmlSetProp (xml_node, "value", value);
xml_node = xmlNewChild (parent,
NULL,
(const xmlChar *)"entry",
NULL);
xmlSetProp (xml_node,
(const xmlChar *)"key",
(const xmlChar *)key);
xmlSetProp (xml_node,
(const xmlChar *)"value",
(const xmlChar *)value);
gedit_debug_message (DEBUG_METADATA, "entry: %s = %s", key, value);
}
static void
save_item (const gchar *key, const gpointer *data, xmlNodePtr parent)
{
{
xmlNodePtr xml_node;
const Item *item = (const Item *)data;
gchar *atime;
......@@ -401,32 +408,33 @@ save_item (const gchar *key, const gpointer *data, xmlNodePtr parent)
gedit_debug (DEBUG_METADATA);
g_return_if_fail (key != NULL);
if (item == NULL)
return;
xml_node = xmlNewChild (parent, NULL, "document", NULL);
xmlSetProp (xml_node, "uri", key);
xml_node = xmlNewChild (parent, NULL, (const xmlChar *)"document", NULL);
xmlSetProp (xml_node, (const xmlChar *)"uri", (const xmlChar *)key);
gedit_debug_message (DEBUG_METADATA, "uri: %s", key);
atime = g_strdup_printf ("%ld", item->atime);
xmlSetProp (xml_node, "atime", atime);
xmlSetProp (xml_node, (const xmlChar *)"atime", (const xmlChar *)atime);
gedit_debug_message (DEBUG_METADATA, "atime: %s", atime);
g_free (atime);
g_hash_table_foreach (item->values,
(GHFunc)save_values, xml_node);
(GHFunc)save_values,
xml_node);
}
static void
get_oldest (const gchar *key, const gpointer value, const gchar ** key_to_remove)
{
const Item *item = (const Item *)value;
if (*key_to_remove == NULL)
{
*key_to_remove = key;
......@@ -472,7 +480,7 @@ gedit_metadata_manager_save (gpointer data)
gchar *file_name;
gedit_debug (DEBUG_METADATA);
if (!gedit_metadata_manager->modified)
return TRUE;
......@@ -480,28 +488,29 @@ gedit_metadata_manager_save (gpointer data)
xmlIndentTreeOutput = TRUE;
doc = xmlNewDoc ("1.0");
doc = xmlNewDoc ((const xmlChar *)"1.0");
if (doc == NULL)
return TRUE;
/* Create metadata root */
root = xmlNewDocNode (doc, NULL, "metadata", NULL);
root = xmlNewDocNode (doc, NULL, (const xmlChar *)"metadata", NULL);
xmlDocSetRootElement (doc, root);
g_hash_table_foreach (gedit_metadata_manager->items,
(GHFunc)save_item, root);
(GHFunc)save_item,
root);
/* FIXME: lock file - Paolo */
file_name = gnome_util_home_file (METADATA_FILE);
xmlSaveFormatFile (file_name, doc, 1);
g_free (file_name);
xmlFreeDoc (doc);
gedit_metadata_manager->modified = FALSE;
gedit_debug_message (DEBUG_METADATA, "DONE");
return TRUE;
}
......@@ -826,7 +826,7 @@ DEFINE_INT_PREF (print_line_numbers,
* gnome_font_face_find_closest() (probably a gnome-print bug)
*/
static void
face_and_size_from_full_name (const guchar *name,
face_and_size_from_full_name (const gchar *name,
GnomeFontFace **face,
gdouble *size)
{
......@@ -843,7 +843,7 @@ face_and_size_from_full_name (const guchar *name,
*size = 12;
}
*face = gnome_font_face_find_closest (copy);
*face = gnome_font_face_find_closest ((guchar *)copy);
g_free (copy);
}
......@@ -854,6 +854,7 @@ font_description_from_gnome_font_name (const char *font_name)
PangoFontDescription *desc;
PangoStyle style;
PangoWeight weight;
const gchar *family_name;
gdouble size;
face_and_size_from_full_name (font_name, &face, &size);
......@@ -861,9 +862,10 @@ font_description_from_gnome_font_name (const char *font_name)
/* Pango and GnomePrint have basically the same numeric weight values */
weight = (PangoWeight) gnome_font_face_get_weight_code (face);
style = gnome_font_face_is_italic (face) ? PANGO_STYLE_ITALIC : PANGO_STYLE_NORMAL;
family_name = (const gchar *) gnome_font_face_get_family_name (face);
desc = pango_font_description_new ();
pango_font_description_set_family (desc, gnome_font_face_get_family_name (face));
pango_font_description_set_family (desc, family_name);
pango_font_description_set_weight (desc, weight);
pango_font_description_set_style (desc, style);
pango_font_description_set_size (desc, size * PANGO_SCALE);
......
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