diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/bind/core_bind.cpp | 2 | ||||
-rw-r--r-- | core/io/file_access_pack.cpp | 2 | ||||
-rw-r--r-- | core/typedefs.h | 6 |
3 files changed, 8 insertions, 2 deletions
diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp index e7ddbc690f..67de156fc3 100644 --- a/core/bind/core_bind.cpp +++ b/core/bind/core_bind.cpp @@ -792,7 +792,7 @@ Dictionary _OS::get_datetime_from_unix_time(int64_t unix_time_val) const { size_t imonth = 0; - while (dayno >= MONTH_DAYS_TABLE[LEAPYEAR(year)][imonth]) { + while ((unsigned long)dayno >= MONTH_DAYS_TABLE[LEAPYEAR(year)][imonth]) { dayno -= MONTH_DAYS_TABLE[LEAPYEAR(year)][imonth]; imonth++; } diff --git a/core/io/file_access_pack.cpp b/core/io/file_access_pack.cpp index c97b8cafac..d38d09c6bb 100644 --- a/core/io/file_access_pack.cpp +++ b/core/io/file_access_pack.cpp @@ -272,7 +272,7 @@ int FileAccessPack::get_buffer(uint8_t *p_dst, int p_length) const { if (eof) return 0; - int64_t to_read = p_length; + uint64_t to_read = p_length; if (to_read + pos > pf.size) { eof = true; to_read = int64_t(pf.size) - int64_t(pos); diff --git a/core/typedefs.h b/core/typedefs.h index 78688ff311..a3d7314b1c 100644 --- a/core/typedefs.h +++ b/core/typedefs.h @@ -328,4 +328,10 @@ struct _GlobalLock { #define _PRINTF_FORMAT_ATTRIBUTE_2_3 #endif +/** This is needed due to a strange OpenGL API that expects a pointer + * type for an argument that is actually an offset. + */ + +#define CAST_INT_TO_UCHAR_PTR(ptr) ((uint8_t *)(uintptr_t)(ptr)) + #endif // TYPEDEFS_H |