summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/SCsub1
-rw-r--r--core/io/file_access_zip.h2
-rw-r--r--core/math/math_funcs.h7
-rw-r--r--core/math/random_pcg.h5
-rw-r--r--core/register_core_types.cpp2
-rw-r--r--core/translation_po.h2
6 files changed, 10 insertions, 9 deletions
diff --git a/core/SCsub b/core/SCsub
index 16ee49d003..59fe63b4b3 100644
--- a/core/SCsub
+++ b/core/SCsub
@@ -121,6 +121,7 @@ if env["builtin_zstd"]:
"compress/zstdmt_compress.c",
"compress/zstd_compress_literals.c",
"compress/zstd_compress_sequences.c",
+ "compress/zstd_compress_superblock.c",
"decompress/huf_decompress.c",
"decompress/zstd_ddict.c",
"decompress/zstd_decompress_block.c",
diff --git a/core/io/file_access_zip.h b/core/io/file_access_zip.h
index 2cce24e878..c251b3c424 100644
--- a/core/io/file_access_zip.h
+++ b/core/io/file_access_zip.h
@@ -79,7 +79,7 @@ public:
};
class FileAccessZip : public FileAccess {
- unzFile zfile;
+ unzFile zfile = nullptr;
unz_file_info64 file_info;
mutable bool at_eof;
diff --git a/core/math/math_funcs.h b/core/math/math_funcs.h
index 9f8d4da5b3..24b42790f0 100644
--- a/core/math/math_funcs.h
+++ b/core/math/math_funcs.h
@@ -46,7 +46,8 @@ class Math {
public:
Math() {} // useless to instance
- static const uint64_t RANDOM_MAX = 0xFFFFFFFF;
+ // Not using 'RANDOM_MAX' to avoid conflict with system headers on some OSes (at least NetBSD).
+ static const uint64_t RANDOM_32BIT_MAX = 0xFFFFFFFF;
static _ALWAYS_INLINE_ double sin(double p_x) { return ::sin(p_x); }
static _ALWAYS_INLINE_ float sin(float p_x) { return ::sinf(p_x); }
@@ -283,8 +284,8 @@ public:
static void randomize();
static uint32_t rand_from_seed(uint64_t *seed);
static uint32_t rand();
- static _ALWAYS_INLINE_ double randd() { return (double)rand() / (double)Math::RANDOM_MAX; }
- static _ALWAYS_INLINE_ float randf() { return (float)rand() / (float)Math::RANDOM_MAX; }
+ static _ALWAYS_INLINE_ double randd() { return (double)rand() / (double)Math::RANDOM_32BIT_MAX; }
+ static _ALWAYS_INLINE_ float randf() { return (float)rand() / (float)Math::RANDOM_32BIT_MAX; }
static double random(double from, double to);
static float random(float from, float to);
diff --git a/core/math/random_pcg.h b/core/math/random_pcg.h
index 8fd5a056fa..09b13ab74d 100644
--- a/core/math/random_pcg.h
+++ b/core/math/random_pcg.h
@@ -31,12 +31,12 @@
#ifndef RANDOM_PCG_H
#define RANDOM_PCG_H
-#include <math.h>
-
#include "core/math/math_defs.h"
#include "thirdparty/misc/pcg.h"
+#include <math.h>
+
#if defined(__GNUC__)
#define CLZ32(x) __builtin_clz(x)
#elif defined(_MSC_VER)
@@ -67,7 +67,6 @@ class RandomPCG {
public:
static const uint64_t DEFAULT_SEED = 12047754176567800795U;
static const uint64_t DEFAULT_INC = PCG_DEFAULT_INC_64;
- static const uint64_t RANDOM_MAX = 0xFFFFFFFF;
RandomPCG(uint64_t p_seed = DEFAULT_SEED, uint64_t p_inc = DEFAULT_INC);
diff --git a/core/register_core_types.cpp b/core/register_core_types.cpp
index 4f094dd6c6..a2b3f75bea 100644
--- a/core/register_core_types.cpp
+++ b/core/register_core_types.cpp
@@ -232,7 +232,7 @@ void register_core_types() {
}
void register_core_settings() {
- //since in register core types, globals may not e present
+ // Since in register core types, globals may not be present.
GLOBAL_DEF("network/limits/tcp/connect_timeout_seconds", (30));
ProjectSettings::get_singleton()->set_custom_property_info("network/limits/tcp/connect_timeout_seconds", PropertyInfo(Variant::INT, "network/limits/tcp/connect_timeout_seconds", PROPERTY_HINT_RANGE, "1,1800,1"));
GLOBAL_DEF_RST("network/limits/packet_peer_stream/max_buffer_po2", (16));
diff --git a/core/translation_po.h b/core/translation_po.h
index 730635f63d..88830210ef 100644
--- a/core/translation_po.h
+++ b/core/translation_po.h
@@ -42,7 +42,7 @@ class TranslationPO : public Translation {
// TLDR: Maps context to a list of source strings and translated strings. In PO terms, maps msgctxt to a list of msgid and msgstr.
// The first key corresponds to context, and the second key (of the contained HashMap) corresponds to source string.
// The value Vector<StringName> in the second map stores the translated strings. Index 0, 1, 2 matches msgstr[0], msgstr[1], msgstr[2]... in the case of plurals.
- // Otherwise index 0 mathes to msgstr in a singular translation.
+ // Otherwise index 0 matches to msgstr in a singular translation.
// Strings without context have "" as first key.
HashMap<StringName, HashMap<StringName, Vector<StringName>>> translation_map;