summaryrefslogtreecommitdiff
path: root/camel/providers
diff options
context:
space:
mode:
Diffstat (limited to 'camel/providers')
-rw-r--r--camel/providers/imap/camel-imap-folder.c4
-rw-r--r--camel/providers/imapx/camel-imapx-server.c2
-rw-r--r--camel/providers/imapx/camel-imapx-utils.c8
-rw-r--r--camel/providers/local/camel-local-folder.c2
-rw-r--r--camel/providers/local/camel-maildir-summary.c6
-rw-r--r--camel/providers/local/camel-mbox-store.c2
-rw-r--r--camel/providers/nntp/camel-nntp-store.c2
-rw-r--r--camel/providers/pop3/camel-pop3-engine.c2
8 files changed, 14 insertions, 14 deletions
diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c
index 0b1abb0c9..90ee0d4a9 100644
--- a/camel/providers/imap/camel-imap-folder.c
+++ b/camel/providers/imap/camel-imap-folder.c
@@ -226,7 +226,7 @@ camel_imap_folder_get_type (void)
(CamelObjectFinalizeFunc) imap_finalize);
/* only localize here, do not create GSList, we do not want to leak */
- for (i = 0; i < sizeof (imap_property_list)/sizeof (imap_property_list [0]); i++)
+ for (i = 0; i < G_N_ELEMENTS (imap_property_list); i++)
imap_property_list [i].description = _(imap_property_list [i].description);
}
@@ -523,7 +523,7 @@ imap_getv(CamelObject *object, CamelException *ex, CamelArgGetV *args)
props.argv[0] = *arg;
((CamelObjectClass *)parent_class)->getv(object, ex, &props);
- for (i = 0; i < sizeof (imap_property_list)/sizeof (imap_property_list [0]); i++)
+ for (i = 0; i < G_N_ELEMENTS (imap_property_list); i++)
*arg->ca_ptr = g_slist_append (*arg->ca_ptr, &imap_property_list[i]);
break; }
/* imap args */
diff --git a/camel/providers/imapx/camel-imapx-server.c b/camel/providers/imapx/camel-imapx-server.c
index 52dedcb38..533b75a06 100644
--- a/camel/providers/imapx/camel-imapx-server.c
+++ b/camel/providers/imapx/camel-imapx-server.c
@@ -2067,7 +2067,7 @@ imapx_job_sync_changes_start(CamelIMAPXServer *is, CamelIMAPXJob *job)
guint32 orset = on?job->u.sync_changes.on_set:job->u.sync_changes.off_set;
GArray *user_set = on?job->u.sync_changes.on_user:job->u.sync_changes.off_user;
- for (j=0;j<sizeof(flags_table)/sizeof(flags_table[0]);j++) {
+ for (j = 0; j < G_N_ELEMENTS (flags_table); j++) {
guint32 flag = flags_table[j].flag;
CamelIMAPXCommand *ic = NULL;
diff --git a/camel/providers/imapx/camel-imapx-utils.c b/camel/providers/imapx/camel-imapx-utils.c
index f1223f7de..16c3b1529 100644
--- a/camel/providers/imapx/camel-imapx-utils.c
+++ b/camel/providers/imapx/camel-imapx-utils.c
@@ -71,7 +71,7 @@ imap_parse_flags(CamelIMAPXStream *stream, guint32 *flagsp, CamelFlag **user_fla
// FIXME: ascii_toupper
while ((c=*p))
*p++ = toupper(c);
- for (i=0;i<(gint)(sizeof(flag_table)/sizeof(flag_table[0]));i++)
+ for (i = 0; i < G_N_ELEMENTS (flag_table); i++)
if (!strcmp(token, flag_table[i].name)) {
flags |= flag_table[i].flag;
goto found;
@@ -103,7 +103,7 @@ imap_write_flags(CamelStream *stream, guint32 flags, CamelFlag *user_flags)
if (camel_stream_write(stream, "(", 1) == -1)
camel_exception_throw(1, "io error: %s", strerror(errno));
- for (i=0;flags!=0 && i<(gint)(sizeof(flag_table)/sizeof(flag_table[0]));i++) {
+ for (i=0;flags!=0 && i< G_N_ELEMENTS (flag_table);i++) {
if (flag_table[i].flag & flags) {
if (camel_stream_write(stream, flag_table[i].name, strlen(flag_table[i].name)) == -1)
camel_exception_throw(1, "io error: %s", strerror(errno));
@@ -166,7 +166,7 @@ imap_parse_capability(CamelIMAPXStream *stream, CamelException *ex)
*p++ = toupper(c);
case IMAP_TOK_INT:
printf(" cap: '%s'\n", token);
- for (i=0;i<(gint)(sizeof(capa_table)/sizeof(capa_table[0]));i++)
+ for (i = 0; i < G_N_ELEMENTS (capa_table); i++)
if (strcmp(token, capa_table[i].name))
cinfo->capa |= capa_table[i].flag;
break;
@@ -1250,7 +1250,7 @@ imap_parse_list(CamelIMAPXStream *is, CamelException *ex)
p = token;
while ((c=*p))
*p++ = toupper(c);
- for (i=0;i<(gint)(sizeof(list_flag_table)/sizeof(list_flag_table[0]));i++)
+ for (i = 0; i < G_N_ELEMENTS (list_flag_table); i++)
if (!strcmp(token, list_flag_table[i].name))
linfo->flags |= list_flag_table[i].flag;
} else {
diff --git a/camel/providers/local/camel-local-folder.c b/camel/providers/local/camel-local-folder.c
index 1ce89fc38..5b2890cf7 100644
--- a/camel/providers/local/camel-local-folder.c
+++ b/camel/providers/local/camel-local-folder.c
@@ -195,7 +195,7 @@ camel_local_folder_get_type(void)
(CamelObjectInitFunc) local_init,
(CamelObjectFinalizeFunc) local_finalize);
- for (i=0;i<sizeof(local_property_list)/sizeof(local_property_list[0]);i++) {
+ for (i = 0; i < G_N_ELEMENTS (local_property_list); i++) {
local_property_list[i].description = _(local_property_list[i].description);
local_folder_properties = g_slist_prepend(local_folder_properties, &local_property_list[i]);
}
diff --git a/camel/providers/local/camel-maildir-summary.c b/camel/providers/local/camel-maildir-summary.c
index e49063478..8cc0c9e6d 100644
--- a/camel/providers/local/camel-maildir-summary.c
+++ b/camel/providers/local/camel-maildir-summary.c
@@ -196,9 +196,9 @@ gchar *camel_maildir_summary_info_to_name(const CamelMaildirMessageInfo *info)
gint i;
uid = camel_message_info_uid (info);
- buf = g_alloca (strlen (uid) + strlen (":2,") + (sizeof (flagbits) / sizeof (flagbits[0])) + 1);
+ buf = g_alloca (strlen (uid) + strlen (":2,") + G_N_ELEMENTS (flagbits) + 1);
p = buf + sprintf (buf, "%s:2,", uid);
- for (i = 0; i < sizeof (flagbits) / sizeof (flagbits[0]); i++) {
+ for (i = 0; i < G_N_ELEMENTS (flagbits); i++) {
if (info->info.info.flags & flagbits[i].flagbit)
*p++ = flagbits[i].flag;
}
@@ -222,7 +222,7 @@ gint camel_maildir_summary_name_to_info(CamelMaildirMessageInfo *info, const gch
p+=3;
while ((c = *p++)) {
/* we could assume that the flags are in order, but its just as easy not to require */
- for (i=0; i < sizeof(flagbits)/sizeof(flagbits[0]);i++) {
+ for (i = 0; i < G_N_ELEMENTS (flagbits); i++) {
if (flagbits[i].flag == c && (info->info.info.flags & flagbits[i].flagbit) == 0) {
set |= flagbits[i].flagbit;
}
diff --git a/camel/providers/local/camel-mbox-store.c b/camel/providers/local/camel-mbox-store.c
index 43ca1c22a..95ab8714b 100644
--- a/camel/providers/local/camel-mbox-store.c
+++ b/camel/providers/local/camel-mbox-store.c
@@ -114,7 +114,7 @@ ignore_file(const gchar *filename, gboolean sbd)
if (flen > 0 && filename[flen-1] == '~')
return TRUE;
- for (i = 0; i <(sizeof(extensions) / sizeof(extensions[0])); i++) {
+ for (i = 0; i < G_N_ELEMENTS (extensions); i++) {
len = strlen(extensions[i]);
if (len < flen && !strcmp(filename + flen - len, extensions[i]))
return TRUE;
diff --git a/camel/providers/nntp/camel-nntp-store.c b/camel/providers/nntp/camel-nntp-store.c
index b4fbe3eed..200a09dea 100644
--- a/camel/providers/nntp/camel-nntp-store.c
+++ b/camel/providers/nntp/camel-nntp-store.c
@@ -125,7 +125,7 @@ xover_setup(CamelNNTPStore *store, CamelException *ex)
while ((c = *p++)) {
if (c == ':') {
p[-1] = 0;
- for (i=0;i<sizeof(headers)/sizeof(headers[0]);i++) {
+ for (i = 0; i < G_N_ELEMENTS (headers); i++) {
if (strcmp(line, headers[i].name) == 0) {
xover->name = headers[i].name;
if (strncmp((gchar *) p, "full", 4) == 0)
diff --git a/camel/providers/pop3/camel-pop3-engine.c b/camel/providers/pop3/camel-pop3-engine.c
index ad4e21760..0bc17363d 100644
--- a/camel/providers/pop3/camel-pop3-engine.c
+++ b/camel/providers/pop3/camel-pop3-engine.c
@@ -213,7 +213,7 @@ cmd_capa(CamelPOP3Engine *pe, CamelPOP3Stream *stream, gpointer data)
tok = next;
}
} else {
- for (i=0;i<sizeof(capa)/sizeof(capa[0]);i++) {
+ for (i = 0; i < G_N_ELEMENTS (capa); i++) {
if (strcmp((gchar *) capa[i].cap, (gchar *) line) == 0)
pe->capa |= capa[i].flag;
}