Error building sieve/test.c from 2.2.5
Albert Chin
info-cyrus at mlists.thewrittenword.com
Wed Jun 9 18:46:57 EDT 2004
sieve/test.c has:
static int test_comparator(void)
{
struct testcase *t;
int didfail = 0;
for (t = tc; t->comp != NULL; t++) {
comparator_t *c = lookup_comp(t->comp, t->mode, -1, NULL);
int res;
char *mode;
struct testcase is:
struct testcase {
const char *comp;
int mode;
const char *pat;
const char *text;
int result;
};
sieve/comparator.c defines lookup_comp() as:
comparator_t *lookup_comp(int comp, int mode, int relation,
void **comprock)
So, t->comp is of type 'const char*' yet the first argument to
lookup_comp wants an int. How to fix?
Should I change:
struct testcase tc[] =
{ { "i;octet", IS, "", "", 1 },
{ "i;octet", IS, "a", "", 0 },
{ "i;octet", IS, "", "a", 0 },
{ "i;octet", IS, "a", "a", 1 },
{ "i;octet", IS, "a", "A", 0 },
...
to:
struct testcase tc[] =
{ { B_OCTET, IS, "", "", 1 },
{ B_OCTET, IS, "a", "", 0 },
{ B_OCTET, IS, "", "a", 0 },
{ B_OCTET, IS, "a", "a", 1 },
{ B_OCTET, IS, "a", "A", 0 },
...
--
albert chin (china at thewrittenword.com)
---
Cyrus Home Page: http://asg.web.cmu.edu/cyrus
Cyrus Wiki/FAQ: http://cyruswiki.andrew.cmu.edu
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html
More information about the Info-cyrus
mailing list