diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2009-05-27 04:58:27 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2009-05-27 04:58:27 +0800 |
commit | 333656eba50f2120bbee3e817b8faf0baf448faf (patch) | |
tree | 3869bc4847dd4ab67625b82207ff98ef19045e8d /e-util | |
parent | 1682814ef78902b385fe84589f8755b0ff4b5b5a (diff) | |
parent | ffa17ed195a6bbb40d386fb572b7941e22f47f8d (diff) | |
download | gsoc2013-evolution-333656eba50f2120bbee3e817b8faf0baf448faf.tar.gz gsoc2013-evolution-333656eba50f2120bbee3e817b8faf0baf448faf.tar.zst gsoc2013-evolution-333656eba50f2120bbee3e817b8faf0baf448faf.zip |
Merge branch 'warnings'
Diffstat (limited to 'e-util')
-rw-r--r-- | e-util/e-bconf-map.h | 14 | ||||
-rw-r--r-- | e-util/e-bit-array.h | 3 | ||||
-rw-r--r-- | e-util/e-error.c | 56 | ||||
-rw-r--r-- | e-util/e-folder-map.c | 2 | ||||
-rw-r--r-- | e-util/e-folder-map.h | 3 | ||||
-rw-r--r-- | e-util/e-html-utils.c | 2 | ||||
-rw-r--r-- | e-util/e-logger.c | 2 | ||||
-rw-r--r-- | e-util/e-logger.h | 2 | ||||
-rw-r--r-- | e-util/e-non-intrusive-error-dialog.h | 8 | ||||
-rw-r--r-- | e-util/e-text-event-processor-emacs-like.c | 2 | ||||
-rw-r--r-- | e-util/e-text-event-processor-types.h | 6 | ||||
-rw-r--r-- | e-util/e-text-event-processor.c | 3 | ||||
-rw-r--r-- | e-util/e-util-labels.c | 18 | ||||
-rw-r--r-- | e-util/e-util-labels.h | 9 | ||||
-rw-r--r-- | e-util/e-xml-utils.h | 2 | ||||
-rw-r--r-- | e-util/gconf-bridge.c | 5 |
16 files changed, 66 insertions, 71 deletions
diff --git a/e-util/e-bconf-map.h b/e-util/e-bconf-map.h index 1d72119c8c..dfd015ec65 100644 --- a/e-util/e-bconf-map.h +++ b/e-util/e-bconf-map.h @@ -45,9 +45,9 @@ enum { }; typedef struct _e_bconf_map { - char *from; - char *to; - int type; + const gchar *from; + const gchar *to; + gint type; struct _e_bconf_map *child; } e_bconf_map_t; @@ -83,13 +83,13 @@ enum { }; typedef struct { - char *from; - char *to; - int type; + const gchar *from; + const gchar *to; + gint type; } e_gconf_map_t; typedef struct { - char *root; + const gchar *root; e_gconf_map_t *map; } e_gconf_map_list_t; diff --git a/e-util/e-bit-array.h b/e-util/e-bit-array.h index ea8ed89797..4504f5afc6 100644 --- a/e-util/e-bit-array.h +++ b/e-util/e-bit-array.h @@ -66,7 +66,7 @@ void e_bit_array_clear (EBitArray *selection); gint e_bit_array_selected_count (EBitArray *selection); void e_bit_array_select_all (EBitArray *selection); void e_bit_array_invert_selection (EBitArray *selection); -int e_bit_array_bit_count (EBitArray *selection); +gint e_bit_array_bit_count (EBitArray *selection); void e_bit_array_change_one_row (EBitArray *selection, int row, gboolean grow); @@ -91,7 +91,6 @@ void e_bit_array_delete_single_mode (EBitArray *esm, void e_bit_array_move_row (EBitArray *esm, int old_row, int new_row); -gint e_bit_array_bit_count (EBitArray *esm); gboolean e_bit_array_cross_and (EBitArray *esm); gboolean e_bit_array_cross_or (EBitArray *esm); diff --git a/e-util/e-error.c b/e-util/e-error.c index 7c1248bb7b..23e52bca8e 100644 --- a/e-util/e-error.c +++ b/e-util/e-error.c @@ -41,27 +41,27 @@ struct _e_error_button { struct _e_error_button *next; - char *stock; - char *label; - int response; + const gchar *stock; + const gchar *label; + gint response; }; struct _e_error { guint32 flags; - char *id; - int type; - int default_response; - char *title; - char *primary; - char *secondary; - char *help_uri; + const gchar *id; + gint type; + gint default_response; + const gchar *title; + const gchar *primary; + const gchar *secondary; + const gchar *help_uri; gboolean scroll; struct _e_error_button *buttons; }; struct _e_error_table { - char *domain; - char *translation_domain; + const gchar *domain; + const gchar *translation_domain; GHashTable *errors; }; @@ -84,8 +84,8 @@ static struct _e_error default_errors[] = { /* ********************************************************************** */ static struct { - char *name; - int id; + const gchar *name; + gint id; } response_map[] = { { "GTK_RESPONSE_REJECT", GTK_RESPONSE_REJECT }, { "GTK_RESPONSE_ACCEPT", GTK_RESPONSE_ACCEPT }, @@ -111,9 +111,9 @@ map_response(const char *name) } static struct { - const char *name; - const char *icon; - const char *title; + const gchar *name; + const gchar *icon; + const gchar *title; } type_map[] = { { "info", GTK_STOCK_DIALOG_INFO, N_("Evolution Information") }, { "warning", GTK_STOCK_DIALOG_WARNING, N_("Evolution Warning") }, @@ -184,7 +184,7 @@ ee_load(const char *path) table = g_malloc0(sizeof(*table)); table->domain = g_strdup(tmp); table->errors = g_hash_table_new(g_str_hash, g_str_equal); - g_hash_table_insert(error_table, table->domain, table); + g_hash_table_insert(error_table, (gpointer) table->domain, table); tmp2 = (char *)xmlGetProp(root, (const unsigned char *)"translation-domain"); if (tmp2) { @@ -263,16 +263,20 @@ ee_load(const char *path) } } else if (!strcmp((char *)scan->name, "button")) { struct _e_error_button *b; + gchar *label = NULL; + gchar *stock = NULL; b = g_malloc0(sizeof(*b)); tmp = (char *)xmlGetProp(scan, (const unsigned char *)"stock"); if (tmp) { - b->stock = g_strdup(tmp); + stock = g_strdup(tmp); + b->stock = stock; xmlFree(tmp); } tmp = (char *)xmlGetProp(scan, (const unsigned char *)"label"); if (tmp) { - b->label = g_strdup(dgettext(table->translation_domain, tmp)); + label = g_strdup(dgettext(table->translation_domain, tmp)); + b->label = label; xmlFree(tmp); } tmp = (char *)xmlGetProp(scan, (const unsigned char *)"response"); @@ -281,10 +285,10 @@ ee_load(const char *path) xmlFree(tmp); } - if (b->stock == NULL && b->label == NULL) { + if (stock == NULL && label == NULL) { g_warning("Error file '%s': missing button details in error '%s'", path, e->id); - g_free(b->stock); - g_free(b->label); + g_free(stock); + g_free(label); g_free(b); } else { lastbutton->next = b; @@ -293,7 +297,7 @@ ee_load(const char *path) } } - g_hash_table_insert(table->errors, e->id, e); + g_hash_table_insert(table->errors, (gpointer) e->id, e); } } @@ -319,8 +323,8 @@ ee_load_tables(void) table->domain = "builtin"; table->errors = g_hash_table_new(g_str_hash, g_str_equal); for (i=0;i<sizeof(default_errors)/sizeof(default_errors[0]);i++) - g_hash_table_insert(table->errors, default_errors[i].id, &default_errors[i]); - g_hash_table_insert(error_table, table->domain, table); + g_hash_table_insert(table->errors, (gpointer) default_errors[i].id, &default_errors[i]); + g_hash_table_insert(error_table, (gpointer) table->domain, table); /* look for installed error tables */ base = g_build_filename (EVOLUTION_PRIVDATADIR, "errors", NULL); diff --git a/e-util/e-folder-map.c b/e-util/e-folder-map.c index 3475d61a70..157c4ca353 100644 --- a/e-util/e-folder-map.c +++ b/e-util/e-folder-map.c @@ -150,7 +150,7 @@ e_folder_map_dir (const char *dirname, const char *type, GSList **dir_list) } GSList * -e_folder_map_local_folders (char *local_dir, char *type) +e_folder_map_local_folders (const gchar *local_dir, const gchar *type) { const char *name; GDir *dir; diff --git a/e-util/e-folder-map.h b/e-util/e-folder-map.h index e61dc140ff..a939ea777f 100644 --- a/e-util/e-folder-map.h +++ b/e-util/e-folder-map.h @@ -28,7 +28,8 @@ G_BEGIN_DECLS -GSList *e_folder_map_local_folders (char *local_dir, char *type); +GSList * e_folder_map_local_folders (const gchar *local_dir, + const gchar *type); G_END_DECLS diff --git a/e-util/e-html-utils.c b/e-util/e-html-utils.c index d634f5f6b0..4cdb0eefa3 100644 --- a/e-util/e-html-utils.c +++ b/e-util/e-html-utils.c @@ -246,7 +246,7 @@ e_text_to_html_full (const char *input, unsigned int flags, guint32 color) colored = TRUE; } } else if (colored) { - gchar *no_font = "</FONT>"; + const gchar *no_font = "</FONT>"; out = check_size (&buffer, &buffer_size, out, 9); out += sprintf (out, "%s", no_font); diff --git a/e-util/e-logger.c b/e-util/e-logger.c index 0a458b7444..3d3c88c384 100644 --- a/e-util/e-logger.c +++ b/e-util/e-logger.c @@ -198,7 +198,7 @@ e_logger_get_type (void) } ELogger * -e_logger_create (gchar *component) +e_logger_create (const gchar *component) { g_return_val_if_fail (component != NULL, NULL); diff --git a/e-util/e-logger.h b/e-util/e-logger.h index f7dfd8017e..186d918f12 100644 --- a/e-util/e-logger.h +++ b/e-util/e-logger.h @@ -70,7 +70,7 @@ struct _ELoggerClass { }; GType e_logger_get_type (void); -ELogger * e_logger_create (gchar *component); +ELogger * e_logger_create (const gchar *component); const gchar * e_logger_get_component (ELogger *logger); void e_logger_log (ELogger *logger, gint level, diff --git a/e-util/e-non-intrusive-error-dialog.h b/e-util/e-non-intrusive-error-dialog.h index e801d47a52..827e17f868 100644 --- a/e-util/e-non-intrusive-error-dialog.h +++ b/e-util/e-non-intrusive-error-dialog.h @@ -31,10 +31,10 @@ G_BEGIN_DECLS struct _log_data { - int level; - char *key; - char *text; - char *stock_id; + gint level; + const gchar *key; + const gchar *text; + const gchar *stock_id; GdkPixbuf *pbuf; } ldata [] = { { E_LOG_ERROR, N_("Error"), N_("Errors"), GTK_STOCK_DIALOG_ERROR }, diff --git a/e-util/e-text-event-processor-emacs-like.c b/e-util/e-text-event-processor-emacs-like.c index 60da48d375..4b99d897db 100644 --- a/e-util/e-text-event-processor-emacs-like.c +++ b/e-util/e-text-event-processor-emacs-like.c @@ -29,8 +29,6 @@ #include "e-text-event-processor-emacs-like.h" #include "e-util.h" -static void e_text_event_processor_emacs_like_init (ETextEventProcessorEmacsLike *card); -static void e_text_event_processor_emacs_like_class_init (ETextEventProcessorEmacsLikeClass *klass); static gint e_text_event_processor_emacs_like_event (ETextEventProcessor *tep, ETextEventProcessorEvent *event); G_DEFINE_TYPE (ETextEventProcessorEmacsLike, e_text_event_processor_emacs_like, E_TEXT_EVENT_PROCESSOR_TYPE) diff --git a/e-util/e-text-event-processor-types.h b/e-util/e-text-event-processor-types.h index 9caf2abe6d..c4c0efa424 100644 --- a/e-util/e-text-event-processor-types.h +++ b/e-util/e-text-event-processor-types.h @@ -83,8 +83,8 @@ typedef enum { typedef struct { ETextEventProcessorCommandPosition position; ETextEventProcessorCommandAction action; - int value; - char *string; + gint value; + const gchar *string; guint32 time; } ETextEventProcessorCommand; @@ -102,7 +102,7 @@ typedef struct { guint state; guint keyval; gint length; - gchar *string; + const gchar *string; } ETextEventProcessorEventKey; typedef struct { diff --git a/e-util/e-text-event-processor.c b/e-util/e-text-event-processor.c index b515f33f57..48100de64a 100644 --- a/e-util/e-text-event-processor.c +++ b/e-util/e-text-event-processor.c @@ -27,9 +27,6 @@ #include "e-text-event-processor.h" #include "e-util.h" -static void e_text_event_processor_init (ETextEventProcessor *card); -static void e_text_event_processor_class_init (ETextEventProcessorClass *klass); - static void e_text_event_processor_set_property (GObject *object, guint prop_id, const GValue *value, diff --git a/e-util/e-util-labels.c b/e-util/e-util-labels.c index 85984da59c..a7d5913bbd 100644 --- a/e-util/e-util-labels.c +++ b/e-util/e-util-labels.c @@ -34,8 +34,14 @@ #include "e-dialog-utils.h" #include "filter/filter-option.h" -/* Note, the first element of each EUtilLabel must NOT be translated */ -EUtilLabel label_defaults[LABEL_DEFAULTS_NUM] = { +typedef struct { + const gchar *tag; + const gchar *name; + const gchar *colour; +} DefaultLabel; + +/* Note, the first element of each DefaultLabel must NOT be translated */ +DefaultLabel label_defaults[] = { { "$Labelimportant", N_("I_mportant"), "#EF2929" }, /* red */ { "$Labelwork", N_("_Work"), "#F57900" }, /* orange */ { "$Labelpersonal", N_("_Personal"), "#4E9A06" }, /* green */ @@ -84,7 +90,7 @@ e_util_labels_parse (GConfClient *client) label = g_new (EUtilLabel, 1); /* Needed for Backward Compatibility */ - if (num < LABEL_DEFAULTS_NUM) { + if (num < G_N_ELEMENTS (label_defaults)) { label->name = g_strdup ((buf && *buf) ? buf : _(label_defaults[num].name)); label->tag = g_strdup (label_defaults[num].tag); num++; @@ -106,7 +112,7 @@ e_util_labels_parse (GConfClient *client) if (head) g_slist_free (head); - while (num < LABEL_DEFAULTS_NUM) { + while (num < G_N_ELEMENTS (label_defaults)) { /* complete the list with defaults */ label = g_new (EUtilLabel, 1); label->tag = g_strdup (label_defaults[num].tag); @@ -452,7 +458,7 @@ e_util_labels_is_system (const char *tag) if (!tag) return FALSE; - for (i = 0; i < LABEL_DEFAULTS_NUM; i++) { + for (i = 0; i < G_N_ELEMENTS (label_defaults); i++) { if (strcmp (tag, label_defaults[i].tag) == 0) return TRUE; } @@ -474,7 +480,7 @@ e_util_labels_get_new_tag (const char *old_tag) if (!old_tag) return NULL; - for (i = 0; i < LABEL_DEFAULTS_NUM; i++) { + for (i = 0; i < G_N_ELEMENTS (label_defaults); i++) { /* default labels have same name as those old, only with prefix "$Label" */ if (!strcmp (old_tag, label_defaults[i].tag + 6)) return label_defaults[i].tag; diff --git a/e-util/e-util-labels.h b/e-util/e-util-labels.h index 26520ff226..ee06cccc99 100644 --- a/e-util/e-util-labels.h +++ b/e-util/e-util-labels.h @@ -27,16 +27,13 @@ struct _GtkWindow; struct _GConfClient; typedef struct { - char *tag; - char *name; - char *colour; + gchar *tag; + gchar *name; + gchar *colour; } EUtilLabel; #define E_UTIL_LABELS_GCONF_KEY "/apps/evolution/mail/labels" -#define LABEL_DEFAULTS_NUM 5 -extern EUtilLabel label_defaults[LABEL_DEFAULTS_NUM]; - GSList * e_util_labels_parse (struct _GConfClient *client); void e_util_labels_free (GSList *labels); diff --git a/e-util/e-xml-utils.h b/e-util/e-xml-utils.h index 59d11c63fe..ef8ae8ac8a 100644 --- a/e-util/e-xml-utils.h +++ b/e-util/e-xml-utils.h @@ -92,8 +92,6 @@ void e_xml_set_string_prop_by_name (xmlNode *parent, gchar *e_xml_get_translated_string_prop_by_name (const xmlNode *parent, const xmlChar *prop_name); -int e_xml_save_file (const char *filename, xmlDocPtr doc); - G_END_DECLS #endif /* __E_XML_UTILS__ */ diff --git a/e-util/gconf-bridge.c b/e-util/gconf-bridge.c index 81fe08ef14..ff880a12bd 100644 --- a/e-util/gconf-bridge.c +++ b/e-util/gconf-bridge.c @@ -107,11 +107,6 @@ typedef union { static void unbind (Binding *binding); -#if !HAVE_DECL_GCONF_VALUE_COMPARE /* Not in headers in GConf < 2.13 */ -int gconf_value_compare (const GConfValue *value_a, - const GConfValue *value_b); -#endif - static GConfBridge *bridge = NULL; /* Global GConfBridge object */ /* Free up all resources allocated by the GConfBridge. Called on exit. */ |