Changeset 213
- Timestamp:
- 05/03/06 15:18:22
- Files:
-
- trunk/libtinymail-camel/tny-account.c (modified) (6 diffs)
- trunk/libtinymail-camel/tny-camel-common.c (modified) (5 diffs)
- trunk/libtinymail-camel/tny-camel-stream.c (modified) (2 diffs)
- trunk/libtinymail-camel/tny-msg-folder.c (modified) (21 diffs)
- trunk/libtinymail-camel/tny-session-camel.c (modified) (18 diffs)
- trunk/libtinymail-camel/tny-store-account.c (modified) (2 diffs)
- trunk/libtinymail-camel/tny-stream-camel.c (modified) (1 diff)
- trunk/libtinymail-camel/tny-transport-account.c (modified) (2 diffs)
- trunk/libtinymailui-gtk/tny-attach-list-model.c (modified) (1 diff)
- trunk/libtinymailui-gtk/tny-msg-header-list-model.c (modified) (6 diffs)
- trunk/libtinymailui-gtk/tny-msg-view.c (modified) (11 diffs)
- trunk/libtinymailui-gtk/tny-text-buffer-stream.c (modified) (1 diff)
- trunk/tinymail/tny-account-store.c (modified) (11 diffs)
- trunk/tinymail/tny-summary-window.c (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/libtinymail-camel/tny-account.c
r212 r213 82 82 g_static_rec_mutex_lock (priv->service_lock); 83 83 84 if ( priv->id)84 if (G_UNLIKELY (priv->id)) 85 85 g_free (priv->id); 86 86 … … 99 99 g_static_rec_mutex_lock (priv->service_lock); 100 100 101 if ( priv->proto)101 if (G_UNLIKELY (priv->proto)) 102 102 g_free (priv->proto); 103 103 … … 118 118 g_static_rec_mutex_lock (priv->service_lock); 119 119 120 if ( priv->user)120 if (G_UNLIKELY (priv->user)) 121 121 g_free (priv->user); 122 122 … … 137 137 g_static_rec_mutex_lock (priv->service_lock); 138 138 139 if ( priv->host)139 if (G_UNLIKELY (priv->host)) 140 140 g_free (priv->host); 141 141 … … 160 160 priv->pass_func_set = TRUE; 161 161 162 if ( !TNY_ACCOUNT_GET_CLASS (self)->reconnect_func)162 if (G_UNLIKELY (!TNY_ACCOUNT_GET_CLASS (self)->reconnect_func)) 163 163 g_error ("This TnyAccountIface instance isn't a fully implemented type\n"); 164 164 … … 328 328 329 329 g_static_rec_mutex_lock (priv->service_lock); 330 if ( priv->id)330 if (G_LIKELY (priv->id)) 331 331 g_free (priv->id); 332 332 333 if ( priv->user)333 if (G_LIKELY (priv->user)) 334 334 g_free (priv->user); 335 335 336 if ( priv->host)336 if (G_LIKELY (priv->host)) 337 337 g_free (priv->host); 338 338 339 if ( priv->proto)339 if (G_LIKELY (priv->proto)) 340 340 g_free (priv->proto); 341 341 342 g_static_rec_mutex_unlock (priv->service_lock); 342 343 trunk/libtinymail-camel/tny-camel-common.c
r186 r213 28 28 stfnd = strchr (tok, '<'); 29 29 30 if ( stfnd)30 if (G_LIKELY (stfnd)) 31 31 { 32 32 char *name = (char*)tok, *lname = NULL; … … 37 37 gtfnd = strchr (stfnd, '>'); 38 38 39 if ( !gtfnd)39 if (G_UNLIKELY (!gtfnd)) 40 40 { 41 41 g_warning ("Invalid e-mail address in field"); … … 46 46 *gtfnd = '\0'; 47 47 48 if ( *name == ' ')48 if (G_LIKELY (*name == ' ')) 49 49 *name++; 50 50 51 if ( *lname == ' ')51 if (G_LIKELY (*lname == ' ')) 52 52 *lname-- = '\0'; 53 53 camel_internet_address_add (target, name, email); … … 59 59 lname += (strlen (name)-1); 60 60 61 if ( *name == ' ')61 if (G_LIKELY (*name == ' ')) 62 62 *name++; 63 63 64 if ( *lname == ' ')64 if (G_LIKELY (*lname == ' ')) 65 65 *lname-- = '\0'; 66 66 camel_internet_address_add (target, NULL, name); … … 78 78 tok = strtok_r (dup, ",;", &save); 79 79 80 while ( tok != NULL)80 while (G_LIKELY (tok != NULL)) 81 81 { 82 82 trunk/libtinymail-camel/tny-camel-stream.c
r212 r213 45 45 g_return_val_if_fail (TNY_IS_STREAM_IFACE (output), -1); 46 46 47 while (!camel_stream_eos (stream)) { 47 while (G_LIKELY (!camel_stream_eos (stream))) 48 { 48 49 nb_read = camel_stream_read (stream, tmp_buf, sizeof (tmp_buf)); 49 if ( nb_read < 0)50 if (G_UNLIKELY (nb_read < 0)) 50 51 return -1; 51 else if (nb_read > 0) { 52 else if (G_LIKELY (nb_read > 0)) 53 { 52 54 nb_written = 0; 53 55 54 while (nb_written < nb_read) { 56 while (G_LIKELY (nb_written < nb_read)) 57 { 55 58 ssize_t len = tny_stream_iface_write (output, tmp_buf + nb_written, 56 59 nb_read - nb_written); 57 if ( len < 0)60 if (G_UNLIKELY (len < 0)) 58 61 return -1; 59 62 nb_written += len; … … 123 126 TnyCamelStream *self = (TnyCamelStream *)object; 124 127 125 if ( self->stream)128 if (G_LIKELY (self->stream)) 126 129 g_object_unref (G_OBJECT (self->stream)); 127 130 trunk/libtinymail-camel/tny-msg-folder.c
r212 r213 78 78 gint count = 0; 79 79 80 while ( (count < 5) && list)80 while (G_LIKELY ((count < 5) && list)) 81 81 { 82 82 GList *element = list; 83 if ( element && element->data)83 if (G_LIKELY (element && element->data)) 84 84 d->relaxed_func (element->data, NULL); 85 85 list = g_list_remove_link (list, element); … … 90 90 d->list = list; 91 91 92 if ( count <= 1)92 if (G_UNLIKELY (count <= 1)) 93 93 return FALSE; 94 94 … … 100 100 tny_msg_folder_hdr_cache_uncacher (TnyMsgFolderPriv *priv) 101 101 { 102 if ( priv->cached_hdrs)102 if (G_LIKELY (priv->cached_hdrs)) 103 103 { 104 104 RelaxedData *d = g_new (RelaxedData, 1); … … 118 118 tny_msg_folder_hdr_cache_remover (TnyMsgFolderPriv *priv) 119 119 { 120 if ( priv->cached_hdrs)120 if (G_LIKELY (priv->cached_hdrs)) 121 121 { 122 122 RelaxedData *d = g_new (RelaxedData, 1); … … 128 128 priv->cached_hdrs = NULL; 129 129 /* Speedup trick, also check tny-msg-header.c */ 130 if ( priv->folder && priv->cached_uids)130 if (G_LIKELY (priv->folder && priv->cached_uids)) 131 131 camel_folder_free_uids (priv->folder, priv->cached_uids); 132 132 priv->cached_uids = NULL; … … 145 145 g_mutex_lock (priv->folder_lock); 146 146 147 if ( priv->folder)147 if (G_LIKELY (priv->folder)) 148 148 camel_object_unref (CAMEL_OBJECT (priv->folder)); 149 149 priv->folder = NULL; 150 150 151 151 g_mutex_lock (priv->cached_msgs_lock); 152 if ( priv->cached_msgs)152 if (G_LIKELY (priv->cached_msgs)) 153 153 g_hash_table_destroy (priv->cached_msgs); 154 154 priv->cached_msgs = NULL; … … 164 164 { 165 165 g_mutex_lock (priv->folder_lock); 166 if ( !priv->folder)166 if (G_LIKELY (!priv->folder)) 167 167 { 168 168 CamelException ex = CAMEL_EXCEPTION_INITIALISER; … … 174 174 priv->has_summary_cap = camel_folder_has_summary_capability (priv->folder); 175 175 176 if ( priv->folder && priv->has_summary_cap)176 if (G_LIKELY (priv->folder) && G_LIKELY (priv->has_summary_cap)) 177 177 { 178 178 priv->unread_length = (guint) … … 244 244 245 245 /* These will synchronize me using _tny_msg_folder_set_subscribed_priv */ 246 if (subscribed) 246 247 if (G_LIKELY (subscribed)) 247 248 tny_store_account_iface_subscribe 248 249 (TNY_STORE_ACCOUNT_IFACE (priv->account), self); … … 364 365 365 366 g_mutex_lock (priv->cached_hdrs_lock); 366 if (!priv->cached_hdrs) 367 368 if (G_UNLIKELY (!priv->cached_hdrs)) 367 369 { 368 370 GPtrArray *uids = NULL; … … 443 445 444 446 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? */ 448 451 449 452 priv->cached_msgs = g_hash_table_new_full … … 456 459 } 457 460 458 if ( !message)461 if (G_LIKELY (!message)) 459 462 { 460 463 CamelException *ex = camel_exception_new (); … … 498 501 const gchar *name = NULL; 499 502 500 if ( !priv->cached_name)503 if (G_UNLIKELY (!priv->cached_name)) 501 504 { 502 505 load_folder (priv); … … 521 524 TnyMsgFolderPriv *priv = TNY_MSG_FOLDER_GET_PRIVATE (TNY_MSG_FOLDER (self)); 522 525 523 if ( priv->folder_name)526 if (G_UNLIKELY (priv->folder_name)) 524 527 g_free (priv->folder_name); 525 528 … … 535 538 TnyMsgFolderPriv *priv = TNY_MSG_FOLDER_GET_PRIVATE (TNY_MSG_FOLDER (self)); 536 539 537 if ( priv->cached_name)540 if (G_UNLIKELY (priv->cached_name)) 538 541 g_free (priv->cached_name); 539 542 … … 552 555 camel_folder_rename (priv->folder, name); 553 556 554 if ( priv->cached_name)557 if (G_UNLIKELY (priv->cached_name)) 555 558 g_free (priv->cached_name); 556 559 … … 573 576 g_mutex_lock (priv->folder_lock); 574 577 575 if ( priv->folder)578 if (G_UNLIKELY (priv->folder)) 576 579 camel_object_unref (priv->folder); 577 580 … … 659 662 TnyMsgFolderPriv *priv = TNY_MSG_FOLDER_GET_PRIVATE (self); 660 663 661 if ( priv->folders)664 if (G_LIKELY (priv->folders)) 662 665 { 663 666 g_mutex_lock (priv->folders_lock); … … 669 672 670 673 g_mutex_lock (priv->cached_hdrs_lock); 671 if ( priv->folder)674 if (G_LIKELY (priv->folder)) 672 675 { 673 676 g_mutex_lock (priv->folder_lock); … … 677 680 g_mutex_unlock (priv->cached_hdrs_lock); 678 681 679 if ( priv->cached_name)682 if (G_LIKELY (priv->cached_name)) 680 683 g_free (priv->cached_name); 681 684 … … 704 707 TnyMsgFolderPriv *priv = TNY_MSG_FOLDER_GET_PRIVATE (self); 705 708 706 if ( priv->folder != NULL)709 if (G_LIKELY (priv->folder != NULL)) 707 710 unload_folder (priv); 708 711 trunk/libtinymail-camel/tny-session-camel.c
r212 r213 89 89 CamelService *service = (CamelService*)_tny_account_get_service (TNY_ACCOUNT (account)); 90 90 91 while ( copy)91 while (G_LIKELY (copy)) 92 92 { 93 93 pf = copy->data; 94 94 95 if ( pf->service == NULL || pf->account == NULL)95 if (G_UNLIKELY (pf->service == NULL) || G_UNLIKELY (pf->account == NULL)) 96 96 { 97 97 mark_del = g_list_append (mark_del, copy); … … 99 99 } 100 100 101 if ( pf->service == service)101 if (G_UNLIKELY (pf->service == service)) 102 102 { 103 103 found = TRUE; … … 108 108 } 109 109 110 if ( !found)110 if (G_UNLIKELY (!found)) 111 111 pf = g_new0 (PrivForgetPassFunc, 1); 112 112 … … 115 115 pf->service = service; 116 116 117 if ( !found)117 if (G_UNLIKELY (!found)) 118 118 forget_password_funcs = g_list_append (forget_password_funcs, pf); 119 119 120 if (mark_del) 121 while (mark_del) 120 if (G_UNLIKELY (mark_del)) 121 { 122 while (G_LIKELY (mark_del)) 122 123 { 123 124 forget_password_funcs = g_list_remove (forget_password_funcs, mark_del->data); … … 125 126 } 126 127 127 g_list_free (mark_del); 128 g_list_free (mark_del); 129 } 128 130 129 131 return; … … 150 152 CamelService *service = (CamelService*)_tny_account_get_service (TNY_ACCOUNT (account)); 151 153 152 while ( copy)154 while (G_LIKELY (copy)) 153 155 { 154 156 pf = copy->data; 155 157 156 if ( pf->service == NULL || pf->account == NULL)158 if (G_UNLIKELY (pf->service) == NULL || G_UNLIKELY (pf->account == NULL)) 157 159 { 158 160 mark_del = g_list_append (mark_del, copy); … … 160 162 } 161 163 162 if ( pf->service == service)164 if (G_UNLIKELY (pf->service == service)) 163 165 { 164 166 found = TRUE; … … 169 171 } 170 172 171 if ( !found)173 if (G_UNLIKELY (!found)) 172 174 pf = g_new0 (PrivPassFunc, 1); 173 175 … … 176 178 pf->service = service; 177 179 178 if ( !found)180 if (G_UNLIKELY (!found)) 179 181 password_funcs = g_list_append (password_funcs, pf); 180 182 181 if (mark_del) 182 while (mark_del) 183 if (G_UNLIKELY (mark_del)) 184 { 185 while (G_LIKELY (mark_del)) 183 186 { 184 187 password_funcs = g_list_remove (password_funcs, mark_del->data); … … 186 189 } 187 190 188 g_list_free (mark_del); 191 g_list_free (mark_del); 192 } 189 193 190 194 return; … … 201 205 gchar *retval = NULL; 202 206 203 while ( copy)207 while (G_LIKELY (copy)) 204 208 { 205 209 PrivPassFunc *pf = copy->data; 206 210 207 if ( pf->service == service)211 if (G_UNLIKELY (pf->service == service)) 208 212 { 209 213 found = TRUE; … … 216 220 } 217 221 218 if ( found)222 if (G_LIKELY (found)) 219 223 retval = func (account, prompt); 220 224 221 if ( !retval)225 if (G_UNLIKELY (!retval)) 222 226 camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL, ""); 223 227 … … 234 238 gboolean found = FALSE; 235 239 236 while ( copy)240 while (G_LIKELY (copy)) 237 241 { 238 242 PrivForgetPassFunc *pf = copy->data; 239 243 240 if ( pf->service == service)244 if (G_UNLIKELY (pf->service == service)) 241 245 { 242 246 found = TRUE; … … 249 253 } 250 254 251 if ( found)255 if (G_LIKELY (found)) 252 256 func (account); 253 257 … … 274 278 275 279 url = camel_url_new (uri + offset, ex); 276 if (!url) 280 281 if (G_UNLIKELY (!url)) 277 282 { 278 283 g_free(curi); … … 281 286 282 287 store = (CamelStore *)camel_session_get_service(session, uri+offset, CAMEL_PROVIDER_STORE, ex); 283 if ( store)288 if (G_LIKELY (store)) 284 289 { 285 290 const char *name; … … 288 293 { 289 294 name = url->fragment; 290 } else 291 { 295 } else { 292 296 if (url->path && *url->path) 293 297 name = url->path + 1; … … 402 406 gchar *camel_dir = NULL; 403 407 404 if ( camel_init (base_directory, TRUE) != 0)408 if (G_LIKELY (camel_init (base_directory, TRUE) != 0)) 405 409 { 406 410 g_error ("Critical ERROR: Cannot init %d as camel directory\n", base_directory); trunk/libtinymail-camel/tny-store-account.c
r212 r213 53 53 TnyAccountPriv *priv = TNY_ACCOUNT_GET_PRIVATE (self); 54 54 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)) 56 57 { 57 58 CamelURL *url = NULL; … … 133 134 TnyStoreAccountPriv *priv = TNY_STORE_ACCOUNT_GET_PRIVATE (self); 134 135 135 while ( iter)136 while (G_LIKELY (iter)) 136 137 { 137 138 gboolean subscribed = TRUE; trunk/libtinymail-camel/tny-stream-camel.c
r212 r213 64 64 g_return_val_if_fail (TNY_IS_STREAM_IFACE (output), -1); 65 65 66 while (G_LIKELY (!camel_stream_eos (stream))) { 66 while (G_LIKELY (!camel_stream_eos (stream))) 67 { 67 68 nb_read = camel_stream_read (stream, tmp_buf, sizeof (tmp_buf)); 68 69 if (G_UNLIKELY (nb_read < 0)) 69 70 return -1; 70 else if (G_LIKELY (nb_read > 0)) { 71 else if (G_LIKELY (nb_read > 0)) 72 { 71 73 nb_written = 0; 72 74 trunk/libtinymail-camel/tny-transport-account.c
r212 r213 56 56 TnyAccountPriv *priv = TNY_ACCOUNT_GET_PRIVATE (self); 57 57 58 if ( priv->session && priv->proto && priv->host)58 if (G_LIKELY (priv->session) && G_UNLIKELY (priv->proto) && G_UNLIKELY (priv->host)) 59 59 { 60 60 GString *urlstr = g_string_new (""); … … 92 92 apriv->url_string, &ex); 93 93 94 if ( transport && message && header)94 if (G_LIKELY (transport && message && header)) 95 95 { 96 96 CamelInternetAddress trunk/libtinymailui-gtk/tny-attach-list-model.c
r212 r213 69 69 tny_msg_mime_part_iface_get_content_type (part), 0, NULL); 70 70 71 if ( icon)71 if (G_LIKELY (icon)) 72 72 { 73 73 pixbuf = gtk_icon_theme_load_icon (priv->theme, icon, 74 74 GTK_ICON_SIZE_LARGE_TOOLBAR, 0, NULL); 75 75 g_free (icon); 76 } else 77 { 78 if (!stock_file_pixbuf) 76 } else { 77 if (G_UNLIKELY (!stock_file_pixbuf)) 79 78 stock_file_pixbuf = gtk_icon_theme_load_icon (priv->theme, 80 79 GTK_STOCK_FILE, GTK_ICON_SIZE_LARGE_TOOLBAR, trunk/libtinymailui-gtk/tny-msg-header-list-model.c
r212 r213 87 87 list = g_list_nth (G_LIST (list_model->headers), i); 88 88 89 if ( i >= list_model->length)89 if (G_UNLIKELY (i >= list_model->length)) 90 90 return FALSE; 91 91 … … 109 109 list; list = list->next) 110 110 { 111 if ( list == G_LIST (iter->user_data))111 if (G_UNLIKELY (list == G_LIST (iter->user_data))) 112 112 break; 113 113 i++; … … 211 211 tny_msg_header_list_model_iter_n_children (GtkTreeModel *self, GtkTreeIter *iter) 212 212 { 213 if ( !iter)213 if (G_LIKELY (!iter)) 214 214 return TNY_MSG_HEADER_LIST_MODEL (self)->length; 215 215 … … 222 222 GList *child; 223 223 224 if ( parent)224 if (G_UNLIKELY (parent)) 225 225 return FALSE; 226 226 227 227 child = g_list_nth (G_LIST (TNY_MSG_HEADER_LIST_MODEL (self)->headers), n); 228 228 229 if ( child)229 if (G_LIKELY (child)) 230 230 { 231 231 iter->stamp = TNY_MSG_HEADER_LIST_MODEL (self)->stamp; … … 247 247 header = G_LIST (iter->user_data)->data; 248 248 249 if ( header)249 if (G_LIKELY (header)) 250 250 tny_msg_header_iface_uncache (header); 251 251 … … 347 347 self->length = 0; 348 348 349 if ( self->folder)349 if (G_LIKELY (self->folder)) 350 350 g_object_unref (G_OBJECT (self->folder)); 351 351 trunk/libtinymailui-gtk/tny-msg-view.c
r212 r213 79 79 80 80 gtk_text_buffer_set_text (headerbuffer, "", 0); 81 gtk_text_buffer_set_text (buffer, "", 0); 81 82 82 83 gtk_text_buffer_get_start_iter (headerbuffer, &hiter); … … 110 111 111 112 112 while ( parts)113 while (G_LIKELY (parts)) 113 114 { 114 115 TnyMsgMimePartIface *part = parts->data; 115 116 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/*"))) 117 118 { 118 119 tny_stream_iface_reset (dest); … … 122 123 tny_msg_mime_part_iface_get_filename (part)) 123 124 { 124 if ( first_attach)125 if (G_UNLIKELY (first_attach)) 125 126 { 126 127 model = tny_attach_list_model_new (); … … 136 137 } 137 138 138 if ( !first_attach)139 if (G_LIKELY (!first_attach)) 139 140 { 140 141 gtk_icon_view_set_model (priv->attachview, GTK_TREE_MODEL (model)); … … 155 156 GNOME_VFS_OPEN_WRITE, FALSE, 0777); 156 157 157 if ( result != GNOME_VFS_OK)158 if (G_UNLIKELY (result != GNOME_VFS_OK)) 158 159 return result; 159 160 … … 175 176 GtkTreeIter iter; 176 177 177 if ( gtk_tree_model_get_iter(model, &iter, path))178 if (G_LIKELY (gtk_tree_model_get_iter(model, &iter, path))) 178 179 { 179 180 TnyMsgMimePartIface *part; … … 183 184 &part, -1); 184 185 185 if ( part)186 if (G_LIKELY (part)) 186 187 { 187 188 GtkWidget *toplevel = gtk_widget_get_toplevel (GTK_WIDGET (self)); 188 189 189 if ( !GTK_WIDGET_TOPLEVEL (toplevel))190 if (G_UNLIKELY (!GTK_WIDGET_TOPLEVEL (toplevel))) 190 191 return; 191 192 … … 206 207 tny_msg_mime_part_iface_get_filename (part)); 207 208 208 if ( gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT)209 if (G_LIKELY (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT)) 209 210 { 210 211 gchar *uri; … … 243 244 static gint 244 245 tny_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 { 251 247 g_return_val_if_fail (event != NULL, FALSE); 252 248 253 menu = GTK_MENU (widget);254 249 255 if ( event->type == GDK_BUTTON_PRESS)250 if (G_UNLIKELY (event->type == GDK_BUTTON_PRESS)) 256 251 { 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)) 259 261 { 260 262 gtk_menu_popup (menu, NULL, NULL, NULL, NULL, … … 272 274 TnyMsgViewPriv *priv = TNY_MSG_VIEW_GET_PRIVATE (self); 273 275 274 if ( priv->msg)276 if (G_LIKELY (priv->msg)) 275 277 g_object_unref (G_OBJECT (priv->msg)); 276 278 … … 382 384 TnyMsgViewPriv *priv = TNY_MSG_VIEW_GET_PRIVATE (self); 383 385 384 if ( priv->msg)386 if (G_LIKELY (priv->msg)) 385 387 g_object_unref (G_OBJECT (priv->msg)); 386 388 trunk/libtinymailui-gtk/tny-text-buffer-stream.c
r212 r213 48 48 ssize_t nb_written; 49 49 50 while (!tny_stream_iface_eos (self)) { 50 while (G_LIKELY (!tny_stream_iface_eos (self))) 51 { 51 52 nb_read = tny_stream_iface_read (self, tmp_buf, sizeof (tmp_buf)); 52 if ( nb_read < 0)53 if (G_UNLIKELY (nb_read < 0)) 53 54 return -1; 54 else if ( nb_read > 0) {55 else if (G_LIKELY (nb_read > 0)) { 55 56 nb_written = 0; 56 57 57 while (nb_written < nb_read) { 58 while (G_LIKELY (nb_written < nb_read)) 59 { 58 60 ssize_t len = tny_stream_iface_write (output, tmp_buf + nb_written, 59 61 nb_read - nb_written); 60 if ( len < 0)62 if (G_UNLIKELY (len < 0)) 61 63 return -1; 62 64 nb_written += len; trunk/tinymail/tny-account-store.c
r212 r213 89 89 g_mutex_lock (priv->transport_accounts_lock); 90 90 91 if ( priv->store_accounts)91 if (G_LIKELY (priv->store_accounts)) 92 92 destroy_these_accounts (priv->store_accounts); 93 93 94 if ( priv->transport_accounts)94 if (G_LIKELY (priv->transport_accounts)) 95 95 destroy_these_accounts (priv->transport_accounts); 96 96 … … 110 110 const gchar *accountid = tny_account_iface_get_id (account); 111 111 112 if ( !passwords)112 if (G_UNLIKELY (!passwords)) 113 113 passwords = g_hash_table_new (g_str_hash, g_str_equal); 114 114 115 115 retval = g_hash_table_lookup (passwords, accountid); 116 116 117 if ( !retval)117 if (G_UNLIKELY (!retval)) 118 118 { 119 119 GtkDialog *dialog = GTK_DIALOG (tny_password_dialog_new ()); … … 122 122 prompt); 123 123 124 if ( gtk_dialog_run (dialog) == GTK_RESPONSE_OK)124 if (G_LIKELY (gtk_dialog_run (dialog) == GTK_RESPONSE_OK)) 125 125 { 126 126 const gchar *pwd = tny_password_dialog_get_password … … 142 142 per_account_forget_pass_func (TnyAccountIface *account) 143 143 { 144 if ( passwords)144 if (G_LIKELY (passwords)) 145 145 { 146 146 const gchar *accountid = tny_account_iface_get_id (account); … … 148 148 gchar *pwd = g_hash_table_lookup (passwords, accountid); 149 149 150 if ( pwd)150 if (G_LIKELY (pwd)) 151 151 { 152 152 memset (pwd, 0, strlen (pwd)); … … 164 164 TnyAccountIface *found = NULL; 165 165 166 while ( accounts)166 while (G_LIKELY (accounts)) 167 167 { 168 168 TnyAccountIface *account = accounts->data; 169 169 const gchar *aid = tny_account_iface_get_id (account); 170 170 171 if ( strcmp (key, aid)==0)171 if (G_UNLIKELY (strcmp (key, aid) == 0)) 172 172 { 173 173 found = account; 174 174 break; 175 175 } 176 176 177 accounts = g_list_next (accounts); 177 178 } … … 240 241 TnyAccountStorePriv *priv = TNY_ACCOUNT_STORE_GET_PRIVATE (self); 241 242 242 if ( !priv->cache_dir)243 if (G_UNLIKELY (!priv->cache_dir)) 243 244 { 244 245 /* Note that there's no listener for this key. If it changes, … … 345 346 const GList *retval; 346 347 347 if ( !priv->store_accounts)348 if (G_UNLIKELY (!priv->store_accounts)) 348 349 tny_account_store_get_all_accounts (self); 349 350 … … 362 363 const GList *retval; 363 364 364 if ( !priv->transport_accounts)365 if (G_UNLIKELY (!priv->transport_accounts)) 365 366 tny_account_store_get_all_accounts (self); 366 367 … … 504 505 priv->transport_accounts_lock = NULL; 505 506 506 if ( priv->cache_dir)507 if (G_LIKELY (priv->cache_dir)) 507 508 g_free (priv->cache_dir); 508 509 … … 522 523 /* TODO: potential problem: singleton without lock */ 523 524 524 if ( !the_singleton)525 if (G_UNLIKELY (!the_singleton)) 525 526 { 526 527 object = G_OBJECT_CLASS (parent_class)->constructor (type, tr
