Changeset 213

Show
Ignore:
Timestamp:
05/03/06 15:18:22
Author:
pvanhoof
Message:

Little fix

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libtinymail-camel/tny-account.c

    r212 r213  
    8282        g_static_rec_mutex_lock (priv->service_lock); 
    8383 
    84         if (priv->id
     84        if (G_UNLIKELY (priv->id)
    8585                g_free (priv->id); 
    8686 
     
    9999        g_static_rec_mutex_lock (priv->service_lock); 
    100100 
    101         if (priv->proto
     101        if (G_UNLIKELY (priv->proto)
    102102                g_free (priv->proto); 
    103103 
     
    118118        g_static_rec_mutex_lock (priv->service_lock); 
    119119 
    120         if (priv->user
     120        if (G_UNLIKELY (priv->user)
    121121                g_free (priv->user); 
    122122 
     
    137137        g_static_rec_mutex_lock (priv->service_lock); 
    138138 
    139         if (priv->host
     139        if (G_UNLIKELY (priv->host)
    140140                g_free (priv->host); 
    141141 
     
    160160        priv->pass_func_set = TRUE; 
    161161 
    162         if (!TNY_ACCOUNT_GET_CLASS (self)->reconnect_func
     162        if (G_UNLIKELY (!TNY_ACCOUNT_GET_CLASS (self)->reconnect_func)
    163163                g_error ("This TnyAccountIface instance isn't a fully implemented type\n"); 
    164164 
     
    328328 
    329329        g_static_rec_mutex_lock (priv->service_lock); 
    330         if (priv->id
     330        if (G_LIKELY (priv->id)
    331331                g_free (priv->id); 
    332332 
    333         if (priv->user
     333        if (G_LIKELY (priv->user)
    334334                g_free (priv->user); 
    335335 
    336         if (priv->host
     336        if (G_LIKELY (priv->host)
    337337                g_free (priv->host); 
    338338 
    339         if (priv->proto
     339        if (G_LIKELY (priv->proto)
    340340                g_free (priv->proto); 
     341 
    341342        g_static_rec_mutex_unlock (priv->service_lock); 
    342343 
  • trunk/libtinymail-camel/tny-camel-common.c

    r186 r213  
    2828        stfnd = strchr (tok, '<'); 
    2929         
    30         if (stfnd
     30        if (G_LIKELY (stfnd)
    3131        { 
    3232                char *name = (char*)tok, *lname = NULL; 
     
    3737                gtfnd = strchr (stfnd, '>'); 
    3838         
    39                 if (!gtfnd
     39                if (G_UNLIKELY (!gtfnd)
    4040                { 
    4141                        g_warning ("Invalid e-mail address in field"); 
     
    4646                *gtfnd = '\0'; 
    4747         
    48                 if (*name == ' '
     48                if (G_LIKELY (*name == ' ')
    4949                        *name++; 
    5050         
    51                 if (*lname == ' '
     51                if (G_LIKELY (*lname == ' ')
    5252                        *lname-- = '\0'; 
    5353                camel_internet_address_add (target, name, email); 
     
    5959                lname += (strlen (name)-1); 
    6060 
    61                 if (*name == ' '
     61                if (G_LIKELY (*name == ' ')
    6262                        *name++; 
    6363         
    64                 if (*lname == ' '
     64                if (G_LIKELY (*lname == ' ')
    6565                        *lname-- = '\0'; 
    6666                camel_internet_address_add (target, NULL, name); 
     
    7878        tok = strtok_r (dup, ",;", &save); 
    7979 
    80         while (tok != NULL
     80        while (G_LIKELY (tok != NULL)
    8181        { 
    8282                 
  • trunk/libtinymail-camel/tny-camel-stream.c

    r212 r213  
    4545        g_return_val_if_fail (TNY_IS_STREAM_IFACE (output), -1); 
    4646 
    47         while (!camel_stream_eos (stream)) { 
     47        while (G_LIKELY (!camel_stream_eos (stream))) 
     48        { 
    4849                nb_read = camel_stream_read (stream, tmp_buf, sizeof (tmp_buf)); 
    49                 if (nb_read < 0
     50                if (G_UNLIKELY (nb_read < 0)
    5051                        return -1; 
    51                 else if (nb_read > 0) { 
     52                else if (G_LIKELY (nb_read > 0)) 
     53                { 
    5254                        nb_written = 0; 
    5355         
    54                         while (nb_written < nb_read) { 
     56                        while (G_LIKELY (nb_written < nb_read)) 
     57                        { 
    5558                                ssize_t len = tny_stream_iface_write (output, tmp_buf + nb_written, 
    5659                                                                  nb_read - nb_written); 
    57                                 if (len < 0
     60                                if (G_UNLIKELY (len < 0)
    5861                                        return -1; 
    5962                                nb_written += len; 
     
    123126        TnyCamelStream *self = (TnyCamelStream *)object; 
    124127 
    125         if (self->stream
     128        if (G_LIKELY (self->stream)
    126129                g_object_unref (G_OBJECT (self->stream)); 
    127130 
  • trunk/libtinymail-camel/tny-msg-folder.c

    r212 r213  
    7878        gint count = 0; 
    7979 
    80         while ((count < 5) && list
     80        while (G_LIKELY ((count < 5) && list)
    8181        { 
    8282                GList *element = list; 
    83                 if (element && element->data
     83                if (G_LIKELY (element && element->data)
    8484                        d->relaxed_func (element->data, NULL); 
    8585                list = g_list_remove_link (list, element); 
     
    9090        d->list = list; 
    9191 
    92         if (count <= 1
     92        if (G_UNLIKELY (count <= 1)
    9393                return FALSE; 
    9494         
     
    100100tny_msg_folder_hdr_cache_uncacher (TnyMsgFolderPriv *priv) 
    101101{ 
    102         if (priv->cached_hdrs
     102        if (G_LIKELY (priv->cached_hdrs)
    103103        { 
    104104                RelaxedData *d = g_new (RelaxedData, 1); 
     
    118118tny_msg_folder_hdr_cache_remover (TnyMsgFolderPriv *priv) 
    119119{ 
    120         if (priv->cached_hdrs
     120        if (G_LIKELY (priv->cached_hdrs)
    121121        { 
    122122                RelaxedData *d = g_new (RelaxedData, 1); 
     
    128128                priv->cached_hdrs = NULL; 
    129129                /* Speedup trick, also check tny-msg-header.c */ 
    130                 if (priv->folder && priv->cached_uids
     130                if (G_LIKELY (priv->folder && priv->cached_uids)
    131131                        camel_folder_free_uids (priv->folder, priv->cached_uids); 
    132132                priv->cached_uids = NULL; 
     
    145145        g_mutex_lock (priv->folder_lock); 
    146146 
    147         if (priv->folder
     147        if (G_LIKELY (priv->folder)
    148148                camel_object_unref (CAMEL_OBJECT (priv->folder)); 
    149149        priv->folder = NULL; 
    150150 
    151151        g_mutex_lock (priv->cached_msgs_lock); 
    152         if (priv->cached_msgs
     152        if (G_LIKELY (priv->cached_msgs)
    153153                g_hash_table_destroy (priv->cached_msgs); 
    154154        priv->cached_msgs = NULL; 
     
    164164{ 
    165165        g_mutex_lock (priv->folder_lock); 
    166         if (!priv->folder
     166        if (G_LIKELY (!priv->folder)
    167167        { 
    168168                CamelException ex = CAMEL_EXCEPTION_INITIALISER; 
     
    174174                priv->has_summary_cap = camel_folder_has_summary_capability (priv->folder); 
    175175 
    176                 if (priv->folder && priv->has_summary_cap
     176                if (G_LIKELY (priv->folder) && G_LIKELY (priv->has_summary_cap)
    177177                { 
    178178                        priv->unread_length = (guint) 
     
    244244 
    245245        /* These will synchronize me using _tny_msg_folder_set_subscribed_priv */ 
    246         if (subscribed) 
     246 
     247        if (G_LIKELY (subscribed)) 
    247248                tny_store_account_iface_subscribe  
    248249                        (TNY_STORE_ACCOUNT_IFACE (priv->account), self); 
     
    364365 
    365366        g_mutex_lock (priv->cached_hdrs_lock); 
    366         if (!priv->cached_hdrs) 
     367 
     368        if (G_UNLIKELY (!priv->cached_hdrs)) 
    367369        { 
    368370                GPtrArray *uids = NULL; 
     
    443445 
    444446        g_mutex_lock (priv->cached_msgs_lock); 
    445         if (!priv->cached_msgs) 
    446         { 
    447                 /* Questionable: Do we really want a message cache? */ 
     447 
     448        if (G_UNLIKELY (!priv->cached_msgs)) 
     449        { 
     450                /* Questionable: Do we really want a message cache anyway? */ 
    448451 
    449452                priv->cached_msgs = g_hash_table_new_full  
     
    456459        } 
    457460         
    458         if (!message
     461        if (G_LIKELY (!message)
    459462        { 
    460463                CamelException *ex = camel_exception_new (); 
     
    498501        const gchar *name = NULL; 
    499502         
    500         if (!priv->cached_name
     503        if (G_UNLIKELY (!priv->cached_name)
    501504        { 
    502505                load_folder (priv); 
     
    521524        TnyMsgFolderPriv *priv = TNY_MSG_FOLDER_GET_PRIVATE (TNY_MSG_FOLDER (self)); 
    522525 
    523         if (priv->folder_name
     526        if (G_UNLIKELY (priv->folder_name)
    524527                g_free (priv->folder_name); 
    525528 
     
    535538        TnyMsgFolderPriv *priv = TNY_MSG_FOLDER_GET_PRIVATE (TNY_MSG_FOLDER (self)); 
    536539 
    537         if (priv->cached_name
     540        if (G_UNLIKELY (priv->cached_name)
    538541                g_free (priv->cached_name); 
    539542 
     
    552555        camel_folder_rename (priv->folder, name); 
    553556 
    554         if (priv->cached_name
     557        if (G_UNLIKELY (priv->cached_name)
    555558                g_free (priv->cached_name); 
    556559 
     
    573576        g_mutex_lock (priv->folder_lock); 
    574577         
    575         if (priv->folder
     578        if (G_UNLIKELY (priv->folder)
    576579                camel_object_unref (priv->folder); 
    577580 
     
    659662        TnyMsgFolderPriv *priv = TNY_MSG_FOLDER_GET_PRIVATE (self); 
    660663 
    661         if (priv->folders
     664        if (G_LIKELY (priv->folders)
    662665        { 
    663666                g_mutex_lock (priv->folders_lock); 
     
    669672 
    670673        g_mutex_lock (priv->cached_hdrs_lock); 
    671         if (priv->folder
     674        if (G_LIKELY (priv->folder)
    672675        { 
    673676                g_mutex_lock (priv->folder_lock); 
     
    677680        g_mutex_unlock (priv->cached_hdrs_lock); 
    678681 
    679         if (priv->cached_name
     682        if (G_LIKELY (priv->cached_name)
    680683                g_free (priv->cached_name); 
    681684 
     
    704707        TnyMsgFolderPriv *priv = TNY_MSG_FOLDER_GET_PRIVATE (self); 
    705708 
    706         if (priv->folder != NULL
     709        if (G_LIKELY (priv->folder != NULL)
    707710                unload_folder (priv); 
    708711 
  • trunk/libtinymail-camel/tny-session-camel.c

    r212 r213  
    8989        CamelService *service = (CamelService*)_tny_account_get_service (TNY_ACCOUNT (account)); 
    9090 
    91         while (copy
     91        while (G_LIKELY (copy)
    9292        { 
    9393                pf = copy->data; 
    9494 
    95                 if (pf->service == NULL || pf->account == NULL
     95                if (G_UNLIKELY (pf->service == NULL) || G_UNLIKELY (pf->account == NULL)
    9696                { 
    9797                        mark_del = g_list_append (mark_del, copy); 
     
    9999                } 
    100100 
    101                 if (pf->service == service
     101                if (G_UNLIKELY (pf->service == service)
    102102                { 
    103103                        found = TRUE; 
     
    108108        } 
    109109 
    110         if (!found
     110        if (G_UNLIKELY (!found)
    111111                pf = g_new0 (PrivForgetPassFunc, 1); 
    112112 
     
    115115        pf->service = service; 
    116116 
    117         if (!found
     117        if (G_UNLIKELY (!found)
    118118                forget_password_funcs = g_list_append (forget_password_funcs, pf); 
    119119 
    120         if (mark_del)  
    121                 while (mark_del) 
     120        if (G_UNLIKELY (mark_del))  
     121        { 
     122                while (G_LIKELY (mark_del)) 
    122123                { 
    123124                        forget_password_funcs = g_list_remove (forget_password_funcs, mark_del->data); 
     
    125126                } 
    126127 
    127         g_list_free (mark_del); 
     128                g_list_free (mark_del); 
     129        } 
    128130 
    129131        return; 
     
    150152        CamelService *service = (CamelService*)_tny_account_get_service (TNY_ACCOUNT (account)); 
    151153 
    152         while (copy
     154        while (G_LIKELY (copy)
    153155        { 
    154156                pf = copy->data; 
    155157 
    156                 if (pf->service == NULL || pf->account == NULL
     158                if (G_UNLIKELY (pf->service) == NULL || G_UNLIKELY (pf->account == NULL)
    157159                { 
    158160                        mark_del = g_list_append (mark_del, copy); 
     
    160162                } 
    161163 
    162                 if (pf->service == service
     164                if (G_UNLIKELY (pf->service == service)
    163165                { 
    164166                        found = TRUE; 
     
    169171        } 
    170172 
    171         if (!found
     173        if (G_UNLIKELY (!found)
    172174                pf = g_new0 (PrivPassFunc, 1); 
    173175 
     
    176178        pf->service = service; 
    177179 
    178         if (!found
     180        if (G_UNLIKELY (!found)
    179181                password_funcs = g_list_append (password_funcs, pf); 
    180182 
    181         if (mark_del)  
    182                 while (mark_del) 
     183        if (G_UNLIKELY (mark_del)) 
     184        { 
     185                while (G_LIKELY (mark_del)) 
    183186                { 
    184187                        password_funcs = g_list_remove (password_funcs, mark_del->data); 
     
    186189                } 
    187190 
    188         g_list_free (mark_del); 
     191                g_list_free (mark_del); 
     192        } 
    189193 
    190194        return; 
     
    201205        gchar *retval = NULL; 
    202206 
    203         while (copy
     207        while (G_LIKELY (copy)
    204208        { 
    205209                PrivPassFunc *pf = copy->data; 
    206210 
    207                 if (pf->service == service
     211                if (G_UNLIKELY (pf->service == service)
    208212                { 
    209213                        found = TRUE; 
     
    216220        } 
    217221 
    218         if (found
     222        if (G_LIKELY (found)
    219223                retval = func (account, prompt); 
    220224 
    221         if (!retval
     225        if (G_UNLIKELY (!retval)
    222226                camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL, ""); 
    223227 
     
    234238        gboolean found = FALSE; 
    235239 
    236         while (copy
     240        while (G_LIKELY (copy)
    237241        { 
    238242                PrivForgetPassFunc *pf = copy->data; 
    239243 
    240                 if (pf->service == service
     244                if (G_UNLIKELY (pf->service == service)
    241245                { 
    242246                        found = TRUE; 
     
    249253        } 
    250254 
    251         if (found
     255        if (G_LIKELY (found)
    252256                func (account); 
    253257 
     
    274278         
    275279        url = camel_url_new (uri + offset, ex); 
    276         if (!url)  
     280 
     281        if (G_UNLIKELY (!url)) 
    277282        { 
    278283                g_free(curi); 
     
    281286 
    282287        store = (CamelStore *)camel_session_get_service(session, uri+offset, CAMEL_PROVIDER_STORE, ex); 
    283         if (store)  
     288        if (G_LIKELY (store)) 
    284289        { 
    285290                const char *name; 
     
    288293                { 
    289294                        name = url->fragment; 
    290                 } else  
    291                 { 
     295                } else { 
    292296                        if (url->path && *url->path) 
    293297                                name = url->path + 1; 
     
    402406        gchar *camel_dir = NULL; 
    403407 
    404         if (camel_init (base_directory, TRUE) != 0
     408        if (G_LIKELY (camel_init (base_directory, TRUE) != 0)
    405409        { 
    406410                g_error ("Critical ERROR: Cannot init %d as camel directory\n", base_directory); 
  • trunk/libtinymail-camel/tny-store-account.c

    r212 r213  
    5353        TnyAccountPriv *priv = TNY_ACCOUNT_GET_PRIVATE (self); 
    5454 
    55         if (priv->session && priv->proto && priv->user && priv->host) 
     55        if (G_LIKELY (priv->session) && G_UNLIKELY (priv->proto) &&  
     56                G_UNLIKELY (priv->user) && G_UNLIKELY (priv->host)) 
    5657        { 
    5758                CamelURL *url = NULL; 
     
    133134        TnyStoreAccountPriv *priv = TNY_STORE_ACCOUNT_GET_PRIVATE (self); 
    134135 
    135         while (iter
     136        while (G_LIKELY (iter)
    136137        { 
    137138                gboolean subscribed = TRUE; 
  • trunk/libtinymail-camel/tny-stream-camel.c

    r212 r213  
    6464        g_return_val_if_fail (TNY_IS_STREAM_IFACE (output), -1); 
    6565 
    66         while (G_LIKELY (!camel_stream_eos (stream))) { 
     66        while (G_LIKELY (!camel_stream_eos (stream)))  
     67        { 
    6768                nb_read = camel_stream_read (stream, tmp_buf, sizeof (tmp_buf)); 
    6869                if (G_UNLIKELY (nb_read < 0)) 
    6970                        return -1; 
    70                 else if (G_LIKELY (nb_read > 0)) { 
     71                else if (G_LIKELY (nb_read > 0))  
     72                { 
    7173                        nb_written = 0; 
    7274         
  • trunk/libtinymail-camel/tny-transport-account.c

    r212 r213  
    5656        TnyAccountPriv *priv = TNY_ACCOUNT_GET_PRIVATE (self); 
    5757 
    58         if (priv->session && priv->proto && priv->host
     58        if (G_LIKELY (priv->session) && G_UNLIKELY (priv->proto) && G_UNLIKELY (priv->host)
    5959        { 
    6060                GString *urlstr = g_string_new (""); 
     
    9292                        apriv->url_string, &ex); 
    9393 
    94         if (transport && message && header
     94        if (G_LIKELY (transport && message && header)
    9595        { 
    9696                CamelInternetAddress  
  • trunk/libtinymailui-gtk/tny-attach-list-model.c

    r212 r213  
    6969                tny_msg_mime_part_iface_get_content_type (part), 0, NULL); 
    7070 
    71         if (icon
     71        if (G_LIKELY (icon)
    7272        { 
    7373                pixbuf = gtk_icon_theme_load_icon (priv->theme, icon,  
    7474                        GTK_ICON_SIZE_LARGE_TOOLBAR, 0, NULL); 
    7575                g_free (icon); 
    76         } else  
    77         { 
    78                 if (!stock_file_pixbuf) 
     76        } else { 
     77                if (G_UNLIKELY (!stock_file_pixbuf)) 
    7978                        stock_file_pixbuf = gtk_icon_theme_load_icon (priv->theme,  
    8079                                GTK_STOCK_FILE, GTK_ICON_SIZE_LARGE_TOOLBAR,  
  • trunk/libtinymailui-gtk/tny-msg-header-list-model.c

    r212 r213  
    8787        list = g_list_nth (G_LIST (list_model->headers), i); 
    8888 
    89         if (i >= list_model->length
     89        if (G_UNLIKELY (i >= list_model->length)
    9090                return FALSE; 
    9191                 
     
    109109                list; list = list->next)  
    110110        { 
    111                 if (list == G_LIST (iter->user_data)) 
     111                if (G_UNLIKELY (list == G_LIST (iter->user_data))) 
    112112                        break; 
    113113                i++; 
     
    211211tny_msg_header_list_model_iter_n_children (GtkTreeModel *self, GtkTreeIter *iter) 
    212212{ 
    213         if (!iter
     213        if (G_LIKELY (!iter)
    214214                return TNY_MSG_HEADER_LIST_MODEL (self)->length; 
    215215 
     
    222222        GList *child; 
    223223 
    224         if (parent
     224        if (G_UNLIKELY (parent)
    225225                return FALSE; 
    226226 
    227227        child = g_list_nth (G_LIST (TNY_MSG_HEADER_LIST_MODEL (self)->headers), n); 
    228228 
    229         if (child)  
     229        if (G_LIKELY (child)) 
    230230        { 
    231231                iter->stamp = TNY_MSG_HEADER_LIST_MODEL (self)->stamp; 
     
    247247        header = G_LIST (iter->user_data)->data; 
    248248         
    249         if (header
     249        if (G_LIKELY (header)
    250250                tny_msg_header_iface_uncache (header); 
    251251 
     
    347347        self->length = 0; 
    348348 
    349         if (self->folder
     349        if (G_LIKELY (self->folder)
    350350                g_object_unref (G_OBJECT (self->folder)); 
    351351 
  • trunk/libtinymailui-gtk/tny-msg-view.c

    r212 r213  
    7979 
    8080        gtk_text_buffer_set_text (headerbuffer, "", 0); 
     81        gtk_text_buffer_set_text (buffer, "", 0); 
    8182 
    8283        gtk_text_buffer_get_start_iter (headerbuffer, &hiter); 
     
    110111 
    111112 
    112         while (parts
     113        while (G_LIKELY (parts)
    113114        { 
    114115                TnyMsgMimePartIface *part = parts->data; 
    115116 
    116                 if (tny_msg_mime_part_iface_content_type_is (part, "text/*")) 
     117                if (G_LIKELY (tny_msg_mime_part_iface_content_type_is (part, "text/*"))) 
    117118                { 
    118119                        tny_stream_iface_reset (dest); 
     
    122123                        tny_msg_mime_part_iface_get_filename (part)) 
    123124                { 
    124                         if (first_attach
     125                        if (G_UNLIKELY (first_attach)
    125126                        { 
    126127                                model = tny_attach_list_model_new (); 
     
    136137        } 
    137138 
    138         if (!first_attach
     139        if (G_LIKELY (!first_attach)
    139140        { 
    140141                gtk_icon_view_set_model (priv->attachview, GTK_TREE_MODEL (model)); 
     
    155156                GNOME_VFS_OPEN_WRITE, FALSE, 0777); 
    156157 
    157         if (result != GNOME_VFS_OK
     158        if (G_UNLIKELY (result != GNOME_VFS_OK)
    158159                return result; 
    159160 
     
    175176        GtkTreeIter iter; 
    176177 
    177         if (gtk_tree_model_get_iter(model, &iter, path)) 
     178        if (G_LIKELY (gtk_tree_model_get_iter(model, &iter, path))) 
    178179        { 
    179180                TnyMsgMimePartIface *part; 
     
    183184                        &part, -1); 
    184185 
    185                 if (part
     186                if (G_LIKELY (part)
    186187                { 
    187188                        GtkWidget *toplevel = gtk_widget_get_toplevel (GTK_WIDGET (self)); 
    188189 
    189                         if (!GTK_WIDGET_TOPLEVEL (toplevel)) 
     190                        if (G_UNLIKELY (!GTK_WIDGET_TOPLEVEL (toplevel))) 
    190191                                return; 
    191192 
     
    206207                                tny_msg_mime_part_iface_get_filename (part)); 
    207208 
    208                         if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT
     209                        if (G_LIKELY (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT)
    209210                        { 
    210211                                gchar *uri; 
     
    243244static gint 
    244245tny_msg_view_popup_handler (GtkWidget *widget, GdkEvent *event) 
    245 
    246         GtkMenu *menu; 
    247         GdkEventButton *event_button; 
    248          
    249         g_return_val_if_fail (widget != NULL, FALSE); 
    250         g_return_val_if_fail (GTK_IS_MENU (widget), FALSE); 
     246{        
    251247        g_return_val_if_fail (event != NULL, FALSE); 
    252248         
    253         menu = GTK_MENU (widget); 
    254249         
    255         if (event->type == GDK_BUTTON_PRESS
     250        if (G_UNLIKELY (event->type == GDK_BUTTON_PRESS)
    256251        { 
    257           event_button = (GdkEventButton *) event; 
    258           if (event_button->button == 3) 
     252                GtkMenu *menu; 
     253                GdkEventButton *event_button; 
     254 
     255                menu = GTK_MENU (widget); 
     256                g_return_val_if_fail (widget != NULL, FALSE); 
     257                g_return_val_if_fail (GTK_IS_MENU (widget), FALSE); 
     258 
     259                event_button = (GdkEventButton *) event; 
     260                if (G_LIKELY (event_button->button == 3)) 
    259261                { 
    260262                        gtk_menu_popup (menu, NULL, NULL, NULL, NULL,  
     
    272274        TnyMsgViewPriv *priv = TNY_MSG_VIEW_GET_PRIVATE (self); 
    273275 
    274         if (priv->msg
     276        if (G_LIKELY (priv->msg)
    275277                g_object_unref (G_OBJECT (priv->msg)); 
    276278 
     
    382384        TnyMsgViewPriv *priv = TNY_MSG_VIEW_GET_PRIVATE (self); 
    383385 
    384         if (priv->msg
     386        if (G_LIKELY (priv->msg)
    385387                g_object_unref (G_OBJECT (priv->msg)); 
    386388 
  • trunk/libtinymailui-gtk/tny-text-buffer-stream.c

    r212 r213  
    4848        ssize_t nb_written; 
    4949         
    50         while (!tny_stream_iface_eos (self)) { 
     50        while (G_LIKELY (!tny_stream_iface_eos (self)))  
     51        { 
    5152                nb_read = tny_stream_iface_read (self, tmp_buf, sizeof (tmp_buf)); 
    52                 if (nb_read < 0
     53                if (G_UNLIKELY (nb_read < 0)
    5354                        return -1; 
    54                 else if (nb_read > 0) { 
     55                else if (G_LIKELY (nb_read > 0)) { 
    5556                        nb_written = 0; 
    5657         
    57                         while (nb_written < nb_read) { 
     58                        while (G_LIKELY (nb_written < nb_read)) 
     59                        { 
    5860                                ssize_t len = tny_stream_iface_write (output, tmp_buf + nb_written, 
    5961                                                                  nb_read - nb_written); 
    60                                 if (len < 0
     62                                if (G_UNLIKELY (len < 0)
    6163                                        return -1; 
    6264                                nb_written += len; 
  • trunk/tinymail/tny-account-store.c

    r212 r213  
    8989        g_mutex_lock (priv->transport_accounts_lock); 
    9090 
    91         if (priv->store_accounts
     91        if (G_LIKELY (priv->store_accounts)
    9292                destroy_these_accounts (priv->store_accounts); 
    9393 
    94         if (priv->transport_accounts
     94        if (G_LIKELY (priv->transport_accounts)
    9595                destroy_these_accounts (priv->transport_accounts); 
    9696 
     
    110110        const gchar *accountid = tny_account_iface_get_id (account); 
    111111 
    112         if (!passwords
     112        if (G_UNLIKELY (!passwords)
    113113                passwords = g_hash_table_new (g_str_hash, g_str_equal); 
    114114 
    115115        retval = g_hash_table_lookup (passwords, accountid); 
    116116 
    117         if (!retval
     117        if (G_UNLIKELY (!retval)
    118118        { 
    119119                GtkDialog *dialog = GTK_DIALOG (tny_password_dialog_new ()); 
     
    122122                        prompt); 
    123123 
    124                 if (gtk_dialog_run (dialog) == GTK_RESPONSE_OK
     124                if (G_LIKELY (gtk_dialog_run (dialog) == GTK_RESPONSE_OK)
    125125                { 
    126126                        const gchar *pwd = tny_password_dialog_get_password  
     
    142142per_account_forget_pass_func (TnyAccountIface *account) 
    143143{ 
    144         if (passwords
     144        if (G_LIKELY (passwords)
    145145        { 
    146146                const gchar *accountid = tny_account_iface_get_id (account); 
     
    148148                gchar *pwd = g_hash_table_lookup (passwords, accountid); 
    149149 
    150                 if (pwd)  
     150                if (G_LIKELY (pwd)) 
    151151                { 
    152152                        memset (pwd, 0, strlen (pwd)); 
     
    164164        TnyAccountIface *found = NULL; 
    165165 
    166         while (accounts
     166        while (G_LIKELY (accounts)
    167167        { 
    168168                TnyAccountIface *account = accounts->data; 
    169169                const gchar *aid = tny_account_iface_get_id (account); 
    170170                 
    171                 if (strcmp (key, aid)==0
     171                if (G_UNLIKELY (strcmp (key, aid) == 0)
    172172                { 
    173173                        found = account; 
    174174                        break; 
    175175                } 
     176 
    176177                accounts = g_list_next (accounts); 
    177178        } 
     
    240241        TnyAccountStorePriv *priv = TNY_ACCOUNT_STORE_GET_PRIVATE (self); 
    241242 
    242         if (!priv->cache_dir
     243        if (G_UNLIKELY (!priv->cache_dir)
    243244        { 
    244245                /* Note that there's no listener for this key. If it changes, 
     
    345346        const GList *retval; 
    346347 
    347         if (!priv->store_accounts
     348        if (G_UNLIKELY (!priv->store_accounts)
    348349                tny_account_store_get_all_accounts (self); 
    349350 
     
    362363        const GList *retval; 
    363364 
    364         if (!priv->transport_accounts
     365        if (G_UNLIKELY (!priv->transport_accounts)
    365366                tny_account_store_get_all_accounts (self); 
    366367 
     
    504505        priv->transport_accounts_lock = NULL; 
    505506 
    506         if (priv->cache_dir
     507        if (G_LIKELY (priv->cache_dir)
    507508                g_free (priv->cache_dir); 
    508509 
     
    522523        /* TODO: potential problem: singleton without lock */ 
    523524 
    524         if (!the_singleton
     525        if (G_UNLIKELY (!the_singleton)
    525526        { 
    526527                object = G_OBJECT_CLASS (parent_class)->constructor (type, 
  • tr