From fe3f50b49a27ace46b2f6ac9bd05f49caff425e5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20Ma=C5=9Blanka?= <piotr.maslanka@henrietta.com.pl>
Date: Fri, 9 Jul 2021 20:03:12 +0200
Subject: [PATCH] fixed warnings about signed to unsigned comparison

---
 README.md               | 2 +-
 setup.cfg               | 2 +-
 tempsdb/chunks/base.pxd | 8 ++++----
 tempsdb/chunks/base.pyx | 6 +++---
 4 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/README.md b/README.md
index 64095ba..d8ea636 100644
--- a/README.md
+++ b/README.md
@@ -55,7 +55,7 @@ Consult the docs for how to disable it.
 
 ## v0.6.5
 
-* _TBA_
+* fixed warnings about signed to unsigned comparison
 
 ## v0.6.4
 
diff --git a/setup.cfg b/setup.cfg
index 9824331..3178369 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,7 +1,7 @@
 # coding: utf-8
 [metadata]
 name = tempsdb
-version = 0.6.5a1
+version = 0.6.5a2
 long-description = file: README.md
 long-description-content-type = text/markdown; charset=UTF-8
 license_files = LICENSE
diff --git a/tempsdb/chunks/base.pxd b/tempsdb/chunks/base.pxd
index c128df5..bd446f5 100644
--- a/tempsdb/chunks/base.pxd
+++ b/tempsdb/chunks/base.pxd
@@ -26,9 +26,9 @@ cdef class Chunk:
     cdef int sync(self) except -1
     cpdef unsigned long long get_timestamp_at(self, unsigned int index)
     cpdef bytes get_value_at(self, unsigned int index)
-    cpdef bytes get_slice_of_piece_at(self, unsigned int index, int start, int stop)
-    cpdef bytes get_slice_of_piece_starting_at(self, unsigned int index, int start)
-    cpdef int get_byte_of_piece(self, unsigned int index, int byte_index) except -1
+    cpdef bytes get_slice_of_piece_at(self, unsigned int index, unsigned int start, unsigned int stop)
+    cpdef bytes get_slice_of_piece_starting_at(self, unsigned int index, unsigned int start)
+    cpdef int get_byte_of_piece(self, unsigned int index, unsigned int byte_index) except -1
     cpdef unsigned int find_left(self, unsigned long long timestamp)
     cpdef unsigned int find_right(self, unsigned long long timestamp)
     cdef object open_file(self, str path)
@@ -49,7 +49,7 @@ cdef class Chunk:
         """
         return self.min_ts
 
-    cdef inline int length(self):
+    cdef inline unsigned int length(self):
         """
         :return: amount of entries in this chunk
         :rtype: int 
diff --git a/tempsdb/chunks/base.pyx b/tempsdb/chunks/base.pyx
index b86c553..0fa4df8 100644
--- a/tempsdb/chunks/base.pyx
+++ b/tempsdb/chunks/base.pyx
@@ -214,7 +214,7 @@ cdef class Chunk:
 
         self.after_init()
 
-    cpdef int get_byte_of_piece(self, unsigned int index, int byte_index) except -1:
+    cpdef int get_byte_of_piece(self, unsigned int index, unsigned int byte_index) except -1:
         """
         Return a particular byte of given element at given index.
         
@@ -230,7 +230,7 @@ cdef class Chunk:
         cdef unsigned long ofs = HEADER_SIZE + TIMESTAMP_SIZE + index * (self.block_size + TIMESTAMP_SIZE) + byte_index
         return ord(self.mmap[ofs])
 
-    cpdef bytes get_slice_of_piece_starting_at(self, unsigned int index, int start):
+    cpdef bytes get_slice_of_piece_starting_at(self, unsigned int index, unsigned int start):
         """
         Return a slice of data from given element starting at given index to the end
         
@@ -240,7 +240,7 @@ cdef class Chunk:
         """
         return self.get_slice_of_piece_at(index, start, self.block_size)
 
-    cpdef bytes get_slice_of_piece_at(self, unsigned int index, int start, int stop):
+    cpdef bytes get_slice_of_piece_at(self, unsigned int index, unsigned int start, unsigned int stop):
         """
         Return a slice of data from given element
         
-- 
GitLab