summaryrefslogtreecommitdiffstats
path: root/vpp-japi
diff options
context:
space:
mode:
authorDave Wallace <dwallacelf@gmail.com>2015-12-15 13:22:37 +0000
committerGerrit Code Review <gerrit@projectrotterdam.info>2015-12-15 13:22:37 +0000
commit317be0349275f1f461028853d936670729591796 (patch)
tree2423d844a2f9ed9176f54ce5d07a368e248e9e6f /vpp-japi
parentec65a1afd3f118849a7629d99ab2a1dcd2dda341 (diff)
parentd2dc3df90d20419dfaee03f3096ed18d20fa391a (diff)
Merge "replacing all vec_sort() invocations to vec_sort_with_function()"
Diffstat (limited to 'vpp-japi')
-rw-r--r--vpp-japi/japi/vppjni.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/vpp-japi/japi/vppjni.c b/vpp-japi/japi/vppjni.c
index 740a3425d90..4274c31dd91 100644
--- a/vpp-japi/japi/vppjni.c
+++ b/vpp-japi/japi/vppjni.c
@@ -362,6 +362,15 @@ out:
return (rv);
}
+static int
+name_sort_cmp (void * a1, void * a2)
+{
+ name_sort_t * n1 = a1;
+ name_sort_t * n2 = a2;
+
+ return strcmp ((char *)n1->name, (char *)n2->name);
+}
+
JNIEXPORT jstring JNICALL Java_org_openvpp_vppjapi_vppConn_getInterfaceList
(JNIEnv * env, jobject obj, jstring name_filter)
{
@@ -387,8 +396,7 @@ JNIEXPORT jstring JNICALL Java_org_openvpp_vppjapi_vppConn_getInterfaceList
}
}));
- vec_sort (nses, n1, n2,
- strcmp ((char *)n1->name, (char *)n2->name));
+ vec_sort_with_function (nses, name_sort_cmp);
vec_foreach (ns, nses)
s = format (s, "%s: %d, ", ns->name, ns->value);