You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datasketches.apache.org by jm...@apache.org on 2023/01/24 09:25:19 UTC

[datasketches-cpp] branch 4.0-cleanup created (now f042608)

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

jmalkin pushed a change to branch 4.0-cleanup
in repository https://gitbox.apache.org/repos/asf/datasketches-cpp.git


      at f042608  Remove unsigned < 0 check

This branch includes the following new commits:

     new c7a26d2  fixed conversion of -1 to unsigned
     new f042608  Remove unsigned < 0 check

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



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


[datasketches-cpp] 01/02: fixed conversion of -1 to unsigned

Posted by jm...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit c7a26d26f98aca57687e1aa388048fd0236851db
Author: AlexanderSaydakov <Al...@users.noreply.github.com>
AuthorDate: Tue Jan 3 15:37:38 2023 -0800

    fixed conversion of -1 to unsigned
---
 python/src/vector_of_kll.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/python/src/vector_of_kll.cpp b/python/src/vector_of_kll.cpp
index db30af6..68e418c 100644
--- a/python/src/vector_of_kll.cpp
+++ b/python/src/vector_of_kll.cpp
@@ -72,7 +72,7 @@ class vector_of_kll_sketches {
     std::string to_string(bool print_levels = false, bool print_items = false) const;
 
     // binary output/input
-    py::list serialize(py::array_t<uint32_t>& isk);
+    py::list serialize(const py::array_t<int>& isk);
     // note: deserialize() replaces the sketch at the specified
     //       index. Not a static method.
     void deserialize(const py::bytes& sk_bytes, uint32_t idx);
@@ -404,7 +404,7 @@ void vector_of_kll_sketches<T, C>::deserialize(const py::bytes& sk_bytes,
 }
 
 template<typename T, typename C>
-py::list vector_of_kll_sketches<T, C>::serialize(py::array_t<uint32_t>& isk) {
+py::list vector_of_kll_sketches<T, C>::serialize(const py::array_t<int>& isk) {
   std::vector<uint32_t> inds = get_indices(isk);
   const size_t num_sketches = inds.size();
 


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


[datasketches-cpp] 02/02: Remove unsigned < 0 check

Posted by jm...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit f042608f4a9ce1b500b69330392e07b995cbc4ad
Author: Jon Malkin <78...@users.noreply.github.com>
AuthorDate: Wed Jan 11 18:13:51 2023 -0800

    Remove unsigned < 0 check
    
    uint8_t can never be < 0 so this addresses a warning from gcc.
---
 cpc/include/cpc_compressor_impl.hpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cpc/include/cpc_compressor_impl.hpp b/cpc/include/cpc_compressor_impl.hpp
index ef0ce61..7f323be 100644
--- a/cpc/include/cpc_compressor_impl.hpp
+++ b/cpc/include/cpc_compressor_impl.hpp
@@ -449,7 +449,7 @@ uint8_t cpc_compressor<A>::determine_pseudo_phase(uint8_t lg_k, uint32_t c) {
     if (lg_k < 4) throw std::logic_error("lgK < 4");
     const size_t tmp = c >> (lg_k - 4);
     const uint8_t phase = tmp & 15;
-    if (phase < 0 || phase >= 16) throw std::out_of_range("wrong phase");
+    if (phase >= 16) throw std::out_of_range("wrong phase");
     return phase;
   }
 }


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