aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-François Rameau <jframeau@cvs.gnome.org>2005-07-04 05:38:55 +0800
committerJean-François Rameau <jframeau@src.gnome.org>2005-07-04 05:38:55 +0800
commit0e935c597fe2e3e00f672b98f77eaebf48660857 (patch)
tree158d7f1f7afde6398bb207805c77dc864018d6ae
parentb0488b2a6c81ef558613c34fb398a111643b72e3 (diff)
downloadgsoc2013-epiphany-0e935c597fe2e3e00f672b98f77eaebf48660857.tar
gsoc2013-epiphany-0e935c597fe2e3e00f672b98f77eaebf48660857.tar.gz
gsoc2013-epiphany-0e935c597fe2e3e00f672b98f77eaebf48660857.tar.bz2
gsoc2013-epiphany-0e935c597fe2e3e00f672b98f77eaebf48660857.tar.lz
gsoc2013-epiphany-0e935c597fe2e3e00f672b98f77eaebf48660857.tar.xz
gsoc2013-epiphany-0e935c597fe2e3e00f672b98f77eaebf48660857.tar.zst
gsoc2013-epiphany-0e935c597fe2e3e00f672b98f77eaebf48660857.zip
EphyCookie's expires field is now of time_t type (fixes gcc 4.0 warning).
2005-07-03 Jean-François Rameau <jframeau@cvs.gnome.org> * embed/ephy-cookie-manager.h: EphyCookie's expires field is now of time_t type (fixes gcc 4.0 warning). * embed/ephy-favicon-cache.c: * lib/ephy-file-helpers.c: * lib/ephy-langs.c: * lib/ephy-node-db.c: * lib/ephy-node.c: * lib/ephy-state.c: * lib/egg/eggtraymanager.c: * src/ephy-extensions-manager.c: * src/ephy-main.c: * src/ephy-notebook.c: * src/ephy-session.c: * src/ephy-window.c: Fixes more signed/unsigned problems with gcc 4.0.
-rw-r--r--ChangeLog21
-rw-r--r--embed/ephy-cookie-manager.h3
-rw-r--r--embed/ephy-favicon-cache.c6
-rw-r--r--lib/egg/eggtraymanager.c4
-rw-r--r--lib/ephy-file-helpers.c8
-rw-r--r--lib/ephy-langs.c4
-rw-r--r--lib/ephy-node-db.c16
-rw-r--r--lib/ephy-node.c57
-rw-r--r--lib/ephy-state.c7
-rw-r--r--src/ephy-extensions-manager.c10
-rw-r--r--src/ephy-main.c2
-rw-r--r--src/ephy-notebook.c2
-rw-r--r--src/ephy-session.c4
-rw-r--r--src/ephy-window.c4
14 files changed, 88 insertions, 60 deletions
diff --git a/ChangeLog b/ChangeLog
index 66cac8b9a..27e42f114 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,24 @@
+2005-07-03 Jean-François Rameau <jframeau@cvs.gnome.org>
+
+ * embed/ephy-cookie-manager.h:
+
+ EphyCookie's expires field is now of time_t type (fixes gcc 4.0 warning).
+
+ * embed/ephy-favicon-cache.c:
+ * lib/ephy-file-helpers.c:
+ * lib/ephy-langs.c:
+ * lib/ephy-node-db.c:
+ * lib/ephy-node.c:
+ * lib/ephy-state.c:
+ * lib/egg/eggtraymanager.c:
+ * src/ephy-extensions-manager.c:
+ * src/ephy-main.c:
+ * src/ephy-notebook.c:
+ * src/ephy-session.c:
+ * src/ephy-window.c:
+
+ Fixes more signed/unsigned problems with gcc 4.0.
+
2005-07-01 Jean-François Rameau <jframeau@cvs.gnome.org>
* src/ephy-navigation-action.c: (build_back_or_forward_menu),
diff --git a/embed/ephy-cookie-manager.h b/embed/ephy-cookie-manager.h
index 3b4bf84f1..6ff97f8cc 100644
--- a/embed/ephy-cookie-manager.h
+++ b/embed/ephy-cookie-manager.h
@@ -24,6 +24,7 @@
#include <glib-object.h>
#include <glib.h>
+#include <time.h>
G_BEGIN_DECLS
@@ -45,7 +46,7 @@ typedef struct
char *value;
char *domain;
char *path;
- gulong expires;
+ time_t expires;
glong real_expires;
guint is_secure : 1;
guint is_session : 1;
diff --git a/embed/ephy-favicon-cache.c b/embed/ephy-favicon-cache.c
index 0e283e229..83c14ffad 100644
--- a/embed/ephy-favicon-cache.c
+++ b/embed/ephy-favicon-cache.c
@@ -36,8 +36,8 @@
#include "ephy-node.h"
#include "ephy-debug.h"
-#define EPHY_FAVICON_CACHE_XML_ROOT "ephy_favicons_cache"
-#define EPHY_FAVICON_CACHE_XML_VERSION "1.1"
+#define EPHY_FAVICON_CACHE_XML_ROOT (const xmlChar *)"ephy_favicons_cache"
+#define EPHY_FAVICON_CACHE_XML_VERSION (const xmlChar *)"1.1"
#define EPHY_FAVICON_CACHE_OBSOLETE_DAYS 30
@@ -287,7 +287,7 @@ ephy_favicon_cache_finalize (GObject *object)
remove_obsolete_icons (cache);
ephy_node_db_write_to_xml_safe
- (cache->priv->db, cache->priv->xml_file,
+ (cache->priv->db, (const xmlChar *)cache->priv->xml_file,
EPHY_FAVICON_CACHE_XML_ROOT,
EPHY_FAVICON_CACHE_XML_VERSION,
NULL,
diff --git a/lib/egg/eggtraymanager.c b/lib/egg/eggtraymanager.c
index f076a64d3..2167ea607 100644
--- a/lib/egg/eggtraymanager.c
+++ b/lib/egg/eggtraymanager.c
@@ -686,13 +686,13 @@ egg_tray_manager_get_child_title (EggTrayManager *manager,
return NULL;
}
- if (!g_utf8_validate (val, nitems, NULL))
+ if (!g_utf8_validate ((const gchar *)val, nitems, NULL))
{
XFree (val);
return NULL;
}
- retval = g_strndup (val, nitems);
+ retval = g_strndup ((const gchar *)val, nitems);
XFree (val);
diff --git a/lib/ephy-file-helpers.c b/lib/ephy-file-helpers.c
index 8f06eba69..d84b568c9 100644
--- a/lib/ephy-file-helpers.c
+++ b/lib/ephy-file-helpers.c
@@ -416,19 +416,19 @@ load_mime_from_xml (void)
tag = xmlTextReaderConstName (reader);
type = xmlTextReaderNodeType (reader);
- if (xmlStrEqual (tag, "safe") && type == XML_READER_TYPE_ELEMENT)
+ if (xmlStrEqual (tag, (const xmlChar *)"safe") && type == XML_READER_TYPE_ELEMENT)
{
permission = EPHY_MIME_PERMISSION_SAFE;
}
- else if (xmlStrEqual (tag, "unsafe") && type == XML_READER_TYPE_ELEMENT)
+ else if (xmlStrEqual (tag, (const xmlChar *)"unsafe") && type == XML_READER_TYPE_ELEMENT)
{
permission = EPHY_MIME_PERMISSION_UNSAFE;
}
- else if (xmlStrEqual (tag, "mime-type"))
+ else if (xmlStrEqual (tag, (const xmlChar *)"mime-type"))
{
xmlChar *type;
- type = xmlTextReaderGetAttribute (reader, "type");
+ type = xmlTextReaderGetAttribute (reader, (const xmlChar *)"type");
g_hash_table_insert (mime_table, type,
GINT_TO_POINTER (permission));
}
diff --git a/lib/ephy-langs.c b/lib/ephy-langs.c
index ff0ecb981..f1977d829 100644
--- a/lib/ephy-langs.c
+++ b/lib/ephy-langs.c
@@ -351,8 +351,8 @@ load_iso_entries (int iso,
reader = xmlNewTextReaderFilename (filename);
if (reader == NULL) goto out;
- xmlStrPrintf (iso_entries, sizeof (iso_entries), "iso_%d_entries", iso);
- xmlStrPrintf (iso_entry, sizeof (iso_entry), "iso_%d_entry", iso);
+ xmlStrPrintf (iso_entries, sizeof (iso_entries), (const xmlChar *)"iso_%d_entries", iso);
+ xmlStrPrintf (iso_entry, sizeof (iso_entry), (const xmlChar *)"iso_%d_entry", iso);
ret = xmlTextReaderRead (reader);
diff --git a/lib/ephy-node-db.c b/lib/ephy-node-db.c
index 613251ef5..af2899664 100644
--- a/lib/ephy-node-db.c
+++ b/lib/ephy-node-db.c
@@ -303,7 +303,7 @@ ephy_node_db_load_from_file (EphyNodeDb *db,
name = xmlTextReaderConstName (reader);
type = xmlTextReaderNodeType (reader);
- if (xmlStrEqual (name, "node")
+ if (xmlStrEqual (name, (const xmlChar *)"node")
&& type == XML_READER_TYPE_ELEMENT)
{
xmlNodePtr subtree;
@@ -324,7 +324,7 @@ ephy_node_db_load_from_file (EphyNodeDb *db,
xmlChar *version;
/* check version info */
- version = xmlTextReaderGetAttribute (reader, "version");
+ version = xmlTextReaderGetAttribute (reader, (const xmlChar *)"version");
if (xmlStrEqual (version, xml_version) == FALSE)
{
success = FALSE;
@@ -368,7 +368,7 @@ ephy_node_db_write_to_xml_valist (EphyNodeDb *db,
START_PROFILER ("Saving node db")
/* FIXME: do we want to turn compression on ? */
- writer = xmlNewTextWriterFilename (filename, 0);
+ writer = xmlNewTextWriterFilename ((const char *)filename, 0);
if (writer == NULL)
{
return -1;
@@ -377,7 +377,7 @@ ephy_node_db_write_to_xml_valist (EphyNodeDb *db,
ret = xmlTextWriterSetIndent (writer, 1);
if (ret < 0) goto out;
- ret = xmlTextWriterSetIndentString (writer, " ");
+ ret = xmlTextWriterSetIndentString (writer, (const xmlChar *)" ");
if (ret < 0) goto out;
ret = xmlTextWriterStartDocument (writer, "1.0", NULL, NULL);
@@ -386,7 +386,7 @@ ephy_node_db_write_to_xml_valist (EphyNodeDb *db,
ret = xmlTextWriterStartElement (writer, root);
if (ret < 0) goto out;
- ret = xmlTextWriterWriteAttribute (writer, "version", version);
+ ret = xmlTextWriterWriteAttribute (writer, (const xmlChar *)"version", version);
if (ret < 0) goto out;
if (comment != NULL)
@@ -484,12 +484,12 @@ ephy_node_db_write_to_xml_safe (EphyNodeDb *db,
int ret = 0;
char *tmp_file;
- tmp_file = g_strconcat (filename, ".tmp", NULL);
+ tmp_file = g_strconcat ((const gchar *)filename, ".tmp", NULL);
va_start (argptr, node);
ret = ephy_node_db_write_to_xml_valist
- (db, tmp_file, root, version, comment, node, argptr);
+ (db, (const xmlChar *)tmp_file, root, version, comment, node, argptr);
va_end (argptr);
@@ -499,7 +499,7 @@ ephy_node_db_write_to_xml_safe (EphyNodeDb *db,
goto failed;
}
- if (ephy_file_switch_temp_file (filename, tmp_file) == FALSE)
+ if (ephy_file_switch_temp_file ((const char *)filename, tmp_file) == FALSE)
{
ret = -1;
}
diff --git a/lib/ephy-node.c b/lib/ephy-node.c
index 41dbe57de..9e98ccd8c 100644
--- a/lib/ephy-node.c
+++ b/lib/ephy-node.c
@@ -681,11 +681,11 @@ write_parent (guint id,
*/
if (data->ret < 0) return;
- data->ret = xmlTextWriterStartElement (writer, "parent");
+ data->ret = xmlTextWriterStartElement (writer, (const xmlChar *)"parent");
if (data->ret < 0) return;
data->ret = xmlTextWriterWriteFormatAttribute
- (writer, "id", "%ld", node_info->node->id);
+ (writer, (const xmlChar *)"id", "%ld", node_info->node->id);
if (data->ret < 0) return;
data->ret = xmlTextWriterEndElement (writer); /* parent */
@@ -705,11 +705,11 @@ ephy_node_write_to_xml(EphyNode *node,
g_return_val_if_fail (writer != NULL, -1);
/* start writing the node */
- ret = xmlTextWriterStartElement (writer, "node");
+ ret = xmlTextWriterStartElement (writer, (const xmlChar *)"node");
if (ret < 0) goto out;
/* write node id */
- ret = xmlTextWriterWriteFormatAttribute (writer, "id", "%ld", node->id);
+ ret = xmlTextWriterWriteFormatAttribute (writer, (const xmlChar *)"id", "%ld", node->id);
if (ret < 0) goto out;
/* write node properties */
@@ -721,21 +721,22 @@ ephy_node_write_to_xml(EphyNode *node,
if (value == NULL) continue;
- ret = xmlTextWriterStartElement (writer, "property");
+ ret = xmlTextWriterStartElement (writer, (const xmlChar *)"property");
if (ret < 0) break;
- ret = xmlTextWriterWriteFormatAttribute (writer, "id", "%d", i);
+ ret = xmlTextWriterWriteFormatAttribute (writer, (const xmlChar *)"id", "%d", i);
if (ret < 0) break;
ret = xmlTextWriterWriteAttribute
- (writer, "value_type", g_type_name (G_VALUE_TYPE (value)));
+ (writer, (const xmlChar *)"value_type",
+ (const xmlChar *)g_type_name (G_VALUE_TYPE (value)));
if (ret < 0) break;
switch (G_VALUE_TYPE (value))
{
case G_TYPE_STRING:
ret = xmlTextWriterWriteString
- (writer, g_value_get_string (value));
+ (writer, (const xmlChar *)g_value_get_string (value));
break;
case G_TYPE_BOOLEAN:
ret = xmlTextWriterWriteFormatString
@@ -750,12 +751,12 @@ ephy_node_write_to_xml(EphyNode *node,
(writer, "%ld", g_value_get_long (value));
break;
case G_TYPE_FLOAT:
- g_ascii_dtostr (xml_buf, sizeof (xml_buf),
+ g_ascii_dtostr ((gchar *)xml_buf, sizeof (xml_buf),
g_value_get_float (value));
ret = xmlTextWriterWriteString (writer, xml_buf);
break;
case G_TYPE_DOUBLE:
- g_ascii_dtostr (xml_buf, sizeof (xml_buf),
+ g_ascii_dtostr ((gchar *)xml_buf, sizeof (xml_buf),
g_value_get_double (value));
ret = xmlTextWriterWriteString (writer, xml_buf);
break;
@@ -814,7 +815,7 @@ ephy_node_new_from_xml (EphyNodeDb *db, xmlNodePtr xml_node)
{
EphyNode *node;
xmlNodePtr xml_child;
- char *xml;
+ xmlChar *xml;
long id;
g_return_val_if_fail (EPHY_IS_NODE_DB (db), NULL);
@@ -822,22 +823,22 @@ ephy_node_new_from_xml (EphyNodeDb *db, xmlNodePtr xml_node)
if (ephy_node_db_is_immutable (db)) return NULL;
- xml = xmlGetProp (xml_node, "id");
+ xml = xmlGetProp (xml_node, (const xmlChar *)"id");
if (xml == NULL)
return NULL;
- id = atol (xml);
+ id = atol ((const char *)xml);
xmlFree (xml);
node = ephy_node_new_with_id (db, id);
for (xml_child = xml_node->children; xml_child != NULL; xml_child = xml_child->next) {
- if (strcmp (xml_child->name, "parent") == 0) {
+ if (strcmp ((const char *)xml_child->name, "parent") == 0) {
EphyNode *parent;
long parent_id;
- xml = xmlGetProp (xml_child, "id");
+ xml = xmlGetProp (xml_child, (const xmlChar *)"id");
g_assert (xml != NULL);
- parent_id = atol (xml);
+ parent_id = atol ((const char *)xml);
xmlFree (xml);
parent = ephy_node_db_get_node_from_id (db, parent_id);
@@ -848,17 +849,17 @@ ephy_node_new_from_xml (EphyNodeDb *db, xmlNodePtr xml_node)
ephy_node_emit_signal (parent, EPHY_NODE_CHILD_ADDED, node);
}
- } else if (strcmp (xml_child->name, "property") == 0) {
+ } else if (strcmp ((const char *)xml_child->name, "property") == 0) {
GType value_type;
GValue *value;
int property_id;
- xml = xmlGetProp (xml_child, "id");
- property_id = atoi (xml);
+ xml = xmlGetProp (xml_child, (const xmlChar *)"id");
+ property_id = atoi ((const char *)xml);
xmlFree (xml);
- xml = xmlGetProp (xml_child, "value_type");
- value_type = g_type_from_name (xml);
+ xml = xmlGetProp (xml_child, (const xmlChar *)"value_type");
+ value_type = g_type_from_name ((const gchar *)xml);
xmlFree (xml);
xml = xmlNodeGetContent (xml_child);
@@ -868,28 +869,28 @@ ephy_node_new_from_xml (EphyNodeDb *db, xmlNodePtr xml_node)
switch (value_type)
{
case G_TYPE_STRING:
- g_value_set_string (value, xml);
+ g_value_set_string (value, (const gchar *)xml);
break;
case G_TYPE_INT:
- g_value_set_int (value, atoi (xml));
+ g_value_set_int (value, atoi ((const char *)xml));
break;
case G_TYPE_BOOLEAN:
- g_value_set_boolean (value, atoi (xml));
+ g_value_set_boolean (value, atoi ((const char *)xml));
break;
case G_TYPE_LONG:
- g_value_set_long (value, atol (xml));
+ g_value_set_long (value, atol ((const char *)xml));
break;
case G_TYPE_FLOAT:
- g_value_set_float (value, g_ascii_strtod (xml, NULL));
+ g_value_set_float (value, g_ascii_strtod ((const gchar *)xml, NULL));
break;
case G_TYPE_DOUBLE:
- g_value_set_double (value, g_ascii_strtod (xml, NULL));
+ g_value_set_double (value, g_ascii_strtod ((const gchar *)xml, NULL));
break;
case G_TYPE_POINTER:
{
EphyNode *property_node;
- property_node = ephy_node_db_get_node_from_id (db, atol (xml));
+ property_node = ephy_node_db_get_node_from_id (db, atol ((const char *)xml));
g_value_set_pointer (value, property_node);
break;
diff --git a/lib/ephy-state.c b/lib/ephy-state.c
index f12ada4bc..fe578b0fd 100644
--- a/lib/ephy-state.c
+++ b/lib/ephy-state.c
@@ -34,8 +34,8 @@
#include <gtk/gtkexpander.h>
#define EPHY_STATES_XML_FILE "states.xml"
-#define EPHY_STATES_XML_ROOT "ephy_states"
-#define EPHY_STATES_XML_VERSION "1.0"
+#define EPHY_STATES_XML_ROOT (const xmlChar *)"ephy_states"
+#define EPHY_STATES_XML_VERSION (const xmlChar *)"1.0"
enum
{
@@ -63,7 +63,8 @@ ephy_states_save (void)
NULL);
ephy_node_db_write_to_xml_safe
- (states_db, xml_file,
+ (states_db,
+ (const xmlChar *)xml_file,
EPHY_STATES_XML_ROOT,
EPHY_STATES_XML_VERSION,
NULL, /* comment */
diff --git a/src/ephy-extensions-manager.c b/src/ephy-extensions-manager.c
index a140ad34d..6a19e8464 100644
--- a/src/ephy-extensions-manager.c
+++ b/src/ephy-extensions-manager.c
@@ -392,7 +392,7 @@ ephy_extensions_manager_load_string (EphyExtensionsManager *manager,
* put the schema validation on the Doc Tree and then pass that to the
* reader. (maybe switch to RelaxNG?)
*/
- doc = xmlParseDoc (xml);
+ doc = xmlParseDoc ((const xmlChar *)xml);
if (doc == NULL)
{
@@ -561,7 +561,7 @@ ephy_extensions_manager_load_string (EphyExtensionsManager *manager,
else if (state == STATE_URL &&
type == XML_READER_TYPE_TEXT)
{
- einfo->url = xmlTextReaderValue (reader);
+ einfo->url = (char *)xmlTextReaderValue (reader);
}
else if (state == STATE_AUTHOR &&
type == XML_READER_TYPE_END_ELEMENT &&
@@ -648,8 +648,8 @@ ephy_extensions_manager_load_string (EphyExtensionsManager *manager,
xmlFreeDoc (doc);
/* assign localised strings */
- einfo->description = description.string;
- einfo->name = name.string;
+ einfo->description = (char *)description.string;
+ einfo->name = (char *)name.string;
/* sanity check */
if (ret < 0 || state != STATE_STOP ||
@@ -838,7 +838,7 @@ load_extension (EphyExtensionsManager *manager,
if (info->load_failed) return;
/* get a loader */
- loader = get_loader_for_type (manager, info->loader_type);
+ loader = get_loader_for_type (manager, (const char *)info->loader_type);
if (loader == NULL)
{
g_message ("No loader found for extension '%s' of type '%s'\n",
diff --git a/src/ephy-main.c b/src/ephy-main.c
index d60d15a52..e5b9094b2 100644
--- a/src/ephy-main.c
+++ b/src/ephy-main.c
@@ -174,7 +174,7 @@ slowly_and_stupidly_obtain_timestamp (Display *xdisplay)
XChangeProperty (xdisplay,
xwindow, atom_name,
atom_type,
- 8, PropModeReplace, name, strlen (name));
+ 8, PropModeReplace, (unsigned char *)name, strlen (name));
}
XWindowEvent (xdisplay,
diff --git a/src/ephy-notebook.c b/src/ephy-notebook.c
index bd953fca7..82e13203d 100644
--- a/src/ephy-notebook.c
+++ b/src/ephy-notebook.c
@@ -725,7 +725,7 @@ notebook_drag_data_received_cb (GtkWidget* widget, GdkDragContext *context,
char **split;
/* URL_TYPE has format: url \n title */
- split = g_strsplit (selection_data->data, "\n", 2);
+ split = g_strsplit ((const gchar *)selection_data->data, "\n", 1);
if (split != NULL && split[0] != NULL && split[0][0] != '\0')
{
ephy_link_open (EPHY_LINK (notebook), split[0], tab,
diff --git a/src/ephy-session.c b/src/ephy-session.c
index a54e81401..96e016137 100644
--- a/src/ephy-session.c
+++ b/src/ephy-session.c
@@ -593,7 +593,9 @@ write_ephy_window (xmlTextWriterPtr writer,
role = gtk_window_get_role (GTK_WINDOW (window));
if (role != NULL)
{
- ret = xmlTextWriterWriteAttribute (writer, "role", role);
+ ret = xmlTextWriterWriteAttribute (writer,
+ (const xmlChar *)"role",
+ (const xmlChar *)role);
if (ret < 0) return ret;
}
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 54a7bce81..186458fbd 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -1538,11 +1538,13 @@ popup_menu_at_coords (GtkMenu *menu, gint *x, gint *y, gboolean *push_in,
{
GtkWidget *window = GTK_WIDGET (user_data);
EphyEmbedEvent *event;
+ guint ux, uy;
event = g_object_get_data (G_OBJECT (window), "context_event");
g_return_if_fail (event != NULL);
- ephy_embed_event_get_coords (event, x, y);
+ ephy_embed_event_get_coords (event, &ux, &uy);
+ *x = ux; *y = uy;
/* FIXME: better position the popup within the window bounds? */
ephy_gui_sanitise_popup_position (menu, window, x, y);