Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
akien-mga committed Jan 19, 2024
1 parent 8fe13ce commit 6eff4f6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions core/io/packet_peer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down Expand Up @@ -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;
}
}

Expand Down Expand Up @@ -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;
}
}

Expand Down Expand Up @@ -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;
}
}

Expand Down Expand Up @@ -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;
}
}

Expand Down Expand Up @@ -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;
}
}

Expand Down Expand Up @@ -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;
}
}

Expand Down Expand Up @@ -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;
}
}

Expand Down Expand Up @@ -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;
}
}

Expand Down Expand Up @@ -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;
}
}

Expand Down
2 changes: 1 addition & 1 deletion servers/rendering/renderer_rd/storage_rd/light_storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6eff4f6

Please sign in to comment.