Dead code removal: #if 0 conf, dso, pqueue, threads
authorRich Salz <rsalz@openssl.org>
Fri, 30 Jan 2015 17:46:49 +0000 (12:46 -0500)
committerRich Salz <rsalz@openssl.org>
Fri, 30 Jan 2015 17:46:49 +0000 (12:46 -0500)
Mostly, but not completely, debugging print statements.
Some old logic kept for internal documentation reasons, perhaps.

Reviewed-by: Richard Levitte <levitte@openssl.org>
crypto/conf/conf_api.c
crypto/conf/conf_lib.c
crypto/dso/dso_dl.c
crypto/dso/dso_dlfcn.c
crypto/dso/dso_null.c
crypto/dso/dso_vms.c
crypto/dso/dso_win32.c
crypto/pqueue/pqueue.c
crypto/threads/th-lock.c

index 4cf7553376e6268f6365fe63bc70e1d3fa459e7b..ff73f3822fb3c07572db229320051faf33471404 100644 (file)
@@ -157,28 +157,6 @@ char *_CONF_get_string(const CONF *conf, const char *section,
         return (getenv(name));
 }
 
         return (getenv(name));
 }
 
-#if 0                           /* There's no way to provide error checking
-                                 * with this function, so force implementors
-                                 * of the higher levels to get a string and
-                                 * read the number themselves. */
-long _CONF_get_number(CONF *conf, char *section, char *name)
-{
-    char *str;
-    long ret = 0;
-
-    str = _CONF_get_string(conf, section, name);
-    if (str == NULL)
-        return (0);
-    for (;;) {
-        if (conf->meth->is_number(conf, *str))
-            ret = ret * 10 + conf->meth->to_int(conf, *str);
-        else
-            return (ret);
-        str++;
-    }
-}
-#endif
-
 static unsigned long conf_value_hash(const CONF_VALUE *v)
 {
     return (lh_strhash(v->section) << 2) ^ lh_strhash(v->name);
 static unsigned long conf_value_hash(const CONF_VALUE *v)
 {
     return (lh_strhash(v->section) << 2) ^ lh_strhash(v->name);
index 2aadb37ee5808f0a20fa9627ccb9a1e251c24e73..29e77c742bd226200381a2ae86c15c4d316ea3c2 100644 (file)
@@ -373,19 +373,3 @@ int NCONF_dump_bio(const CONF *conf, BIO *out)
 
     return conf->meth->dump(conf, out);
 }
 
     return conf->meth->dump(conf, out);
 }
-
-/* This function should be avoided */
-#if 0
-long NCONF_get_number(CONF *conf, char *group, char *name)
-{
-    int status;
-    long ret = 0;
-
-    status = NCONF_get_number_e(conf, group, name, &ret);
-    if (status == 0) {
-        /* This function does not believe in errors... */
-        ERR_get_error();
-    }
-    return ret;
-}
-#endif
index 1f4d1986633573160ed74d5d1263db870d3cf1d0..989d4d95878a8de2586b691362442025fa125ea9 100644 (file)
@@ -77,13 +77,6 @@ static int dl_load(DSO *dso);
 static int dl_unload(DSO *dso);
 static void *dl_bind_var(DSO *dso, const char *symname);
 static DSO_FUNC_TYPE dl_bind_func(DSO *dso, const char *symname);
 static int dl_unload(DSO *dso);
 static void *dl_bind_var(DSO *dso, const char *symname);
 static DSO_FUNC_TYPE dl_bind_func(DSO *dso, const char *symname);
-# if 0
-static int dl_unbind_var(DSO *dso, char *symname, void *symptr);
-static int dl_unbind_func(DSO *dso, char *symname, DSO_FUNC_TYPE symptr);
-static int dl_init(DSO *dso);
-static int dl_finish(DSO *dso);
-static int dl_ctrl(DSO *dso, int cmd, long larg, void *parg);
-# endif
 static char *dl_name_converter(DSO *dso, const char *filename);
 static char *dl_merger(DSO *dso, const char *filespec1,
                        const char *filespec2);
 static char *dl_name_converter(DSO *dso, const char *filename);
 static char *dl_merger(DSO *dso, const char *filespec1,
                        const char *filespec2);
@@ -96,11 +89,6 @@ static DSO_METHOD dso_meth_dl = {
     dl_unload,
     dl_bind_var,
     dl_bind_func,
     dl_unload,
     dl_bind_var,
     dl_bind_func,
-/* For now, "unbind" doesn't exist */
-# if 0
-    NULL,                       /* unbind_var */
-    NULL,                       /* unbind_func */
-# endif
     NULL,                       /* ctrl */
     dl_name_converter,
     dl_merger,
     NULL,                       /* ctrl */
     dl_name_converter,
     dl_merger,
index ec87f475f80b623f831169ba0c1aea8a1d73cb36..c9a9a8bbb0c82a48dfc9941dc4ffce1cd997d177 100644 (file)
@@ -99,12 +99,6 @@ static int dlfcn_load(DSO *dso);
 static int dlfcn_unload(DSO *dso);
 static void *dlfcn_bind_var(DSO *dso, const char *symname);
 static DSO_FUNC_TYPE dlfcn_bind_func(DSO *dso, const char *symname);
 static int dlfcn_unload(DSO *dso);
 static void *dlfcn_bind_var(DSO *dso, const char *symname);
 static DSO_FUNC_TYPE dlfcn_bind_func(DSO *dso, const char *symname);
-# if 0
-static int dlfcn_unbind(DSO *dso, char *symname, void *symptr);
-static int dlfcn_init(DSO *dso);
-static int dlfcn_finish(DSO *dso);
-static long dlfcn_ctrl(DSO *dso, int cmd, long larg, void *parg);
-# endif
 static char *dlfcn_name_converter(DSO *dso, const char *filename);
 static char *dlfcn_merger(DSO *dso, const char *filespec1,
                           const char *filespec2);
 static char *dlfcn_name_converter(DSO *dso, const char *filename);
 static char *dlfcn_merger(DSO *dso, const char *filespec1,
                           const char *filespec2);
@@ -117,11 +111,6 @@ static DSO_METHOD dso_meth_dlfcn = {
     dlfcn_unload,
     dlfcn_bind_var,
     dlfcn_bind_func,
     dlfcn_unload,
     dlfcn_bind_var,
     dlfcn_bind_func,
-/* For now, "unbind" doesn't exist */
-# if 0
-    NULL,                       /* unbind_var */
-    NULL,                       /* unbind_func */
-# endif
     NULL,                       /* ctrl */
     dlfcn_name_converter,
     dlfcn_merger,
     NULL,                       /* ctrl */
     dlfcn_name_converter,
     dlfcn_merger,
index 20122d1cab0a50d6e9026a4574ab36808f275d33..ab2125c28662a1f9b8426da41d0167082a054a6f 100644 (file)
@@ -72,11 +72,6 @@ static DSO_METHOD dso_meth_null = {
     NULL,                       /* unload */
     NULL,                       /* bind_var */
     NULL,                       /* bind_func */
     NULL,                       /* unload */
     NULL,                       /* bind_var */
     NULL,                       /* bind_func */
-/* For now, "unbind" doesn't exist */
-#if 0
-    NULL,                       /* unbind_var */
-    NULL,                       /* unbind_func */
-#endif
     NULL,                       /* ctrl */
     NULL,                       /* dso_name_converter */
     NULL,                       /* dso_merger */
     NULL,                       /* ctrl */
     NULL,                       /* dso_name_converter */
     NULL,                       /* dso_merger */
index 8793f7e0ff4154b22edda209a9967adbe7db206d..649818412489a9357a81f63071c9ccb11cc4e2ac 100644 (file)
@@ -95,13 +95,6 @@ static int vms_load(DSO *dso);
 static int vms_unload(DSO *dso);
 static void *vms_bind_var(DSO *dso, const char *symname);
 static DSO_FUNC_TYPE vms_bind_func(DSO *dso, const char *symname);
 static int vms_unload(DSO *dso);
 static void *vms_bind_var(DSO *dso, const char *symname);
 static DSO_FUNC_TYPE vms_bind_func(DSO *dso, const char *symname);
-# if 0
-static int vms_unbind_var(DSO *dso, char *symname, void *symptr);
-static int vms_unbind_func(DSO *dso, char *symname, DSO_FUNC_TYPE symptr);
-static int vms_init(DSO *dso);
-static int vms_finish(DSO *dso);
-static long vms_ctrl(DSO *dso, int cmd, long larg, void *parg);
-# endif
 static char *vms_name_converter(DSO *dso, const char *filename);
 static char *vms_merger(DSO *dso, const char *filespec1,
                         const char *filespec2);
 static char *vms_name_converter(DSO *dso, const char *filename);
 static char *vms_merger(DSO *dso, const char *filespec1,
                         const char *filespec2);
@@ -112,11 +105,6 @@ static DSO_METHOD dso_meth_vms = {
     NULL,                       /* unload */
     vms_bind_var,
     vms_bind_func,
     NULL,                       /* unload */
     vms_bind_var,
     vms_bind_func,
-/* For now, "unbind" doesn't exist */
-# if 0
-    NULL,                       /* unbind_var */
-    NULL,                       /* unbind_func */
-# endif
     NULL,                       /* ctrl */
     vms_name_converter,
     vms_merger,
     NULL,                       /* ctrl */
     vms_name_converter,
     vms_merger,
index c65234e9c44bb577719cabc14bbb25feb73de049..e671672920c8aa060414b523c00ca60b65d9a94a 100644 (file)
@@ -119,13 +119,6 @@ static int win32_load(DSO *dso);
 static int win32_unload(DSO *dso);
 static void *win32_bind_var(DSO *dso, const char *symname);
 static DSO_FUNC_TYPE win32_bind_func(DSO *dso, const char *symname);
 static int win32_unload(DSO *dso);
 static void *win32_bind_var(DSO *dso, const char *symname);
 static DSO_FUNC_TYPE win32_bind_func(DSO *dso, const char *symname);
-# if 0
-static int win32_unbind_var(DSO *dso, char *symname, void *symptr);
-static int win32_unbind_func(DSO *dso, char *symname, DSO_FUNC_TYPE symptr);
-static int win32_init(DSO *dso);
-static int win32_finish(DSO *dso);
-static long win32_ctrl(DSO *dso, int cmd, long larg, void *parg);
-# endif
 static char *win32_name_converter(DSO *dso, const char *filename);
 static char *win32_merger(DSO *dso, const char *filespec1,
                           const char *filespec2);
 static char *win32_name_converter(DSO *dso, const char *filename);
 static char *win32_merger(DSO *dso, const char *filespec1,
                           const char *filespec2);
@@ -140,11 +133,6 @@ static DSO_METHOD dso_meth_win32 = {
     win32_unload,
     win32_bind_var,
     win32_bind_func,
     win32_unload,
     win32_bind_var,
     win32_bind_func,
-/* For now, "unbind" doesn't exist */
-# if 0
-    NULL,                       /* unbind_var */
-    NULL,                       /* unbind_func */
-# endif
     NULL,                       /* ctrl */
     win32_name_converter,
     win32_merger,
     NULL,                       /* ctrl */
     win32_name_converter,
     win32_merger,
@@ -476,13 +464,6 @@ static char *win32_joiner(DSO *dso, const struct file_st *file_split)
         offset++;
         start = end + 1;
     }
         offset++;
         start = end + 1;
     }
-# if 0                          /* Not needed, since the directory converter
-                                 * above already appeneded a backslash */
-    if (file_split->predir && (file_split->dir || file_split->file)) {
-        result[offset] = '\\';
-        offset++;
-    }
-# endif
     start = file_split->dir;
     while (file_split->dirlen > (start - file_split->dir)) {
         const char *end = openssl_strnchr(start, '/',
     start = file_split->dir;
     while (file_split->dirlen > (start - file_split->dir)) {
         const char *end = openssl_strnchr(start, '/',
@@ -496,13 +477,6 @@ static char *win32_joiner(DSO *dso, const struct file_st *file_split)
         offset++;
         start = end + 1;
     }
         offset++;
         start = end + 1;
     }
-# if 0                          /* Not needed, since the directory converter
-                                 * above already appeneded a backslash */
-    if (file_split->dir && file_split->file) {
-        result[offset] = '\\';
-        offset++;
-    }
-# endif
     strncpy(&result[offset], file_split->file, file_split->filelen);
     offset += file_split->filelen;
     result[offset] = '\0';
     strncpy(&result[offset], file_split->file, file_split->filelen);
     offset += file_split->filelen;
     result[offset] = '\0';
index 06a1b8d7cca06a29d4d1412364d01f51106ec73e..675ac60dbaf83e7c772766af63619295009e8660 100644 (file)
@@ -179,13 +179,6 @@ pitem *pqueue_find(pqueue_s *pq, unsigned char *prio64be)
     if (!found)
         return NULL;
 
     if (!found)
         return NULL;
 
-#if 0                           /* find works in peek mode */
-    if (prev == NULL)
-        pq->items = next->next;
-    else
-        prev->next = next->next;
-#endif
-
     return found;
 }
 
     return found;
 }
 
index 1b5765948a95d0cc5dea4f65414d43de103b9c67..9a8e90954e1f79263bc8296345cbdc562ac9fc36 100644 (file)
@@ -200,18 +200,6 @@ void CRYPTO_thread_cleanup(void)
 
 void solaris_locking_callback(int mode, int type, char *file, int line)
 {
 
 void solaris_locking_callback(int mode, int type, char *file, int line)
 {
-# if 0
-    fprintf(stderr, "thread=%4d mode=%s lock=%s %s:%d\n",
-            CRYPTO_thread_id(),
-            (mode & CRYPTO_LOCK) ? "l" : "u",
-            (type & CRYPTO_READ) ? "r" : "w", file, line);
-# endif
-
-# if 0
-    if (CRYPTO_LOCK_SSL_CERT == type)
-        fprintf(stderr, "(t,m,f,l) %ld %d %s %d\n",
-                CRYPTO_thread_id(), mode, file, line);
-# endif
     if (mode & CRYPTO_LOCK) {
 # ifdef USE_MUTEX
         mutex_lock(&(lock_cs[type]));
     if (mode & CRYPTO_LOCK) {
 # ifdef USE_MUTEX
         mutex_lock(&(lock_cs[type]));
@@ -338,17 +326,6 @@ void thread_cleanup(void)
 
 void pthreads_locking_callback(int mode, int type, char *file, int line)
 {
 
 void pthreads_locking_callback(int mode, int type, char *file, int line)
 {
-# if 0
-    fprintf(stderr, "thread=%4d mode=%s lock=%s %s:%d\n",
-            CRYPTO_thread_id(),
-            (mode & CRYPTO_LOCK) ? "l" : "u",
-            (type & CRYPTO_READ) ? "r" : "w", file, line);
-# endif
-# if 0
-    if (CRYPTO_LOCK_SSL_CERT == type)
-        fprintf(stderr, "(t,m,f,l) %ld %d %s %d\n",
-                CRYPTO_thread_id(), mode, file, line);
-# endif
     if (mode & CRYPTO_LOCK) {
         pthread_mutex_lock(&(lock_cs[type]));
         lock_count[type]++;
     if (mode & CRYPTO_LOCK) {
         pthread_mutex_lock(&(lock_cs[type]));
         lock_count[type]++;