Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: jni/JniFilter.cpp

Issue 6606493159784448: New JNI bindings (Closed)
Patch Set: Style review fixes Created March 28, 2014, 11 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: jni/JniFilter.cpp
diff --git a/jni/JniFilter.cpp b/jni/JniFilter.cpp
index 56d4f206eb8b65ebb39186f13a4f77f384ba2adf..a1a9f6e66050ce5d487443c2b69b7ed93cabea12 100644
--- a/jni/JniFilter.cpp
+++ b/jni/JniFilter.cpp
@@ -21,15 +21,14 @@
static AdblockPlus::Filter* GetFilterPtr(jlong ptr)
{
- return AdblockPlus::Android::JniLong2TypePtr<AdblockPlus::FilterPtr>(ptr)->get();
+ return JniLongToTypePtr<AdblockPlus::FilterPtr>(ptr)->get();
}
static jlong JNICALL JniCtor(JNIEnv* env, jclass clazz, jlong jsValue)
{
TRY
{
- return AdblockPlus::Android::JniPtr2Long(
- new AdblockPlus::FilterPtr(new AdblockPlus::Filter(AdblockPlus::Android::JniGetJsValuePtr(jsValue))));
+ return JniPtrToLong(new AdblockPlus::FilterPtr(new AdblockPlus::Filter(JniGetJsValuePtr(jsValue))));
}
CATCH_THROW_AND_RETURN(env, 0)
}
@@ -113,12 +112,13 @@ static jboolean JNICALL JniOperatorEquals(JNIEnv* env, jclass clazz, jlong ptr,
static JNINativeMethod methods[] =
{
-{ (char*)"ctor", (char*)"(J)J", (void*)JniCtor },
-{ (char*)"getType", (char*)"(J)" TYP("Filter$Type"), (void*)JniGetType },
-{ (char*)"isListed", (char*)"(J)Z", (void*)JniIsListed },
-{ (char*)"addToList", (char*)"(J)V", (void*)JniAddToList },
-{ (char*)"removeFromList", (char*)"(J)V", (void*)JniRemoveFromList },
-{ (char*)"operatorEquals", (char*)"(JJ)Z", (void*)JniOperatorEquals }, };
+ { (char*)"ctor", (char*)"(J)J", (void*)JniCtor },
+ { (char*)"getType", (char*)"(J)" TYP("Filter$Type"), (void*)JniGetType },
+ { (char*)"isListed", (char*)"(J)Z", (void*)JniIsListed },
+ { (char*)"addToList", (char*)"(J)V", (void*)JniAddToList },
+ { (char*)"removeFromList", (char*)"(J)V", (void*)JniRemoveFromList },
+ { (char*)"operatorEquals", (char*)"(JJ)Z", (void*)JniOperatorEquals }
+};
extern "C" JNIEXPORT void JNICALL Java_org_adblockplus_android_api_Filter_registerNatives(JNIEnv *env, jclass clazz)
{

Powered by Google App Engine
This is Rietveld