You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datasketches.apache.org by al...@apache.org on 2021/02/17 07:26:59 UTC

[datasketches-cpp] branch master updated: Fix unused function compile issues

This is an automated email from the ASF dual-hosted git repository.

alsay pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/datasketches-cpp.git


The following commit(s) were added to refs/heads/master by this push:
     new dc3e6cb  Fix unused function compile issues
     new 74dec07  Merge pull request #198 from chufucun/cpc_unused
dc3e6cb is described below

commit dc3e6cb7f8dc013c23668950a43f1f5af0962c55
Author: Fucun Chu <ch...@hotmail.com>
AuthorDate: Wed Feb 17 14:14:23 2021 +0800

    Fix unused function compile issues
    
    Integrating DataSketches CPC to Impala, when compiling with -ASan parameter, the following error is displayed:
    ...
    In file included from /home/impdev/Impala/be/src/exprs/datasketches-common.cc:22:
    In file included from /home/impdev/Impala/be/src/thirdparty/datasketches/cpc_sketch.hpp:309:
    In file included from /home/impdev/Impala/be/src/thirdparty/datasketches/cpc_sketch_impl.hpp:32:
    /home/impdev/Impala/be/src/thirdparty/datasketches/icon_estimator.hpp:248:15: error: unused function 'compute_icon_estimate' [-Werror,-Wunused-function]
    static double compute_icon_estimate(uint8_t lg_k, uint64_t c) {
                  ^
    1 error generated.
---
 cpc/include/icon_estimator.hpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/cpc/include/icon_estimator.hpp b/cpc/include/icon_estimator.hpp
index 27d76ca..4a9daea 100644
--- a/cpc/include/icon_estimator.hpp
+++ b/cpc/include/icon_estimator.hpp
@@ -231,7 +231,7 @@ static const double ICON_POLYNOMIAL_COEFFICIENTS[ICON_TABLE_SIZE] = {
 #endif
 };
 
-static double evaluate_polynomial(const double* coefficients, int start, int num, double x) {
+static inline double evaluate_polynomial(const double* coefficients, int start, int num, double x) {
   const int final = start + num - 1;
   double total = coefficients[final];
   for (int j = final - 1; j >= start; j--) {
@@ -241,11 +241,11 @@ static double evaluate_polynomial(const double* coefficients, int start, int num
   return total;
 }
 
-static double icon_exponential_approximation(double k, double c) {
+static inline double icon_exponential_approximation(double k, double c) {
   return (0.7940236163830469 * k * pow(2.0, c / k));
 }
 
-static double compute_icon_estimate(uint8_t lg_k, uint64_t c) {
+static inline double compute_icon_estimate(uint8_t lg_k, uint64_t c) {
   if (lg_k < ICON_MIN_LOG_K || lg_k > ICON_MAX_LOG_K) throw std::out_of_range("lg_k out of range");
   if (c < 2) return ((c == 0) ? 0.0 : 1.0);
   const size_t k = 1 << lg_k;


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org