From 7452e0ce1c40a09e6aedddf64d81dd124fa4609a Mon Sep 17 00:00:00 2001 From: Martin Desruisseaux Date: Wed, 2 May 2018 13:48:19 +0200 Subject: Use the #define constant generated by javac instead than a constant maintained manually. --- src/jniproj.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/jniproj.c b/src/jniproj.c index 072fa04c..573dd0e7 100644 --- a/src/jniproj.c +++ b/src/jniproj.c @@ -54,9 +54,6 @@ #define PJ_FIELD_NAME "ptr" #define PJ_FIELD_TYPE "J" -#define PJ_MAX_DIMENSION 100 -/* The PJ_MAX_DIMENSION value appears also in quoted strings. - Please perform a search-and-replace if this value is changed. */ /*! * \brief @@ -391,9 +388,9 @@ JNIEXPORT void JNICALL Java_org_proj4_PJ_transform if (c) (*env)->ThrowNew(env, c, "The target CRS and the coordinates array can not be null."); return; } - if (dimension < 2 || dimension > PJ_MAX_DIMENSION) { /* Arbitrary upper value for catching potential misuse. */ + if (dimension < 2 || dimension > org_proj4_PJ_DIMENSION_MAX) { /* Arbitrary upper value for catching potential misuse. */ jclass c = (*env)->FindClass(env, "java/lang/IllegalArgumentException"); - if (c) (*env)->ThrowNew(env, c, "Illegal dimension. Must be in the [2-100] range."); + if (c) (*env)->ThrowNew(env, c, "Illegal number of dimensions."); return; } if ((offset < 0) || (numPts < 0) || (offset + dimension*numPts) > (*env)->GetArrayLength(env, coordinates)) { -- cgit v1.2.3