diff --git a/core/io/packet_peer.cpp b/core/io/packet_peer.cpp index 48806fba7306..0329ace31305 100644 --- a/core/io/packet_peer.cpp +++ b/core/io/packet_peer.cpp @@ -318,9 +318,9 @@ int PacketPeerStream::get_output_buffer_max_size() const { } PacketPeerStream::PacketPeerStream() { - int rbsize = GLOBAL_GET("network/limits/packet_peer_stream/max_buffer_po2"); + int64_t rbsize = GLOBAL_GET("network/limits/packet_peer_stream/max_buffer_po2"); ring_buffer.resize(rbsize); - input_buffer.resize(1 << rbsize); - output_buffer.resize(1 << rbsize); + input_buffer.resize(int64_t(1) << rbsize); + output_buffer.resize(int64_t(1) << rbsize); } diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/NativeInterop/InteropStructs.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/NativeInterop/InteropStructs.cs index d5d9404ed1bc..c806263edb57 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/NativeInterop/InteropStructs.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/NativeInterop/InteropStructs.cs @@ -474,7 +474,7 @@ public readonly IntPtr Buffer public readonly unsafe int Size { [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => _ptr != IntPtr.Zero ? *((int*)_ptr - 1) : 0; + get => _ptr != IntPtr.Zero ? (int)(*((ulong*)_ptr - 1)) : 0; } } @@ -725,7 +725,7 @@ private struct VariantVector public readonly unsafe int Size { [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => _ptr != null ? *((int*)_ptr - 1) : 0; + get => _ptr != null ? (int)(*((ulong*)_ptr - 1)) : 0; } } @@ -875,7 +875,7 @@ public readonly unsafe byte* Buffer public readonly unsafe int Size { [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => _ptr != null ? *((int*)_ptr - 1) : 0; + get => _ptr != null ? (int)(*((ulong*)_ptr - 1)) : 0; } } @@ -939,7 +939,7 @@ public readonly unsafe long* Buffer public readonly unsafe int Size { [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => _ptr != null ? *((int*)_ptr - 1) : 0; + get => _ptr != null ? (int)(*((ulong*)_ptr - 1)) : 0; } } @@ -971,7 +971,7 @@ public readonly unsafe float* Buffer public readonly unsafe int Size { [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => _ptr != null ? *((int*)_ptr - 1) : 0; + get => _ptr != null ? (int)(*((ulong*)_ptr - 1)) : 0; } } @@ -1003,7 +1003,7 @@ public readonly unsafe double* Buffer public readonly unsafe int Size { [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => _ptr != null ? *((int*)_ptr - 1) : 0; + get => _ptr != null ? (int)(*((ulong*)_ptr - 1)) : 0; } } @@ -1035,7 +1035,7 @@ public readonly unsafe godot_string* Buffer public readonly unsafe int Size { [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => _ptr != null ? *((int*)_ptr - 1) : 0; + get => _ptr != null ? (int)(*((ulong*)_ptr - 1)) : 0; } } @@ -1067,7 +1067,7 @@ public readonly unsafe Vector2* Buffer public readonly unsafe int Size { [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => _ptr != null ? *((int*)_ptr - 1) : 0; + get => _ptr != null ? (int)(*((ulong*)_ptr - 1)) : 0; } } @@ -1099,7 +1099,7 @@ public readonly unsafe Vector3* Buffer public readonly unsafe int Size { [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => _ptr != null ? *((int*)_ptr - 1) : 0; + get => _ptr != null ? (int)(*((ulong*)_ptr - 1)) : 0; } } @@ -1131,7 +1131,7 @@ public readonly unsafe Color* Buffer public readonly unsafe int Size { [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => _ptr != null ? *((int*)_ptr - 1) : 0; + get => _ptr != null ? (int)(*((ulong*)_ptr - 1)) : 0; } } diff --git a/servers/rendering/renderer_rd/storage_rd/light_storage.cpp b/servers/rendering/renderer_rd/storage_rd/light_storage.cpp index 21c6425a8783..150e82c25c5b 100644 --- a/servers/rendering/renderer_rd/storage_rd/light_storage.cpp +++ b/servers/rendering/renderer_rd/storage_rd/light_storage.cpp @@ -1988,7 +1988,7 @@ void LightStorage::shadow_atlas_set_size(RID p_atlas, int p_size, bool p_16_bits for (int i = 0; i < 4; i++) { //clear subdivisions shadow_atlas->quadrants[i].shadows.clear(); - shadow_atlas->quadrants[i].shadows.resize(1 << shadow_atlas->quadrants[i].subdivision); + shadow_atlas->quadrants[i].shadows.resize(int64_t(1) << int64_t(shadow_atlas->quadrants[i].subdivision)); } //erase shadow atlas reference from lights