diff options
author | Daniel Black <grooverdan@users.sourceforge.net> | 2018-06-30 21:23:21 +1000 |
---|---|---|
committer | Vicențiu-Marian Ciorbaru <vicentiu@mariadb.org> | 2018-08-25 18:27:14 +0300 |
commit | 6b22cc4ae074276eb0adca4c7a7a0b99cc6ca56b (patch) | |
tree | 92af6f407f3dea0413dc370b19ff4061ff84b8b2 | |
parent | 4ba6327f9560a23c128c2434d0fe6511d0d94452 (diff) | |
download | mariadb-git-6b22cc4ae074276eb0adca4c7a7a0b99cc6ca56b.tar.gz |
connect engine: GetStringUTFChars takes pointer arg
Avoids compile errors of the form:
/storage/connect/jdbconn.cpp:1473:41: error: cannot initialize a parameter of type 'jboolean *' (aka 'unsigned char *') with an rvalue of type 'jboolean' (aka 'unsigned char')
name = env->GetStringUTFChars(label, (jboolean)false);
^~~~~~~~~~~~~~~
/usr/lib/jvm/java-8-oracle/include/jni.h:1616:58: note: passing argument to parameter 'isCopy' here
const char* GetStringUTFChars(jstring str, jboolean *isCopy) {
-rw-r--r-- | storage/connect/javaconn.cpp | 4 | ||||
-rw-r--r-- | storage/connect/jdbconn.cpp | 10 | ||||
-rw-r--r-- | storage/connect/jmgoconn.cpp | 4 | ||||
-rw-r--r-- | storage/connect/tabjmg.cpp | 2 |
4 files changed, 10 insertions, 10 deletions
diff --git a/storage/connect/javaconn.cpp b/storage/connect/javaconn.cpp index d1be0ca1848..e73149486a8 100644 --- a/storage/connect/javaconn.cpp +++ b/storage/connect/javaconn.cpp @@ -153,7 +153,7 @@ bool JAVAConn::Check(jint rc) if (exc != nullptr && tid != nullptr) { jstring s = (jstring)env->CallObjectMethod(exc, tid); - const char *utf = env->GetStringUTFChars(s, (jboolean)false); + const char *utf = env->GetStringUTFChars(s, NULL); env->DeleteLocalRef(s); Msg = PlugDup(m_G, utf); } else @@ -162,7 +162,7 @@ bool JAVAConn::Check(jint rc) env->ExceptionClear(); } else if (rc < 0) { s = (jstring)env->CallObjectMethod(job, errid); - Msg = (char*)env->GetStringUTFChars(s, (jboolean)false); + Msg = (char*)env->GetStringUTFChars(s, NULL); } else Msg = NULL; diff --git a/storage/connect/jdbconn.cpp b/storage/connect/jdbconn.cpp index ddbc3115f0b..7e42ca126d0 100644 --- a/storage/connect/jdbconn.cpp +++ b/storage/connect/jdbconn.cpp @@ -828,11 +828,11 @@ bool JDBConn::Connect(PJPARM sop) jstring s = (jstring)env->CallObjectMethod(job, qcid); if (s != nullptr) { - char *qch = (char*)env->GetStringUTFChars(s, (jboolean)false); + char *qch = (char*)env->GetStringUTFChars(s, NULL); m_IDQuoteChar[0] = *qch; } else { s = (jstring)env->CallObjectMethod(job, errid); - Msg = (char*)env->GetStringUTFChars(s, (jboolean)false); + Msg = (char*)env->GetStringUTFChars(s, NULL); } // endif s } // endif qcid @@ -1010,7 +1010,7 @@ void JDBConn::SetColumnValue(int rank, PSZ name, PVAL val) cn = nullptr; if (cn) { - field = env->GetStringUTFChars(cn, (jboolean)false); + field = env->GetStringUTFChars(cn, NULL); val->SetValue_psz((PSZ)field); } else val->Reset(); @@ -1084,7 +1084,7 @@ void JDBConn::SetColumnValue(int rank, PSZ name, PVAL val) cn = nullptr; if (cn) { - const char *field = env->GetStringUTFChars(cn, (jboolean)false); + const char *field = env->GetStringUTFChars(cn, NULL); val->SetValue_psz((PSZ)field); } else val->Reset(); @@ -1462,7 +1462,7 @@ bool JDBConn::SetParam(JDBCCOL *colp) return NULL; } // endif label - name = env->GetStringUTFChars(label, (jboolean)false); + name = env->GetStringUTFChars(label, NULL); crp = qrp->Colresp; // Column_Name crp->Kdata->SetValue((char*)name, i); n = env->GetIntArrayElements(val, 0); diff --git a/storage/connect/jmgoconn.cpp b/storage/connect/jmgoconn.cpp index 1731ccbeb8c..33668e69988 100644 --- a/storage/connect/jmgoconn.cpp +++ b/storage/connect/jmgoconn.cpp @@ -522,7 +522,7 @@ PSZ JMgoConn::GetDocument(void) jdc = (jstring)env->CallObjectMethod(job, getdocid); if (jdc) - doc = (PSZ)env->GetStringUTFChars(jdc, (jboolean)false); + doc = (PSZ)env->GetStringUTFChars(jdc, NULL); } // endif getdocid @@ -807,7 +807,7 @@ PSZ JMgoConn::GetColumnValue(PSZ path) fn = (jstring)env->CallObjectMethod(job, objfldid, jn); if (fn) - fld = (PSZ)env->GetStringUTFChars(fn, (jboolean)false); + fld = (PSZ)env->GetStringUTFChars(fn, NULL); } // endif objfldid diff --git a/storage/connect/tabjmg.cpp b/storage/connect/tabjmg.cpp index ba3e1c3e7c0..4653973a4db 100644 --- a/storage/connect/tabjmg.cpp +++ b/storage/connect/tabjmg.cpp @@ -101,7 +101,7 @@ bool JMGDISC::ColDesc(PGLOBAL g, jobject obj, char *pcn, char *pfmt, continue; jkey = (jstring)Jcp->env->CallObjectMethod(Jcp->job, bvnameid); - key = Jcp->env->GetStringUTFChars(jkey, (jboolean)false); + key = Jcp->env->GetStringUTFChars(jkey, NULL); if (pcn) { strncpy(colname, pcn, 64); |