From 90f504820799f90c16b6dbb6b3e7a303e499bdc3 Mon Sep 17 00:00:00 2001 From: Yanqin Jin Date: Wed, 5 Sep 2018 13:41:09 -0700 Subject: [PATCH] Remove warnings caused by unused variables in jni (#4345) Summary: Test plan ``` $make clean jclean $make -j32 rocksdbjavastatic $make -j32 rocksdbjava ``` Pull Request resolved: https://github.com/facebook/rocksdb/pull/4345 Differential Revision: D9661256 Pulled By: riversand963 fbshipit-source-id: aed316c53b29d02fbdd3fa1063a3e832b8a66469 --- java/rocksjni/transaction.cc | 4 ++++ java/rocksjni/writebatchhandlerjnicallback.cc | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/java/rocksjni/transaction.cc b/java/rocksjni/transaction.cc index 43be09560..a29736df2 100644 --- a/java/rocksjni/transaction.cc +++ b/java/rocksjni/transaction.cc @@ -612,7 +612,11 @@ void txn_write_kv_parts_helper(JNIEnv* env, const jint& jkey_parts_len, const jobjectArray& jvalue_parts, const jint& jvalue_parts_len) { +#ifndef DEBUG + (void) jvalue_parts_len; +#else assert(jkey_parts_len == jvalue_parts_len); +#endif auto key_parts = std::vector(); auto value_parts = std::vector(); diff --git a/java/rocksjni/writebatchhandlerjnicallback.cc b/java/rocksjni/writebatchhandlerjnicallback.cc index 69fe87659..bf9001110 100644 --- a/java/rocksjni/writebatchhandlerjnicallback.cc +++ b/java/rocksjni/writebatchhandlerjnicallback.cc @@ -306,7 +306,11 @@ rocksdb::Status WriteBatchHandlerJniCallback::PutBlobIndexCF(uint32_t column_fam } rocksdb::Status WriteBatchHandlerJniCallback::MarkBeginPrepare(bool unprepare) { +#ifndef DEBUG + (void) unprepare; +#else assert(!unprepare); +#endif m_env->CallVoidMethod(m_jcallback_obj, m_jMarkBeginPrepareMethodId); // check for Exception, in-particular RocksDBException