You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2023/11/23 17:08:45 UTC

(commons-crypto) 01/01: These appear to be unused

This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch unused
in repository https://gitbox.apache.org/repos/asf/commons-crypto.git

commit 8e45a6f192c98a62d45c9bac424eabe9cf16e975
Author: Sebb <se...@apache.org>
AuthorDate: Thu Nov 23 17:08:39 2023 +0000

    These appear to be unused
---
 .../commons/crypto/org_apache_commons_crypto.h     | 41 ----------------------
 .../random/org_apache_commons_crypto_random.h      |  2 --
 2 files changed, 43 deletions(-)

diff --git a/src/main/native/org/apache/commons/crypto/org_apache_commons_crypto.h b/src/main/native/org/apache/commons/crypto/org_apache_commons_crypto.h
index 4c16db1c..210715b1 100644
--- a/src/main/native/org/apache/commons/crypto/org_apache_commons_crypto.h
+++ b/src/main/native/org/apache/commons/crypto/org_apache_commons_crypto.h
@@ -46,22 +46,6 @@
     } \
   }
 
-/* Helper macro to return if an exception is pending */
-#define PASS_EXCEPTIONS(env) \
-  { \
-    if ((*env)->ExceptionCheck(env)) return; \
-  }
-
-#define PASS_EXCEPTIONS_GOTO(env, target) \
-  { \
-    if ((*env)->ExceptionCheck(env)) goto target; \
-  }
-
-#define PASS_EXCEPTIONS_RET(env, ret) \
-  { \
-    if ((*env)->ExceptionCheck(env)) return (ret); \
-  }
-
 void close_library();
 
 /**
@@ -260,25 +244,6 @@ static FARPROC WINAPI do_dlsym_fallback(JNIEnv *env, HMODULE handle, LPCSTR symb
 #endif
 // Windows part end
 
-
-#define LOCK_CLASS(env, clazz, classname) \
-  if ((*env)->MonitorEnter(env, clazz) != 0) { \
-    char exception_msg[128]; \
-    snprintf(exception_msg, sizeof(exception_msg), "Failed to lock %s", classname); \
-    THROW(env, "java/lang/InternalError", exception_msg); \
-  }
-
-#define UNLOCK_CLASS(env, clazz, classname) \
-  if ((*env)->MonitorExit(env, clazz) != 0) { \
-    char exception_msg[128]; \
-    snprintf(exception_msg, sizeof(exception_msg), "Failed to unlock %s", classname); \
-    THROW(env, "java/lang/InternalError", exception_msg); \
-  }
-
-#define RETRY_ON_EINTR(ret, expr) do { \
-  ret = expr; \
-} while ((ret == -1) && (errno == EINTR));
-
 #include "config.h"
 
 #include <openssl/aes.h>
@@ -286,12 +251,6 @@ static FARPROC WINAPI do_dlsym_fallback(JNIEnv *env, HMODULE handle, LPCSTR symb
 #include <openssl/err.h>
 #include <openssl/opensslv.h>
 
-/**
- * A helper macro to convert the java 'context-handle'
- * to a EVP_CIPHER_CTX pointer.
- */
-#define CONTEXT(context) ((EVP_CIPHER_CTX*)((ptrdiff_t)(context)))
-
 /**
  * A helper macro to convert the EVP_CIPHER_CTX pointer to the
  * java 'context-handle'.
diff --git a/src/main/native/org/apache/commons/crypto/random/org_apache_commons_crypto_random.h b/src/main/native/org/apache/commons/crypto/random/org_apache_commons_crypto_random.h
index 41e5cf37..8e93a57c 100644
--- a/src/main/native/org/apache/commons/crypto/random/org_apache_commons_crypto_random.h
+++ b/src/main/native/org/apache/commons/crypto/random/org_apache_commons_crypto_random.h
@@ -21,8 +21,6 @@
 
 #include "org_apache_commons_crypto.h"
 
-#define UNUSED(x) ((void)(x))
-
 #include <openssl/crypto.h>
 #include <openssl/engine.h>
 #include <openssl/rand.h>