[evolution-data-server] Prefer G_N_ELEMENTS over sizeof calculations.
- From: Matthew Barnes <mbarnes src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [evolution-data-server] Prefer G_N_ELEMENTS over sizeof calculations.
- Date: Mon, 26 Oct 2009 23:13:29 +0000 (UTC)
commit 32417e99d20f007de5151d10c051805e7b795ecc
Author: Matthew Barnes <mbarnes redhat com>
Date: Sat Oct 24 19:13:18 2009 -0400
Prefer G_N_ELEMENTS over sizeof calculations.
.../backends/groupwise/e-book-backend-groupwise.c | 2 +-
addressbook/backends/ldap/e-book-backend-ldap.c | 20 +++++++--------
addressbook/libebook/e-book-query.c | 2 +-
addressbook/libedata-book/e-book-backend-sexp.c | 2 +-
addressbook/libedata-book/e-book-backend-summary.c | 4 +-
calendar/libecal/e-cal-component.c | 2 +-
calendar/libecal/e-cal-recur.c | 26 +++++++-------------
calendar/libedata-cal/e-cal-backend-sexp.c | 3 +-
camel/camel-charset-map.c | 2 +-
camel/camel-disco-folder.c | 2 +-
camel/camel-filter-driver.c | 2 +-
camel/camel-filter-search.c | 2 +-
camel/camel-folder-search.c | 2 +-
camel/camel-folder-summary.c | 10 +++----
camel/camel-html-parser.c | 2 +-
camel/camel-mime-filter-enriched.c | 12 +++------
camel/camel-mime-filter-html.c | 2 -
camel/camel-mime-filter-tohtml.c | 4 +--
camel/camel-mime-utils.c | 6 ++--
camel/camel-partition-table.c | 12 ++++-----
camel/camel-search-sql-sexp.c | 2 +-
camel/camel-text-index.c | 6 ++--
camel/providers/imap/camel-imap-folder.c | 4 +-
camel/providers/imapx/camel-imapx-server.c | 2 +-
camel/providers/imapx/camel-imapx-utils.c | 8 +++---
camel/providers/local/camel-local-folder.c | 2 +-
camel/providers/local/camel-maildir-summary.c | 6 ++--
camel/providers/local/camel-mbox-store.c | 2 +-
camel/providers/nntp/camel-nntp-store.c | 2 +-
camel/providers/pop3/camel-pop3-engine.c | 2 +-
camel/tests/folder/test1.c | 4 +--
camel/tests/folder/test10.c | 4 +--
camel/tests/folder/test11.c | 8 ++----
camel/tests/folder/test2.c | 4 +--
camel/tests/folder/test3.c | 6 +---
camel/tests/folder/test4.c | 4 +--
camel/tests/folder/test5.c | 4 +--
camel/tests/folder/test6.c | 4 +--
camel/tests/folder/test7.c | 4 +--
camel/tests/folder/test8.c | 4 +--
camel/tests/folder/test9.c | 14 ++++------
camel/tests/message/test2.c | 6 +---
camel/tests/mime-filter/test1.c | 2 +-
camel/tests/misc/split.c | 7 +----
camel/tests/misc/test1.c | 2 +-
camel/tests/misc/test2.c | 4 +-
camel/tests/misc/url.c | 3 +-
camel/tests/misc/utf7.c | 3 +-
camel/tests/stream/test3.c | 6 +---
libedataserver/e-account.c | 4 +-
libedataserver/e-iconv.c | 4 +--
libedataserver/e-sexp.c | 2 +-
libedataserver/e-time-utils.c | 2 +-
servers/groupwise/e-gw-item.c | 8 +++---
54 files changed, 106 insertions(+), 162 deletions(-)
---
diff --git a/addressbook/backends/groupwise/e-book-backend-groupwise.c b/addressbook/backends/groupwise/e-book-backend-groupwise.c
index ebd0cc7..cfa0dfa 100644
--- a/addressbook/backends/groupwise/e-book-backend-groupwise.c
+++ b/addressbook/backends/groupwise/e-book-backend-groupwise.c
@@ -1856,7 +1856,7 @@ e_book_backend_groupwise_build_gw_filter (EBookBackendGroupwise *ebgw, const gch
sexp_data->auto_completion = 0;
sexp_data->search_string = NULL;
- for (i=0;i<sizeof(symbols)/sizeof(symbols[0]);i++) {
+ for (i = 0; i < G_N_ELEMENTS (symbols); i++) {
if (symbols[i].type == 1) {
e_sexp_add_ifunction(sexp, 0, symbols[i].name,
(ESExpIFunc *)symbols[i].func, sexp_data);
diff --git a/addressbook/backends/ldap/e-book-backend-ldap.c b/addressbook/backends/ldap/e-book-backend-ldap.c
index cb4c2d4..667bd45 100644
--- a/addressbook/backends/ldap/e-book-backend-ldap.c
+++ b/addressbook/backends/ldap/e-book-backend-ldap.c
@@ -419,8 +419,6 @@ static struct prop_info {
#undef GROUP_PROP
};
-static gint num_prop_infos = sizeof(prop_info) / sizeof(prop_info[0]);
-
#if 0
static void
remove_view (gint msgid, LDAPOp *op, EDataBookView *view)
@@ -565,7 +563,7 @@ add_oc_attributes_to_supported_fields (EBookBackendLDAP *bl, LDAPObjectClass *oc
gint i;
GHashTable *attr_hash = g_hash_table_new (g_str_hash, g_str_equal);
- for (i = 0; i < num_prop_infos; i ++)
+ for (i = 0; i < G_N_ELEMENTS (prop_info); i ++)
g_hash_table_insert (attr_hash, (gpointer) prop_info[i].ldap_attr, (gchar *)e_contact_field_name (prop_info[i].field_id));
if (oc->oc_at_oids_must)
@@ -1318,7 +1316,7 @@ build_mods_from_contacts (EBookBackendLDAP *bl, EContact *current, EContact *new
/* we walk down the list of properties we can deal with (that
big table at the top of the file) */
- for (i = 0; i < num_prop_infos; i ++) {
+ for (i = 0; i < G_N_ELEMENTS (prop_info); i ++) {
gboolean include;
gboolean new_prop_present = FALSE;
gboolean current_prop_present = FALSE;
@@ -3768,13 +3766,13 @@ func_contains(struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointer
query_length = 3; /* strlen ("(|") + strlen (")") */
- for (i = 0; i < num_prop_infos; i ++) {
+ for (i = 0; i < G_N_ELEMENTS (prop_info); i ++) {
query_length += 1 /* strlen ("(") */ + strlen(prop_info[i].ldap_attr) + strlen (match_str);
}
big_query = g_malloc0(query_length + 1);
strcat (big_query, "(|");
- for (i = 0; i < num_prop_infos; i ++) {
+ for (i = 0; i < G_N_ELEMENTS (prop_info); i ++) {
strcat (big_query, "(");
strcat (big_query, prop_info[i].ldap_attr);
strcat (big_query, match_str);
@@ -3942,13 +3940,13 @@ func_exists(struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointer da
query_length = 3; /* strlen ("(|") + strlen (")") */
- for (i = 0; i < num_prop_infos; i ++) {
+ for (i = 0; i < G_N_ELEMENTS (prop_info); i ++) {
query_length += 1 /* strlen ("(") */ + strlen(prop_info[i].ldap_attr) + strlen (match_str);
}
big_query = g_malloc0(query_length + 1);
strcat (big_query, "(|");
- for (i = 0; i < num_prop_infos; i ++) {
+ for (i = 0; i < G_N_ELEMENTS (prop_info); i ++) {
strcat (big_query, "(");
strcat (big_query, prop_info[i].ldap_attr);
strcat (big_query, match_str);
@@ -4006,7 +4004,7 @@ e_book_backend_ldap_build_query (EBookBackendLDAP *bl, const gchar *query)
sexp = e_sexp_new();
- for (i=0;i<sizeof(symbols)/sizeof(symbols[0]);i++) {
+ for (i = 0; i < G_N_ELEMENTS (symbols); i++) {
if (symbols[i].type == 1) {
e_sexp_add_ifunction(sexp, 0, symbols[i].name,
(ESExpIFunc *)symbols[i].func, &data);
@@ -4062,7 +4060,7 @@ query_prop_to_ldap (gchar *query_prop)
{
gint i;
- for (i = 0; i < num_prop_infos; i ++)
+ for (i = 0; i < G_N_ELEMENTS (prop_info); i ++)
if (!strcmp (query_prop, e_contact_field_name (prop_info[i].field_id)))
return prop_info[i].ldap_attr;
@@ -4133,7 +4131,7 @@ build_contact_from_entry (EBookBackendLDAP *bl,
ldap_value_free (values);
}
else {
- for (i = 0; i < num_prop_infos; i ++)
+ for (i = 0; i < G_N_ELEMENTS (prop_info); i ++)
if (!g_ascii_strcasecmp (attr, prop_info[i].ldap_attr)) {
info = &prop_info[i];
break;
diff --git a/addressbook/libebook/e-book-query.c b/addressbook/libebook/e-book-query.c
index d86133a..1ea7416 100644
--- a/addressbook/libebook/e-book-query.c
+++ b/addressbook/libebook/e-book-query.c
@@ -609,7 +609,7 @@ e_book_query_from_string (const gchar *query_string)
sexp = e_sexp_new();
- for (i=0;i<sizeof(symbols)/sizeof(symbols[0]);i++) {
+ for (i = 0; i < G_N_ELEMENTS (symbols); i++) {
if (symbols[i].type == 1) {
e_sexp_add_ifunction(sexp, 0, symbols[i].name,
(ESExpIFunc *)symbols[i].func, &list);
diff --git a/addressbook/libedata-book/e-book-backend-sexp.c b/addressbook/libedata-book/e-book-backend-sexp.c
index b517aa3..de16beb 100644
--- a/addressbook/libedata-book/e-book-backend-sexp.c
+++ b/addressbook/libedata-book/e-book-backend-sexp.c
@@ -870,7 +870,7 @@ e_book_backend_sexp_new (const gchar *text)
sexp->priv->search_sexp = e_sexp_new();
- for (i=0;i<sizeof(symbols)/sizeof(symbols[0]);i++) {
+ for (i = 0; i < G_N_ELEMENTS (symbols); i++) {
if (symbols[i].type == 1) {
e_sexp_add_ifunction(sexp->priv->search_sexp, 0, symbols[i].name,
(ESExpIFunc *)symbols[i].func, sexp->priv->search_context);
diff --git a/addressbook/libedata-book/e-book-backend-summary.c b/addressbook/libedata-book/e-book-backend-summary.c
index fd6fd10..84d1b9a 100644
--- a/addressbook/libedata-book/e-book-backend-summary.c
+++ b/addressbook/libedata-book/e-book-backend-summary.c
@@ -990,7 +990,7 @@ e_book_backend_summary_is_summary_query (EBookBackendSummary *summary, const gch
sexp = e_sexp_new();
- for (i=0;i<sizeof(check_symbols)/sizeof(check_symbols[0]);i++) {
+ for (i = 0; i < G_N_ELEMENTS (check_symbols); i++) {
if (check_symbols[i].type == 1) {
e_sexp_add_ifunction(sexp, 0, check_symbols[i].name,
(ESExpIFunc *)check_symbols[i].func, summary);
@@ -1215,7 +1215,7 @@ e_book_backend_summary_search (EBookBackendSummary *summary, const gchar *query)
sexp = e_sexp_new();
- for (i=0;i<sizeof(symbols)/sizeof(symbols[0]);i++) {
+ for (i = 0; i < G_N_ELEMENTS (symbols); i++) {
if (symbols[i].type == 1) {
e_sexp_add_ifunction(sexp, 0, symbols[i].name,
(ESExpIFunc *)symbols[i].func, summary);
diff --git a/calendar/libecal/e-cal-component.c b/calendar/libecal/e-cal-component.c
index af556dd..30faa54 100644
--- a/calendar/libecal/e-cal-component.c
+++ b/calendar/libecal/e-cal-component.c
@@ -3882,7 +3882,7 @@ e_cal_component_has_simple_recurrence (ECalComponent *comp)
goto cleanup;
/* Any funky BY_* */
-#define N_HAS_BY(field) (count_by_xxx (field, sizeof (field) / sizeof (field[0])))
+#define N_HAS_BY(field) (count_by_xxx (field, G_N_ELEMENTS (field)))
n_by_second = N_HAS_BY (r->by_second);
n_by_minute = N_HAS_BY (r->by_minute);
diff --git a/calendar/libecal/e-cal-recur.c b/calendar/libecal/e-cal-recur.c
index 490f7ca..794aa3d 100644
--- a/calendar/libecal/e-cal-recur.c
+++ b/calendar/libecal/e-cal-recur.c
@@ -980,26 +980,22 @@ e_cal_recur_from_icalproperty (icalproperty *prop, gboolean exception,
r->week_start_day = e_cal_recur_ical_weekday_to_weekday (ir.week_start);
- r->bymonth = array_to_list (ir.by_month,
- sizeof (ir.by_month) / sizeof (ir.by_month[0]));
+ r->bymonth = array_to_list (ir.by_month, G_N_ELEMENTS (ir.by_month));
for (elem = r->bymonth; elem; elem = elem->next) {
/* We need to convert from 1-12 to 0-11, i.e. subtract 1. */
gint month = GPOINTER_TO_INT (elem->data) - 1;
elem->data = GINT_TO_POINTER (month);
}
- r->byweekno = array_to_list (ir.by_week_no,
- sizeof (ir.by_week_no) / sizeof (ir.by_week_no[0]));
+ r->byweekno = array_to_list (ir.by_week_no, G_N_ELEMENTS (ir.by_week_no));
- r->byyearday = array_to_list (ir.by_year_day,
- sizeof (ir.by_year_day) / sizeof (ir.by_year_day[0]));
+ r->byyearday = array_to_list (ir.by_year_day, G_N_ELEMENTS (ir.by_year_day));
- r->bymonthday = array_to_list (ir.by_month_day,
- sizeof (ir.by_month_day) / sizeof (ir.by_month_day[0]));
+ r->bymonthday = array_to_list (ir.by_month_day, G_N_ELEMENTS (ir.by_month_day));
/* FIXME: libical only supports 8 values, out of possible 107 * 7. */
r->byday = NULL;
- max_elements = sizeof (ir.by_day) / sizeof (ir.by_day[0]);
+ max_elements = G_N_ELEMENTS (ir.by_day);
for (i = 0; i < max_elements && ir.by_day[i] != ICAL_RECURRENCE_ARRAY_MAX; i++) {
enum icalrecurrencetype_weekday day;
gint weeknum, weekday;
@@ -1015,17 +1011,13 @@ e_cal_recur_from_icalproperty (icalproperty *prop, gboolean exception,
GINT_TO_POINTER (weekday));
}
- r->byhour = array_to_list (ir.by_hour,
- sizeof (ir.by_hour) / sizeof (ir.by_hour[0]));
+ r->byhour = array_to_list (ir.by_hour, G_N_ELEMENTS (ir.by_hour));
- r->byminute = array_to_list (ir.by_minute,
- sizeof (ir.by_minute) / sizeof (ir.by_minute[0]));
+ r->byminute = array_to_list (ir.by_minute, G_N_ELEMENTS (ir.by_minute));
- r->bysecond = array_to_list (ir.by_second,
- sizeof (ir.by_second) / sizeof (ir.by_second[0]));
+ r->bysecond = array_to_list (ir.by_second, G_N_ELEMENTS (ir.by_second));
- r->bysetpos = array_to_list (ir.by_set_pos,
- sizeof (ir.by_set_pos) / sizeof (ir.by_set_pos[0]));
+ r->bysetpos = array_to_list (ir.by_set_pos, G_N_ELEMENTS (ir.by_set_pos));
return r;
}
diff --git a/calendar/libedata-cal/e-cal-backend-sexp.c b/calendar/libedata-cal/e-cal-backend-sexp.c
index f94248b..4d84c7b 100644
--- a/calendar/libedata-cal/e-cal-backend-sexp.c
+++ b/calendar/libedata-cal/e-cal-backend-sexp.c
@@ -1167,7 +1167,6 @@ static struct prop_info {
LIST_PROP ( "category", "category", compare_category ),
LIST_PROP ( "arbitrary", "arbitrary", compare_arbitrary )
};
-static gint num_prop_infos = sizeof(prop_info_table) / sizeof(prop_info_table[0]);
static ESExpResult *
entry_compare(SearchContext *ctx, struct _ESExp *f,
@@ -1188,7 +1187,7 @@ entry_compare(SearchContext *ctx, struct _ESExp *f,
propname = argv[0]->value.string;
any_field = !strcmp(propname, "x-evolution-any-field");
- for (i = 0; i < num_prop_infos; i ++) {
+ for (i = 0; i < G_N_ELEMENTS (prop_info_table); i ++) {
if (any_field
|| !strcmp (prop_info_table[i].query_prop, propname)) {
info = &prop_info_table[i];
diff --git a/camel/camel-charset-map.c b/camel/camel-charset-map.c
index 3c6b61e..dec0ee8 100644
--- a/camel/camel-charset-map.c
+++ b/camel/camel-charset-map.c
@@ -140,7 +140,7 @@ gint main (gint argc, gchar **argv)
iconv_t cd;
/* dont count the terminator */
- bytes = ((sizeof (tables) / sizeof (tables[0])) + 7 - 1) / 8;
+ bytes = (G_N_ELEMENTS (tables) + 7 - 1) / 8;
g_assert (bytes <= 4);
for (i = 0; i < 128; i++)
diff --git a/camel/camel-disco-folder.c b/camel/camel-disco-folder.c
index d3a5887..b734115 100644
--- a/camel/camel-disco-folder.c
+++ b/camel/camel-disco-folder.c
@@ -175,7 +175,7 @@ camel_disco_folder_get_type (void)
(CamelObjectClassInitFunc)camel_disco_folder_class_init, NULL,
(CamelObjectInitFunc)camel_disco_folder_init, NULL);
- for (i=0;i<sizeof(disco_property_list)/sizeof(disco_property_list[0]);i++) {
+ for (i = 0; i < G_N_ELEMENTS (disco_property_list); i++) {
disco_property_list[i].description = _(disco_property_list[i].description);
disco_folder_properties = g_slist_prepend(disco_folder_properties, &disco_property_list[i]);
}
diff --git a/camel/camel-filter-driver.c b/camel/camel-filter-driver.c
index 75080fc..cdfe7cc 100644
--- a/camel/camel-filter-driver.c
+++ b/camel/camel-filter-driver.c
@@ -218,7 +218,7 @@ camel_filter_driver_init (CamelFilterDriver *obj)
p->eval = e_sexp_new ();
/* Load in builtin symbols */
- for (i = 0; i < sizeof (symbols) / sizeof (symbols[0]); i++) {
+ for (i = 0; i < G_N_ELEMENTS (symbols); i++) {
if (symbols[i].type == 1) {
e_sexp_add_ifunction (p->eval, 0, symbols[i].name, (ESExpIFunc *)symbols[i].func, obj);
} else {
diff --git a/camel/camel-filter-search.c b/camel/camel-filter-search.c
index e67a6c3..01afb29 100644
--- a/camel/camel-filter-search.c
+++ b/camel/camel-filter-search.c
@@ -721,7 +721,7 @@ camel_filter_search_match (CamelSession *session,
sexp = e_sexp_new ();
- for (i = 0; i < sizeof (symbols) / sizeof (symbols[0]); i++) {
+ for (i = 0; i < G_N_ELEMENTS (symbols); i++) {
if (symbols[i].type == 1)
e_sexp_add_ifunction (sexp, 0, symbols[i].name, (ESExpIFunc *)symbols[i].func, &fms);
else
diff --git a/camel/camel-folder-search.c b/camel/camel-folder-search.c
index cb28863..24292fa 100644
--- a/camel/camel-folder-search.c
+++ b/camel/camel-folder-search.c
@@ -224,7 +224,7 @@ camel_folder_search_construct (CamelFolderSearch *search)
gint i;
CamelFolderSearchClass *klass = (CamelFolderSearchClass *)CAMEL_OBJECT_GET_CLASS(search);
- for (i=0;i<sizeof(builtins)/sizeof(builtins[0]);i++) {
+ for (i = 0; i < G_N_ELEMENTS (builtins); i++) {
gpointer func;
/* c is sure messy sometimes */
func = *((gpointer *)(((gchar *)klass)+builtins[i].offset));
diff --git a/camel/camel-folder-summary.c b/camel/camel-folder-summary.c
index cdd3d04..060c3a3 100644
--- a/camel/camel-folder-summary.c
+++ b/camel/camel-folder-summary.c
@@ -2577,11 +2577,9 @@ static const gchar * tokens[] = {
"us-ascii", /* 25 words */
};
-#define tokens_len (sizeof(tokens)/sizeof(tokens[0]))
-
/* baiscally ...
0 = null
- 1-tokens_len == tokens[id-1]
+ 1-len(tokens) == tokens[id-1]
>=32 string, length = n-32
*/
@@ -2624,11 +2622,11 @@ camel_folder_summary_encode_token(FILE *out, const gchar *str)
lower[i] = tolower(str[i]);
lower[i] = 0;
#ifdef USE_BSEARCH
- match = bsearch(lower, tokens, tokens_len, sizeof(gchar *), (gint (*)(gconstpointer , gconstpointer ))token_search_cmp);
+ match = bsearch(lower, tokens, G_N_ELEMENTS (tokens), sizeof(gchar *), (gint (*)(gconstpointer , gconstpointer ))token_search_cmp);
if (match)
token = match-tokens;
#else
- for (i=0;i<tokens_len;i++) {
+ for (i = 0; i < G_N_ELEMENTS (tokens); i++) {
if (!strcmp(tokens[i], lower)) {
token = i;
break;
@@ -2674,7 +2672,7 @@ camel_folder_summary_decode_token(FILE *in, gchar **str)
if (len<32) {
if (len <= 0) {
ret = NULL;
- } else if (len<= tokens_len) {
+ } else if (len<= G_N_ELEMENTS (tokens)) {
ret = g_strdup(tokens[len-1]);
} else {
io(printf ("Invalid token encountered: %d", len));
diff --git a/camel/camel-html-parser.c b/camel/camel-html-parser.c
index 5c9ca8f..4efa277 100644
--- a/camel/camel-html-parser.c
+++ b/camel/camel-html-parser.c
@@ -466,7 +466,7 @@ static void tokenise_setup(void)
if (entities == NULL) {
entities = g_hash_table_new(g_str_hash, g_str_equal);
- for (i=0;i<sizeof(entity_map)/sizeof(entity_map[0]);i++) {
+ for (i = 0; i < G_N_ELEMENTS (entity_map); i++) {
g_hash_table_insert(entities, (gchar *)entity_map[i].name, GUINT_TO_POINTER(entity_map[i].val));
}
}
diff --git a/camel/camel-mime-filter-enriched.c b/camel/camel-mime-filter-enriched.c
index ed3cac0..992408a 100644
--- a/camel/camel-mime-filter-enriched.c
+++ b/camel/camel-mime-filter-enriched.c
@@ -88,8 +88,6 @@ static struct {
{ "/param", " -->", FALSE, NULL },
};
-#define NUM_ENRICHED_TAGS (sizeof (enriched_tags) / sizeof (enriched_tags[0]))
-
static GHashTable *enriched_hash = NULL;
static void camel_mime_filter_enriched_class_init (CamelMimeFilterEnrichedClass *klass);
@@ -137,7 +135,7 @@ camel_mime_filter_enriched_class_init (CamelMimeFilterEnrichedClass *klass)
if (!enriched_hash) {
enriched_hash = g_hash_table_new (camel_strcase_hash, camel_strcase_equal);
- for (i = 0; i < NUM_ENRICHED_TAGS; i++)
+ for (i = 0; i < G_N_ELEMENTS (enriched_tags); i++)
g_hash_table_insert (
enriched_hash,
(gpointer) enriched_tags[i].enriched,
@@ -164,7 +162,7 @@ enriched_tag_needs_param (const gchar *tag)
{
gint i;
- for (i = 0; i < NUM_ENRICHED_TAGS; i++)
+ for (i = 0; i < G_N_ELEMENTS (enriched_tags); i++)
if (!g_ascii_strcasecmp (tag, enriched_tags[i].enriched))
return enriched_tags[i].needs_param;
@@ -182,8 +180,6 @@ static const gchar *valid_colours[] = {
"red", "green", "blue", "yellow", "cyan", "magenta", "black", "white"
};
-#define NUM_VALID_COLOURS (sizeof (valid_colours) / sizeof (valid_colours[0]))
-
static gchar *
param_parse_colour (const gchar *inptr, gint inlen)
{
@@ -192,7 +188,7 @@ param_parse_colour (const gchar *inptr, gint inlen)
guint v;
gint i;
- for (i = 0; i < NUM_VALID_COLOURS; i++) {
+ for (i = 0; i < G_N_ELEMENTS (valid_colours); i++) {
if (!g_ascii_strncasecmp (inptr, valid_colours[i], inlen))
return g_strdup (valid_colours[i]);
}
@@ -260,7 +256,7 @@ param_parse (const gchar *enriched, const gchar *inptr, gint inlen)
{
gint i;
- for (i = 0; i < NUM_ENRICHED_TAGS; i++) {
+ for (i = 0; i < G_N_ELEMENTS (enriched_tags); i++) {
if (!g_ascii_strcasecmp (enriched, enriched_tags[i].enriched))
return enriched_tags[i].parse_param (inptr, inlen);
}
diff --git a/camel/camel-mime-filter-html.c b/camel/camel-mime-filter-html.c
index 6832dbc..4cb0cc9 100644
--- a/camel/camel-mime-filter-html.c
+++ b/camel/camel-mime-filter-html.c
@@ -49,8 +49,6 @@ struct _CamelMimeFilterHTMLPrivate {
/* well we odnt use this stuff yet */
-#define ARRAY_LEN(x) (sizeof(x)/sizeof((x)[0]))
-
static struct {
gchar *element;
gchar *remap;
diff --git a/camel/camel-mime-filter-tohtml.c b/camel/camel-mime-filter-tohtml.c
index efff477..93e7be9 100644
--- a/camel/camel-mime-filter-tohtml.c
+++ b/camel/camel-mime-filter-tohtml.c
@@ -68,8 +68,6 @@ static struct {
{ CONVERT_ADDRSPEC, { "@", "mailto:", camel_url_addrspec_start, camel_url_addrspec_end } },
};
-#define NUM_URL_PATTERNS (sizeof (patterns) / sizeof (patterns[0]))
-
static void camel_mime_filter_tohtml_class_init (CamelMimeFilterToHTMLClass *klass);
static void camel_mime_filter_tohtml_init (CamelMimeFilterToHTML *filter);
static void camel_mime_filter_tohtml_finalize (CamelObject *obj);
@@ -456,7 +454,7 @@ camel_mime_filter_tohtml_new (guint32 flags, guint32 colour)
new->flags = flags;
new->colour = colour;
- for (i = 0; i < NUM_URL_PATTERNS; i++) {
+ for (i = 0; i < G_N_ELEMENTS (patterns); i++) {
if (patterns[i].mask & flags)
camel_url_scanner_add (new->scanner, &patterns[i].pattern);
}
diff --git a/camel/camel-mime-utils.c b/camel/camel-mime-utils.c
index fb2dbdb..d3abbd2 100644
--- a/camel/camel-mime-utils.c
+++ b/camel/camel-mime-utils.c
@@ -3046,7 +3046,7 @@ static const gchar *encodings[] = {
const gchar *
camel_transfer_encoding_to_string (CamelTransferEncoding encoding)
{
- if (encoding >= sizeof (encodings) / sizeof (encodings[0]))
+ if (encoding >= G_N_ELEMENTS (encodings))
encoding = 0;
return encodings[encoding];
@@ -3058,7 +3058,7 @@ camel_transfer_encoding_from_string (const gchar *string)
gint i;
if (string != NULL) {
- for (i = 0; i < sizeof (encodings) / sizeof (encodings[0]); i++)
+ for (i = 0; i < G_N_ELEMENTS (encodings); i++)
if (!g_ascii_strcasecmp (string, encodings[i]))
return i;
}
@@ -4540,7 +4540,7 @@ camel_header_raw_check_mailing_list(struct _camel_header_raw **list)
pthread_once(&mailing_list_init_once, mailing_list_init);
- for (i = 0; i < sizeof (mail_list_magic) / sizeof (mail_list_magic[0]); i++) {
+ for (i = 0; i < G_N_ELEMENTS (mail_list_magic); i++) {
v = camel_header_raw_find (list, mail_list_magic[i].name, NULL);
for (j=0;j<3;j++) {
match[j].rm_so = -1;
diff --git a/camel/camel-partition-table.c b/camel/camel-partition-table.c
index bf0bb3e..f721a34 100644
--- a/camel/camel-partition-table.c
+++ b/camel/camel-partition-table.c
@@ -383,8 +383,6 @@ camel_partition_table_add(CamelPartitionTable *cpi, const gchar *key, camel_key_
struct _CamelPartitionKey keys[CAMEL_BLOCK_SIZE/4];
gint ret = -1;
-#define KEY_SIZE (sizeof(kb->keys)/sizeof(kb->keys[0]))
-
hashid = hash_key(key);
CAMEL_PARTITION_TABLE_LOCK(cpi, lock);
@@ -403,7 +401,7 @@ camel_partition_table_add(CamelPartitionTable *cpi, const gchar *key, camel_key_
/* TODO: Keep the key array in sorted order, cheaper lookups and split operation */
- if (kb->used < sizeof(kb->keys)/sizeof(kb->keys[0])) {
+ if (kb->used < G_N_ELEMENTS (kb->keys)) {
/* Have room, just put it in */
kb->keys[kb->used].hashid = hashid;
kb->keys[kb->used].keyid = keyid;
@@ -431,8 +429,8 @@ camel_partition_table_add(CamelPartitionTable *cpi, const gchar *key, camel_key_
nkb = (CamelPartitionKeyBlock *)&nblock->data;
}
- if (pblock && pkb->used < KEY_SIZE) {
- if (nblock && nkb->used < KEY_SIZE) {
+ if (pblock && pkb->used < G_N_ELEMENTS (kb->keys)) {
+ if (nblock && nkb->used < G_N_ELEMENTS (kb->keys)) {
if (pkb->used < nkb->used) {
newindex = index+1;
newblock = nblock;
@@ -445,7 +443,7 @@ camel_partition_table_add(CamelPartitionTable *cpi, const gchar *key, camel_key_
newblock = pblock;
}
} else {
- if (nblock && nkb->used < KEY_SIZE) {
+ if (nblock && nkb->used < G_N_ELEMENTS (kb->keys)) {
newindex = index+1;
newblock = nblock;
}
@@ -454,7 +452,7 @@ camel_partition_table_add(CamelPartitionTable *cpi, const gchar *key, camel_key_
/* We had no room, need to split across another block */
if (newblock == NULL) {
/* See if we have room in the partition table for this block or need to split that too */
- if (ptb->used >= sizeof(ptb->partition)/sizeof(ptb->partition[0])) {
+ if (ptb->used >= G_N_ELEMENTS (ptb->partition)) {
/* TODO: Could check next block to see if it'll fit there first */
ptnblock = camel_block_file_new_block(cpi->blocks);
if (ptnblock == NULL) {
diff --git a/camel/camel-search-sql-sexp.c b/camel/camel-search-sql-sexp.c
index a6d432d..97928d5 100644
--- a/camel/camel-search-sql-sexp.c
+++ b/camel/camel-search-sql-sexp.c
@@ -598,7 +598,7 @@ camel_sexp_to_sql_sexp (const gchar *sql)
sexp = e_sexp_new();
- for (i=0;i<sizeof(symbols)/sizeof(symbols[0]);i++) {
+ for (i = 0; i < G_N_ELEMENTS (symbols); i++) {
if (symbols[i].immediate)
e_sexp_add_ifunction(sexp, 0, symbols[i].name,
(ESExpIFunc *) symbols[i].func, NULL);
diff --git a/camel/camel-text-index.c b/camel/camel-text-index.c
index f696fd7..8b9bb42 100644
--- a/camel/camel-text-index.c
+++ b/camel/camel-text-index.c
@@ -238,7 +238,7 @@ text_index_add_name_to_word(CamelIndex *idx, const gchar *word, camel_key_t name
camel_dlist_addhead(&p->word_cache, (CamelDListNode *)w);
w->names[w->used] = nameid;
w->used++;
- if (w->used == sizeof(w->names)/sizeof(w->names[0])) {
+ if (w->used == G_N_ELEMENTS (w->names)) {
io(printf("writing key file entry '%s' [%x]\n", w->word, w->data));
if (camel_key_file_write(p->links, &w->data, w->used, w->names) != -1) {
rb->keys++;
@@ -453,7 +453,7 @@ text_index_compress_nosync(CamelIndex *idx)
newkeyid = (camel_key_t)GPOINTER_TO_INT(g_hash_table_lookup(remap, GINT_TO_POINTER(records[i])));
if (newkeyid) {
newrecords[newcount++] = newkeyid;
- if (newcount == sizeof(newrecords)/sizeof(newrecords[0])) {
+ if (newcount == G_N_ELEMENTS (newrecords)) {
if (camel_key_file_write(newp->links, &newdata, newcount, newrecords) == -1) {
g_free(records);
goto fail;
@@ -1056,7 +1056,7 @@ add_partition(GHashTable *map, CamelBlockFile *blocks, camel_block_t id)
}
pm = (CamelPartitionMapBlock *)&bl->data;
- if (pm->used > sizeof(pm->partition)/sizeof(pm->partition[0])) {
+ if (pm->used > G_N_ELEMENTS (pm->partition)) {
g_warning("Partition block %x invalid\n", id);
camel_block_file_unref_block(blocks, bl);
return;
diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c
index 0b1abb0..90ee0d4 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 52dedcb..533b75a 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 f1223f7..16c3b15 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 1ce89fc..5b2890c 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 e490634..8cc0c9e 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 43ca1c2..95ab871 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 b4fbe3e..200a09d 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 ad4e217..0bc1736 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;
}
diff --git a/camel/tests/folder/test1.c b/camel/tests/folder/test1.c
index 639b1c0..6261b1d 100644
--- a/camel/tests/folder/test1.c
+++ b/camel/tests/folder/test1.c
@@ -9,8 +9,6 @@
#include <camel/camel-service.h>
#include <camel/camel-store.h>
-#define ARRAY_LEN(x) (sizeof(x)/sizeof(x[0]))
-
static const gchar *local_drivers[] = {
"local"
};
@@ -41,7 +39,7 @@ gint main(gint argc, gchar **argv)
/* todo: cross-check everything with folder_info checks as well */
/* todo: subscriptions? */
/* todo: work out how to do imap/pop/nntp tests */
- for (i=0;i<ARRAY_LEN(local_providers);i++) {
+ for (i = 0; i < G_N_ELEMENTS (local_providers); i++) {
path = g_strdup_printf("%s:///tmp/camel-test/%s", local_providers[i], local_providers[i]);
test_folder_basic(session, path, TRUE, FALSE);
diff --git a/camel/tests/folder/test10.c b/camel/tests/folder/test10.c
index 493adab..2c980b5 100644
--- a/camel/tests/folder/test10.c
+++ b/camel/tests/folder/test10.c
@@ -18,8 +18,6 @@
#define d(x)
-#define ARRAY_LEN(x) (sizeof(x)/sizeof(x[0]))
-
static const gchar *local_drivers[] = { "local" };
static gchar *local_providers[] = {
"mbox",
@@ -80,7 +78,7 @@ gint main(gint argc, gchar **argv)
else
camel_test_start("store and folder bag torture test, unstacked references");
- for (j=0;j<ARRAY_LEN(local_providers);j++) {
+ for (j = 0; j < G_N_ELEMENTS (local_providers); j++) {
camel_test_push("provider %s", local_providers[j]);
path = g_strdup_printf("%s:///tmp/camel-test/%s", local_providers[j], local_providers[j]);
diff --git a/camel/tests/folder/test11.c b/camel/tests/folder/test11.c
index ee53b28..fe20aaf 100644
--- a/camel/tests/folder/test11.c
+++ b/camel/tests/folder/test11.c
@@ -17,8 +17,6 @@
#define d(x)
-#define ARRAY_LEN(x) (sizeof(x)/sizeof(x[0]))
-
static const gchar *local_drivers[] = { "local" };
static CamelSession *session;
@@ -164,21 +162,21 @@ gint main(gint argc, gchar **argv)
fi = camel_store_get_folder_info(store, "", CAMEL_STORE_FOLDER_INFO_RECURSIVE, ex);
check_msg(!camel_exception_is_set(ex), "%s", camel_exception_get_description(ex));
check(fi != NULL);
- check_fi(fi, fi_list_1, ARRAY_LEN(fi_list_1));
+ check_fi(fi, fi_list_1, G_N_ELEMENTS (fi_list_1));
camel_test_pull();
camel_test_push("folder info, flat");
fi = camel_store_get_folder_info(store, "", 0, ex);
check_msg(!camel_exception_is_set(ex), "%s", camel_exception_get_description(ex));
check(fi != NULL);
- check_fi(fi, fi_list_2, ARRAY_LEN(fi_list_2));
+ check_fi(fi, fi_list_2, G_N_ELEMENTS (fi_list_2));
camel_test_pull();
camel_test_push("folder info, recursive, non root");
fi = camel_store_get_folder_info(store, "testbox", CAMEL_STORE_FOLDER_INFO_RECURSIVE, ex);
check_msg(!camel_exception_is_set(ex), "%s", camel_exception_get_description(ex));
check(fi != NULL);
- check_fi(fi, fi_list_3, ARRAY_LEN(fi_list_3));
+ check_fi(fi, fi_list_3, G_N_ELEMENTS (fi_list_3));
camel_test_pull();
check_unref(store, 1);
diff --git a/camel/tests/folder/test2.c b/camel/tests/folder/test2.c
index dd265dc..a7c07cc 100644
--- a/camel/tests/folder/test2.c
+++ b/camel/tests/folder/test2.c
@@ -18,8 +18,6 @@
#include <camel/camel-folder-summary.h>
#include <camel/camel-mime-message.h>
-#define ARRAY_LEN(x) (sizeof(x)/sizeof(x[0]))
-
static const gchar *local_drivers[] = { "local" };
static gchar *stores[] = {
@@ -45,7 +43,7 @@ gint main(gint argc, gchar **argv)
session = camel_test_session_new ("/tmp/camel-test");
/* we iterate over all stores we want to test, with indexing or indexing turned on or off */
- for (i=0;i<ARRAY_LEN(stores);i++) {
+ for (i = 0; i < G_N_ELEMENTS (stores); i++) {
gchar *name = stores[i];
test_folder_message_ops(session, name, TRUE, "testbox");
diff --git a/camel/tests/folder/test3.c b/camel/tests/folder/test3.c
index e3bc7aa..97fb0c6 100644
--- a/camel/tests/folder/test3.c
+++ b/camel/tests/folder/test3.c
@@ -16,8 +16,6 @@
#include <camel/camel-folder-summary.h>
#include <camel/camel-mime-message.h>
-#define ARRAY_LEN(x) (sizeof(x)/sizeof(x[0]))
-
static void
test_folder_search_sub(CamelFolder *folder, const gchar *expr, gint expected)
{
@@ -130,7 +128,7 @@ run_search(CamelFolder *folder, gint m)
j = 2;
push("performing searches, expected %d", m);
- for (i=0;i<ARRAY_LEN(searches);i++) {
+ for (i = 0; i < G_N_ELEMENTS (searches); i++) {
push("running search %d: %s", i, searches[i].expr);
test_folder_search(folder, searches[i].expr, searches[i].counts[j]);
pull();
@@ -171,7 +169,7 @@ gint main(gint argc, gchar **argv)
/* todo: work out how to do imap/pop/nntp tests */
/* we iterate over all stores we want to test, with indexing or indexing turned on or off */
- for (i=0;i<ARRAY_LEN(stores);i++) {
+ for (i = 0; i < G_N_ELEMENTS (stores); i++) {
gchar *name = stores[i];
for (indexed = 0;indexed<2;indexed++) {
gchar *what = g_strdup_printf("folder search: %s (%sindexed)", name, indexed?"":"non-");
diff --git a/camel/tests/folder/test4.c b/camel/tests/folder/test4.c
index 11072a5..411b0c5 100644
--- a/camel/tests/folder/test4.c
+++ b/camel/tests/folder/test4.c
@@ -9,8 +9,6 @@
#include <camel/camel-service.h>
#include <camel/camel-store.h>
-#define ARRAY_LEN(x) (sizeof(x)/sizeof(x[0]))
-
static const gchar *imap_drivers[] = { "imap4" };
static gchar *remote_providers[] = {
@@ -36,7 +34,7 @@ gint main(gint argc, gchar **argv)
/* todo: cross-check everything with folder_info checks as well */
/* todo: subscriptions? */
- for (i=0;i<ARRAY_LEN(remote_providers);i++) {
+ for (i = 0; i < G_N_ELEMENTS (remote_providers); i++) {
path = getenv(remote_providers[i]);
if (path == NULL) {
diff --git a/camel/tests/folder/test5.c b/camel/tests/folder/test5.c
index 16b786a..f2a0a8f 100644
--- a/camel/tests/folder/test5.c
+++ b/camel/tests/folder/test5.c
@@ -9,8 +9,6 @@
#include <camel/camel-service.h>
#include <camel/camel-store.h>
-#define ARRAY_LEN(x) (sizeof(x)/sizeof(x[0]))
-
static const gchar *nntp_drivers[] = { "nntp" };
static gchar *remote_providers[] = {
@@ -36,7 +34,7 @@ gint main(gint argc, gchar **argv)
/* todo: cross-check everything with folder_info checks as well */
/* todo: subscriptions? */
- for (i=0;i<ARRAY_LEN(remote_providers);i++) {
+ for (i = 0; i < G_N_ELEMENTS (remote_providers); i++) {
path = getenv(remote_providers[i]);
if (path == NULL) {
diff --git a/camel/tests/folder/test6.c b/camel/tests/folder/test6.c
index 84c8b48..900a87b 100644
--- a/camel/tests/folder/test6.c
+++ b/camel/tests/folder/test6.c
@@ -13,8 +13,6 @@
#include <camel/camel-folder-summary.h>
#include <camel/camel-mime-message.h>
-#define ARRAY_LEN(x) (sizeof(x)/sizeof(x[0]))
-
static const gchar *imap_drivers[] = { "imap4" };
static gchar *remote_providers[] = {
"IMAP_TEST_URL",
@@ -37,7 +35,7 @@ gint main(gint argc, gchar **argv)
session = camel_test_session_new ("/tmp/camel-test");
- for (i=0;i<ARRAY_LEN(remote_providers);i++) {
+ for (i = 0; i < G_N_ELEMENTS (remote_providers); i++) {
path = getenv(remote_providers[i]);
if (path == NULL) {
diff --git a/camel/tests/folder/test7.c b/camel/tests/folder/test7.c
index cd88517..7dec571 100644
--- a/camel/tests/folder/test7.c
+++ b/camel/tests/folder/test7.c
@@ -14,8 +14,6 @@
#include <camel/camel-folder-summary.h>
#include <camel/camel-mime-message.h>
-#define ARRAY_LEN(x) (sizeof(x)/sizeof(x[0]))
-
static const gchar *nntp_drivers[] = { "nntp" };
static gchar *remote_providers[] = {
"NNTP_TEST_URL",
@@ -38,7 +36,7 @@ gint main(gint argc, gchar **argv)
session = camel_test_session_new ("/tmp/camel-test");
- for (i=0;i<ARRAY_LEN(remote_providers);i++) {
+ for (i = 0; i < G_N_ELEMENTS (remote_providers); i++) {
path = getenv(remote_providers[i]);
if (path == NULL) {
diff --git a/camel/tests/folder/test8.c b/camel/tests/folder/test8.c
index a42cbac..f2c2e1c 100644
--- a/camel/tests/folder/test8.c
+++ b/camel/tests/folder/test8.c
@@ -18,8 +18,6 @@
#define d(x)
-#define ARRAY_LEN(x) (sizeof(x)/sizeof(x[0]))
-
static const gchar *local_drivers[] = { "local" };
static gchar *local_providers[] = {
@@ -147,7 +145,7 @@ gint main(gint argc, gchar **argv)
session = camel_test_session_new ("/tmp/camel-test");
- for (j=0;j<ARRAY_LEN(local_providers);j++) {
+ for (j = 0; j < G_N_ELEMENTS (local_providers); j++) {
for (index=0;index<2;index++) {
path = g_strdup_printf("method %s %s", local_providers[j], index?"indexed":"nonindexed");
camel_test_start(path);
diff --git a/camel/tests/folder/test9.c b/camel/tests/folder/test9.c
index fa9cb06..326064c 100644
--- a/camel/tests/folder/test9.c
+++ b/camel/tests/folder/test9.c
@@ -18,8 +18,6 @@
#include "camel/camel-filter-driver.h"
#include "camel/camel-stream-fs.h"
-#define ARRAY_LEN(x) (sizeof(x)/sizeof(x[0]))
-
static const gchar *local_drivers[] = { "local" };
struct {
@@ -81,7 +79,7 @@ static CamelFolder *get_folder(CamelFilterDriver *d, const gchar *uri, gpointer
{
gint i;
- for (i=0;i<ARRAY_LEN(mailboxes);i++)
+ for (i = 0; i < G_N_ELEMENTS (mailboxes); i++)
if (!strcmp(mailboxes[i].name, uri)) {
camel_object_ref((CamelObject *)mailboxes[i].folder);
return mailboxes[i].folder;
@@ -122,7 +120,7 @@ gint main(gint argc, gchar **argv)
pull();
push("Creating output folders");
- for (i=0;i<ARRAY_LEN(mailboxes);i++) {
+ for (i = 0; i < G_N_ELEMENTS (mailboxes); i++) {
push("creating %s", mailboxes[i].name);
mailboxes[i].folder = folder = camel_store_get_folder(store, mailboxes[i].name, CAMEL_STORE_FOLDER_CREATE, ex);
check_msg(!camel_exception_is_set(ex), "%s", camel_exception_get_description(ex));
@@ -171,7 +169,7 @@ gint main(gint argc, gchar **argv)
push("Building filters");
driver = camel_filter_driver_new(session);
camel_filter_driver_set_folder_func(driver, get_folder, NULL);
- for (i=0;i<ARRAY_LEN(rules);i++) {
+ for (i = 0; i < G_N_ELEMENTS (rules); i++) {
camel_filter_driver_add_rule(driver, rules[i].name, rules[i].match, rules[i].action);
}
pull();
@@ -188,7 +186,7 @@ gint main(gint argc, gchar **argv)
/* this tests that invalid rules are caught */
push("Testing broken match rules");
- for (i=0;i<ARRAY_LEN(brokens);i++) {
+ for (i = 0; i < G_N_ELEMENTS (brokens); i++) {
push("rule %s", brokens[i].match);
driver = camel_filter_driver_new(session);
camel_filter_driver_set_folder_func(driver, get_folder, NULL);
@@ -202,7 +200,7 @@ gint main(gint argc, gchar **argv)
pull();
push("Testing broken action rules");
- for (i=0;i<ARRAY_LEN(brokena);i++) {
+ for (i = 0; i < G_N_ELEMENTS (brokena); i++) {
push("rule %s", brokena[i].action);
driver = camel_filter_driver_new(session);
camel_filter_driver_set_folder_func(driver, get_folder, NULL);
@@ -215,7 +213,7 @@ gint main(gint argc, gchar **argv)
}
pull();
- for (i=0;i<ARRAY_LEN(mailboxes);i++) {
+ for (i = 0; i < G_N_ELEMENTS (mailboxes); i++) {
check_unref(mailboxes[i].folder, 1);
}
diff --git a/camel/tests/message/test2.c b/camel/tests/message/test2.c
index 75635d8..f72290d 100644
--- a/camel/tests/message/test2.c
+++ b/camel/tests/message/test2.c
@@ -80,8 +80,6 @@ fail:
#define to_utf8(in, type) convert(in, type, "utf-8")
#define from_utf8(in, type) convert(in, "utf-8", type)
-#define ARRAY_LEN(x) (sizeof(x)/sizeof(x[0]))
-
gint main(gint argc, gchar **argv)
{
gint i;
@@ -220,7 +218,7 @@ gint main(gint argc, gchar **argv)
camel_test_start("CamelInternetAddress, I18N");
- for (i=0;i<ARRAY_LEN(test_lines);i++) {
+ for (i = 0;i < G_N_ELEMENTS (test_lines); i++) {
push("Testing text line %d (%s) '%s'", i, test_lines[i].type, test_lines[i].line);
addr = camel_internet_address_new();
@@ -295,7 +293,7 @@ gint main(gint argc, gchar **argv)
camel_test_start("CamelInternetAddress, I18N decode");
- for (i=0;i<ARRAY_LEN(test_address);i++) {
+ for (i = 0; i < G_N_ELEMENTS (test_address); i++) {
push("Testing address line %d '%s'", i, test_address[i].addr);
addr = camel_internet_address_new();
diff --git a/camel/tests/mime-filter/test1.c b/camel/tests/mime-filter/test1.c
index 4e67ef9..93bfb9e 100644
--- a/camel/tests/mime-filter/test1.c
+++ b/camel/tests/mime-filter/test1.c
@@ -64,7 +64,7 @@ main (gint argc, gchar **argv)
camel_test_start("canonicalisation filter tests");
- for (i=0;i<sizeof(tests)/sizeof(tests[0]);i++) {
+ for (i = 0; i < G_N_ELEMENTS (tests); i++) {
gint step;
camel_test_push("Data test %d '%s'\n", i, tests[i].in);
diff --git a/camel/tests/misc/split.c b/camel/tests/misc/split.c
index 841591b..fd78a27 100644
--- a/camel/tests/misc/split.c
+++ b/camel/tests/misc/split.c
@@ -33,7 +33,6 @@ static struct {
{ "\\\"escaped", 1, { { "\"escaped", CAMEL_SEARCH_WORD_COMPLEX } } },
};
-#define SPLIT_LENGTH (sizeof(split_tests)/sizeof(split_tests[0]))
static struct {
gchar *word;
@@ -53,8 +52,6 @@ static struct {
{ "\\\" \"quoted\"compl;ex\" simple", 4, { { "quoted", CAMEL_SEARCH_WORD_SIMPLE}, { "compl", CAMEL_SEARCH_WORD_SIMPLE }, { "ex", CAMEL_SEARCH_WORD_SIMPLE }, { "simple", CAMEL_SEARCH_WORD_SIMPLE } } },
};
-#define SIMPLE_LENGTH (sizeof(simple_tests)/sizeof(simple_tests[0]))
-
gint
main (gint argc, gchar **argv)
{
@@ -65,7 +62,7 @@ main (gint argc, gchar **argv)
camel_test_start("Search splitting");
- for (i=0; i<SPLIT_LENGTH; i++) {
+ for (i = 0; i < G_N_ELEMENTS (split_tests); i++) {
camel_test_push("split %d '%s'", i, split_tests[i].word);
words = camel_search_words_split(split_tests[i].word);
@@ -86,7 +83,7 @@ main (gint argc, gchar **argv)
camel_test_start("Search splitting - simple");
- for (i=0; i<SIMPLE_LENGTH; i++) {
+ for (i = 0; i < G_N_ELEMENTS (simple_tests); i++) {
camel_test_push("simple split %d '%s'", i, simple_tests[i].word);
tmp = camel_search_words_split(simple_tests[i].word);
diff --git a/camel/tests/misc/test1.c b/camel/tests/misc/test1.c
index 160d1b3..dc6affd 100644
--- a/camel/tests/misc/test1.c
+++ b/camel/tests/misc/test1.c
@@ -35,7 +35,7 @@ main (gint argc, gchar **argv)
camel_test_start("references decoding");
- for (i=0;i<sizeof(test1)/sizeof(test1[0]);i++) {
+ for (i = 0; i < G_N_ELEMENTS (test1); i++) {
struct _camel_header_references *head, *node;
camel_test_push("references decoding[%d] '%s'", i, test1[i].header);
diff --git a/camel/tests/misc/test2.c b/camel/tests/misc/test2.c
index aec3e58..7bc372d 100644
--- a/camel/tests/misc/test2.c
+++ b/camel/tests/misc/test2.c
@@ -72,7 +72,7 @@ main (gint argc, gchar **argv)
camel_test_start("Param list decoding");
- for (i=0;i<sizeof(test1)/sizeof(test1[0]);i++) {
+ for (i = 0; i < G_N_ELEMENTS (test1); i++) {
struct _camel_header_param *head, *node;
camel_test_push("param decoding[%d] '%s'", i, test1[i].list);
@@ -94,7 +94,7 @@ main (gint argc, gchar **argv)
camel_test_start("Param list encoding");
- for (i=0;i<sizeof(test2)/sizeof(test2[0]);i++) {
+ for (i = 0; i < G_N_ELEMENTS (test2); i++) {
struct _camel_header_param *head = NULL, *scan;
gchar *text;
diff --git a/camel/tests/misc/url.c b/camel/tests/misc/url.c
index 062b8d4..207e0fb 100644
--- a/camel/tests/misc/url.c
+++ b/camel/tests/misc/url.c
@@ -69,7 +69,6 @@ struct {
{ "pop://us%3ar host", "pop://us%3ar host" },
{ "pop://us%2fr host", "pop://us%2fr host" }
};
-gint num_tests = sizeof (tests) / sizeof (tests[0]);
gint
main (gint argc, gchar **argv)
@@ -101,7 +100,7 @@ main (gint argc, gchar **argv)
camel_test_pull ();
g_free (url_string);
- for (i = 0; i < num_tests; i++) {
+ for (i = 0; i < G_N_ELEMENTS (tests); i++) {
camel_test_push ("<%s> + <%s> = <%s>?", base, tests[i].url_string, tests[i].result);
url = camel_url_new_with_base (base_url, tests[i].url_string);
if (!url) {
diff --git a/camel/tests/misc/utf7.c b/camel/tests/misc/utf7.c
index 0aea68b..45d8d7b 100644
--- a/camel/tests/misc/utf7.c
+++ b/camel/tests/misc/utf7.c
@@ -41,7 +41,6 @@ static struct {
"\"The sayings of Confucius,\" James R. Ware, trans. &U,BTFw-:&ZYeB9FH6ckh5Pg-, 1980. (Chinese text with English translation)&Vttm+E6UfZM-, &W4tRQ066bOg-, &UxdOrA-: &Ti1XC2b4Xpc-, 1990.",
{ 0x0022, 0x0054, 0x0068, 0x0065, 0x0020, 0x0073, 0x0061, 0x0079, 0x0069, 0x006e, 0x0067, 0x0073, 0x0020, 0x006f, 0x0066, 0x0020, 0x0043, 0x006f, 0x006e, 0x0066, 0x0075, 0x0063, 0x0069, 0x0075, 0x0073, 0x002c, 0x0022, 0x0020, 0x004a, 0x0061, 0x006d, 0x0065, 0x0073, 0x0020, 0x0052, 0x002e, 0x0020, 0x0057, 0x0061, 0x0072, 0x0065, 0x002c, 0x0020, 0x0074, 0x0072, 0x0061, 0x006e, 0x0073, 0x002e, 0x0020, 0x0020, 0x53f0, 0x5317, 0x003a, 0x6587, 0x81f4, 0x51fa, 0x7248, 0x793e, 0x002c, 0x0020, 0x0031, 0x0039, 0x0038, 0x0030, 0x002e, 0x0020, 0x0020, 0x0028, 0x0043, 0x0068, 0x0069, 0x006e, 0x0065, 0x0073, 0x0065, 0x0020, 0x0074, 0x0065, 0x0078, 0x0074, 0x0020, 0x0077, 0x0069, 0x0074, 0x0068, 0x0020, 0x0045, 0x006e, 0x0067, 0x006c, 0x0069, 0x0073, 0x0068, 0x0020, 0x0074, 0x0072, 0x0061, 0x006e, 0x0073, 0x006c, 0x0061, 0x0074, 0x0069, 0x006f, 0x006e, 0x0029, 0x56db, 0x66f8, 0x4e94, 0x7d93, 0x002c, 0x0020, 0x5b8b, 0x5143, 0x4eba, 0x6ce8, 0x002c, 0x0020, 0x5317, 0x4eac, 0x003a, 0x0020,
0x0020, 0x4e2d, 0x570b, 0x66f8, 0x5e97, 0x002c, 0x0020, 0x0031, 0x0039, 0x0039, 0x0030, 0x002e, } },
};
-#define TESTS_LENGTH (sizeof(tests)/sizeof(tests[0]))
gint
main (gint argc, gchar **argv)
@@ -58,7 +57,7 @@ main (gint argc, gchar **argv)
camel_test_start("UTF8, UTF7 RFC1642+RFC2060");
- for (i=0; i<TESTS_LENGTH; i++) {
+ for (i = 0; i < G_N_ELEMENTS (tests); i++) {
camel_test_push("%2d: %s utf8 decode", i, tests[i].utf7);
p = tests[i].utf8;
diff --git a/camel/tests/stream/test3.c b/camel/tests/stream/test3.c
index 864b64c..d11015d 100644
--- a/camel/tests/stream/test3.c
+++ b/camel/tests/stream/test3.c
@@ -12,8 +12,6 @@
#include "camel/camel-stream-fs.h"
#include "camel/camel-seekable-substream.h"
-#define ARRAY_LEN(x) (sizeof(x)/sizeof(x[0]))
-
struct {
off_t lower, upper;
} ranges[] = {
@@ -48,7 +46,7 @@ gint main(gint argc, gchar **argv)
push("testing writing method %d", j);
ss = (CamelSeekableStream *)camel_stream_mem_new();
check(ss != NULL);
- for (i=0;i<ARRAY_LEN(ranges);i++) {
+ for (i = 0; i < G_N_ELEMENTS (ranges); i++) {
push("stream subrange %d-%d", ranges[i].lower, ranges[i].upper);
sus = (CamelSeekableSubstream *)camel_seekable_substream_new(ss, ranges[i].lower, ranges[i].upper);
check(sus != NULL);
@@ -77,7 +75,7 @@ gint main(gint argc, gchar **argv)
push("testing writing method %d", j);
ss = (CamelSeekableStream *)camel_stream_fs_new_with_name("stream.txt", O_RDWR|O_CREAT|O_TRUNC, 0600);
check(ss != NULL);
- for (i=0;i<ARRAY_LEN(ranges);i++) {
+ for (i = 0; i < G_N_ELEMENTS (ranges); i++) {
push("stream subrange %d-%d", ranges[i].lower, ranges[i].upper);
sus = (CamelSeekableSubstream *)camel_seekable_substream_new(ss, ranges[i].lower, ranges[i].upper);
check(sus != NULL);
diff --git a/libedataserver/e-account.c b/libedataserver/e-account.c
index 98b4c4a..7f72c0d 100644
--- a/libedataserver/e-account.c
+++ b/libedataserver/e-account.c
@@ -854,13 +854,13 @@ ea_setting_setup (void)
return;
ea_option_table = g_hash_table_new(g_str_hash, g_str_equal);
- for (i=0;i<sizeof(ea_option_list)/sizeof(ea_option_list[0]);i++)
+ for (i = 0; i < G_N_ELEMENTS (ea_option_list); i++)
g_hash_table_insert(ea_option_table, (gpointer) ea_option_list[i].key, &ea_option_list[i]);
gconf_client_add_dir(gconf, LOCK_BASE, GCONF_CLIENT_PRELOAD_NONE, NULL);
ea_system_table = g_hash_table_new(g_str_hash, g_str_equal);
- for (i=0;i<sizeof(system_perms)/sizeof(system_perms[0]);i++) {
+ for (i = 0; i < G_N_ELEMENTS (system_perms); i++) {
g_hash_table_insert(ea_system_table, (gchar *)system_perms[i].key, &system_perms[i]);
sprintf(key, LOCK_BASE "/%s", system_perms[i].key);
entry = gconf_client_get_entry(gconf, key, NULL, TRUE, &err);
diff --git a/libedataserver/e-iconv.c b/libedataserver/e-iconv.c
index 411f71c..dc5e9ef 100644
--- a/libedataserver/e-iconv.c
+++ b/libedataserver/e-iconv.c
@@ -598,8 +598,6 @@ static const struct {
{ "koi8-u", "uk" }
};
-#define NUM_CJKR_LANGS (sizeof (cjkr_lang_map) / sizeof (cjkr_lang_map[0]))
-
const gchar *
e_iconv_charset_language (const gchar *charset)
{
@@ -609,7 +607,7 @@ e_iconv_charset_language (const gchar *charset)
return NULL;
charset = e_iconv_charset_name (charset);
- for (i = 0; i < NUM_CJKR_LANGS; i++) {
+ for (i = 0; i < G_N_ELEMENTS (cjkr_lang_map); i++) {
if (!g_ascii_strcasecmp (cjkr_lang_map[i].charset, charset))
return cjkr_lang_map[i].lang;
}
diff --git a/libedataserver/e-sexp.c b/libedataserver/e-sexp.c
index 5a5e53f..6f4b057 100644
--- a/libedataserver/e-sexp.c
+++ b/libedataserver/e-sexp.c
@@ -1124,7 +1124,7 @@ e_sexp_init (ESExp *s)
s->result_chunks = e_memchunk_new(16, sizeof(struct _ESExpResult));
/* load in builtin symbols? */
- for (i=0;i<sizeof(symbols)/sizeof(symbols[0]);i++) {
+ for (i = 0; i < G_N_ELEMENTS (symbols); i++) {
if (symbols[i].type == 1) {
e_sexp_add_ifunction(s, 0, symbols[i].name, (ESExpIFunc *)symbols[i].func, (gpointer)&symbols[i]);
} else {
diff --git a/libedataserver/e-time-utils.c b/libedataserver/e-time-utils.c
index 75c2f1d..73759c5 100644
--- a/libedataserver/e-time-utils.c
+++ b/libedataserver/e-time-utils.c
@@ -1775,7 +1775,7 @@ e_time_parse_date_ex (const gchar *value, struct tm *result, gboolean *two_digit
*two_digit_year = FALSE;
}
- status = parse_with_strptime (value, result, format, sizeof (format)/sizeof (format [0]));
+ status = parse_with_strptime (value, result, format, G_N_ELEMENTS (format));
if (status == E_TIME_PARSE_OK && !has_correct_date (result))
status = E_TIME_PARSE_INVALID;
diff --git a/servers/groupwise/e-gw-item.c b/servers/groupwise/e-gw-item.c
index 8c35531..0951680 100644
--- a/servers/groupwise/e-gw-item.c
+++ b/servers/groupwise/e-gw-item.c
@@ -3181,7 +3181,7 @@ e_gw_item_set_calendar_item_elements (EGwItem *item, SoupSoapMessage *msg)
if (rrule->by_day[0]) {
gint i, max_elements;
soup_soap_message_start_element (msg, "byDay", NULL, NULL);
- max_elements = sizeof (rrule->by_day) / sizeof (rrule->by_day[0]);
+ max_elements = G_N_ELEMENTS (rrule->by_day);
/* expand into a sequence of 'day' here */
for (i = 0; i < max_elements && rrule->by_day [i] != E_GW_ITEM_RECUR_END_MARKER; i++) {
const gchar *dow = e_gw_recur_get_day_of_week (rrule->by_day [i]);
@@ -3204,7 +3204,7 @@ e_gw_item_set_calendar_item_elements (EGwItem *item, SoupSoapMessage *msg)
gchar month_day[3];
soup_soap_message_start_element (msg, "byMonthDay", NULL, NULL);
- max_elements = sizeof (rrule->by_month_day) / sizeof (rrule->by_month_day [i]);
+ max_elements = G_N_ELEMENTS (rrule->by_month_day);
/* expand into a sequence of 'day' here */
for (i = 0; i < max_elements && rrule->by_month_day [i] != E_GW_ITEM_RECUR_END_MARKER; i++) {
/*TODO occurence attribute */
@@ -3219,7 +3219,7 @@ e_gw_item_set_calendar_item_elements (EGwItem *item, SoupSoapMessage *msg)
gint i, max_elements;
gchar year_day[4];
soup_soap_message_start_element (msg, "byYearDay", NULL, NULL);
- max_elements = sizeof (rrule->by_year_day) / sizeof (rrule->by_year_day [i]);
+ max_elements = G_N_ELEMENTS (rrule->by_year_day);
/* expand into a sequence of 'day' here */
for (i = 0; i < max_elements && rrule->by_year_day [i] != E_GW_ITEM_RECUR_END_MARKER; i++) {
/*TODO occurence attribute */
@@ -3234,7 +3234,7 @@ e_gw_item_set_calendar_item_elements (EGwItem *item, SoupSoapMessage *msg)
gint i, max_elements;
gchar month[3];
soup_soap_message_start_element (msg, "byMonth", NULL, NULL);
- max_elements = sizeof (rrule->by_month) / sizeof (rrule->by_month [i]);
+ max_elements = G_N_ELEMENTS (rrule->by_month);
/* expand into a sequence of 'month' here */
for (i = 0; i < max_elements && rrule->by_month [i] != E_GW_ITEM_RECUR_END_MARKER; i++) {
/*TODO occurence attribute */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]