Skip to content

Commit

Permalink
Correct compilation warnings #71
Browse files Browse the repository at this point in the history
(cherry picked from commit 886244a)
  • Loading branch information
kaorut committed Jul 25, 2020
1 parent 88c7048 commit b1b8199
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
18 changes: 15 additions & 3 deletions executable/search_dict_c/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,16 @@ typedef struct

static size_t to_size_t(const char* const p_bytes, size_t* const p_byte_offset)
{
assert(p_bytes);
assert(p_byte_offset);
if (!p_bytes)
{
assert(0);
return 0;
}
if (!p_byte_offset)
{
assert(0);
return 0;
}

size_t value = 0;
for (size_t i = 0; i < 4; ++i)
Expand Down Expand Up @@ -141,7 +149,11 @@ static void to_array_of_lex_span(
{
assert(p_bytes);
assert(p_byte_offset);
assert(p_lex_spans);
if (!p_lex_spans)
{
assert(0);
return;
}

for (size_t i = 0; i < lex_span_count; ++i)
{
Expand Down
2 changes: 1 addition & 1 deletion library/trie/test/src/test_tetengo.trie.trie.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ namespace
}
}

copy_detector(copy_detector&& another) : value{ std::move(another.value) } {}
copy_detector(copy_detector&& another) noexcept : value{ std::move(another.value) } {}
};

template <typename T>
Expand Down

0 comments on commit b1b8199

Please sign in to comment.