diff options
| author | Matthew Barnes <mbarnes@redhat.com> | 2009-10-24 19:13:18 -0400 |
|---|---|---|
| committer | Matthew Barnes <mbarnes@redhat.com> | 2009-10-26 19:08:58 -0400 |
| commit | 32417e99d20f007de5151d10c051805e7b795ecc (patch) | |
| tree | 27b7bf52960e01ab1d186050de92249d9667f181 /camel/camel-text-index.c | |
| parent | d8a5369df5c9423198b211ac668f9e609c0259b8 (diff) | |
| download | evolution-data-server-32417e99d20f007de5151d10c051805e7b795ecc.tar.gz | |
Prefer G_N_ELEMENTS over sizeof calculations.
Diffstat (limited to 'camel/camel-text-index.c')
| -rw-r--r-- | camel/camel-text-index.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/camel/camel-text-index.c b/camel/camel-text-index.c index f696fd793..8b9bb422b 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; |
