enum reposset_ret reposset_add_checkpoint(struct reposset *rset, unsigned int reposno, enum mime_types comp, unsigned long int point) { /* XXX: technically, reposno should be below the number of * entries, but we'll allow checkpoints to be entered for the * coming repository as well, for convenience sake. Also, we * should probably maintain the sorting of the array explicitly, * but we assume that they come in sorted order. */ assert(comp == MIME_TYPE_APPLICATION_X_GZIP || comp == MIME_TYPE_APPLICATION_X_BZIP2); assert(!rset->check_len || rset->check[rset->check_len - 1].reposno < reposno); if (rset->check_len >= rset->check_size) { void *ptr = realloc(rset->check, sizeof(*rset->check) * rset->check_size * 2); if (ptr) { rset->check = ptr; rset->check_size *= 2; assert(rset->check_len < rset->check_size); } else { return REPOSSET_ENOMEM; } } rset->check[rset->check_len].reposno = reposno; rset->check[rset->check_len].offset = point; rset->check[rset->check_len].comp = comp; assert(!rset->check_len || check_cmp(&rset->check[rset->check_len - 1], &rset->check[rset->check_len]) < 0); /* ensure ordering is correct */ rset->check_len++; return REPOSSET_OK; }
int main (int argc, char *argv[]) { mpfr_test_init (); tests_start_mpfr (); check_inexact (); check_cmp (argc, argv); tests_end_mpfr (); return 0; }
int main (int argc, char *argv[]) { mpfr_test_init (); tests_start_mpfr (); check_inexact (); check_cmp (argc, argv); test_generic (MPFR_PREC_MIN, 1000, 10); tests_end_mpfr (); return 0; }