From: stephan Date: Mon, 4 Sep 2023 05:58:13 +0000 (+0000) Subject: Remove several unnececessary functions. X-Git-Tag: version-3.44.0~216^2~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3aeb58c90ccfdad1f4327cc477acd0cc185ed64f;p=thirdparty%2Fsqlite.git Remove several unnececessary functions. FossilOrigin-Name: 84433c72b0b08e7906ef87758caffe98f95df812945a7aea675bbc20791e33c0 --- diff --git a/ext/jni/src/c/sqlite3-jni.c b/ext/jni/src/c/sqlite3-jni.c index 7c7b57a475..9a0ff6338d 100644 --- a/ext/jni/src/c/sqlite3-jni.c +++ b/ext/jni/src/c/sqlite3-jni.c @@ -1592,44 +1592,6 @@ static void OutputPointer_set_obj(JNIEnv * const env, S3JniExceptionIsFatal("Cannot set OutputPointer.T.value"); } -/* -** Sets the value property of the OutputPointer.sqlite3 jOut object to -** v. -*/ -static void OutputPointer_set_sqlite3(JNIEnv * const env, jobject const jOut, - jobject v){ - OutputPointer_set_obj(env, S3JniNph(OutputPointer_sqlite3), jOut, v); -} - -/* -** Sets the value property of the OutputPointer.sqlite3_blob jOut object to -** v. -*/ -static void OutputPointer_set_sqlite3_blob(JNIEnv * const env, jobject const jOut, - jobject v){ - OutputPointer_set_obj(env, S3JniNph(OutputPointer_sqlite3_blob), jOut, v); -} - -/* -** Sets the value property of the OutputPointer.sqlite3_stmt jOut object to -** v. -*/ -static void OutputPointer_set_sqlite3_stmt(JNIEnv * const env, jobject const jOut, - jobject v){ - OutputPointer_set_obj(env, S3JniNph(OutputPointer_sqlite3_stmt), jOut, v); -} - -#ifdef SQLITE_ENABLE_PREUPDATE_HOOK -/* -** Sets the value property of the OutputPointer.sqlite3_value jOut object to -** v. -*/ -static void OutputPointer_set_sqlite3_value(JNIEnv * const env, jobject const jOut, - jobject v){ - OutputPointer_set_obj(env, S3JniNph(OutputPointer_sqlite3_value), jOut, v); -} -#endif /* SQLITE_ENABLE_PREUPDATE_HOOK */ - #ifdef SQLITE_ENABLE_FTS5 #if 0 /* @@ -1680,15 +1642,13 @@ static void S3Jni_jobject_finalizer(void *v){ } } - - /* ** Returns a new Java instance of the class referred to by pRef, which ** MUST be interface-compatible with NativePointerHolder and MUST have ** a no-arg constructor. The NativePointerHolder_set() method is -** passed the new Java object and pNative. Hypothetically returns NULL -** if Java fails to allocate, but the JNI docs are not entirely clear -** on that detail. +** passed the new Java object (which must not be NULL) and pNative +** (which may be NULL). Hypothetically returns NULL if Java fails to +** allocate, but the JNI docs are not entirely clear on that detail. ** ** Always use a static pointer from the S3JniNphOps struct for the ** 2nd argument. @@ -2484,7 +2444,7 @@ S3JniApi(sqlite3_blob_open(),jint,1blob_1open)( if( 0==rc ){ jobject rv = new_java_sqlite3_blob(env, pBlob); if( rv ){ - OutputPointer_set_sqlite3_blob(env, jOut, rv); + OutputPointer_set_obj(env, S3JniNph(OutputPointer_sqlite3_blob), jOut, rv); }else{ sqlite3_blob_close(pBlob); rc = SQLITE_NOMEM; @@ -2529,7 +2489,7 @@ S3JniApi(sqlite3_blob_write(),jint,1blob_1write)( const jsize nBa = pBuf ? (*env)->GetArrayLength(env, jBa) : 0; int rc = SQLITE_MISUSE; if(b && pBuf){ - rc = sqlite3_blob_write( b, pBuf, nBa, (int)iOffset ); + rc = sqlite3_blob_write( b, pBuf, (int)nBa, (int)iOffset ); } s3jni_jbyteArray_release(jBa, pBuf); return (jint)rc; @@ -3620,7 +3580,8 @@ static int s3jni_open_post(JNIEnv * const env, S3JniEnv * const jc, S3JniDb_set_aside(ps); ps = 0; } - OutputPointer_set_sqlite3(env, jOut, ps ? ps->jDb : 0); + OutputPointer_set_obj(env, S3JniNph(OutputPointer_sqlite3), + jOut, ps ? ps->jDb : 0); return theRc ? theRc : rc; } @@ -3712,7 +3673,9 @@ end: ** what follows... */ assert(zTail ? ((void*)zTail>=(void*)pBuf) : 1); assert(zTail ? (((int)((void*)zTail - (void*)pBuf)) >= 0) : 1); - OutputPointer_set_Int32(env, outTail, (int)(zTail ? (zTail - (const char *)pBuf) : 0)); + OutputPointer_set_Int32( + env, outTail, (int)(zTail ? (zTail - (const char *)pBuf) : 0) + ); } if( pStmt ){ NativePointerHolder_set(S3JniNph(sqlite3_stmt), jStmt, pStmt); @@ -3725,7 +3688,8 @@ end: S3JniUnrefLocal(jStmt); jStmt = 0; } - OutputPointer_set_sqlite3_stmt(env, jOutStmt, jStmt); + OutputPointer_set_obj(env, S3JniNph(OutputPointer_sqlite3_stmt), + jOutStmt, jStmt); return (jint)rc; } S3JniApi(sqlite3_prepare(),jint,1prepare)( @@ -3932,7 +3896,8 @@ static int s3jni_preupdate_newold(JNIEnv * const env, int isNew, jobject jDb, if( 0==rc ){ jobject pWrap = new_java_sqlite3_value(env, pOut); if( pWrap ){ - OutputPointer_set_sqlite3_value(env, jOut, pWrap); + OutputPointer_set_obj(env, S3JniNph(OutputPointer_sqlite3_value), + jOut, pWrap); S3JniUnrefLocal(pWrap); }else{ rc = SQLITE_NOMEM; diff --git a/ext/jni/src/c/sqlite3-jni.h b/ext/jni/src/c/sqlite3-jni.h index 35231f0fc2..f291269717 100644 --- a/ext/jni/src/c/sqlite3-jni.h +++ b/ext/jni/src/c/sqlite3-jni.h @@ -2277,6 +2277,8 @@ JNIEXPORT jobject JNICALL Java_org_sqlite_jni_Fts5ExtensionApi_xUserData #ifdef __cplusplus extern "C" { #endif +#undef org_sqlite_jni_fts5_api_iVersion +#define org_sqlite_jni_fts5_api_iVersion 2L /* * Class: org_sqlite_jni_fts5_api * Method: getInstanceForDb diff --git a/ext/jni/src/org/sqlite/jni/fts5_api.java b/ext/jni/src/org/sqlite/jni/fts5_api.java index a0376dfc8f..854a0348b1 100644 --- a/ext/jni/src/org/sqlite/jni/fts5_api.java +++ b/ext/jni/src/org/sqlite/jni/fts5_api.java @@ -25,7 +25,8 @@ import org.sqlite.jni.annotation.*; public final class fts5_api extends NativePointerHolder { /* Only invoked from JNI */ private fts5_api(){} - public final int iVersion = 2; + + public static final int iVersion = 2; /** Returns the fts5_api instance associated with the given db, or diff --git a/manifest b/manifest index 007295b3cb..ea5b7628ae 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Move\san\sinternal\sutility\sclass\sout\sof\sthe\spublic\sJava\sAPI. -D 2023-09-04T05:34:30.074 +C Remove\sseveral\sunnececessary\sfunctions. +D 2023-09-04T05:58:13.370 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -237,8 +237,8 @@ F ext/icu/sqliteicu.h fa373836ed5a1ee7478bdf8a1650689294e41d0c89c1daab26e9ae78a3 F ext/jni/GNUmakefile 2ae5e34ad21da48a8c1dd6e9e421d6bbb78716e3a03ad29dd86d9bd530ee3fc0 F ext/jni/README.md 1332b1fa27918bd5d9ca2d0d4f3ac3a6ab86b9e3699dc5bfe32904a027f3d2a9 F ext/jni/jar-dist.make 030aaa4ae71dd86e4ec5e7c1e6cd86f9dfa47c4592c070d2e35157e42498e1fa -F ext/jni/src/c/sqlite3-jni.c 4b6f4295378c198b145d402ca84af1f70fa242d713e1cfb37c0c10ab7d4d5cd0 -F ext/jni/src/c/sqlite3-jni.h ff3f05fa179a0242eb86fea90c1f77d695338876bba49a754700b3c129468735 +F ext/jni/src/c/sqlite3-jni.c 93452c93e4e23884490f0c8ee76a38bc6c9a441800d95ff86aacb0991ab414d0 +F ext/jni/src/c/sqlite3-jni.h 6a6dfa22fc760f3a355cdc42cae07ea06ae3ee6d4fbf60bb11220a250926064c F ext/jni/src/org/sqlite/jni/AbstractCollationCallback.java 95e88ba04f4aac51ffec65693e878e234088b2f21b387f4e4285c8b72b33e436 F ext/jni/src/org/sqlite/jni/AggregateFunction.java 7312486bc65fecdb91753c0a4515799194e031f45edbe16a6373cea18f404dc4 F ext/jni/src/org/sqlite/jni/AuthorizerCallback.java e6135be32f12bf140bffa39be7fd1a45ad83b2661ed49c08dbde04c8485feb38 @@ -275,7 +275,7 @@ F ext/jni/src/org/sqlite/jni/annotation/Canonical.java 2767daa5b3893b96729db80a0 F ext/jni/src/org/sqlite/jni/annotation/NotNull.java d9b32956cb9fb11d1f8a562e5df70d0599820265285120c63858294dbe2b7711 F ext/jni/src/org/sqlite/jni/annotation/Nullable.java 6f962a98c9a5c6e9d21c50ae8716b16bdfdc934a191608cbb7e12ea588ddb6af F ext/jni/src/org/sqlite/jni/annotation/package-info.java f66bfb621c6494e67c03ed38a9e26a3bd6af99b9f9f6ef79556bcec30a025a22 -F ext/jni/src/org/sqlite/jni/fts5_api.java bf7009a7fd2d11a77280380e6e2c7f98e377494b3f265e50fc44cbb9a24275d9 +F ext/jni/src/org/sqlite/jni/fts5_api.java 386ecbcfcd03c24afbca52dc8bdf00791b6f2cbc0dd7be53e354071ada94f7bc F ext/jni/src/org/sqlite/jni/fts5_extension_function.java bec9f17a7e784d57eca99d812a65ecc9dd74c8df62d6d90cc1ecb3e37de14d47 F ext/jni/src/org/sqlite/jni/fts5_tokenizer.java a92c2e55bda492e4c76d48ddc73369bcc0d5e8727940840f9339e3292ea58fa7 F ext/jni/src/org/sqlite/jni/package-info.java a3946db2504de747a1993c4f6e8ce604bec5a8e5a134b292c3b07527bc321a99 @@ -2117,8 +2117,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P fc34e2bfa4a2255f019a2514367e58596837289de49f7fab87279c8b40c7f119 -R 768a12cfd33f550248c1b9dce66d5e0b +P 8e1ae3197a62796565b7260b230057bdb3f136edd00a83f8a63532d44d386243 +R 5de5f56813f9d2b943c3cc107d561381 U stephan -Z 1c5b437e775779fe47dd6a40997032e6 +Z b5a6e033e7444f24fb64279fc427f971 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index f84fffe1b1..dca1c56b19 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -8e1ae3197a62796565b7260b230057bdb3f136edd00a83f8a63532d44d386243 \ No newline at end of file +84433c72b0b08e7906ef87758caffe98f95df812945a7aea675bbc20791e33c0 \ No newline at end of file