Skip to content

Commit

Permalink
reduce compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
maxbachmann committed Sep 4, 2022
1 parent 5073572 commit 49c4fd2
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 34 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/releasebuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ jobs:
CIBW_TEST_SKIP: "*-win32"
CIBW_TEST_REQUIRES: pytest hypothesis pandas
CIBW_TEST_COMMAND: pytest {package}/tests
CIBW_TEST_COMMAND_LINUX: "{package}/tools/seg_wrapper.sh pytest {package}/tests"
CIBW_BUILD_VERBOSITY: 3

steps:
Expand Down Expand Up @@ -142,7 +141,6 @@ jobs:
CIBW_TEST_SKIP: "{*-macosx_{arm64,universal2},pp*-macosx_*}"
CIBW_TEST_REQUIRES: pytest hypothesis pandas
CIBW_TEST_COMMAND: pytest {package}/tests
CIBW_TEST_COMMAND_LINUX: "{package}/tools/seg_wrapper.sh pytest {package}/tests"
CIBW_BUILD_VERBOSITY: 3

steps:
Expand Down Expand Up @@ -193,7 +191,7 @@ jobs:
CIBW_TEST_SKIP: "{*_{aarch64,ppc64le,s390x,i686},*musllinux_*,pp38-*}"
CIBW_TEST_REQUIRES: pytest hypothesis pandas
CIBW_TEST_COMMAND: pytest {package}/tests
CIBW_TEST_COMMAND_LINUX: "{package}/tools/seg_wrapper.sh pytest {package}/tests"
# CIBW_TEST_COMMAND: "{package}/tools/seg_wrapper.sh pytest {package}/tests"
CIBW_BUILD_VERBOSITY: 3

steps:
Expand Down
54 changes: 27 additions & 27 deletions src/rapidfuzz/cpp_common.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,18 @@ cdef extern from "rapidfuzz/details/types.hpp" namespace "rapidfuzz" nogil:

ctypedef struct RfEditOp "rapidfuzz::EditOp":
EditType type
int64_t src_pos
int64_t dest_pos
size_t src_pos
size_t dest_pos

cdef cppclass RfScoreAlignment "rapidfuzz::ScoreAlignment"[T]:
T score
int64_t src_start
int64_t src_end
int64_t dest_start
int64_t dest_end
size_t src_start
size_t src_end
size_t dest_start
size_t dest_end

RfScoreAlignment()
RfScoreAlignment(T score, int64_t src_start, int64_t src_end, int64_t dest_start, int64_t dest_end)
RfScoreAlignment(T score, size_t src_start, size_t src_end, size_t dest_start, size_t dest_end)

cdef cppclass RfOpcodes "rapidfuzz::Opcodes"

Expand Down Expand Up @@ -100,23 +100,23 @@ cdef extern from "rapidfuzz/details/types.hpp" namespace "rapidfuzz" nogil:
bint operator>=(const_iterator)

RfEditops() except +
RfEditops(int64_t) except +
RfEditops(size_t) except +
RfEditops(const RfEditops&) except +
RfEditops(const RfOpcodes&) except +
bool operator==(const RfEditops&)
RfEditOp& operator[](int64_t pos) except +
int64_t size()
RfEditOp& operator[](size_t pos) except +
size_t size()
RfEditops inverse() except +
RfEditops remove_subsequence(const RfEditops& subsequence) except +
RfEditops slice(int, int, int) except +
void remove_slice(int, int, int) except +
int64_t get_src_len()
void set_src_len(int64_t)
int64_t get_dest_len()
void set_dest_len(int64_t)
size_t get_src_len()
void set_src_len(size_t)
size_t get_dest_len()
void set_dest_len(size_t)
RfEditops reverse()
void emplace_back(...)
void reserve(int64_t) except +
void reserve(size_t) except +
void shrink_to_fit() except +

iterator begin()
Expand All @@ -127,10 +127,10 @@ cdef extern from "rapidfuzz/details/types.hpp" namespace "rapidfuzz" nogil:

ctypedef struct RfOpcode "rapidfuzz::Opcode":
EditType type
int64_t src_begin
int64_t src_end
int64_t dest_begin
int64_t dest_end
size_t src_begin
size_t src_end
size_t dest_begin
size_t dest_end

cdef cppclass RfOpcodes "rapidfuzz::Opcodes":
ctypedef size_t size_type
Expand Down Expand Up @@ -188,20 +188,20 @@ cdef extern from "rapidfuzz/details/types.hpp" namespace "rapidfuzz" nogil:
bint operator>=(const_iterator)

RfOpcodes() except +
RfOpcodes(int64_t) except +
RfOpcodes(size_t) except +
RfOpcodes(const RfOpcodes&) except +
RfOpcodes(const RfEditops&) except +
bool operator==(const RfOpcodes&)
RfOpcode& operator[](int64_t pos) except +
int64_t size()
RfOpcode& operator[](size_t pos) except +
size_t size()
RfOpcodes inverse() except +
int64_t get_src_len()
void set_src_len(int64_t)
int64_t get_dest_len()
void set_dest_len(int64_t)
size_t get_src_len()
void set_src_len(size_t)
size_t get_dest_len()
void set_dest_len(size_t)
RfOpcodes reverse()
void emplace_back(...)
void reserve(int64_t) except +
void reserve(size_t) except +
RfOpcode& back() except +
void shrink_to_fit() except +
bint empty()
Expand Down
8 changes: 4 additions & 4 deletions src/rapidfuzz/distance/_initialize_cpp.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ cdef RfEditops list_to_editops(ops, Py_ssize_t src_len, Py_ssize_t dest_len) exc
cdef RfEditops result
cdef Py_ssize_t i
cdef EditType edit_type
cdef int64_t src_pos, dest_pos
cdef size_t src_pos, dest_pos
cdef Py_ssize_t ops_len = len(ops)
result.set_src_len(src_len)
result.set_dest_len(dest_len)
Expand Down Expand Up @@ -99,7 +99,7 @@ cdef RfOpcodes list_to_opcodes(ops, Py_ssize_t src_len, Py_ssize_t dest_len) exc
cdef RfOpcodes result
cdef Py_ssize_t i
cdef EditType edit_type
cdef int64_t src_start, src_end, dest_start, dest_end
cdef size_t src_start, src_end, dest_start, dest_end
cdef Py_ssize_t ops_len = len(ops)
if not ops_len or len(ops[0]) == 3:
return RfOpcodes(list_to_editops(ops, src_len, dest_len))
Expand Down Expand Up @@ -154,7 +154,7 @@ cdef RfOpcodes list_to_opcodes(ops, Py_ssize_t src_len, Py_ssize_t dest_len) exc
return result

cdef list editops_to_list(const RfEditops& ops):
cdef int64_t op_count = ops.size()
cdef size_t op_count = ops.size()
cdef list result_list = PyList_New(<Py_ssize_t>op_count)
for i in range(op_count):
result_item = (edit_type_to_str(ops[i].type), ops[i].src_pos, ops[i].dest_pos)
Expand All @@ -164,7 +164,7 @@ cdef list editops_to_list(const RfEditops& ops):
return result_list

cdef list opcodes_to_list(const RfOpcodes& ops):
cdef int64_t op_count = ops.size()
cdef size_t op_count = ops.size()
cdef list result_list = PyList_New(<Py_ssize_t>op_count)
for i in range(op_count):
result_item = (
Expand Down

0 comments on commit 49c4fd2

Please sign in to comment.