Skip to content

Commit 64b0990

Browse files
committed
Merge pull request #106999 from fire/vsk-does-not-declare-anything-4.5
Avoid `-Wmissing-declarations` warning in RenderingShaderContainer
2 parents 4bbef7d + bc2bf7d commit 64b0990

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

servers/rendering/rendering_shader_container.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@
3232

3333
#include "core/io/compression.h"
3434

35-
const uint32_t RenderingShaderContainer::MAGIC_NUMBER = 0x43535247;
36-
const uint32_t RenderingShaderContainer::VERSION = 2;
37-
3835
static inline uint32_t aligned_to(uint32_t p_size, uint32_t p_alignment) {
3936
if (p_size % p_alignment) {
4037
return p_size + (p_alignment - (p_size % p_alignment));
@@ -228,8 +225,8 @@ bool RenderingShaderContainer::from_bytes(const PackedByteArray &p_bytes) {
228225
bytes_offset += sizeof(ContainerHeader);
229226
bytes_offset += _from_bytes_header_extra_data(&bytes_ptr[bytes_offset]);
230227

231-
ERR_FAIL_COND_V_MSG(container_header.magic_number != MAGIC_NUMBER, false, "Incorrect magic number in shader container.");
232-
ERR_FAIL_COND_V_MSG(container_header.version > VERSION, false, "Unsupported version in shader container.");
228+
ERR_FAIL_COND_V_MSG(container_header.magic_number != CONTAINER_MAGIC_NUMBER, false, "Incorrect magic number in shader container.");
229+
ERR_FAIL_COND_V_MSG(container_header.version > CONTAINER_VERSION, false, "Unsupported version in shader container.");
233230
ERR_FAIL_COND_V_MSG(container_header.format != _format(), false, "Incorrect format in shader container.");
234231
ERR_FAIL_COND_V_MSG(container_header.format_version > _format_version(), false, "Unsupported format version in shader container.");
235232

@@ -354,8 +351,8 @@ PackedByteArray RenderingShaderContainer::to_bytes() const {
354351
uint64_t bytes_offset = 0;
355352
uint8_t *bytes_ptr = bytes.ptrw();
356353
ContainerHeader &container_header = *(ContainerHeader *)(&bytes_ptr[bytes_offset]);
357-
container_header.magic_number = MAGIC_NUMBER;
358-
container_header.version = VERSION;
354+
container_header.magic_number = CONTAINER_MAGIC_NUMBER;
355+
container_header.version = CONTAINER_VERSION;
359356
container_header.format = _format();
360357
container_header.format_version = _format_version();
361358
container_header.shader_count = shaders.size();

servers/rendering/rendering_shader_container.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ class RenderingShaderContainer : public RefCounted {
3737
GDSOFTCLASS(RenderingShaderContainer, RefCounted);
3838

3939
public:
40-
static const uint32_t MAGIC_NUMBER;
41-
static const uint32_t VERSION;
40+
static const uint32_t CONTAINER_MAGIC_NUMBER = 0x43535247;
41+
static const uint32_t CONTAINER_VERSION = 2;
4242

4343
protected:
4444
struct ContainerHeader {

0 commit comments

Comments
 (0)