#At file:///Users/mz/mysql/ndb-6.3-ndbjtie/ based on revid:bernhard.ocklin@stripped
3115 Martin Zaun 2009-11-13 [merge]
ndbjtie - merge
added:
storage/ndb/ndbjtie/src/ndbapi_wrapper.hpp
modified:
storage/ndb/ndbjtie/jtie/include/jtie_gcalls.hpp
storage/ndb/ndbjtie/jtie/test/myapi/myapi.hpp
storage/ndb/ndbjtie/src/Makefile.am
storage/ndb/ndbjtie/src/ndbapi_jtie.hpp
=== modified file 'storage/ndb/ndbjtie/jtie/include/jtie_gcalls.hpp'
--- a/storage/ndb/ndbjtie/jtie/include/jtie_gcalls.hpp 2009-11-07 04:40:48 +0000
+++ b/storage/ndb/ndbjtie/jtie/include/jtie_gcalls.hpp 2009-11-11 06:26:33 +0000
@@ -463,7 +463,7 @@
// ---------------------------------------------------------------------------
// status flag declaration
-#define SFD int s; (void)s;
+#define SFD int s = 1; (void)s;
#define PARAM_CONV_BEGIN(n) \
JAPT(n) jap##n = cast< JAPT(n), JFPT(n) >(jfp##n); \
=== modified file 'storage/ndb/ndbjtie/jtie/test/myapi/myapi.hpp'
--- a/storage/ndb/ndbjtie/jtie/test/myapi/myapi.hpp 2009-11-04 17:28:51 +0000
+++ b/storage/ndb/ndbjtie/jtie/test/myapi/myapi.hpp 2009-11-11 06:26:33 +0000
@@ -592,27 +592,27 @@ struct A {
static A & return_null_ref() {
TRACE("A & A::return_null_ref()");
- return *((A *)NULL);
+ return *((A *)0);
};
- static void take_ptr(A * a) {
+ static void take_ptr(A * o) {
TRACE("void A::take_ptr(A *)");
- if (a != A::a) ABORT_ERROR("void A::take_ptr(A *)");
+ if (o != A::a) ABORT_ERROR("void A::take_ptr(A *)");
};
- static void take_null_ptr(A * a) {
+ static void take_null_ptr(A * o) {
TRACE("void A::take_null_ptr(A *)");
- if (a != NULL) ABORT_ERROR("void A::take_null_ptr(A *)");
+ if (o != NULL) ABORT_ERROR("void A::take_null_ptr(A *)");
};
- static void take_ref(A & a) {
+ static void take_ref(A & o) {
TRACE("void A::take_ref(A &)");
- if (&a != A::a) ABORT_ERROR("void A::take_ref(A &)");
+ if (&o != A::a) ABORT_ERROR("void A::take_ref(A &)");
};
- static void take_null_ref(A & a) {
+ static void take_null_ref(A & o) {
TRACE("void A::take_null_ref(A &)");
- if (&a != NULL) ABORT_ERROR("void A::take_null_ref(A &)");
+ if (&o != NULL) ABORT_ERROR("void A::take_null_ref(A &)");
};
static void print(A * p0) {
@@ -821,9 +821,9 @@ struct C0 {
TRACE("C0()");
}
- C0(const C0 & c) {
+ C0(const C0 & o) {
TRACE("C0(const C0 &)");
- (void)c;
+ (void)o;
ABORT_ERROR("!USE OF COPY CONSTRUCTOR!");
}
@@ -831,9 +831,9 @@ struct C0 {
TRACE("~C0()");
}
- C0 & operator=(const C0 & p) {
+ C0 & operator=(const C0 & o) {
TRACE("C0 & operator=(const C0 &)");
- (void)p;
+ (void)o;
ABORT_ERROR("!USE OF ASSIGNMENT OPERATOR!");
return *this;
}
@@ -919,9 +919,9 @@ struct C1 : public C0 {
TRACE("C1()");
};
- C1(const C1 & c) : C0(c) {
+ C1(const C1 & o) : C0(o) {
TRACE("C1(const C1 &)");
- (void)c;
+ (void)o;
ABORT_ERROR("!USE OF COPY CONSTRUCTOR!");
};
=== modified file 'storage/ndb/ndbjtie/src/Makefile.am'
--- a/storage/ndb/ndbjtie/src/Makefile.am 2009-11-09 16:53:03 +0000
+++ b/storage/ndb/ndbjtie/src/Makefile.am 2009-11-13 19:00:13 +0000
@@ -111,6 +111,9 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/storage/ndb/include/ndbapi \
@JNI_INCLUDE_DIRS@
+# XXX for Sun Studio 12.1 compilers
+# -DNDBJTIE_USE_WRAPPER_VARIANT
+
## build a shared library
pkglib_LTLIBRARIES = libndbjtie.la
=== modified file 'storage/ndb/ndbjtie/src/ndbapi_jtie.hpp'
--- a/storage/ndb/ndbjtie/src/ndbapi_jtie.hpp 2009-11-11 05:12:59 +0000
+++ b/storage/ndb/ndbjtie/src/ndbapi_jtie.hpp 2009-11-13 19:00:13 +0000
@@ -25,6 +25,7 @@
// API to implement against
#include "NdbApi.hpp"
#include "NdbError.hpp"
+#include "ndbapi_wrapper.hpp"
// libraries
#include "ndbjtie_defs.hpp"
@@ -1662,7 +1663,11 @@ JNIEXPORT jint JNICALL
Java_com_mysql_ndbjtie_ndbapi_NdbDictionary_00024Dictionary_listObjects(JNIEnv * env, jobject obj, jobject p0, jint p1)
{
TRACE("jint Java_com_mysql_ndbjtie_ndbapi_NdbDictionary_00024Dictionary_listObjects(JNIEnv *, jobject, jobject, jint)");
+#ifndef NDBJTIE_USE_WRAPPER_VARIANT
return gcall< ttrait_c_m_n_n_NdbDictionary_Dictionary_ct, ttrait_int, ttrait_c_m_n_n_NdbDictionary_DictionaryConst_List_r, ttrait_c_m_n_n_NdbDictionary_Object_Type_iv/*_enum_*/, &NdbDictionary::Dictionary::listObjects >(env, obj, p0, p1); // call of overloaded const/non-const method
+#else
+ return gcall< ttrait_int, ttrait_c_m_n_n_NdbDictionary_Dictionary_cr, ttrait_c_m_n_n_NdbDictionary_DictionaryConst_List_r, ttrait_c_m_n_n_NdbDictionary_Object_Type_iv/*_enum_*/, &NdbApiWrapper::listObjects >(env, NULL, obj, p0, p1);
+#endif // NDBJTIE_USE_WRAPPER_VARIANT
}
/*
@@ -1710,7 +1715,11 @@ JNIEXPORT jint JNICALL
Java_com_mysql_ndbjtie_ndbapi_NdbDictionary_00024Dictionary_listIndexes(JNIEnv * env, jobject obj, jobject p0, jstring p1)
{
TRACE("jint Java_com_mysql_ndbjtie_ndbapi_NdbDictionary_00024Dictionary_listIndexes(JNIEnv *, jobject, jobject, jstring)");
+#ifndef NDBJTIE_USE_WRAPPER_VARIANT
return gcall< ttrait_c_m_n_n_NdbDictionary_Dictionary_ct, ttrait_int, ttrait_c_m_n_n_NdbDictionary_DictionaryConst_List_r, ttrait_utf8cstring, &NdbDictionary::Dictionary::listIndexes >(env, obj, p0, p1); // call of overloaded const/non-const method
+#else
+ return gcall< ttrait_int, ttrait_c_m_n_n_NdbDictionary_Dictionary_cr, ttrait_c_m_n_n_NdbDictionary_DictionaryConst_List_r, ttrait_utf8cstring, &NdbApiWrapper::listIndexes >(env, NULL, obj, p0, p1);
+#endif // NDBJTIE_USE_WRAPPER_VARIANT
}
/*
@@ -1722,7 +1731,11 @@ JNIEXPORT jint JNICALL
Java_com_mysql_ndbjtie_ndbapi_NdbDictionary_00024Dictionary_listEvents(JNIEnv * env, jobject obj, jobject p0)
{
TRACE("jint Java_com_mysql_ndbjtie_ndbapi_NdbDictionary_00024Dictionary_listEvents(JNIEnv *, jobject, jobject)");
+#ifndef NDBJTIE_USE_WRAPPER_VARIANT
return gcall< ttrait_c_m_n_n_NdbDictionary_Dictionary_ct, ttrait_int, ttrait_c_m_n_n_NdbDictionary_DictionaryConst_List_r, &NdbDictionary::Dictionary::listEvents >(env, obj, p0); // call of overloaded const/non-const method
+#else
+ return gcall< ttrait_int, ttrait_c_m_n_n_NdbDictionary_Dictionary_cr, ttrait_c_m_n_n_NdbDictionary_DictionaryConst_List_r, &NdbApiWrapper::listEvents >(env, NULL, obj, p0);
+#endif // NDBJTIE_USE_WRAPPER_VARIANT
}
/*
@@ -5796,7 +5809,11 @@ JNIEXPORT jobject JNICALL
Java_com_mysql_ndbjtie_ndbapi_NdbOperation_getBlobHandle__Ljava_lang_String_2(JNIEnv * env, jobject obj, jstring p0)
{
TRACE("jobject Java_com_mysql_ndbjtie_ndbapi_NdbOperation_getBlobHandle__Ljava_lang_String_2(JNIEnv *, jobject, jstring)");
+#ifndef NDBJTIE_USE_WRAPPER_VARIANT
return gcall< ttrait_c_m_n_n_NdbOperation_ct, ttrait_c_m_n_n_NdbBlob_p, ttrait_utf8cstring, &NdbOperation::getBlobHandle >(env, obj, p0); // call of overloaded const/non-const method
+#else
+ return gcall< ttrait_c_m_n_n_NdbBlob_p, ttrait_c_m_n_n_NdbOperation_cr, ttrait_utf8cstring, &NdbApiWrapper::getBlobHandle >(env, NULL, obj, p0);
+#endif // NDBJTIE_USE_WRAPPER_VARIANT
}
/*
@@ -5808,7 +5825,11 @@ JNIEXPORT jobject JNICALL
Java_com_mysql_ndbjtie_ndbapi_NdbOperation_getBlobHandle__I(JNIEnv * env, jobject obj, jint p0)
{
TRACE("jobject Java_com_mysql_ndbjtie_ndbapi_NdbOperation_getBlobHandle__I(JNIEnv *, jobject, jint)");
+#ifndef NDBJTIE_USE_WRAPPER_VARIANT
return gcall< ttrait_c_m_n_n_NdbOperation_ct, ttrait_c_m_n_n_NdbBlob_p, ttrait_Uint32, &NdbOperation::getBlobHandle >(env, obj, p0); // call of overloaded const/non-const method
+#else
+ return gcall< ttrait_c_m_n_n_NdbBlob_p, ttrait_c_m_n_n_NdbOperation_cr, ttrait_Uint32, &NdbApiWrapper::getBlobHandle >(env, NULL, obj, p0);
+#endif // NDBJTIE_USE_WRAPPER_VARIANT
}
/*
@@ -6205,7 +6226,11 @@ JNIEXPORT jobject JNICALL
Java_com_mysql_ndbjtie_ndbapi_NdbOperation_getBlobHandleM__Ljava_lang_String_2(JNIEnv * env, jobject obj, jstring p0)
{
TRACE("jobject Java_com_mysql_ndbjtie_ndbapi_NdbOperation_getBlobHandleM__Ljava_lang_String_2(JNIEnv *, jobject, jstring)");
+#ifndef NDBJTIE_USE_WRAPPER_VARIANT
return gcall< ttrait_c_m_n_n_NdbOperation_t, ttrait_c_m_n_n_NdbBlob_p, ttrait_utf8cstring, &NdbOperation::getBlobHandle >(env, obj, p0); // call of overloaded const/non-const method
+#else
+ return gcall< ttrait_c_m_n_n_NdbBlob_p, ttrait_c_m_n_n_NdbOperation_r, ttrait_utf8cstring, &NdbApiWrapper::getBlobHandle >(env, NULL, obj, p0);
+#endif // NDBJTIE_USE_WRAPPER_VARIANT
}
/*
@@ -6217,7 +6242,11 @@ JNIEXPORT jobject JNICALL
Java_com_mysql_ndbjtie_ndbapi_NdbOperation_getBlobHandleM__I(JNIEnv * env, jobject obj, jint p0)
{
TRACE("jobject Java_com_mysql_ndbjtie_ndbapi_NdbOperation_getBlobHandleM__I(JNIEnv *, jobject, jint)");
+#ifndef NDBJTIE_USE_WRAPPER_VARIANT
return gcall< ttrait_c_m_n_n_NdbOperation_t, ttrait_c_m_n_n_NdbBlob_p, ttrait_Uint32, &NdbOperation::getBlobHandle >(env, obj, p0); // call of overloaded const/non-const method
+#else
+ return gcall< ttrait_c_m_n_n_NdbBlob_p, ttrait_c_m_n_n_NdbOperation_r, ttrait_Uint32, &NdbApiWrapper::getBlobHandle >(env, NULL, obj, p0);
+#endif // NDBJTIE_USE_WRAPPER_VARIANT
}
/*
=== added file 'storage/ndb/ndbjtie/src/ndbapi_wrapper.hpp'
--- a/storage/ndb/ndbjtie/src/ndbapi_wrapper.hpp 1970-01-01 00:00:00 +0000
+++ b/storage/ndb/ndbjtie/src/ndbapi_wrapper.hpp 2009-11-13 19:00:13 +0000
@@ -0,0 +1,66 @@
+/*
+ Copyright (C) 2009 Sun Microsystems, Inc.
+ All rights reserved. Use is subject to license terms.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+/*
+ * ndbapi_wrapper.hpp
+ */
+
+#ifndef ndbapi_wrapper_hpp
+#define ndbapi_wrapper_hpp
+
+// API to implement against
+#include "NdbApi.hpp"
+
+struct NdbApiWrapper {
+ static NdbBlob * getBlobHandle() {
+ return 0;
+ }
+
+ static NdbBlob * getBlobHandle(NdbOperation & obj, const char * anAttrName) {
+ return obj.getBlobHandle(anAttrName);
+ }
+
+ static NdbBlob * getBlobHandle(NdbOperation & obj, Uint32 anAttrId) {
+ return obj.getBlobHandle(anAttrId);
+ }
+
+ static NdbBlob * getBlobHandle(const NdbOperation & obj, const char * anAttrName) {
+ return obj.getBlobHandle(anAttrName);
+ }
+
+ static NdbBlob * getBlobHandle(const NdbOperation & obj, Uint32 anAttrId) {
+ return obj.getBlobHandle(anAttrId);
+ }
+
+ static int listIndexes(const NdbDictionary::Dictionary & obj, NdbDictionary::Dictionary::List & list, const char * tableName) {
+ return obj.listIndexes(list, tableName);
+ }
+
+ static int listEvents(const NdbDictionary::Dictionary & obj, NdbDictionary::Dictionary::List & list) {
+ return obj.listEvents(list);
+ }
+
+ static int listObjects(const NdbDictionary::Dictionary & obj, NdbDictionary::Dictionary::List & list, NdbDictionary::Object::Type type = NdbDictionary::Object::TypeUndefined) {
+ return obj.listObjects(list, type);
+ }
+
+ static int getNdbErrorLine(const NdbOperation & obj) {
+ return obj.getNdbErrorLine();
+ }
+};
+
+#endif // ndbapi_wrapper_hpp
Attachment: [text/bzr-bundle] bzr/martin.zaun@sun.com-20091113191957-txp99l1d2f9do7jz.bundle
| Thread |
|---|
| • bzr commit into mysql-5.1-telco-6.3-ndbjtie branch (martin.zaun:3115) | Martin Zaun | 13 Nov |