Return-Path: X-Original-To: apmail-subversion-commits-archive@minotaur.apache.org Delivered-To: apmail-subversion-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7B038C6DD for ; Fri, 1 Jun 2012 03:11:13 +0000 (UTC) Received: (qmail 98410 invoked by uid 500); 1 Jun 2012 03:11:13 -0000 Delivered-To: apmail-subversion-commits-archive@subversion.apache.org Received: (qmail 98255 invoked by uid 500); 1 Jun 2012 03:11:10 -0000 Mailing-List: contact commits-help@subversion.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@subversion.apache.org Delivered-To: mailing list commits@subversion.apache.org Received: (qmail 98182 invoked by uid 99); 1 Jun 2012 03:11:08 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Jun 2012 03:11:08 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Jun 2012 03:11:07 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id F2F4B2388978; Fri, 1 Jun 2012 03:10:46 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1344977 - /subversion/branches/javahl-ra/subversion/bindings/javahl/native/JNIUtil.h Date: Fri, 01 Jun 2012 03:10:46 -0000 To: commits@subversion.apache.org From: vmpn@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120601031046.F2F4B2388978@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: vmpn Date: Fri Jun 1 03:10:46 2012 New Revision: 1344977 URL: http://svn.apache.org/viewvc?rev=1344977&view=rev Log: JavaHL: Added CPPADDR_NULL_PTR macro to reduce amount of duplicate code checking C++ pointer extracted from the java object [ in subversion/bindings/javahl/native ] * JNIUtil.h (CPPADDR_NULL_PTR): New macro to test for NULL pointer and raise java exception if necessary Approved by: gstein Modified: subversion/branches/javahl-ra/subversion/bindings/javahl/native/JNIUtil.h Modified: subversion/branches/javahl-ra/subversion/bindings/javahl/native/JNIUtil.h URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/bindings/javahl/native/JNIUtil.h?rev=1344977&r1=1344976&r2=1344977&view=diff ============================================================================== --- subversion/branches/javahl-ra/subversion/bindings/javahl/native/JNIUtil.h (original) +++ subversion/branches/javahl-ra/subversion/bindings/javahl/native/JNIUtil.h Fri Jun 1 03:10:46 2012 @@ -273,4 +273,12 @@ class JNIUtil */ #define POP_AND_RETURN_NULL POP_AND_RETURN(NULL) +#define CPPADDR_NULL_PTR(expr, ret_val) \ + do { \ + if ((expr) == NULL) { \ + JNIUtil::throwError(_("bad C++ this")); \ + return ret_val; \ + } \ + } while (0) + #endif // JNIUTIL_H