diff options
author | Yan Li <yan.i.li@intel.com> | 2009-09-24 15:51:45 +0800 |
---|---|---|
committer | Yan Li <yanli@infradead.org> | 2009-09-25 11:44:21 +0800 |
commit | 95f768c36c23d14e3a445e4d854149dc0ae54902 (patch) | |
tree | 387bc0da6b74dcbbd8433981fb823d30bbd3c934 | |
parent | 3a59da4efb018bb3ad7d7b19a5ec2714f60aef29 (diff) | |
download | gsoc2013-evolution-95f768c36c23d14e3a445e4d854149dc0ae54902.tar gsoc2013-evolution-95f768c36c23d14e3a445e4d854149dc0ae54902.tar.gz gsoc2013-evolution-95f768c36c23d14e3a445e4d854149dc0ae54902.tar.bz2 gsoc2013-evolution-95f768c36c23d14e3a445e4d854149dc0ae54902.tar.lz gsoc2013-evolution-95f768c36c23d14e3a445e4d854149dc0ae54902.tar.xz gsoc2013-evolution-95f768c36c23d14e3a445e4d854149dc0ae54902.tar.zst gsoc2013-evolution-95f768c36c23d14e3a445e4d854149dc0ae54902.zip |
Bug #596160 - Compiler warnings about _MailComponentPrivate.quit_state
Magic number `-1' is used for quit_state (a enum) as the initial
state. This is confusing and triggers compiler warning since `-1' is
signed while enum is unsigned.
This patch attached fixed it by adding a new state: MC_QUIT_NOT_START
which is used as the initial state.
-rw-r--r-- | mail/mail-component.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/mail/mail-component.c b/mail/mail-component.c index 4e19002ca0..63d6de837f 100644 --- a/mail/mail-component.c +++ b/mail/mail-component.c @@ -132,7 +132,7 @@ struct _MailComponentPrivate { GMutex *lock; /* states/data used during shutdown */ - enum { MC_QUIT_START, MC_QUIT_SYNC, MC_QUIT_THREADS } quit_state; + enum { MC_QUIT_NOT_START, MC_QUIT_START, MC_QUIT_SYNC, MC_QUIT_THREADS } quit_state; gint quit_count; gint quit_expunge; /* expunge on quit this time around? */ @@ -667,7 +667,7 @@ view_changed_cb(EMFolderView *emfv, EComponentView *component_view) v = g_object_get_data((GObject *)component_view, "view-changed-timeout"); - if (mc->priv->quit_state != -1) { + if (mc->priv->quit_state != MC_QUIT_NOT_START) { if (v) { g_source_remove(GPOINTER_TO_INT(v)); g_object_set_data((GObject *)component_view, "view-changed-timeout", NULL); @@ -881,7 +881,7 @@ impl_quit(PortableServer_Servant servant, CORBA_Environment *ev) { MailComponent *mc = MAIL_COMPONENT(bonobo_object_from_servant(servant)); - if (mc->priv->quit_state == -1) + if (mc->priv->quit_state == MC_QUIT_NOT_START) mc->priv->quit_state = MC_QUIT_START; mail_config_prune_proxies (); @@ -1303,7 +1303,7 @@ mail_component_init (MailComponent *component) component->priv = priv; priv->lock = g_mutex_new(); - priv->quit_state = -1; + priv->quit_state = MC_QUIT_NOT_START; /* FIXME This is used as both a filename and URI path throughout * the mail code. Need to clean this up; maybe provide a |