aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/misc
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@src.gnome.org>2007-06-03 10:45:22 +0800
committerMatthew Barnes <mbarnes@src.gnome.org>2007-06-03 10:45:22 +0800
commit646455c0f94ac047b3ed44dbd7e796f746451700 (patch)
treee7750dcec0ad360755a6503f1f128d6a80c16e43 /widgets/misc
parenta01dfc76dc4fe9374f25d7fde53a78c4cf7efd0e (diff)
downloadgsoc2013-evolution-646455c0f94ac047b3ed44dbd7e796f746451700.tar
gsoc2013-evolution-646455c0f94ac047b3ed44dbd7e796f746451700.tar.gz
gsoc2013-evolution-646455c0f94ac047b3ed44dbd7e796f746451700.tar.bz2
gsoc2013-evolution-646455c0f94ac047b3ed44dbd7e796f746451700.tar.lz
gsoc2013-evolution-646455c0f94ac047b3ed44dbd7e796f746451700.tar.xz
gsoc2013-evolution-646455c0f94ac047b3ed44dbd7e796f746451700.tar.zst
gsoc2013-evolution-646455c0f94ac047b3ed44dbd7e796f746451700.zip
Fix compilation warnings in widgets folder (#441014).
svn path=/trunk/; revision=33626
Diffstat (limited to 'widgets/misc')
-rw-r--r--widgets/misc/ChangeLog18
-rw-r--r--widgets/misc/e-dateedit.c4
-rw-r--r--widgets/misc/e-filter-bar.c53
-rw-r--r--widgets/misc/e-image-chooser.c8
-rw-r--r--widgets/misc/e-task-widget.c8
-rw-r--r--widgets/misc/e-unicode.c30
6 files changed, 69 insertions, 52 deletions
diff --git a/widgets/misc/ChangeLog b/widgets/misc/ChangeLog
index fc6c7bf6ee..c817941d53 100644
--- a/widgets/misc/ChangeLog
+++ b/widgets/misc/ChangeLog
@@ -1,4 +1,20 @@
-2007-05-25 Matthew Barnes <mbarnes@redhat.com>
+2007-06-02 Gilles Dartiguelongue <dartigug@esiee.fr>
+
+ ** Fixes part of bug #441014
+
+ * e-dateedit.c: (rebuild_time_popup):
+ * e-filter-bar.c: (get_property), (xml_get_prop_int),
+ (set_property):
+ * e-image-chooser.c: (set_image_from_data),
+ (image_drag_data_received_cb):
+ * e-task-widget.c: (e_task_widget_construct):
+ * e-unicode.c: (e_utf8_strstrcasedecomp), (e_utf8_strstrcase),
+ (e_utf8_from_iconv_string_sized), (e_utf8_to_iconv_string_sized),
+ (e_utf8_xml1_decode), (e_utf8_xml1_encode),
+ (e_xml_get_translated_utf8_string_prop_by_name): various
+ compilation cleanups.
+
++2007-05-25 Matthew Barnes <mbarnes@redhat.com>
** Fixes part of bug #441010
diff --git a/widgets/misc/e-dateedit.c b/widgets/misc/e-dateedit.c
index df85c1b2ae..f3fc4cb43b 100644
--- a/widgets/misc/e-dateedit.c
+++ b/widgets/misc/e-dateedit.c
@@ -1400,7 +1400,7 @@ rebuild_time_popup (EDateEdit *dedit)
EDateEditPrivate *priv;
GtkList *list;
GtkWidget *listitem, *label;
- char buffer[40], *format;
+ char buffer[40];
struct tm tmp_tm;
gint hour, min;
@@ -1738,7 +1738,7 @@ static void
e_date_edit_update_time_entry (EDateEdit *dedit)
{
EDateEditPrivate *priv;
- char buffer[40], *format;
+ char buffer[40];
struct tm tmp_tm = { 0 };
priv = dedit->priv;
diff --git a/widgets/misc/e-filter-bar.c b/widgets/misc/e-filter-bar.c
index 0c1fce045c..164e58655d 100644
--- a/widgets/misc/e-filter-bar.c
+++ b/widgets/misc/e-filter-bar.c
@@ -586,15 +586,16 @@ get_property (GObject *object, guint property_id, GValue *value, GParamSpec *psp
break;
case PROP_STATE: {
/* FIXME: we should have ESearchBar save its own state to the xmlDocPtr */
- char *xmlbuf, *text, buf[12];
+ xmlChar *xmlbuf;
+ char *text, buf[12];
int searchscope, item_id, n, view_id;
xmlNodePtr root, node;
xmlDocPtr doc;
item_id = e_search_bar_get_item_id ((ESearchBar *) efb);
- doc = xmlNewDoc ("1.0");
- root = xmlNewDocNode (doc, NULL, "state", NULL);
+ doc = xmlNewDoc ((const unsigned char *)"1.0");
+ root = xmlNewDocNode (doc, NULL, (const unsigned char *)"state", NULL);
xmlDocSetRootElement (doc, root);
searchscope = e_search_bar_get_search_scope ((ESearchBar *) efb);
view_id = e_search_bar_get_viewitem_id ((ESearchBar *) efb);
@@ -604,37 +605,37 @@ get_property (GObject *object, guint property_id, GValue *value, GParamSpec *psp
if (item_id == E_FILTERBAR_ADVANCED_ID) {
/* advanced query, save the filterbar state */
- node = xmlNewChild (root, NULL, "filter-bar", NULL);
+ node = xmlNewChild (root, NULL, (const unsigned char *)"filter-bar", NULL);
sprintf (buf, "%d", esb->last_search_option);
- xmlSetProp (node, "item_id", buf);
+ xmlSetProp (node, (const unsigned char *)"item_id", (unsigned char *)buf);
sprintf (buf, "%d", searchscope);
- xmlSetProp (node, "searchscope", buf);
+ xmlSetProp (node, (const unsigned char *)"searchscope", (unsigned char *)buf);
sprintf (buf, "%d", view_id);
- xmlSetProp (node, "view_id", buf);
+ xmlSetProp (node, (const unsigned char *)"view_id", (unsigned char *)buf);
xmlAddChild (node, filter_rule_xml_encode (efb->current_query));
} else {
/* simple query, save the searchbar state */
text = e_search_bar_get_text ((ESearchBar *) efb);
- node = xmlNewChild (root, NULL, "search-bar", NULL);
- xmlSetProp (node, "text", text ? text : "");
+ node = xmlNewChild (root, NULL, (const unsigned char *)"search-bar", NULL);
+ xmlSetProp (node, (const unsigned char *)"text", (unsigned char *)(text ? text : ""));
sprintf (buf, "%d", item_id);
- xmlSetProp (node, "item_id", buf);
+ xmlSetProp (node, (const unsigned char *)"item_id", (unsigned char *)buf);
sprintf (buf, "%d", searchscope);
- xmlSetProp (node, "searchscope", buf);
+ xmlSetProp (node, (const unsigned char *)"searchscope", (unsigned char *)buf);
sprintf (buf, "%d", view_id);
- xmlSetProp (node, "view_id", buf);
+ xmlSetProp (node, (const unsigned char *)"view_id", (unsigned char *)buf);
g_free (text);
}
- xmlDocDumpMemory (doc, (xmlChar **) &xmlbuf, &n);
+ xmlDocDumpMemory (doc, &xmlbuf, &n);
xmlFreeDoc (doc);
/* remap to glib memory */
text = g_malloc (n + 1);
- memcpy (text, xmlbuf, n);
+ memcpy (text, (char *)xmlbuf, n);
text[n] = '\0';
xmlFree (xmlbuf);
@@ -653,7 +654,7 @@ xml_get_prop_int (xmlNodePtr node, const char *prop)
char *buf;
int ret;
- if ((buf = xmlGetProp (node, prop))) {
+ if ((buf = (char *)xmlGetProp (node, (unsigned char *)prop))) {
ret = strtol (buf, NULL, 10);
xmlFree (buf);
} else {
@@ -677,18 +678,18 @@ set_property (GObject *object, guint property_id, const GValue *value, GParamSpe
switch (property_id) {
case PROP_STATE:
if ((state = g_value_get_string (value))) {
- if (!(doc = xmlParseDoc ((char *) state)))
+ if (!(doc = xmlParseDoc ((unsigned char *) state)))
return;
root = doc->children;
- if (strcmp (root->name, "state") != 0) {
+ if (strcmp ((char *)root->name, "state") != 0) {
xmlFreeDoc (doc);
return;
}
node = root->children;
while (node != NULL) {
- if (!strcmp (node->name, "filter-bar")) {
+ if (!strcmp ((char *)node->name, "filter-bar")) {
FilterRule *rule = NULL;
@@ -706,7 +707,7 @@ set_property (GObject *object, guint property_id, const GValue *value, GParamSpe
rule = filter_rule_new ();
if (filter_rule_xml_decode (rule, node, efb->context) != 0) {
- gtk_widget_modify_base (((ESearchBar *)efb)->entry, GTK_STATE_NORMAL, NULL);
+ gtk_widget_modify_base (E_SEARCH_BAR (efb)->entry, GTK_STATE_NORMAL, NULL);
gtk_widget_modify_text (((ESearchBar *)efb)->entry, GTK_STATE_NORMAL, NULL);
gtk_widget_modify_base (((ESearchBar *)efb)->icon_entry, GTK_STATE_NORMAL, NULL);
g_object_unref (rule);
@@ -744,7 +745,7 @@ set_property (GObject *object, guint property_id, const GValue *value, GParamSpe
efb->setquery = FALSE;
break;
- } else if (!strcmp (node->name, "search-bar")) {
+ } else if (!strcmp ((char *)node->name, "search-bar")) {
int subitem_id, item_id, scope, view_id;
char *text;
GtkStyle *style = gtk_widget_get_default_style ();
@@ -758,17 +759,17 @@ set_property (GObject *object, guint property_id, const GValue *value, GParamSpe
esb->block_search = TRUE;
if (subitem_id >= 0)
- e_search_bar_set_ids ((ESearchBar *) efb, item_id, subitem_id);
+ e_search_bar_set_ids (E_SEARCH_BAR (efb), item_id, subitem_id);
else
- e_search_bar_set_item_menu ((ESearchBar *) efb, item_id);
+ e_search_bar_set_item_menu (E_SEARCH_BAR (efb), item_id);
esb->block_search = FALSE;
view_id = xml_get_prop_int (node, "view_id");
- e_search_bar_set_viewitem_id ((ESearchBar *) efb, view_id);
+ e_search_bar_set_viewitem_id (E_SEARCH_BAR (efb), view_id);
scope = xml_get_prop_int (node, "searchscope");
- e_search_bar_set_search_scope ((ESearchBar *) efb, scope);
+ e_search_bar_set_search_scope (E_SEARCH_BAR (efb), scope);
- text = xmlGetProp (node, "text");
- e_search_bar_set_text ((ESearchBar *) efb, text);
+ text = (char *)xmlGetProp (node, (const unsigned char *)"text");
+ e_search_bar_set_text (E_SEARCH_BAR (efb), text);
if (text && *text) {
efb->current_query = (FilterRule *)efb->option_rules->pdata[item_id - efb->option_base];
if (efb->config && efb->current_query)
diff --git a/widgets/misc/e-image-chooser.c b/widgets/misc/e-image-chooser.c
index 7fdb2cb415..b5004aca7f 100644
--- a/widgets/misc/e-image-chooser.c
+++ b/widgets/misc/e-image-chooser.c
@@ -232,7 +232,7 @@ set_image_from_data (EImageChooser *chooser,
GdkPixbufLoader *loader = gdk_pixbuf_loader_new ();
GdkPixbuf *pixbuf;
- gdk_pixbuf_loader_write (loader, data, length, NULL);
+ gdk_pixbuf_loader_write (loader, (unsigned char *)data, length, NULL);
gdk_pixbuf_loader_close (loader, NULL);
pixbuf = gdk_pixbuf_loader_get_pixbuf (loader);
@@ -413,15 +413,15 @@ image_drag_data_received_cb (GtkWidget *widget,
GnomeVFSResult result;
GnomeVFSHandle *handle;
char *uri;
- char *nl = strstr (selection_data->data, "\r\n");
+ char *nl = strstr ((char *)selection_data->data, "\r\n");
char *buf = NULL;
/* Why can't we change the info parameter to a GnomeVFSFileInfo and use that? */
GnomeVFSFileInfo info;
if (nl)
- uri = g_strndup (selection_data->data, nl - (char*)selection_data->data);
+ uri = g_strndup ((char *)selection_data->data, nl - (char*)selection_data->data);
else
- uri = g_strdup (selection_data->data);
+ uri = g_strdup ((char *)selection_data->data);
result = gnome_vfs_open (&handle, uri, GNOME_VFS_OPEN_READ);
if (result == GNOME_VFS_OK) {
diff --git a/widgets/misc/e-task-widget.c b/widgets/misc/e-task-widget.c
index 6743b10cb2..43236de8c7 100644
--- a/widgets/misc/e-task-widget.c
+++ b/widgets/misc/e-task-widget.c
@@ -124,8 +124,8 @@ e_task_widget_construct (ETaskWidget *task_widget,
const char *information)
{
ETaskWidgetPrivate *priv;
- GdkPixmap *pixmap;
- GdkBitmap *mask;
+ /*GdkPixmap *pixmap;
+ GdkBitmap *mask;*/
GtkWidget *box;
GtkWidget *frame;
@@ -156,8 +156,8 @@ e_task_widget_construct (ETaskWidget *task_widget,
/* gdk_pixbuf_render_pixmap_and_mask (icon_pixbuf, &pixmap, &mask, 128); */
priv->image = e_spinner_new ();
- e_spinner_set_size (priv->image, GTK_ICON_SIZE_SMALL_TOOLBAR);
- e_spinner_start (priv->image);
+ e_spinner_set_size (E_SPINNER (priv->image), GTK_ICON_SIZE_SMALL_TOOLBAR);
+ e_spinner_start (E_SPINNER (priv->image));
/* gtk_image_new_from_pixmap (pixmap, mask); */
gtk_widget_show (priv->image);
gtk_box_pack_start (GTK_BOX (box), priv->image, FALSE, TRUE, 0);
diff --git a/widgets/misc/e-unicode.c b/widgets/misc/e-unicode.c
index 6bf1fdaaec..cac01ff5a0 100644
--- a/widgets/misc/e-unicode.c
+++ b/widgets/misc/e-unicode.c
@@ -71,7 +71,7 @@ e_utf8_strstrcasedecomp (const gchar *haystack, const gchar *needle)
gunichar *nuni;
gunichar unival;
gint nlen;
- const guchar *o, *p;
+ const gchar *o, *p;
if (haystack == NULL) return NULL;
if (needle == NULL) return NULL;
@@ -126,7 +126,7 @@ e_utf8_strstrcase (const gchar *haystack, const gchar *needle)
gunichar *nuni;
gunichar unival;
gint nlen;
- const guchar *o, *p;
+ const gchar *o, *p;
if (haystack == NULL) return NULL;
if (needle == NULL) return NULL;
@@ -248,7 +248,7 @@ e_utf8_from_iconv_string_sized (iconv_t ic, const gchar *string, gint bytes)
gint i;
/* iso-8859-1 */
ib = (char *) string;
- new = ob = g_new (unsigned char, bytes * 2 + 1);
+ new = ob = (char *)g_new (unsigned char, bytes * 2 + 1);
for (i = 0; i < (bytes); i ++) {
ob += e_unichar_to_utf8 (ib[i], ob);
}
@@ -307,7 +307,7 @@ e_utf8_to_iconv_string_sized (iconv_t ic, const gchar *string, gint bytes)
const gchar *u;
gunichar uc;
- new = g_new (unsigned char, bytes * 4 + 1);
+ new = (char *)g_new (unsigned char, bytes * 4 + 1);
u = string;
len = 0;
@@ -512,7 +512,7 @@ gchar *
e_utf8_xml1_decode (const gchar *text)
{
const guchar *c;
- guchar *u, *d;
+ gchar *u, *d;
int len, s;
g_return_val_if_fail (text != NULL, NULL);
@@ -521,7 +521,7 @@ e_utf8_xml1_decode (const gchar *text)
/* len * 2 is absolute maximum */
u = d = g_malloc (len * 2);
- c = text;
+ c = (guchar *)text;
s = 0;
while (s < len) {
if ((s <= (len - 8)) &&
@@ -534,8 +534,8 @@ e_utf8_xml1_decode (const gchar *text)
isxdigit (c[s + 6]) &&
(c[s + 7] == '\\')) {
/* Valid \U+XXXX\ sequence */
- unsigned int unival;
- unival = strtol (c + s + 3, NULL, 16);
+ int unival;
+ unival = strtol ((char *)(c + s + 3), NULL, 16);
d += e_unichar_to_utf8 (unival, d);
s += 8;
} else if (c[s] > 127) {
@@ -555,8 +555,8 @@ e_utf8_xml1_decode (const gchar *text)
gchar *
e_utf8_xml1_encode (const gchar *text)
{
- guchar *u, *d, *c;
- int unival;
+ gchar *u, *d, *c;
+ unsigned int unival;
int len;
g_return_val_if_fail (text != NULL, NULL);
@@ -569,7 +569,7 @@ e_utf8_xml1_encode (const gchar *text)
len += 1;
}
}
- d = c = g_new (guchar, len + 1);
+ d = c = (char *)g_new (guchar, len + 1);
for (u = e_unicode_get_utf8 (text, &unival); u && unival; u = e_unicode_get_utf8 (u, &unival)) {
if ((unival >= 0x80) || (unival == '\\')) {
@@ -667,7 +667,7 @@ e_unicode_get_utf8 (const gchar *text, gunichar *out)
typedef struct
{
unsigned short ch;
- unsigned char *expansion;
+ char *expansion;
} e_decomposition;
static e_decomposition e_decomp_table[] =
@@ -2036,15 +2036,15 @@ e_xml_get_translated_utf8_string_prop_by_name (const xmlNode *parent, const xmlC
prop = xmlGetProp ((xmlNode *) parent, prop_name);
if (prop != NULL) {
- ret_val = g_strdup (prop);
+ ret_val = g_strdup ((char *)prop);
xmlFree (prop);
return ret_val;
}
combined_name = g_strdup_printf("_%s", prop_name);
- prop = xmlGetProp ((xmlNode *) parent, combined_name);
+ prop = xmlGetProp ((xmlNode *) parent, (unsigned char *)combined_name);
if (prop != NULL) {
- ret_val = g_strdup (gettext (prop));
+ ret_val = g_strdup (gettext ((char *)prop));
xmlFree (prop);
}
g_free(combined_name);