Commit a2b18e65 authored by Rich Salz's avatar Rich Salz
Browse files

ifdef cleanup, part 4a: '#ifdef undef'



This removes all code surrounded by '#ifdef undef'
One case is left: memmove() replaced by open-coded for loop,
in crypto/stack/stack.c  That needs further review.

Also removed a couple of instances of /* dead code */ if I saw them
while doing the main removal.

Reviewed-by: default avatarMatt Caswell <matt@openssl.org>
parent 2747d73c
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -48,6 +48,10 @@
        Remove MS_STATIC; it's a relic from platforms <32 bits.
     [Rich Salz]

  *) Start cleaning up dead code
        Remove all but one '#ifdef undef' which is to be looked at.
     [Rich Salz]

  *) Experimental support for a new, fast, unbiased prime candidate generator,
     bn_probable_prime_dh_coprime(). Not currently used by any prime generator.
     [Felix Laurie von Massenbach <felix@erbridge.co.uk>]
+0 −9
Original line number Diff line number Diff line
@@ -152,15 +152,6 @@ int MAIN(int argc, char **argv)
    argv++;
    num = 0;
    while (argc >= 1) {
#ifdef undef
        if (strcmp(*argv, "-p") == 0) {
            if (--argc < 1)
                goto bad;
            if (!args_from_file(++argv, Nargc, Nargv)) {
                goto end;
            }
        */}
#endif
        if (strcmp(*argv, "-inform") == 0) {
            if (--argc < 1)
                goto bad;
+0 −9
Original line number Diff line number Diff line
@@ -233,15 +233,6 @@ int MAIN(int argc, char **argv)

    if (text) {
        DHparams_print(out, dh);
# ifdef undef
        printf("p=");
        BN_print(stdout, dh->p);
        printf("\ng=");
        BN_print(stdout, dh->g);
        printf("\n");
        if (dh->length != 0)
            printf("recommended private length=%ld\n", dh->length);
# endif
    }

    if (check) {
+0 −20
Original line number Diff line number Diff line
@@ -168,26 +168,6 @@ int MAIN(int argc, char **argv)
        }
        SSL_SESSION_set1_id_context(x, (unsigned char *)context, ctx_len);
    }
#ifdef undef
    /* just testing for memory leaks :-) */
    {
        SSL_SESSION *s;
        char buf[1024 * 10], *p;
        int i;

        s = SSL_SESSION_new();

        p = &buf;
        i = i2d_SSL_SESSION(x, &p);
        p = &buf;
        d2i_SSL_SESSION(&s, &p, (long)i);
        p = &buf;
        d2i_SSL_SESSION(&s, &p, (long)i);
        p = &buf;
        d2i_SSL_SESSION(&s, &p, (long)i);
        SSL_SESSION_free(s);
    }
#endif

    if (!noout || text) {
        out = BIO_new(BIO_s_file());
+0 −5
Original line number Diff line number Diff line
@@ -812,11 +812,6 @@ int test_mont(BIO *bp, BN_CTX *ctx)
        BN_from_montgomery(A, c, mont, ctx);
        if (bp != NULL) {
            if (!results) {
#ifdef undef
                fprintf(stderr, "%d * %d %% %d\n",
                        BN_num_bits(a),
                        BN_num_bits(b), BN_num_bits(&mont->N));
#endif
                BN_print(bp, a);
                BIO_puts(bp, " * ");
                BN_print(bp, b);
Loading