Skip to content

Commit 8ba4f4b

Browse files
authored
Remove dead code (#87)
1 parent 5d2e74f commit 8ba4f4b

File tree

5 files changed

+0
-534
lines changed

5 files changed

+0
-534
lines changed

cutils.c

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -305,32 +305,6 @@ int unicode_from_utf8(const uint8_t *p, int max_len, const uint8_t **pp)
305305
return c;
306306
}
307307

308-
#if 0
309-
310-
#if defined(EMSCRIPTEN) || defined(__ANDROID__)
311-
312-
static void *rqsort_arg;
313-
static int (*rqsort_cmp)(const void *, const void *, void *);
314-
315-
static int rqsort_cmp2(const void *p1, const void *p2)
316-
{
317-
return rqsort_cmp(p1, p2, rqsort_arg);
318-
}
319-
320-
/* not reentrant, but not needed with emscripten */
321-
void rqsort(void *base, size_t nmemb, size_t size,
322-
int (*cmp)(const void *, const void *, void *),
323-
void *arg)
324-
{
325-
rqsort_arg = arg;
326-
rqsort_cmp = cmp;
327-
qsort(base, nmemb, size, rqsort_cmp2);
328-
}
329-
330-
#endif
331-
332-
#else
333-
334308
typedef void (*exchange_f)(void *a, void *b, size_t size);
335309
typedef int (*cmp_f)(const void *, const void *, void *opaque);
336310

@@ -629,5 +603,3 @@ void rqsort(void *base, size_t nmemb, size_t size, cmp_f cmp, void *opaque)
629603
}
630604
}
631605
}
632-
633-
#endif

libbf.c

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -4799,11 +4799,6 @@ int bf_pow(bf_t *r, const bf_t *x, const bf_t *y, limb_t prec, bf_flags_t flags)
47994799
bf_t *y1;
48004800
if (y_emin < 0 && check_exact_power2n(r, T, -y_emin)) {
48014801
/* the problem is reduced to a power to an integer */
4802-
#if 0
4803-
printf("\nn=%" PRId64 "\n", -(int64_t)y_emin);
4804-
bf_print_str("T", T);
4805-
bf_print_str("r", r);
4806-
#endif
48074802
bf_set(T, r);
48084803
y1 = &ytmp_s;
48094804
y1->tab = y->tab;
@@ -6327,34 +6322,6 @@ static limb_t get_digit(const limb_t *tab, limb_t len, slimb_t pos)
63276322
return fast_shr_dec(tab[i], shift) % 10;
63286323
}
63296324

6330-
#if 0
6331-
static limb_t get_digits(const limb_t *tab, limb_t len, slimb_t pos)
6332-
{
6333-
limb_t a0, a1;
6334-
int shift;
6335-
slimb_t i;
6336-
6337-
i = floor_div(pos, LIMB_DIGITS);
6338-
shift = pos - i * LIMB_DIGITS;
6339-
if (i >= 0 && i < len)
6340-
a0 = tab[i];
6341-
else
6342-
a0 = 0;
6343-
if (shift == 0) {
6344-
return a0;
6345-
} else {
6346-
i++;
6347-
if (i >= 0 && i < len)
6348-
a1 = tab[i];
6349-
else
6350-
a1 = 0;
6351-
return fast_shr_dec(a0, shift) +
6352-
fast_urem(a1, &mp_pow_div[LIMB_DIGITS - shift]) *
6353-
mp_pow_dec[shift];
6354-
}
6355-
}
6356-
#endif
6357-
63586325
/* return the addend for rounding. Note that prec can be <= 0 for bf_rint() */
63596326
static int bfdec_get_rnd_add(int *pret, const bfdec_t *r, limb_t l,
63606327
slimb_t prec, int rnd_mode)
@@ -7981,12 +7948,6 @@ static no_inline void limb_to_ntt(BFNTTState *s,
79817948
int j, shift;
79827949
limb_t base_mask1, a0, a1, a2, r, m, m_inv;
79837950

7984-
#if 0
7985-
for(i = 0; i < a_len; i++) {
7986-
printf("%" PRId64 ": " FMT_LIMB "\n",
7987-
(int64_t)i, taba[i]);
7988-
}
7989-
#endif
79907951
memset(tabr, 0, sizeof(NTTLimb) * fft_len * nb_mods);
79917952
shift = dpl & (LIMB_BITS - 1);
79927953
if (shift == 0)
@@ -8113,14 +8074,6 @@ static no_inline void ntt_to_limb(BFNTTState *s, limb_t *tabr, limb_t r_len,
81138074
}
81148075
u[l] = r + carry[l];
81158076

8116-
#if 0
8117-
printf("%" PRId64 ": ", i);
8118-
for(j = nb_mods - 1; j >= 0; j--) {
8119-
printf(" %019" PRIu64, u[j]);
8120-
}
8121-
printf("\n");
8122-
#endif
8123-
81248077
/* write the digits */
81258078
pos = i * dpl;
81268079
for(j = 0; j < n_limb1; j++) {
@@ -8214,14 +8167,6 @@ static no_inline void ntt_to_limb(BFNTTState *s, limb_t *tabr, limb_t r_len,
82148167
}
82158168
u[l] = r + carry[l];
82168169

8217-
#if 0
8218-
printf("%" PRId64 ": ", (int64_t)i);
8219-
for(j = nb_mods - 1; j >= 0; j--) {
8220-
printf(" " FMT_LIMB, u[j]);
8221-
}
8222-
printf("\n");
8223-
#endif
8224-
82258170
/* write the digits */
82268171
pos = i * dpl;
82278172
for(j = 0; j < n_limb1; j++) {

libunicode.c

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -790,13 +790,6 @@ static void sort_cc(int *buf, int len)
790790
buf[k + 1] = ch1;
791791
j++;
792792
}
793-
#if 0
794-
printf("cc:");
795-
for(k = start; k < j; k++) {
796-
printf(" %3d", unicode_get_cc(buf[k]));
797-
}
798-
printf("\n");
799-
#endif
800793
i = j;
801794
}
802795
}
@@ -1495,42 +1488,6 @@ int unicode_prop(CharRange *cr, const char *prop_name)
14951488
POP_XOR,
14961489
POP_END);
14971490
break;
1498-
#if 0
1499-
case UNICODE_PROP_ID_Start:
1500-
ret = unicode_prop_ops(cr,
1501-
POP_GC, M(Lu) | M(Ll) | M(Lt) | M(Lm) | M(Lo) | M(Nl),
1502-
POP_PROP, UNICODE_PROP_Other_ID_Start,
1503-
POP_UNION,
1504-
POP_PROP, UNICODE_PROP_Pattern_Syntax,
1505-
POP_PROP, UNICODE_PROP_Pattern_White_Space,
1506-
POP_UNION,
1507-
POP_INVERT,
1508-
POP_INTER,
1509-
POP_END);
1510-
break;
1511-
case UNICODE_PROP_ID_Continue:
1512-
ret = unicode_prop_ops(cr,
1513-
POP_GC, M(Lu) | M(Ll) | M(Lt) | M(Lm) | M(Lo) | M(Nl) |
1514-
M(Mn) | M(Mc) | M(Nd) | M(Pc),
1515-
POP_PROP, UNICODE_PROP_Other_ID_Start,
1516-
POP_UNION,
1517-
POP_PROP, UNICODE_PROP_Other_ID_Continue,
1518-
POP_UNION,
1519-
POP_PROP, UNICODE_PROP_Pattern_Syntax,
1520-
POP_PROP, UNICODE_PROP_Pattern_White_Space,
1521-
POP_UNION,
1522-
POP_INVERT,
1523-
POP_INTER,
1524-
POP_END);
1525-
break;
1526-
case UNICODE_PROP_Case_Ignorable:
1527-
ret = unicode_prop_ops(cr,
1528-
POP_GC, M(Mn) | M(Cf) | M(Lm) | M(Sk),
1529-
POP_PROP, UNICODE_PROP_Case_Ignorable1,
1530-
POP_XOR,
1531-
POP_END);
1532-
break;
1533-
#else
15341491
/* we use the existing tables */
15351492
case UNICODE_PROP_ID_Continue:
15361493
ret = unicode_prop_ops(cr,
@@ -1539,7 +1496,6 @@ int unicode_prop(CharRange *cr, const char *prop_name)
15391496
POP_XOR,
15401497
POP_END);
15411498
break;
1542-
#endif
15431499
default:
15441500
if (prop_idx >= countof(unicode_prop_table))
15451501
return -2;

0 commit comments

Comments
 (0)