use enum value
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104
diff --git a/etc/2kprime.c b/etc/2kprime.c
index fe25da3..95ed2de 100644
--- a/etc/2kprime.c
+++ b/etc/2kprime.c
@@ -43,7 +43,7 @@ top:
/* quick test on q */
mp_prime_is_prime(&q, 1, &y);
- if (y == 0) {
+ if (y == MP_NO) {
continue;
}
@@ -51,20 +51,20 @@ top:
mp_sub_d(&q, 1uL, &p);
mp_div_2(&p, &p);
mp_prime_is_prime(&p, 3, &y);
- if (y == 0) {
+ if (y == MP_NO) {
continue;
}
/* test on q */
mp_prime_is_prime(&q, 3, &y);
- if (y == 0) {
+ if (y == MP_NO) {
continue;
}
break;
}
- if (y == 0) {
+ if (y == MP_NO) {
++sizes[x];
goto top;
}
diff --git a/etc/drprime.c b/etc/drprime.c
index 73838c4..64e31ef 100644
--- a/etc/drprime.c
+++ b/etc/drprime.c
@@ -30,23 +30,23 @@ top:
a.used = sizes[x];
/* now loop */
- res = 0;
+ res = MP_NO;
for (;;) {
a.dp[0] += 4uL;
if (a.dp[0] >= MP_MASK) break;
mp_prime_is_prime(&a, 1, &res);
- if (res == 0) continue;
+ if (res == MP_NO) continue;
printf(".");
fflush(stdout);
mp_sub_d(&a, 1uL, &b);
mp_div_2(&b, &b);
mp_prime_is_prime(&b, 3, &res);
- if (res == 0) continue;
+ if (res == MP_NO) continue;
mp_prime_is_prime(&a, 3, &res);
- if (res == 1) break;
+ if (res == MP_YES) break;
}
- if (res != 1) {
+ if (res != MP_YES) {
printf("Error not DR modulus\n");
sizes[x] += 1;
goto top;
diff --git a/etc/mersenne.c b/etc/mersenne.c
index 7458472..0c9f52f 100644
--- a/etc/mersenne.c
+++ b/etc/mersenne.c
@@ -11,7 +11,7 @@ static mp_err is_mersenne(long s, mp_bool *pp)
mp_err res;
int k;
- *pp = 0;
+ *pp = MP_NO;
if ((res = mp_init(&n)) != MP_OKAY) {
return res;
@@ -56,9 +56,9 @@ static mp_err is_mersenne(long s, mp_bool *pp)
}
/* if u == 0 then its prime */
- if (mp_iszero(&u) == 1) {
+ if (mp_iszero(&u) == MP_YES) {
mp_prime_is_prime(&n, 8, pp);
- if (*pp != 1) printf("FAILURE\n");
+ if (*pp != MP_YES) printf("FAILURE\n");
}
res = MP_OKAY;
@@ -119,7 +119,7 @@ int main(void)
return -1;
}
- if (pp == 1) {
+ if (pp == MP_YES) {
/* count time */
tt = clock() - tt;