Return-Path: X-Original-To: apmail-openoffice-commits-archive@www.apache.org Delivered-To: apmail-openoffice-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 64357E296 for ; Fri, 8 Feb 2013 16:36:11 +0000 (UTC) Received: (qmail 61497 invoked by uid 500); 8 Feb 2013 16:36:10 -0000 Delivered-To: apmail-openoffice-commits-archive@openoffice.apache.org Received: (qmail 61457 invoked by uid 500); 8 Feb 2013 16:36:10 -0000 Mailing-List: contact commits-help@openoffice.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openoffice.apache.org Delivered-To: mailing list commits@openoffice.apache.org Received: (qmail 61420 invoked by uid 99); 8 Feb 2013 16:36:10 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Feb 2013 16:36:10 +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, 08 Feb 2013 16:36:08 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 61CAE23888E7; Fri, 8 Feb 2013 16:35:48 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1444115 - /openoffice/trunk/main/vcl/inc/vcl/bitmap.hxx Date: Fri, 08 Feb 2013 16:35:48 -0000 To: commits@openoffice.apache.org From: pfg@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130208163548.61CAE23888E7@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: pfg Date: Fri Feb 8 16:35:48 2013 New Revision: 1444115 URL: http://svn.apache.org/r1444115 Log: A miscellaneous use of boost. Sinc(x) is a simple function used in communications. boost happens to use it for quaternion math. The implementation is simple, however it looks fun to re-use the boost function even if just to say we are using quaternion math somewhere ;). The performance difference is not likely to be huge but JIC, set up a specific Boost math policy to limit type promotion with it's corresponding impact. Modified: openoffice/trunk/main/vcl/inc/vcl/bitmap.hxx Modified: openoffice/trunk/main/vcl/inc/vcl/bitmap.hxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/vcl/inc/vcl/bitmap.hxx?rev=1444115&r1=1444114&r2=1444115&view=diff ============================================================================== --- openoffice/trunk/main/vcl/inc/vcl/bitmap.hxx (original) +++ openoffice/trunk/main/vcl/inc/vcl/bitmap.hxx Fri Feb 8 16:35:48 2013 @@ -30,6 +30,17 @@ #include #include +#ifdef WNT +#define _STLP_HAS_NATIVE_FLOAT_ABS +#endif + +#include + +using namespace boost::math::policies; +typedef policy< + promote_double +> SincPolicy; + // ----------- // - Defines - // ----------- @@ -261,8 +272,7 @@ public: } x *= M_PI; - - return sin(x) / x; + return boost::math::sinc_pi(x, SincPolicy()); } };