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

Unified Diff: jni/JniSubscription.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/JniSubscription.cpp
diff --git a/jni/JniSubscription.cpp b/jni/JniSubscription.cpp
index 289a4c84a572a91855454999c389b7255da73cb0..f6216e6c5acca8e9b61bb877e52c11e27d37d563 100644
--- a/jni/JniSubscription.cpp
+++ b/jni/JniSubscription.cpp
@@ -21,15 +21,14 @@
static AdblockPlus::Subscription* GetSubscriptionPtr(jlong ptr)
{
- return AdblockPlus::Android::JniLong2TypePtr<AdblockPlus::SubscriptionPtr>(ptr)->get();
+ return JniLongToTypePtr<AdblockPlus::SubscriptionPtr>(ptr)->get();
}
static jlong JNICALL JniCtor(JNIEnv* env, jclass clazz, jlong jsValue)
{
TRY
{
- return AdblockPlus::Android::JniPtr2Long(
- new AdblockPlus::SubscriptionPtr(new AdblockPlus::Subscription(AdblockPlus::Android::JniGetJsValuePtr(jsValue))));
+ return JniPtrToLong(new AdblockPlus::SubscriptionPtr(new AdblockPlus::Subscription(JniGetJsValuePtr(jsValue))));
}
CATCH_THROW_AND_RETURN(env, 0)
}
@@ -93,13 +92,14 @@ static jboolean JNICALL JniOperatorEquals(JNIEnv* env, jclass clazz, jlong ptr,
static JNINativeMethod methods[] =
{
-{ (char*)"ctor", (char*)"(J)J", (void*)JniCtor },
-{ (char*)"isListed", (char*)"(J)Z", (void*)JniIsListed },
-{ (char*)"addToList", (char*)"(J)V", (void*)JniAddToList },
-{ (char*)"removeFromList", (char*)"(J)V", (void*)JniRemoveFromList },
-{ (char*)"updateFilters", (char*)"(J)V", (void*)JniUpdateFilters },
-{ (char*)"isUpdating", (char*)"(J)Z", (void*)JniIsUpdating },
-{ (char*)"operatorEquals", (char*)"(JJ)Z", (void*)JniOperatorEquals }, };
+ { (char*)"ctor", (char*)"(J)J", (void*)JniCtor },
+ { (char*)"isListed", (char*)"(J)Z", (void*)JniIsListed },
+ { (char*)"addToList", (char*)"(J)V", (void*)JniAddToList },
+ { (char*)"removeFromList", (char*)"(J)V", (void*)JniRemoveFromList },
+ { (char*)"updateFilters", (char*)"(J)V", (void*)JniUpdateFilters },
+ { (char*)"isUpdating", (char*)"(J)Z", (void*)JniIsUpdating },
+ { (char*)"operatorEquals", (char*)"(JJ)Z", (void*)JniOperatorEquals }
+};
extern "C" JNIEXPORT void JNICALL Java_org_adblockplus_android_api_Subscription_registerNatives(JNIEnv *env, jclass clazz)
{

Powered by Google App Engine
This is Rietveld