From e5f665c7187b6934a71169cab5075f899150f17a Mon Sep 17 00:00:00 2001 From: marxin Date: Thu, 21 Feb 2019 20:57:39 +0100 Subject: Fix -Wsign-compare warnings. I decided to modify code in a defensive way. Ideally functions like size() or length() should return an unsigned type. --- modules/gdnative/videodecoder/video_stream_gdnative.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modules/gdnative') diff --git a/modules/gdnative/videodecoder/video_stream_gdnative.cpp b/modules/gdnative/videodecoder/video_stream_gdnative.cpp index 8c2a84f60b..d1794b6c36 100644 --- a/modules/gdnative/videodecoder/video_stream_gdnative.cpp +++ b/modules/gdnative/videodecoder/video_stream_gdnative.cpp @@ -76,7 +76,7 @@ int64_t GDAPI godot_videodecoder_file_seek(void *ptr, int64_t pos, int whence) { } break; case SEEK_CUR: { // Just in case it doesn't exist - if (pos < 0 && -pos > file->get_position()) { + if (pos < 0 && (size_t)-pos > file->get_position()) { return -1; } pos = pos + static_cast(file->get_position()); @@ -86,7 +86,7 @@ int64_t GDAPI godot_videodecoder_file_seek(void *ptr, int64_t pos, int whence) { } break; case SEEK_END: { // Just in case something goes wrong - if (-pos > len) { + if ((size_t)-pos > len) { return -1; } file->seek_end(pos); -- cgit v1.2.3