Fix warnings about integer comparisons
This commit is contained in:
parent
2ec351d8d3
commit
ffb980ae63
@ -26,6 +26,7 @@
|
||||
#include "../gmio_core/internal/helper_stream.h"
|
||||
#include "../gmio_core/internal/helper_task_iface.h"
|
||||
#include "../gmio_core/internal/min_max.h"
|
||||
#include "../gmio_core/internal/safe_cast.h"
|
||||
#include "../gmio_core/internal/stringstream.h"
|
||||
#include "../gmio_core/internal/string_ascii_utils.h"
|
||||
|
||||
@ -90,8 +91,10 @@ static size_t gmio_stringstream_stla_read(
|
||||
(struct gmio_stringstream_stla_cookie*)(cookie);
|
||||
if (stlac != NULL) {
|
||||
const struct gmio_task_iface* task = stlac->task;
|
||||
const size_t to_read =
|
||||
GMIO_MIN(len, stlac->stream_size - stlac->stream_offset + 1);
|
||||
const size_t remaining_contents_size =
|
||||
gmio_streamsize_to_size(
|
||||
stlac->stream_size - stlac->stream_offset + 1);
|
||||
const size_t to_read = GMIO_MIN(len, remaining_contents_size);
|
||||
const size_t len_read = gmio_stream_read_bytes(stream, ptr, to_read);
|
||||
stlac->stream_offset += len_read;
|
||||
stlac->is_stop_requested = gmio_task_iface_is_stop_requested(task);
|
||||
|
@ -73,6 +73,7 @@ const char* generic_test_stl_infos(const struct gmio_test_stl_infos* test)
|
||||
|
||||
if (test->format == GMIO_STL_FORMAT_ASCII) {
|
||||
const size_t name_len = strlen(stla_solid_name);
|
||||
const gmio_streamsize_t name_len_ssize = name_len;
|
||||
#if 0
|
||||
printf("expected_size=%d "
|
||||
"name_len=%d "
|
||||
@ -80,8 +81,8 @@ const char* generic_test_stl_infos(const struct gmio_test_stl_infos* test)
|
||||
"infos.solid_name=%s\n",
|
||||
expected_size, name_len, infos.size, infos.stla_solidname);
|
||||
#endif
|
||||
UTEST_ASSERT((expected_size - name_len) <= infos.size);
|
||||
UTEST_ASSERT(infos.size <= (expected_size + name_len));
|
||||
UTEST_ASSERT((expected_size - name_len_ssize) <= infos.size);
|
||||
UTEST_ASSERT(infos.size <= (expected_size + name_len_ssize));
|
||||
}
|
||||
else {
|
||||
UTEST_COMPARE_INT(expected_size, infos.size);
|
||||
|
Loading…
Reference in New Issue
Block a user