commit - c5abeb29f8072bd0c517712431aae0b98d3d12b6
commit + 5a71467dabbb387cc5bab04d8f48a4a641a00263
blob - 721b021aa5ac4c4ae840fadf287e2ccb7d11207d
blob + 4fe0df00ae3f6a28fbce82098982d3a20f693498
--- jenny.c
+++ jenny.c
if (!(rsl = (char *)malloc(len+sizeof(size_t)))) {
printf("jenny: could not allocate space\n");
cleanup(s);
- exit(0);
+ exit(0);
}
memset(rsl, 0x00, len);
return rsl;
while (fgets(buf, BUFSIZE, f) && (buf[0] != '.')) {
ub4 curr = 0; /* current offset into buf */
ub4 value; /* token value */
- token_type token; /* token type */
ub4 i;
test *t;
goto failure;
}
if (value-1 != i) {
- printf("jenny: -o, number %d found out-of-place\n", value);
+ printf("jenny: -o, number %lu found out-of-place\n", value);
goto failure;
}
if (parse_token(buf, UB4MAXVAL, &curr, &value) != TOKEN_FEATURE) {
goto failure;
}
if (value >= s->dim[i]) {
- printf("jenny: -o, feature %c does not exist in dimension %d\n",
+ printf("jenny: -o, feature %c does not exist in dimension %lu\n",
feature_name[value], i+1);
goto failure;
}
ub4 dimension_number;
ub4 curr = 0;
ub4 fe_len, value;
- ub4 i, j, k;
+ ub4 i, j;
size_t len = strlen(myarg);
token_type t = parse_token(myarg, len, &curr, &value);
return FALSE;
}
fe_len=0;
-
+
number:
dimension_number = --value;
if (dimension_number >= s->ndim) {
return FALSE;
}
if (used[dimension_number]) {
- printf("jenny: -w, dimension %d was given twice in a single without\n",
+ printf("jenny: -w, dimension %lu was given twice in a single without\n",
dimension_number+1);
return FALSE;
}
used[dimension_number] = TRUE;
-
-
+
+
switch (parse_token(myarg, len, &curr, &value)) {
case TOKEN_FEATURE: goto feature;
case TOKEN_END:
printf("jenny: proper withouts look like -w2a1bc99a\n");
return FALSE;
}
-
+
feature:
if (value >= s->dim[dimension_number]) {
- printf("jenny: -w, there is no feature '%c' in dimension %d\n",
+ printf("jenny: -w, there is no feature '%c' in dimension %lu\n",
feature_name[value], dimension_number+1);
return FALSE;
}
/* internal check: we have MAX_FEATURES names for features */
if (strlen(feature_name) != MAX_FEATURES) {
- printf("feature_name length is wrong, %d\n", strlen(feature_name));
+ printf("feature_name length is wrong, %lu\n", strlen(feature_name));
return FALSE;
}
{
ub4 i;
for (i=0; i<len; ++i) {
- printf(" %d%c", i+1, feature_name[t->f[i]]);
+ printf(" %lu%c", i+1, feature_name[t->f[i]]);
}
printf(" \n");
}
feature tuple[MAX_N]; /* n-tuples that include (d,f) */
sb4 i, j, n = s->n[d][f];
ub8 count = 0;
- test *t;
tu_iter ctx;
if (s->tc[d][f] > 0 || s->n[d][f] == s->n_final) {
ub1 *mut) /* mut[i] = 1 if I am allowed to adjust dimension i */
{
ub4 i;
- without *w; /* one of the disobeyed withouts */
ub4 count; /* number of withouts currently hit */
ub2 ndim; /* size of dimord[] */
ub2 temp;
ub4 j;
ub2 best[MAX_FEATURES]; /* best features so far */
ub1 ok = TRUE;
-
+
for (j=ndim; j>0; --j) {
ub2 fcount = 0; /* count of filled elements of best */
ub2 mydim; /* the current dimension */
/* find a good test */
for (i=0; i<GROUP_SIZE; ++i) {
- tu_iter ctx;
sb4 this_count;
/* generate a test that covers the first tuple */