aboutsummaryrefslogtreecommitdiffstats
path: root/e-util
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2007-10-10 12:54:36 +0800
committerMatthew Barnes <mbarnes@src.gnome.org>2007-10-10 12:54:36 +0800
commitb32649a94cd485f742d2ad5f1b76d7385393e137 (patch)
tree002248795c141c992667d73fbf34c40f394fbbf0 /e-util
parent6a2861c3aa49e9439d3e665b0855222716add3a3 (diff)
downloadgsoc2013-evolution-b32649a94cd485f742d2ad5f1b76d7385393e137.tar.gz
gsoc2013-evolution-b32649a94cd485f742d2ad5f1b76d7385393e137.tar.zst
gsoc2013-evolution-b32649a94cd485f742d2ad5f1b76d7385393e137.zip
** Fixes bug #437579
2007-10-09 Matthew Barnes <mbarnes@redhat.com> ** Fixes bug #437579 * addressbook/conduit/address-conduit.c: * addressbook/gui/component/addressbook-config.c: * addressbook/gui/contact-editor/e-contact-editor.c: * addressbook/gui/widgets/eab-gui-util.c: * calendar/conduits/calendar/calendar-conduit.c: * calendar/conduits/memo/memo-conduit.c: * calendar/conduits/todo/todo-conduit.c: * calendar/gui/dialogs/alarm-dialog.c: * calendar/gui/dialogs/event-page.c: * calendar/gui/dialogs/memo-page.c: * calendar/gui/dialogs/task-page.c: * calendar/gui/e-day-view-layout.c: * calendar/gui/e-day-view-layout.h: * calendar/gui/print.c: * e-util/e-pilot-map.c: * e-util/e-plugin.c: * e-util/e-profile-event.c: * e-util/e-signature.c: * filter/filter-file.c: * mail/e-searching-tokenizer.c: * mail/em-folder-browser.c: * mail/em-format-html.c: * mail/em-format-view.c: * mail/em-format.c: * mail/em-mailer-prefs.c: * mail/em-mailer-prefs.h: * mail/mail-session.c: * mail/mail-session.h: * mail/mail-vfolder.c: * mail/message-list.c: * plugins/bbdb/bbdb.c: * plugins/bbdb/gaimbuddies.c: * plugins/calendar-http/calendar-http.c: * plugins/exchange-operations/exchange-user-dialog.c: * plugins/face/face.c: * shell/e-shell-window.c: * shell/e-shell.c: * smime/lib/e-cert-db.c: * tools/killev.c: * widgets/misc/e-cursors.c: * widgets/misc/e-spinner.c: * widgets/misc/e-unicode.c: * widgets/table/e-table-field-chooser-item.c: * widgets/table/e-table-header-item.c: * widgets/table/e-table-header-item.h: * widgets/table/e-table-header-utils.c: * widgets/table/e-table.c: * widgets/text/e-text.c: Fix various compiler warnings. Patch from Milan Crha. svn path=/trunk/; revision=34368
Diffstat (limited to 'e-util')
-rw-r--r--e-util/ChangeLog10
-rw-r--r--e-util/e-pilot-map.c109
-rw-r--r--e-util/e-plugin.c27
-rw-r--r--e-util/e-profile-event.c7
-rw-r--r--e-util/e-signature.c5
5 files changed, 67 insertions, 91 deletions
diff --git a/e-util/ChangeLog b/e-util/ChangeLog
index 55d29ad7ce..6bde75b351 100644
--- a/e-util/ChangeLog
+++ b/e-util/ChangeLog
@@ -1,3 +1,13 @@
+2007-10-09 Matthew Barnes <mbarnes@redhat.com>
+
+ ** Fixes part of bug #437579
+
+ * e-plugin.c:
+ * e-pilot-map.c:
+ * e-profile-event.c:
+ * e-signature.c:
+ Fix various compiler warnings. Patch from Milan Crha.
+
2007-10-02 Matthew Barnes <mbarnes@redhat.com>
** Fixes part of bug #469657
diff --git a/e-util/e-pilot-map.c b/e-util/e-pilot-map.c
index 6587368773..3276337679 100644
--- a/e-util/e-pilot-map.c
+++ b/e-util/e-pilot-map.c
@@ -206,39 +206,23 @@ e_pilot_map_uid_is_archived (EPilotMap *map, const char *uid)
void
e_pilot_map_insert (EPilotMap *map, guint32 pid, const char *uid, gboolean archived)
{
- gpointer key, value;
-
- if (g_hash_table_lookup_extended (map->pid_map, &pid, &key, &value)) {
- EPilotMapPidNode *pnode = value;
- gpointer other_key, other_value;
-
- g_hash_table_remove (map->pid_map, &pid);
+ EPilotMapPidNode *pnode;
+ EPilotMapUidNode *unode;
+ pnode = g_hash_table_lookup (map->pid_map, &pid);
+ if (pnode != NULL) {
/* In case the pid<->uid mapping is not the same anymore */
- if (g_hash_table_lookup_extended (map->uid_map, pnode->uid, &other_key, &other_value)) {
- g_hash_table_remove (map->uid_map, pnode->uid);
- g_free (other_key);
- g_free (other_value);
- }
+ g_hash_table_remove (map->uid_map, pnode->uid);
- g_free (key);
- g_free (value);
+ g_hash_table_remove (map->pid_map, &pid);
}
- if (g_hash_table_lookup_extended (map->uid_map, uid, &key, &value)) {
- EPilotMapUidNode *unode = value;
- gpointer other_key, other_value;
-
- g_hash_table_remove (map->uid_map, uid);
+ unode = g_hash_table_lookup (map->uid_map, uid);
+ if (unode != NULL) {
/* In case the pid<->uid mapping is not the same anymore */
- if (g_hash_table_lookup_extended (map->pid_map, &unode->pid, &other_key, &other_value)) {
- g_hash_table_remove (map->pid_map, &unode->pid);
- g_free (other_key);
- g_free (other_value);
- }
+ g_hash_table_remove (map->pid_map, &unode->pid);
- g_free (key);
- g_free (value);
+ g_hash_table_remove (map->uid_map, uid);
}
real_e_pilot_map_insert (map, pid, uid, archived, TRUE);
@@ -247,54 +231,39 @@ e_pilot_map_insert (EPilotMap *map, guint32 pid, const char *uid, gboolean archi
void
e_pilot_map_remove_by_pid (EPilotMap *map, guint32 pid)
{
- EPilotMapPidNode *pnode = NULL;
- EPilotMapUidNode *unode = NULL;
- gpointer pkey, ukey;
-
+ EPilotMapPidNode *pnode;
+ EPilotMapUidNode *unode;
+
g_return_if_fail (map != NULL);
- if (!g_hash_table_lookup_extended (map->pid_map, &pid,
- &pkey, (gpointer *)&pnode))
+ pnode = g_hash_table_lookup (map->pid_map, &pid);
+ if (pnode == NULL)
return;
-
- g_hash_table_lookup_extended (map->uid_map, pnode->uid, &ukey,
- (gpointer *)&unode);
+
+ unode = g_hash_table_lookup (map->uid_map, pnode->uid);
g_return_if_fail (unode != NULL);
-
- g_hash_table_remove (map->pid_map, &pid);
- g_hash_table_remove (map->uid_map, pnode->uid);
- g_free (pkey);
- g_free (ukey);
- g_free (pnode);
- g_free (unode);
+ g_hash_table_remove (map->uid_map, pnode->uid);
+ g_hash_table_remove (map->pid_map, &pid);
}
void
e_pilot_map_remove_by_uid (EPilotMap *map, const char *uid)
{
- EPilotMapPidNode *pnode = NULL;
- EPilotMapUidNode *unode = NULL;
- gpointer pkey, ukey;
-
+ EPilotMapPidNode *pnode;
+ EPilotMapUidNode *unode;
+
g_return_if_fail (map != NULL);
g_return_if_fail (uid != NULL);
- if (!g_hash_table_lookup_extended (map->uid_map, uid, &ukey, (gpointer *)&unode))
+ unode = g_hash_table_lookup (map->uid_map, uid);
+ if (unode == NULL)
return;
- g_hash_table_lookup_extended (map->pid_map, &unode->pid, &pkey, (gpointer *)&pnode);
+ pnode = g_hash_table_lookup (map->pid_map, &unode->pid);
- g_hash_table_remove (map->uid_map, uid);
g_hash_table_remove (map->pid_map, &unode->pid);
-
- if (unode->pid != 0)
- g_free (pkey);
- g_free (ukey);
-
- if (unode->pid != 0)
- g_free (pnode);
- g_free (unode);
+ g_hash_table_remove (map->uid_map, uid);
}
@@ -363,8 +332,14 @@ e_pilot_map_read (const char *filename, EPilotMap **map)
memset (&handler, 0, sizeof (xmlSAXHandler));
handler.startElement = map_sax_start_element;
- new_map->pid_map = g_hash_table_new (g_int_hash, g_int_equal);
- new_map->uid_map = g_hash_table_new (g_str_hash, g_str_equal);
+ new_map->pid_map = g_hash_table_new_full (
+ g_int_hash, g_int_equal,
+ (GDestroyNotify) g_free,
+ (GDestroyNotify) g_free);
+ new_map->uid_map = g_hash_table_new_full (
+ g_str_hash, g_str_equal,
+ (GDestroyNotify) g_free,
+ (GDestroyNotify) g_free);
if (g_file_test (filename, G_FILE_TEST_EXISTS)) {
if (xmlSAXUserParseFile (&handler, new_map, filename) < 0) {
@@ -416,22 +391,13 @@ e_pilot_map_write (const char *filename, EPilotMap *map)
return 0;
}
-static gboolean
-foreach_remove (gpointer key, gpointer value, gpointer data)
-{
- g_free (key);
- g_free (value);
-
- return TRUE;
-}
-
void
e_pilot_map_clear (EPilotMap *map)
{
g_return_if_fail (map != NULL);
- g_hash_table_foreach_remove (map->pid_map, foreach_remove, NULL);
- g_hash_table_foreach_remove (map->uid_map, foreach_remove, NULL);
+ g_hash_table_remove_all (map->pid_map);
+ g_hash_table_remove_all (map->uid_map);
map->since = 0;
map->write_touched_only = FALSE;
@@ -442,9 +408,6 @@ e_pilot_map_destroy (EPilotMap *map)
{
g_return_if_fail (map != NULL);
- g_hash_table_foreach_remove (map->pid_map, foreach_remove, NULL);
- g_hash_table_foreach_remove (map->uid_map, foreach_remove, NULL);
-
g_hash_table_destroy (map->pid_map);
g_hash_table_destroy (map->uid_map);
g_free (map);
diff --git a/e-util/e-plugin.c b/e-util/e-plugin.c
index 712effb25b..edcdb4d43c 100644
--- a/e-util/e-plugin.c
+++ b/e-util/e-plugin.c
@@ -187,21 +187,20 @@ ep_construct(EPlugin *ep, xmlNodePtr root)
ep->hooks = g_slist_append(ep->hooks, hook);
}
} else {
- GSList *l;
- char *oldclass;
+ gpointer l, oldclass;
if (ep_plugins_pending_hooks == NULL)
ep_plugins_pending_hooks = g_hash_table_new(g_str_hash, g_str_equal);
- if (!g_hash_table_lookup_extended(ep_plugins_pending_hooks, class, (void **)&oldclass, (void **)&l)) {
+ if (!g_hash_table_lookup_extended (ep_plugins_pending_hooks, class, &oldclass, &l)) {
oldclass = class;
l = NULL;
}
else {
g_free(class);
}
- l = g_slist_prepend(l, ep);
- g_hash_table_insert(ep_plugins_pending_hooks, oldclass, l);
- ep->hooks_pending = g_slist_prepend(ep->hooks_pending, node);
+ l = g_slist_prepend (l, ep);
+ g_hash_table_insert (ep_plugins_pending_hooks, oldclass, l);
+ ep->hooks_pending = g_slist_prepend (ep->hooks_pending, node);
}
} else if (strcmp((char *)node->name, "description") == 0) {
ep->description = e_plugin_xml_content_domain(node, ep->domain);
@@ -1110,8 +1109,10 @@ void
e_plugin_hook_register_type(GType type)
{
EPluginHookClass *klass, *oldklass;
- GSList *l, *plugins;
- char *class;
+ GSList *l;
+
+ gpointer plugins; /* GSList */
+ gpointer class;
if (eph_types == NULL)
eph_types = g_hash_table_new(g_str_hash, g_str_equal);
@@ -1133,17 +1134,17 @@ e_plugin_hook_register_type(GType type)
/* if we've already loaded a plugin that needed this hook but it didn't exist, re-load it now */
if (ep_plugins_pending_hooks
- && g_hash_table_lookup_extended(ep_plugins_pending_hooks, klass->id, (void **)&class, (void **)&plugins)) {
+ && g_hash_table_lookup_extended (ep_plugins_pending_hooks, klass->id, &class, &plugins)) {
struct _plugin_doc *pdoc, *ndoc;
- g_hash_table_remove(ep_plugins_pending_hooks, class);
- g_free(class);
+ g_hash_table_remove (ep_plugins_pending_hooks, class);
+ g_free (class);
for (l = plugins; l; l = g_slist_next(l)) {
EPlugin *ep = l->data;
- ep_load_pending(ep, klass);
+ ep_load_pending (ep, klass);
}
- g_slist_free(plugins);
+ g_slist_free (plugins);
/* See if we can now garbage collect the xml definition since its been fully loaded */
diff --git a/e-util/e-profile-event.c b/e-util/e-profile-event.c
index 88e8579c2b..9e647c1585 100644
--- a/e-util/e-profile-event.c
+++ b/e-util/e-profile-event.c
@@ -125,7 +125,7 @@ e_profile_event_target_new(EProfileEvent *eme, const char *id, const char *uid,
}
#ifdef ENABLE_PROFILING
-void
+static void
e_profile_event_emit(const char *id, const char *uid, guint32 flags)
{
EProfileEvent *epe = e_profile_event_peek();
@@ -134,11 +134,12 @@ e_profile_event_emit(const char *id, const char *uid, guint32 flags)
e_event_emit((EEvent *)epe, "event", (EEventTarget *)t);
}
#else
+/* simply keep macro from header file expand to "nothing".
#undef e_profile_event_emit
-void
+static void
e_profile_event_emit(const char *id, const char *uid, guint32 flags)
{
-}
+}*/
#endif
/* ********************************************************************** */
diff --git a/e-util/e-signature.c b/e-util/e-signature.c
index e68516226a..9803ba7389 100644
--- a/e-util/e-signature.c
+++ b/e-util/e-signature.c
@@ -325,7 +325,8 @@ e_signature_set_from_xml (ESignature *signature, const char *xml)
char *
e_signature_to_xml (ESignature *signature)
{
- char *xmlbuf, *tmp;
+ xmlChar *xmlbuf;
+ char *tmp;
xmlNodePtr root, node;
xmlDocPtr doc;
int n;
@@ -352,7 +353,7 @@ e_signature_to_xml (ESignature *signature)
xmlSetProp (root, (const unsigned char *)"format", (const unsigned char *)"text/html");
}
- xmlDocDumpMemory (doc, (xmlChar **)&xmlbuf, &n);
+ xmlDocDumpMemory (doc, &xmlbuf, &n);
xmlFreeDoc (doc);
/* remap to glib memory */